From 7c143efe30cf1320f98b368b0a397a03412bcc0c Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 29 Dec 2025 15:40:00 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/product/components/goods-modal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/product/components/goods-modal.vue b/pages/product/components/goods-modal.vue index 56b9d2f..19873fd 100644 --- a/pages/product/components/goods-modal.vue +++ b/pages/product/components/goods-modal.vue @@ -190,7 +190,7 @@ - + From a12599580872e2b2bd1a8153fe92828256031a03 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 20 Jan 2026 10:16:11 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=86=E9=94=80?= =?UTF-8?q?=E5=91=98=E4=B8=AD=E5=BF=83-=E6=97=A0=E6=84=9F-=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E9=82=80=E8=AF=B7=E4=BA=BA=E7=BB=9F=E4=B8=80=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/market/distribution.js | 8 ++++++++ utils/share.js | 34 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/common/api/market/distribution.js b/common/api/market/distribution.js index 89f453f..acfc46e 100644 --- a/common/api/market/distribution.js +++ b/common/api/market/distribution.js @@ -147,3 +147,11 @@ export const getConfig = (data) => { }; +// 分销员中心-无感-绑定邀请人 +export const autoBindInviteUser = (data) => { + return request({ + url: prveUrl + "/user/distribution/autoBindInviteUser", + method: "post", + data: data, + }); +}; \ No newline at end of file diff --git a/utils/share.js b/utils/share.js index c98a91b..3b3fd87 100644 --- a/utils/share.js +++ b/utils/share.js @@ -1,3 +1,7 @@ +import { + autoBindInviteUser +} from '@/common/api/market/distribution.js' + const accountInfo = wx.getAccountInfoSync(); export const envVersion = accountInfo.miniProgram.envVersion; let type = 3; @@ -13,6 +17,36 @@ if (envVersion === 'trial') { } +/** + * 绑定用户邀请关系(核心函数) + * 功能说明:校验邀请码有效性,有效则调用自动绑定接口完成邀请关系绑定 + * @param {Object} args - 绑定邀请关系的入参对象 + * @param {number} [args.shopUserId] - 需要绑定邀请人的用户ID(integer ,可选) + * @param {number} [args.shopId] - 店铺ID(integer ,可选) + * @param {string} args.inviteCode - 邀请人的邀请码(必填,非空校验通过后才会执行绑定逻辑) + * @returns {void} 无返回值 + */ +export function bindInvite(args) { + // 解构入参对象,获取需要的核心参数 + const { + shopUserId, + shopId, + inviteCode + } = args; + + // 校验邀请码有效性:若邀请码为空、null、undefined,则直接返回,不执行后续绑定逻辑 + if (!inviteCode || inviteCode === null || inviteCode === undefined) { + return; + } + + // 邀请码有效,调用自动绑定邀请人接口,传递绑定所需参数 + autoBindInviteUser({ + id: shopUserId, + shopId, + inviteCode + }); +} + export function wxShare(par) { return { ...par, From 1ed28e2913d502a2d78a7c3b666e8045e5f1749a Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 20 Jan 2026 15:03:14 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BA=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E8=AF=B7=E6=B1=82=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/config.js b/common/config.js index 91fe54d..1273981 100644 --- a/common/config.js +++ b/common/config.js @@ -1,12 +1,9 @@ // const debug = process.env.NODE_ENV == 'development' ? true : false; // const debug = false; // false线上 true本地 -const debug = false; // false线上 true本地 +const debug = true; // false线上 true本地 let baseUrl = '' let baseUrlwws = '' - - - const version = "100"; const autoRemoveCache = { count: 100000, From c60a2115ea4c8e9afca809aa297c92a8c8cd85b8 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 21 Jan 2026 09:40:31 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E5=B0=81=E8=A3=85=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/market/distribution.js | 9 + common/config.js | 2 +- pages/index/index.vue | 1037 ++++++++++++++++------------- pages/index/indexs.vue | 907 +++++++++++++------------ pages/product/index.vue | 47 +- stores/user.js | 116 +++- utils/share.js | 250 ++++++- 7 files changed, 1423 insertions(+), 945 deletions(-) diff --git a/common/api/market/distribution.js b/common/api/market/distribution.js index acfc46e..85f66e0 100644 --- a/common/api/market/distribution.js +++ b/common/api/market/distribution.js @@ -136,6 +136,15 @@ export const getInviteCode = (data) => { data: data, }); }; +export const autoGetInviteCode = (data) => { + return request({ + url: prveUrl + "/user/distribution/autoGetInviteCode", + method: "get", + data: data, + }); +}; + + // 获取配置 export const getConfig = (data) => { diff --git a/common/config.js b/common/config.js index 91fe54d..bc7c7ef 100644 --- a/common/config.js +++ b/common/config.js @@ -1,6 +1,6 @@ // const debug = process.env.NODE_ENV == 'development' ? true : false; // const debug = false; // false线上 true本地 -const debug = false; // false线上 true本地 +const debug = true; // false线上 true本地 let baseUrl = '' let baseUrlwws = '' diff --git a/pages/index/index.vue b/pages/index/index.vue index 379cecf..c2a25f9 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -5,7 +5,8 @@ - + + @@ -133,424 +134,438 @@ + \ No newline at end of file diff --git a/pages/index/indexs.vue b/pages/index/indexs.vue index 0cfbdc8..77794c3 100644 --- a/pages/index/indexs.vue +++ b/pages/index/indexs.vue @@ -2,9 +2,11 @@ + \ No newline at end of file diff --git a/pages/product/index.vue b/pages/product/index.vue index 65902cc..7e63d5c 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -749,7 +749,7 @@ useCartStore } from '@/stores/order.js'; import { - computed, provide + computed, provide, reactive } from 'vue'; const cartStore = useCartStore(); /** @@ -2436,28 +2436,51 @@ } }); } - + + + import { + shareMixin, + handleMixinOnLoad,returnQuery + } from '@/utils/share.js' + defineOptions({ + mixins: [shareMixin], + }); + + onShareAppMessage((res)=>{ + let query=returnQuery() + query+='&type=beforehand' + return { + ...res, + ...query, + path: '/pages/product/index' + '?' + query, + query, + } + }) + + const pageOptions=reactive({}) onLoad(async (e) => { + Object.assign(pageOptions,e) if (e.type) { orderType.value = e.type; } - //获取用户信息 - const userInfo = await APIshopUserInfo({ - shopId: uni.cache.get('shopId') - }) - //获取店铺信息 - const shopInfoRes = await APIusershopInfodetail({ - shopId: uni.cache.get('shopId') - }); + await handleMixinOnLoad(e) + const userInfo= userStore.userInfo + const shopInfoRes=userStore.shopInfo + // //获取用户信息 + // const userInfo = await APIshopUserInfo({ + // shopId: uni.cache.get('shopId') + // }) + // //获取店铺信息 + // const shopInfoRes = await APIusershopInfodetail({ + // shopId: uni.cache.get('shopId') + // }); if (shopInfoRes && shopInfoRes.shopInfo) { Object.assign(shopInfo, shopInfoRes.shopInfo); - uni.cache.set('shopInfo', shopInfoRes.shopInfo) } if (userInfo && typeof userInfo === 'object') { shopUserInfo.value = userInfo - uni.cache.set('shopUserInfo', userInfo) } await productqueryProduct(); diff --git a/stores/user.js b/stores/user.js index f271a91..336729b 100644 --- a/stores/user.js +++ b/stores/user.js @@ -49,7 +49,7 @@ export const Storelogin = defineStore("login", { rawData: infoRes.rawData, source: "wechat", }); - console.log('APIuserlogin',res); + console.log('APIuserlogin', res); if (res) { this.token = res.token; this.miniAppOpenId = res.userInfo @@ -110,12 +110,90 @@ export const productStore = defineStore("product", { latitude: "", longitude: "", }, + token: "", + miniAppOpenId: "", + userInfo: "", + shopId: uni.cache.get('shopId') || '', shopInfo: { shopId: "", isOrderFence: 0, + id: '', }, + shopUserInfo:{ + + }, + isHasLogin:false }), actions: { + actionslogin() { + return new Promise(async (resolve, reject) => { + // #ifdef MP-WEIXIN + uni.login({ + provider: "weixin", + success: (data) => { + // 微信小程序环境 + uni.getUserInfo({ + provider: "weixin", + success: async (infoRes) => { + let res = await APIuserlogin({ + code: data.code, //临时登录凭证 + rawData: infoRes.rawData, + source: "wechat", + }); + console.log('APIuserlogin', res); + if (res) { + this.token = res.token; + this.isHasLogin=true + this.miniAppOpenId = res.userInfo + .miniAppOpenId; + this.userInfo = res.userInfo; + uni.cache.set("token", res.token); + uni.cache.set("userInfo", res.userInfo); + uni.cache.set("followIndex", res + .followIndex || ""); + } + resolve(true); + }, + fail: (err) => { + reject(false); + }, + }); + }, + }); + // #endif + // #ifdef MP-ALIPAY + my.getAuthCode({ + scopes: "auth_base", + success: async (data) => { + // 支付宝小程序环境 + // my.getAuthUserInfo({ + // success: async (infoRes) => { + let res = await APIuserlogin({ + code: data.authCode, //临时登录凭证 + // rawData: JSON.stringify(infoRes), + source: "alipay", + }); + if (res) { + this.isHasLogin=true + this.token = res.token; + this.miniAppOpenId = res.userInfo.miniAppOpenId; + this.userInfo = res.userInfo; + uni.cache.set("token", res.token); + uni.cache.set("openId", res.userInfo.alipayOpenId); + uni.cache.set("userInfo", res.userInfo); + resolve(true); + } + }, + fail: () => { + reject(false); + }, + }); + // #endif + // #ifdef H5 + resolve(true) + // #endif + }); + }, getLocation() { return new Promise((resolve, reject) => { console.log("获取经纬度"); @@ -185,11 +263,11 @@ export const productStore = defineStore("product", { console.log("扫码内容", q); // #ifdef H5 uni.navigateTo({ - url:'/pages/product/index' + url: '/pages/product/index' }) - return + return // #endif - + return new Promise(async (resolve, reject) => { if (q) { console.log(q); @@ -448,19 +526,41 @@ export const productStore = defineStore("product", { // 通过shopId 获取店铺会员信息 actionsproductqueryProduct() { + console.log('actionsproductqueryProduct:token',uni.cache.get('token')); return new Promise(async (resolve, reject) => { try { let res = await APIshopUserInfo(); - uni.cache.set("shopUserInfo", res); - uni.cache.set("orderVIP", res); - uni.cache.set("ordershopUserInfo", res.shopInfo); - resolve(res); + if(res&& typeof res === 'object'){ + this.shopUserInfo=res; + uni.cache.set("shopUserInfo", res); + uni.cache.set("orderVIP", res); + uni.cache.set("ordershopUserInfo", res.shopInfo); + resolve(res); + }else{ + reject(false); + } + } catch (e) { reject(false); } }); }, + async pageOnload() { + //登录 + await this.actionslogin() + //获取会员信息 + await this.actionsproductqueryProduct() + //获取店铺信息 + await this.getShopInfo() + }, + async getShopInfo(shopId) { + const shopRes = await APIusershopInfodetail({ + shopId: this.shopId || shopId, + }); + this.shopInfo = shopRes.shopInfo; + uni.cache.set("shopInfo", shopRes.shopInfo); + }, // 用户信息获取 actionsAPIuser() { return new Promise(async (resolve, reject) => { diff --git a/utils/share.js b/utils/share.js index 3b3fd87..88e88af 100644 --- a/utils/share.js +++ b/utils/share.js @@ -1,7 +1,15 @@ import { - autoBindInviteUser + autoBindInviteUser, + autoGetInviteCode } from '@/common/api/market/distribution.js' - +import { + APIshopUserInfo, + APIusershopInfodetail +} from '@/common/api/member.js' +import { + productStore +} from '@/stores/user.js'; +const accountStore = productStore(); const accountInfo = wx.getAccountInfoSync(); export const envVersion = accountInfo.miniProgram.envVersion; let type = 3; @@ -32,7 +40,7 @@ export function bindInvite(args) { shopUserId, shopId, inviteCode - } = args; + } = args; // 校验邀请码有效性:若邀请码为空、null、undefined,则直接返回,不执行后续绑定逻辑 if (!inviteCode || inviteCode === null || inviteCode === undefined) { @@ -52,4 +60,238 @@ export function wxShare(par) { ...par, type } -} \ No newline at end of file +} + +export async function returnQuery(query) { + + + const shopId = uni.cache.get('shopId') + const shopUserInfo = uni.cache.get('shopUserInfo') + const shopInfo = uni.cache.get('shopInfo') + const inviteCode = await autoGetInviteCode({ + shopId: shopId, + shopUserId: shopUserInfo.id + }) + + const pages = getCurrentPages(); + const currentPage = pages[pages.length - 1]; + const currentPath = currentPage.route; + const currentOptions = currentPage.options; + + + let sharePath = `/${currentPath}`; + const queryJson = { + inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null, + shopId, + shopUserId: shopUserInfo.id, + ...query + } + for (const key in currentOptions) { + if (currentOptions.hasOwnProperty(key)) { + queryJson[key] = encodeURIComponent(currentOptions[key]) + } + } + queryJson.shopId = shopId + queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null + queryJson.shopUserId = shopUserInfo.id + + let result = '' + for (let key in queryJson) { + if (queryJson[key]) { + if (result === '') { + result += `${key}=${queryJson[key]}` + } else { + result += `&${key}=${queryJson[key]}` + } + } + } + return result +} + +function parseQueryString(queryString) { + const queryParams = queryString.split("&").map((param) => param.split("=")); + const params = {}; + for (const [key, value] of queryParams) { + params[key] = value; + } + return params; +} +/** + * 混入的 onLoad 核心逻辑(抽成独立函数) + * @param {Object} opt - 页面 onLoad 接收的参数 + * @param {Object} vm - 组件实例(this) + */ +export async function handleMixinOnLoad(opt, vm) { + console.log('onLoad'); + const options = {} + if (opt.q) { + const q = decodeURIComponent(opt.q); + const params = parseQueryString(q.split("?")[1]); + Object.assign(options, params); + } else { + Object.assign(options, opt); + } + console.log('options', options); + if (options.shopId) { + uni.cache.set('shopId', options.shopId) + accountStore.shopId = options.shopId + await accountStore.pageOnload() + } + uni.setStorageSync('loadFinsh', true) + // const shopId = uni.cache.get('shopId') + // const shopUserInfo = uni.cache.get('shopUserInfo') + // const shopInfo = uni.cache.get('shopInfo') + // const inviteCode = await autoGetInviteCode({ + // shopId: shopId, + // shopUserId: shopUserInfo.id + // }) + + if (options.inviteCode) { + bindInvite(options) + } +} +// utils/share.js +export const shareMixin = { + + // async onLoad(opt) { + // console.log('onLoad'); + // const options = {} + // if (opt.q) { + // const q = decodeURIComponent(opt.q); + // const params = parseQueryString(q.split("?")[1]); + // Object.assign(options, params); + // } else { + // Object.assign(options, opt); + // } + // console.log('options', options); + // if (options.shopId) { + // uni.cache.set('shopId', options.shopId) + // } + + // const shopId = uni.cache.get('shopId') + // const shopUserInfo = uni.cache.get('shopUserInfo') + // const shopInfo = uni.cache.get('shopInfo') + // const inviteCode = await autoGetInviteCode({ + // shopId: shopId, + // shopUserId: shopUserInfo.id + // }) + + // uni.setStorageSync('loadFinsh',true) + + + // if (options.inviteCode) { + // bindInvite(options) + // } + // }, + async onShareAppMessage(res) { + // const shopId = uni.cache.get('shopId') + // const shopUserInfo = uni.cache.get('shopUserInfo') + const shopInfo = uni.cache.get('shopInfo') + // const inviteCode = await autoGetInviteCode({ + // shopId: shopId, + // shopUserId: shopUserInfo.id + // }) + const pages = getCurrentPages(); + const currentPage = pages[pages.length - 1]; + const currentPath = currentPage.route; + const currentOptions = currentPage.options; + + let sharePath = `/${currentPath}`; + // const queryJson = { + // inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null, + // shopId, + // shopUserId: shopUserInfo.id, + // } + // for (const key in currentOptions) { + // if (currentOptions.hasOwnProperty(key)) { + // queryJson[key] = encodeURIComponent(currentOptions[key]) + // } + // } + // queryJson.shopId = shopId + // queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null + // queryJson.shopUserId = shopUserInfo.id + + const query = returnQuery() + + + // 全局默认配置(可被页面覆盖) + const defaultShareConfig = { + title: shopInfo.shopName, + path: sharePath + '?' + query, + imageUrl: shopInfo.logo, + query, + // desc: '描述', + success: (res) => { + console.log('分享好友成功', res); + // 可加埋点等统一逻辑 + }, + fail: (err) => { + console.error('分享好友失败', err); + } + }; + + + + + + // 页面自定义配置覆盖全局 + const pageShareConfig = this.$options.shareConfig || {}; + console.log('mixIn onShareAppMessage', { + ...defaultShareConfig, + ...pageShareConfig + }) + return { + ...defaultShareConfig, + ...pageShareConfig + }; + }, + + + async onShareTimeline() { + + + // const shopId = uni.cache.get('shopId') + // const shopUserInfo = uni.cache.get('shopUserInfo') + const shopInfo = uni.cache.get('shopInfo') + // const inviteCode = await autoGetInviteCode({ + // shopId: shopId, + // shopUserId: shopUserInfo.id + // }) + + const pages = getCurrentPages(); + const currentPage = pages[pages.length - 1]; + const currentPath = currentPage.route; + const currentOptions = currentPage.options; + + + let sharePath = `/${currentPath}`; + // const queryJson = { + // inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null, + // shopId, + // shopUserId: shopUserInfo.id, + // } + // for (const key in currentOptions) { + // if (currentOptions.hasOwnProperty(key)) { + // queryJson[key] = encodeURIComponent(currentOptions[key]) + // } + // } + // queryJson.shopId = shopId + // queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null + // queryJson.shopUserId = shopUserInfo.id + + const query = returnQuery() + + const defaultTimelineConfig = { + title: shopInfo.shopName, + path: sharePath + '?' + query, + imageUrl: shopInfo.logo, + query, + }; + + const pageTimelineConfig = this.$options.shareTimelineConfig || {}; + return { + ...defaultTimelineConfig, + ...pageTimelineConfig + }; + } +}; \ No newline at end of file From 654ed39854130f243b53b05f6d5fba882fd3de51 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 21 Jan 2026 10:26:05 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/css/common.scss | 3 +++ components/ymf-components/ymf-share.vue | 28 ++++++++++++++++++++++++ pages.json | 1 + pages/product/components/goods-modal.vue | 17 ++++++++------ pages/product/index.vue | 6 ++++- utils/share.js | 20 ++++++++--------- 6 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 components/ymf-components/ymf-share.vue diff --git a/common/css/common.scss b/common/css/common.scss index 425b73c..0957cdb 100644 --- a/common/css/common.scss +++ b/common/css/common.scss @@ -44,6 +44,9 @@ page, image { display: block; } + .relative{ + position: relative; + } .absolute{ position: absolute; } diff --git a/components/ymf-components/ymf-share.vue b/components/ymf-components/ymf-share.vue new file mode 100644 index 0000000..a0211e5 --- /dev/null +++ b/components/ymf-components/ymf-share.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index 3189a1a..0e89a0e 100644 --- a/pages.json +++ b/pages.json @@ -2,6 +2,7 @@ "easycom": { "autoscan": true, "custom": { + "^my-(.*)": "@/components/ymf-components/ymf-$1.vue", "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue", "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue" diff --git a/pages/product/components/goods-modal.vue b/pages/product/components/goods-modal.vue index f4a3beb..a294441 100644 --- a/pages/product/components/goods-modal.vue +++ b/pages/product/components/goods-modal.vue @@ -13,8 +13,10 @@ - - {{ goods.name }} + + {{ goods.name }} + + {{ goods.shortTitle ? goods.shortTitle : '' }} @@ -308,6 +310,7 @@ import { useNavbarStore } from '@/stores/navbarStore'; + import ymfShare from '@/components/ymf-components/ymf-share.vue' const store = useNavbarStore(); const { showBack, @@ -479,11 +482,11 @@ const swiperCurrent = ref(0); function returnFirstSku(product) { - console.log('returnFirstSku', product.skuList[0]); + console.log('returnFirstSku', product); return { - ...product.skuList[0], - sku_id: product.skuList[0].id, - id: product.id, + ...product.skuList[0]||'', + sku_id: product.skuList[0].id||'', + id: product.id||'', } } //返回是否是多规格商品 @@ -831,7 +834,7 @@ padding: 0 28rpx; margin-top: 20rpx; font-weight: bold; - font-size: 32upx; + font-size: 32rpx; margin-bottom: 16rpx; } diff --git a/pages/product/index.vue b/pages/product/index.vue index 7e63d5c..734a1ea 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -1445,7 +1445,11 @@ // showShopsku.value = true; goodsModalList.value.push({ show:true, - goods:specifications.item + goods:{ + ...specifications.item, + /*过滤掉只有一个规格且下架的商品或者skuList为空的商品*/ + relatedRecommendJson:(specifications.item.relatedRecommendJson||[]).filter(v=>v.skuList&&v.skuList.length) + } }) }; // 判断商品是否在可售时间内 diff --git a/utils/share.js b/utils/share.js index 88e88af..26a7977 100644 --- a/utils/share.js +++ b/utils/share.js @@ -63,8 +63,8 @@ export function wxShare(par) { } export async function returnQuery(query) { - - + + const shopId = uni.cache.get('shopId') const shopUserInfo = uni.cache.get('shopUserInfo') const shopInfo = uni.cache.get('shopInfo') @@ -72,13 +72,13 @@ export async function returnQuery(query) { shopId: shopId, shopUserId: shopUserInfo.id }) - + const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; const currentPath = currentPage.route; const currentOptions = currentPage.options; - - + + let sharePath = `/${currentPath}`; const queryJson = { inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null, @@ -94,7 +94,7 @@ export async function returnQuery(query) { queryJson.shopId = shopId queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null queryJson.shopUserId = shopUserInfo.id - + let result = '' for (let key in queryJson) { if (queryJson[key]) { @@ -240,10 +240,10 @@ export const shareMixin = { ...defaultShareConfig, ...pageShareConfig }) - return { + return wxShare({ ...defaultShareConfig, ...pageShareConfig - }; + }); }, @@ -289,9 +289,9 @@ export const shareMixin = { }; const pageTimelineConfig = this.$options.shareTimelineConfig || {}; - return { + return wxShare({ ...defaultTimelineConfig, ...pageTimelineConfig - }; + }); } }; \ No newline at end of file From 8f1b21bf007ea063365c437f01e8fa75edefba5d Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 21 Jan 2026 15:11:01 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=82=B9=E9=A4=90=E9=A1=B5=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ymf-components/ymf-share.vue | 12 +- pages/index/index.vue | 10 +- pages/product/components/goods-modal.vue | 8 +- pages/product/index.vue | 143 +++++++++++++++-------- scoreShop/index/index.vue | 48 ++++++-- stores/user.js | 2 + utils/share.js | 49 +++++++- 7 files changed, 200 insertions(+), 72 deletions(-) diff --git a/components/ymf-components/ymf-share.vue b/components/ymf-components/ymf-share.vue index a0211e5..62b7bf2 100644 --- a/components/ymf-components/ymf-share.vue +++ b/components/ymf-components/ymf-share.vue @@ -1,7 +1,7 @@ - - - - - + 商品详情 - - + - {{returnBtmText}} + {{ returnBtmText }} - {{returnBtmText}} + {{ returnBtmText }} - - @@ -101,31 +92,29 @@ - {{item.wareName}} + {{ item.wareName }} - {{item.wareDetail}} + {{ item.wareDetail }} - ¥{{item.groupPrice}} - ¥{{item.originalPrice}} - 限购{{item.limitBuyNum}} + ¥{{ item.groupPrice }} + ¥{{ item.originalPrice }} + 限购{{ item.limitBuyNum }} - - + 合计: - {{totalPrice}} + {{ totalPrice }} - {{number}} + {{ number }} - @@ -137,574 +126,562 @@ \ No newline at end of file +} + diff --git a/groupBuying/index/index.vue b/groupBuying/index/index.vue index b748001..f9c2549 100644 --- a/groupBuying/index/index.vue +++ b/groupBuying/index/index.vue @@ -2,71 +2,63 @@ - + - {{shopInfo.shopName||''}} + {{ shopInfo.shopName || '' }} - - {{index+1}} - {{item}} -