From d68fb476c248c6c3ab974ea6b18d6bba638f12d8 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 06 十一月 2025 12:35:37 +0800
Subject: [PATCH] 页面优化
---
pages/product/goods.vue | 96 ++++++++++++++++++++++++++++++++++++------------
1 files changed, 72 insertions(+), 24 deletions(-)
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index cf365da..c15caa8 100644
--- a/pages/product/goods.vue
+++ b/pages/product/goods.vue
@@ -212,10 +212,10 @@
<u-icon size="34" class="red" name="home-fill"></u-icon>
<view class="red icon-btn-name">搴楅摵</view>
</view>
- <view class="icon-btn-item" @click="linkMsgDetail()">
+<!-- <view class="icon-btn-item" @click="linkMsgDetail()">
<u-icon size="34" name="kefu-ermai"></u-icon>
<view class="icon-btn-name">瀹㈡湇</view>
- </view>
+ </view> -->
<view class="icon-btn-item" @click="reluchToCart()">
<u-icon size="34" name="storeping-cart"></u-icon>
<view class="icon-btn-name">璐墿杞�</view>
@@ -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: "", //閫夋嫨鐨勫晢鍝佽鏍兼樀绉�
@@ -527,7 +529,7 @@
onShareAppMessage(e) {
console.log("寮�濮嬪垎浜�")
- console.log(this.goodsDetail)
+ console.log(JSON.stringify(this.goodsDetail))
// 杩斿洖涓�涓狿romise
return new Promise((resolve) => {
@@ -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,29 @@
});
},
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)
+ const shareId = uni.getStorageSync("shareId");
+ if(shareId){
+ let param = {
+ addType:"SHARE_USER_REGISTRY",
+ extend:"",
+ }
+ let extend = {shareId:shareId}
+ param.extend = JSON.stringify(extend)
+ addPrizeNum(param);
+ }
+ this.actionParam.pageParams = JSON.stringify(options)
if(options.q){
const queryParam = {
id:'',
@@ -594,6 +619,18 @@
// #ifdef MP-WEIXIN
// #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() {
@@ -612,24 +649,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 = Object.assign({}, this.actionParam);
- param.sessionId = this.pageSessionNo
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: {
@@ -742,6 +780,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 +805,6 @@
});
// 杞挱鍥�
this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1);
-
// 鑾峰彇搴楅摵鍩烘湰淇℃伅
this.getStoreBaseInfoFun(this.goodsDetail.storeId);
@@ -774,6 +821,7 @@
if (this.$options.filters.isLogin("auth")) {
this.getGoodsCollectionFun(this.goodsDetail.id);
}
+
// 鑾峰彇IM 闇�瑕佺殑璇濅娇鐢�
// this.getIMDetailMethods();
},
--
Gitblit v1.8.0