From a38827061b6679a39d719dee72904ffbe49bd8e8 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期一, 04 八月 2025 11:14:17 +0800 Subject: [PATCH] 登录用户名,以及隐藏专题,新闻页面调整样式 --- pages/product/goods.vue | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 42 insertions(+), 5 deletions(-) diff --git a/pages/product/goods.vue b/pages/product/goods.vue index 4d87687..a7bbf36 100644 --- a/pages/product/goods.vue +++ b/pages/product/goods.vue @@ -155,7 +155,7 @@ <!-- 閰嶇疆鍦板潃 濡傛灉鏄櫄鎷熶骇鍝佺殑鏃跺�欎笉灞曠ず --> <view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"> <view class="card-flex" @click="shutMask(4)"> - <view class="card-title"> 宸查�� </view> + <view class="card-title"> 鍙�夎鏍� </view> <view class="card-content"> <span v-if="selectedGoods.spec">{{ selectedGoods.spec.specName }}-{{ selectedGoods.spec.specValue @@ -497,7 +497,27 @@ this.productRefHeight = windowHeight - bottomHeight + "px"; }, async onLoad (options) { - this.routerVal = options; + + if(options.q){ + const queryParam = { + id:'', + goodsId:'' + }; + const decodedUrl = decodeURIComponent(decodeURIComponent(options.q)); + console.log('鍘熷URL:', decodedUrl); + const params = this.parseUrlParams(decodedUrl); + const id = params.id; + const gooodsId = params.goodsId; + queryParam.id = id; + queryParam.goodsId = gooodsId; + this.routerVal = queryParam; + }else{ + this.routerVal = options; + } + console.log('鎵撳嵃淇℃伅') + console.log(options) + console.log(this.routerVal) + // #ifdef MP-WEIXIN // 灏忕▼搴忛粯璁ゅ垎浜� uni.showShareMenu({ @@ -522,6 +542,23 @@ }, methods: { + // 瑙f瀽URL鍙傛暟 + parseUrlParams(url) { + const params = {}; + // 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛� + const cleanUrl = url.split('#')[0]; + const queryStr = cleanUrl.split('?')[1] || ''; + + queryStr.split('&').forEach(pair => { + const [key, value] = pair.split('='); + if (key) { + // 濡傛灉鍊煎瓨鍦紝鍒欒В鐮侊紝鍚﹀垯璁句负绌哄瓧绗︿覆 + params[key] = value ? decodeURIComponent(value) : ''; + } + }); + + return params; + }, // 閲嶆柊鎵撳紑涓嬫灦 reStartTakeDownSale(){ this.$refs.takeDownSale.show = true @@ -611,7 +648,7 @@ this.goodsSpec = response.data.result.specs; this.PromotionList = response.data.result.promotionMap; this.goodsParams = response.data.result.goodsParamsDTOList || []; - + console.log('浼樻儬鍗锋椿鍔�--------------------銆�',response.data.result.promotionMap) // 鍒ゆ柇鏄惁鎷煎洟娲诲姩鎴栬�呯Н鍒嗗晢鍝� 濡傛灉鏈夊垯鏄剧ず鎷煎洟娲诲姩淇℃伅 this.PromotionList && Object.keys(this.PromotionList).forEach((item) => { @@ -759,8 +796,8 @@ */ back () { if (getCurrentPages().length == 1) { - uni.switchTab({ - url: "/pages/tabbar/home/index", + uni.redirectTo({ + url: "/pages/commodity-square/commoditySquare", }); } else { uni.navigateBack(); -- Gitblit v1.8.0