Feat:接口对接
This commit is contained in:
@@ -4,15 +4,16 @@
|
||||
</hx-navbar>
|
||||
<view v-if="storeInfo.id">
|
||||
<!-- 原模块 -->
|
||||
<product-con-swiper :img-urls="storeInfo.sliderImageArr" v-if="from!='pre' && from!='day'"></product-con-swiper>
|
||||
<product-con-swiper :img-urls="storeInfo.sliderImageArr"
|
||||
v-if="source!='pre' && source!='day'"></product-con-swiper>
|
||||
<!-- v4 预售轮播图 -->
|
||||
<product-con-swiper :img-urls="preInfo.sliderImageArr" v-if="from==='pre'"></product-con-swiper>
|
||||
<product-con-swiper :img-urls="preInfo.sliderImageArr" v-if="source==='pre'"></product-con-swiper>
|
||||
<!-- v4 每日特价轮播图 -->
|
||||
<product-con-swiper :img-urls="dayInfo.sliderImageArr" v-if="from==='day'"></product-con-swiper>
|
||||
<product-con-swiper :img-urls="dayInfo.sliderImageArr" v-if="source==='day'"></product-con-swiper>
|
||||
|
||||
<view class="wrapper">
|
||||
<!-- 原模块 -->
|
||||
<view class="change-section bg-white" v-if="from===''">
|
||||
<view class="change-section bg-white" v-if="source==='' || source==='famous' ">
|
||||
<view class="introduce bold">{{ storeInfo.storeName }}</view>
|
||||
<rich-text class="subInfo" :nodes="storeInfo.storeInfo" v-if="storeInfo.storeInfo"/>
|
||||
<view class="share acea-row row-between row-middle" style="flex-wrap: nowrap;">
|
||||
@@ -52,15 +53,15 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 文玩 -->
|
||||
<!-- <view class="wenwan-info flex jc-between ai-center" v-if="isWenwan===1">
|
||||
<text>产地:{{ storeInfo.origin }}</text>
|
||||
<text>单位:{{ storeInfo.unitName }}</text>
|
||||
<text>规格:{{ storeInfo.storeInfo }}</text>
|
||||
</view> -->
|
||||
<!-- <view class="wenwan-info flex jc-between ai-center" v-if="isWenwan===1">-->
|
||||
<!-- <text>产地:{{ storeInfo.origin }}</text>-->
|
||||
<!-- <text>单位:{{ storeInfo.unitName }}</text>-->
|
||||
<!-- <text>规格:{{ storeInfo.storeInfo }}</text>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
|
||||
<!-- v4 特产 -->
|
||||
<view class="spe-section change-section bg-white" v-if="from==='spe'">
|
||||
<view class="spe-section change-section bg-white" v-if="source==='spe'">
|
||||
<view class="spe-line-1 flex ai-center">
|
||||
<img class="icon-spe" :src="webUrl+'/20220514112935428191.png'" mode="scaleToFill">
|
||||
<view class="one-t">{{ storeInfo.storeName }}</view>
|
||||
@@ -110,7 +111,7 @@
|
||||
</view>
|
||||
|
||||
<!-- v4 预售抬头 -->
|
||||
<view class="pre-section change-section bg-white" v-if="from==='pre'">
|
||||
<view class="pre-section change-section bg-white" v-if="source==='pre'">
|
||||
|
||||
<view class="pre-line-1 flex">
|
||||
<view class="surplus flex">
|
||||
@@ -141,7 +142,7 @@
|
||||
</view>
|
||||
|
||||
<!-- v4 秒杀抬头 -->
|
||||
<view class="kill-section change-section bg-white" v-if="from==='kill'">
|
||||
<view class="kill-section change-section bg-white" v-if="source==='kill'">
|
||||
|
||||
<view class="kill-line-1 more-t">{{ killInfo.storeInfo.title }}</view>
|
||||
|
||||
@@ -167,7 +168,7 @@
|
||||
</view>
|
||||
|
||||
<!-- v4 每日特价抬头 -->
|
||||
<view class="day-section change-section bg-white" v-if="from==='day'">
|
||||
<view class="day-section change-section bg-white" v-if="source==='day'">
|
||||
<view class="day-line-1 flex ai-center">
|
||||
<img class="icon-day" :src="webUrl+'/20220514103348573632.png'" mode="scaleToFill">
|
||||
<view class="one-t">{{ dayInfo.title }}</view>
|
||||
@@ -400,12 +401,12 @@
|
||||
<!-- 商品详情开始 -->
|
||||
<view class="product-intro" style="margin-top: 24rpx">
|
||||
<!-- 原模块 -->
|
||||
<!-- <view class="conter" v-html="storeInfo.description" ></view>-->
|
||||
<rich-text :nodes="storeInfo.description" v-if="from!='pre' && from!='day'"/>
|
||||
<!-- <view class="conter" v-html="storeInfo.description" ></view>-->
|
||||
<rich-text :nodes="storeInfo.description" v-if="source!='pre' && source!='day'"/>
|
||||
<!-- v4 预售详情 -->
|
||||
<rich-text :nodes="preInfo.description" v-if="from==='pre'"/>
|
||||
<rich-text :nodes="preInfo.description" v-if="source==='pre'"/>
|
||||
<!-- v4 每日特价详情 -->
|
||||
<rich-text :nodes="dayInfo.description" v-if="from==='day'"/>
|
||||
<rich-text :nodes="dayInfo.description" v-if="source==='day'"/>
|
||||
</view>
|
||||
<!-- 商品详情结束 -->
|
||||
|
||||
@@ -501,6 +502,7 @@ import {mapGetters} from "vuex";
|
||||
import {diffDay, formatDateTime} from "@/utils/index";
|
||||
import {getCurAddress, getLocation, getUrlParam} from "@/utils/common.js";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import {famousGoodsShareImage, secKillGoodsShareImage} from "@/api/share";
|
||||
|
||||
export default {
|
||||
name: "GoodsCon",
|
||||
@@ -542,7 +544,7 @@ export default {
|
||||
id: null,
|
||||
partnerId: null,
|
||||
activityId: 0, // v4 add
|
||||
from: "", // v4 add
|
||||
source: "", // v4 add
|
||||
preInfo: {},
|
||||
killInfo: {},
|
||||
dayInfo: {},
|
||||
@@ -582,7 +584,28 @@ export default {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["isLogin", "location"]),
|
||||
computed: mapGetters(["isLogin", "location", "userInfo"]),
|
||||
onShareAppMessage() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let result;
|
||||
let params = `?id=${this.id}&partnerId=${this.userInfo.uid}`;
|
||||
if (this.source === 'famous') {
|
||||
result = await famousGoodsShareImage(this.id);
|
||||
}
|
||||
if (this.source === 'kill') {
|
||||
result = await secKillGoodsShareImage(this.activityId);
|
||||
params += `&activityId=${this.activityId}`
|
||||
}
|
||||
|
||||
if (result.status === 200) {
|
||||
resolve({
|
||||
title: this.storeInfo.storeName,
|
||||
path: '/pages/shop/GoodsCon/index' + params,
|
||||
imageUrl: result.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onLoad: function (options) {
|
||||
// test data
|
||||
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync());
|
||||
@@ -595,7 +618,7 @@ export default {
|
||||
this.id = options.id || null;
|
||||
this.partnerId = options.partnerId || null;
|
||||
this.activityId = this._route.query.activityId;
|
||||
this.from = this._route.query.from || "";
|
||||
this.source = this._route.query.from || "";
|
||||
} else {
|
||||
let obj = uni.getEnterOptionsSync();
|
||||
if (options.scene != null || obj.query.scene != null) {
|
||||
@@ -625,7 +648,7 @@ export default {
|
||||
this.productCon();
|
||||
this.fetchCompanyDatea();
|
||||
|
||||
switch (this.from) {
|
||||
switch (this.source) {
|
||||
case "pre":
|
||||
this.getPreInfo();
|
||||
break;
|
||||
@@ -942,7 +965,7 @@ export default {
|
||||
that.isWenwan = res.data.isWenwan;
|
||||
|
||||
// 给 attr 赋值,将请求回来的规格赋值给 attr
|
||||
if (this.from === "") {
|
||||
if (this.source === "" || this.source === 'famous') {
|
||||
that.$set(that.attr, "productAttr", res.data.productAttr);
|
||||
that.$set(that, "productValue", res.data.productValue);
|
||||
}
|
||||
@@ -1229,7 +1252,7 @@ export default {
|
||||
};
|
||||
|
||||
// v4 新增活动ID
|
||||
switch (this.from) {
|
||||
switch (this.source) {
|
||||
case "pre":
|
||||
q.preSaleId = Number(this.activityId)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user