| | |
| | | <storeLayout v-if="false" id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" /> |
| | | |
| | | <!-- 宝贝详情 --> |
| | | <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId" |
| | | <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId" |
| | | v-if="goodsDetail.id" /> |
| | | |
| | | <!-- 宝贝推荐 --> |
| | |
| | | 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' |
| | |
| | | IMLink: "", // IM地址 |
| | | wholesaleList: [], |
| | | takeDownFromSale: false, // 下架销售状态 |
| | | pageSessionNo:"", |
| | | sendOnShow:false, |
| | | actionParam:{ |
| | | sessionId:'', |
| | | actionType:"PAGE", |
| | | joinType:"SELF", |
| | | pageCode:"GOODS_DETAILS", |
| | | pageParams:"{}", |
| | | pageStatus:"JOIN", |
| | | pageType:"DETAIL" |
| | | } |
| | | }; |
| | | }, |
| | | |
| | |
| | | this.productRefHeight = windowHeight - bottomHeight + "px"; |
| | | }, |
| | | async onLoad (options) { |
| | | this.routerVal = options; |
| | | |
| | | if(options.q){ |
| | | const queryParam = { |
| | | id:'', |
| | | goodsId:'', |
| | | distributionId:'' |
| | | }; |
| | | 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; |
| | | this.actionParam.pageParams = JSON.stringify(params) |
| | | this.actionParam.joinType = 'SCAN' |
| | | }else{ |
| | | this.routerVal = options; |
| | | this.actionParam.pageParams = JSON.stringify(options) |
| | | } |
| | | console.log('打印信息') |
| | | console.log(options) |
| | | console.log(this.routerVal) |
| | | |
| | | // #ifdef MP-WEIXIN |
| | | // 小程序默认分享 |
| | | uni.showShareMenu({ |
| | |
| | | }); |
| | | // #endif |
| | | }, |
| | | onUnload() { |
| | | let param = this.actionParam; |
| | | if (this.sendOnShow)return |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onHide() { |
| | | this.startHidenTime = Date.now() |
| | | let param = this.actionParam; |
| | | this.sendOnShow = true; |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | async onShow () { |
| | | getSessionId().then(res=>{ |
| | | this.pageSessionNo = res.data.data |
| | | if(this.pageSessionNo){ |
| | | let param = this.actionParam; |
| | | param.sessionId = this.pageSessionNo |
| | | userAction(param) |
| | | } |
| | | }) |
| | | this.goodsDetail = {}; |
| | | //如果有参数ids说明事分销短连接,需要获取参数 |
| | | if (this.routerVal.scene) { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // 解析URL参数 |
| | | parseUrlParams(url) { |
| | | const params = {}; |
| | | // 处理可能存在的hash(如果有的话) |
| | | 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 |
| | |
| | | * 初始化信息 |
| | | */ |
| | | async init (id, goodsId, distributionId = "") { |
| | | console.log('打印id:' + id) |
| | | console.log('打印goodsId:'+ goodsId) |
| | | this.isGroup = false; //初始化拼团 |
| | | this.productId = id; // skuId |
| | | // 这里请求获取到页面数据 解析数据 |
| | |
| | | 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) => { |
| | |
| | | */ |
| | | back () { |
| | | if (getCurrentPages().length == 1) { |
| | | uni.switchTab({ |
| | | url: "/pages/tabbar/home/index", |
| | | uni.redirectTo({ |
| | | url: "/pages/commodity-square/commoditySquare", |
| | | }); |
| | | } else { |
| | | uni.navigateBack(); |