From 29851d845f4ab768c78724ab870ecec4ce28c32b Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 24 十月 2025 11:42:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/user_action' into user_action

---
 pages/product/goods.vue |  166 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 129 insertions(+), 37 deletions(-)

diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index 3146a0b..1e4aea1 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -6,13 +6,15 @@
     <!-- 浠卙5鏈夋晥 鎵撳紑App -->
 
     <!-- 鍒嗕韩 -->
-    <shares v-if="enableShare && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="
+<!--    <shares v-if="enableShare && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="
       '/pages/product/goods?id=' +
       this.routerVal.id +
       '&goodsId=' +
       this.routerVal.goodsId
     " :thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods"
       @close="enableShare = false" />
+	  -->
+	  
     <popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
       :y="navbarListY" placement="top-start" />
     <view class="index">
@@ -114,10 +116,18 @@
                     </span>
                   </view>
 
-                  <view class="icons share" @click="shareChange()">
+            <!--      <view class="icons share" @click="shareChange()">
                     <u-icon size="30" name="share-fill"></u-icon>
                     <view>鍒嗕韩</view>
-                  </view>
+                  </view> -->
+				  <view class="icons share"  style="margin-top: -15px;">
+				         <button open-type="share" class="custom-share-btn" plain="true" style="border: none;">
+				              <u-icon size="30" name="share-fill"></u-icon>
+				         </button>
+				          <view style="margin-top: -14px;">鍒嗕韩</view>
+				        </view>
+				  
+				  
                   <view class="icons" @click="clickFavorite(goodsDetail.id)">
                     <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
                       :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
@@ -219,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>
@@ -262,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" />
 
@@ -279,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";
@@ -301,18 +311,16 @@
 import GoodsSwiper from "@/pages/product/product/goods/-goods-swiper.vue"; //杞挱鍥剧粍浠�
 import popupGoods from "@/pages/product/m-buy/goods.vue"; //璐墿杞﹀晢鍝佺殑妯″潡
 import popupAddress from "@/pages/product/product/popup/address.vue"; //鍦板潃閫夋嫨妯″潡
-import shares from "@/pages/product/m-share/index.vue"; //鍒嗕韩
+
 import popups from "@/pages/product/popups/popups.vue"; //姘旀场妗�
 import takeDownFormSaleGoods from "@/pages/product/m-take-down-sale-goods/index.vue"; //涓嬫灦妗�
 import setup from "./product/popup/popup";
-import { getSessionId, userAction } from "@/api/userAction.js";
-	import {
-		getSTSToken
-	} from '@/api/common.js'
+import { getSessionId, userAction,userShare } from "@/api/userAction.js";
+import { getSTSToken } from '@/api/common.js'
+import {addPrizeNum} from '@/api/prize.js'
 export default {
   components: {
     popups,
-    shares,
     PromotionLayout,
     PromotionDetailsLayout,
     PromotionAssembleLayout,
@@ -366,6 +374,7 @@
           ___type: "other",
         },
       ],
+	  consumizetemplateInfo:{},
       popupsSwitch: false, //瀵艰埅鏍忓垪琛ㄦ爮寮�鍏�
       enableShare: false,
       selectedGoods: "", //閫夋嫨鐨勫晢鍝佽鏍兼樀绉�
@@ -454,8 +463,15 @@
 	  		pageCode:"GOODS_DETAILS",
 	  		pageParams:"{}",
 	  		pageStatus:"JOIN",
-	  		pageType:"DETAIL"
-	  	}
+	  		pageType:"DETAIL",
+			shareId:null,
+	  	},
+		shareParam:{
+			pageCode:"GOODS_DETAILS",
+			shareOption:"{}",
+			pageType:"DETAIL"
+		},
+		shareId:'',
     };
   },
 
@@ -508,8 +524,64 @@
 
     this.productRefHeight = windowHeight - bottomHeight + "px";
   },
