From c61f03cfe1fcf023c7128f77f3d692aef309f77f Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 30 十月 2025 14:59:59 +0800
Subject: [PATCH] 页面优化
---
pages/product/goods.vue | 59 +++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/pages/product/goods.vue b/pages/product/goods.vue
index f44ad0c..ee304c0 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";
@@ -374,6 +374,7 @@
___type: "other",
},
],
+ consumizetemplateInfo:{},
popupsSwitch: false, //瀵艰埅鏍忓垪琛ㄦ爮寮�鍏�
enableShare: false,
selectedGoods: "", //閫夋嫨鐨勫晢鍝佽鏍兼樀绉�
@@ -608,6 +609,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() {
@@ -633,18 +646,18 @@
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: {
@@ -757,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) => {
@@ -772,7 +795,6 @@
});
// 杞挱鍥�
this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1);
-
// 鑾峰彇搴楅摵鍩烘湰淇℃伅
this.getStoreBaseInfoFun(this.goodsDetail.storeId);
@@ -789,6 +811,7 @@
if (this.$options.filters.isLogin("auth")) {
this.getGoodsCollectionFun(this.goodsDetail.id);
}
+
// 鑾峰彇IM 闇�瑕佺殑璇濅娇鐢�
// this.getIMDetailMethods();
},
--
Gitblit v1.8.0