From 5e5043b878f5c6fe54fc146c0a1a381e77f8defd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Mon, 29 Dec 2025 15:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=AF=E5=88=86=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E6=A8=A1=E5=9D=97=E7=99=BB=E5=BD=95=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/jfShop/detail/index.vue | 6 +++++- packages/jfShop/index/index.vue | 13 ++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/jfShop/detail/index.vue b/packages/jfShop/detail/index.vue index 4b2822ff..7f087530 100644 --- a/packages/jfShop/detail/index.vue +++ b/packages/jfShop/detail/index.vue @@ -43,7 +43,8 @@ 当前积分{{ userPoints }} - 积分不足,还差{{ selectedGoodsInfo.points - userPoints }}积分哦 + 暂未登录,请先登录 + 积分不足,还差{{ selectedGoodsInfo.points - userPoints }}积分哦 @@ -171,6 +172,9 @@ export default { }, // 获取用户积分 getPointNum() { + if (!uni.getStorageSync("ctoken")) { + return 0; + } request(apiArr2.getUserInfo, 'POST', {}, { silent: false }).then(res => { this.userPoints = res.points; }); diff --git a/packages/jfShop/index/index.vue b/packages/jfShop/index/index.vue index e3005151..9ec53c7d 100644 --- a/packages/jfShop/index/index.vue +++ b/packages/jfShop/index/index.vue @@ -90,6 +90,9 @@ export default { }, methods: { getNum() { + if (!uni.getStorageSync("ctoken")) { + return 0; + } request(apiArr2.getUserInfo, 'POST', {}, { silent: false }).then(res => { this.pointsNum = res.points; }); @@ -101,7 +104,7 @@ export default { }, getList() { if (this.loading || this.noMore) return; - + this.loading = true; const params = { category_id: this.activeCategory, @@ -110,21 +113,21 @@ export default { } request(apiArr.pointShopPage, 'POST', params, { silent: false }, false).then(res => { this.loading = false; - + const newProducts = res.row.map(item => { return { ...item, commodity_pic: picUrl + item.commodity_pic, } }); - + // 如果是第一页,直接替换数据,否则追加 if (this.page_num === 1) { this.products = newProducts; } else { this.products = [...this.products, ...newProducts]; } - + // 判断是否还有更多数据 if (newProducts.length < this.page_size) { this.noMore = true; @@ -153,7 +156,7 @@ export default { } }, toDetail(product) { - NavgateTo('/packages/jfShop/detail/index?product=' + JSON.stringify(product) + '&pointNum=' + this.pointsNum); + NavgateTo('/packages/jfShop/detail/index?product=' + JSON.stringify(product) + '&pointNum=' + this.pointsNum, { isLogin: false }); } } }