From 7dbe13ff4c1b5784aa285faf6b5248d2de25e9ce Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 10 十月 2025 16:22:45 +0800
Subject: [PATCH] 获取定制模板信息
---
pages/product/goods.vue | 44 +++++++++++++++++++++++++++++++++++---------
1 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index cf365da..ae818f0 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -229,7 +229,7 @@
</div> -->
<!-- 姝e父缁撶畻椤甸潰 -->
<view class="detail-btn" v-if="!isGroup && !takeDownFromSale">
- <view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'" @click="shutMask(4)">
+ <view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'&& goodsDetail.customizeFlag!=='CUSTOMIZE'" @click="shutMask(4)">
鍔犲叆璐墿杞�</view>
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">绔嬪嵆璐拱</view>
<view class="to-store-car to-store-btn" v-if="startTimer">鏆傛湭寮�濮�</view>
@@ -272,7 +272,7 @@
<!-- 鍟嗗搧瑙勬牸 鍟嗗搧璇︽儏锛屼互鍙婇粯璁ゅ弬涓庢椿鍔ㄧ殑id-->
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
- @queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :isGroup="isGroup" :id="productId"
+ @queryCart="cartCount()" :goodsDetail="goodsDetail" :consumizetemplateInfo="consumizetemplateInfo" :goodsSpec="goodsSpec" :isGroup="isGroup" :id="productId"
v-if="goodsDetail.id" :pointDetail="pointDetail" :wholesaleList="wholesaleList" @handleClickSku="selectSku"
:buyMask="buyMask" />
@@ -289,7 +289,7 @@
/************鎺ュ彛API***************/
-import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/goods.js";
+import { getGoods, getGoodsList, getMpScene, getGoodsDistribution,getTemplate } from "@/api/goods.js";
import * as API_trade from "@/api/trade.js";
import * as API_Members from "@/api/members.js";
import * as API_store from "@/api/store.js";
@@ -317,6 +317,7 @@
import setup from "./product/popup/popup";
import { getSessionId, userAction,userShare } from "@/api/userAction.js";
import { getSTSToken } from '@/api/common.js'
+import {addPrizeNum} from '@/api/prize.js'
export default {
components: {
popups,
@@ -373,6 +374,7 @@
___type: "other",
},
],
+ consumizetemplateInfo:{},
popupsSwitch: false, //瀵艰埅鏍忓垪琛ㄦ爮寮�鍏�
enableShare: false,
selectedGoods: "", //閫夋嫨鐨勫晢鍝佽鏍兼樀绉�
@@ -535,7 +537,13 @@
this.shareParam.shareOption = JSON.stringify(this.routerVal)
userShare(this.shareParam).then(res => {
this.shareId = res.data.data;
-
+ let param = {
+ addType:"SHARE_GOODS_VIDEO",
+ extend:"",
+ }
+ let extend = {shareId:this.shareId}
+ param.extend = JSON.stringify(extend)
+ addPrizeNum(param);
// 褰撹幏鍙栧埌shareId鍚庯紝鍐峳esolve鍒嗕韩閰嶇疆
resolve({
@@ -561,12 +569,19 @@
});
},
async onLoad (options) {
- if(option.shareId){
- this.actionParam.shareId = option.shareId;
+ if(options.shareId){
+ this.actionParam.shareId = options.shareId;
this.actionParam.joinType = 'SHARE'
console.log('瑙﹀彂onLoad')
+ uni.setStorage({
+ key: 'shareId',
+ data: options.shareId,
+ success: function () {
+ console.log('缂撳瓨shareId鎴愬姛');
+ }
+ });
}
- this.actionParam.pageParams = JSON.stringify(option)
+ this.actionParam.pageParams = JSON.stringify(options)
if(options.q){
const queryParam = {
id:'',
@@ -612,9 +627,10 @@
async onShow () {
getSessionId().then(res=>{
this.pageSessionNo = res.data.data
+ this.actionParam.sessionId = this.pageSessionNo
+ this.actionParam.sessionId = res.data.data
if(this.pageSessionNo){
let param = Object.assign({}, this.actionParam);
- param.sessionId = this.pageSessionNo
userAction(param)
}
})
@@ -742,6 +758,16 @@
this.PromotionList = response.data.result.promotionMap;
this.goodsParams = response.data.result.goodsParamsDTOList || [];
console.log('浼樻儬鍗锋椿鍔�--------------------銆�',response.data.result.promotionMap)
+
+ if(this.goodsDetail.goodsType == 'PHYSICAL_GOODS'&& this.goodsDetail.customizeFlag ==='CUSTOMIZE'){
+ //鑾峰彇妯℃澘淇℃伅
+ this.consumizetemplateInfo = null;
+ console.log('鏄ā鏉胯幏鍙栭渶瑕佽幏鍙栦俊鎭�-------------銆�',this.goodsDetail.id)
+ const template = await getTemplate(this.goodsDetail.id)
+ this.consumizetemplateInfo = template.data.data
+ console.log('鑾峰彇鍒扮殑妯℃澘淇℃伅----------------->',template.data.data)
+
+ }
// 鍒ゆ柇鏄惁鎷煎洟娲诲姩鎴栬�呯Н鍒嗗晢鍝� 濡傛灉鏈夊垯鏄剧ず鎷煎洟娲诲姩淇℃伅
this.PromotionList &&
Object.keys(this.PromotionList).forEach((item) => {
@@ -757,7 +783,6 @@
});
// 杞挱鍥�
this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1);
-
// 鑾峰彇搴楅摵鍩烘湰淇℃伅
this.getStoreBaseInfoFun(this.goodsDetail.storeId);
@@ -774,6 +799,7 @@
if (this.$options.filters.isLogin("auth")) {
this.getGoodsCollectionFun(this.goodsDetail.id);
}
+
// 鑾峰彇IM 闇�瑕佺殑璇濅娇鐢�
// this.getIMDetailMethods();
},
--
Gitblit v1.8.0