+
+
+
+ onShareAppMessage(e) {
+ 		console.log("寮�濮嬪垎浜�")
+ 		console.log(this.goodsDetail)
+ 		// 杩斿洖涓�涓狿romise
+ 		return new Promise((resolve) => {
+ 			
+ 					this.shareId = '';
+ 					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({
+ 						title: this.goodsDetail.goodsName,
+ 						path: '/pages/product/goods' +'?id='+ this.routerVal.id + '&goodsId=' + this.routerVal.goodsId +'&shareId=' + this.shareId,
+ 						imageUrl: this.goodsDetail.goodsGalleryList[0],
+ 						success(e) {
+ 						  console.log("鍒嗕韩鎴愬姛", e);
+ 						},
+ 						fail(e) {
+ 						  console.log('鍒嗕韩澶辫触', e);
+ 						}
+ 					  });
+ 					}).catch(err => {
+ 					  // 澶勭悊閿欒鎯呭喌锛屼緥濡備娇鐢ㄩ粯璁ゅ弬鏁�
+ 					  console.error('鑾峰彇鍒嗕韩ID澶辫触', err);
+ 					  resolve({
+ 						title: this.goodsDetail.goodsName,
+ 						path: '/pages/product/goods' +'?id='+ this.routerVal.id + '&goodsId=' + this.routerVal.goodsId,
+ 						imageUrl: this.goodsDetail.goodsGalleryList[0],
+ 					  });
+ 					});
+ 		});
+ 	},
   async onLoad (options) {
-	 
+	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(options)
 	  if(options.q){
 		  const queryParam = {
 			  id:'',
@@ -535,22 +607,31 @@
 	  console.log(this.routerVal)
     
     // #ifdef MP-WEIXIN
-    // 灏忕▼搴忛粯璁ゅ垎浜�
-    uni.showShareMenu({
-      withShareTicket: true,
-      menus: ["shareAppMessage", "shareTimeline"],
-    });
+
     // #endif
+	this.goodsDetail = {};
+	//濡傛灉鏈夊弬鏁癷ds璇存槑浜嬪垎閿�鐭繛鎺ワ紝闇�瑕佽幏鍙栧弬鏁�
+	if (this.routerVal.scene) {
+	  getMpScene(this.routerVal.scene).then((res) => {
+	    if (res.data.success) {
+	      let data = res.data.result.split(","); // skuId,goodsId,distributionId
+	      this.init(data[0], data[1], data[2]);
+	    }
+	  });
+	} else {
+	  this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
+	}
   },
+  
   onUnload() {
-    let	param = this.actionParam;
+    let param = Object.assign({}, this.actionParam);
     if (this.sendOnShow)return
     param.pageStatus = "LEAVE"
     userAction(param)
   },
   onHide() {
     this.startHidenTime = Date.now()
-    let	param = this.actionParam;
+    let	param = Object.assign({}, this.actionParam);
     this.sendOnShow = true;
     param.pageStatus = "LEAVE"
     userAction(param)
@@ -558,24 +639,25 @@
   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 = this.actionParam;
-	  		param.sessionId = this.pageSessionNo
+	  	let	param = Object.assign({}, this.actionParam);
 	  		userAction(param)
 	  	}
 	  })	
-    this.goodsDetail = {};
-    //濡傛灉鏈夊弬鏁癷ds璇存槑浜嬪垎閿�鐭繛鎺ワ紝闇�瑕佽幏鍙栧弬鏁�
-    if (this.routerVal.scene) {
-      getMpScene(this.routerVal.scene).then((res) => {
-        if (res.data.success) {
-          let data = res.data.result.split(","); // skuId,goodsId,distributionId
-          this.init(data[0], data[1], data[2]);
-        }
-      });
-    } else {
-      this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
-    }
+    // this.goodsDetail = {};
+    // //濡傛灉鏈夊弬鏁癷ds璇存槑浜嬪垎閿�鐭繛鎺ワ紝闇�瑕佽幏鍙栧弬鏁�
+    // if (this.routerVal.scene) {
+    //   getMpScene(this.routerVal.scene).then((res) => {
+    //     if (res.data.success) {
+    //       let data = res.data.result.split(","); // skuId,goodsId,distributionId
+    //       this.init(data[0], data[1], data[2]);
+    //     }
+    //   });
+    // } else {
+    //   this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
+    // }
   },
 
   methods: {
@@ -688,6 +770,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) => {
@@ -703,7 +795,6 @@
         });
       // 杞挱鍥�
       this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1);
-
       // 鑾峰彇搴楅摵鍩烘湰淇℃伅
       this.getStoreBaseInfoFun(this.goodsDetail.storeId);
 
@@ -720,6 +811,7 @@
       if (this.$options.filters.isLogin("auth")) {
         this.getGoodsCollectionFun(this.goodsDetail.id);
       }
+
       // 鑾峰彇IM 闇�瑕佺殑璇濅娇鐢�
       // this.getIMDetailMethods();
     },

--
Gitblit v1.8.0