From 9c199e7943c4bfe3eff5638cfc57641359d821b2 Mon Sep 17 00:00:00 2001 From: sdaduanbilei Date: Mon, 8 Dec 2025 16:03:03 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BB=BB=E5=8A=A1=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/store/index.js | 55 +++++++++++++++++++++++++++--------------- pages/store/index.wxml | 8 +++--- pages/store/index.wxss | 12 +++++++++ 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/pages/store/index.js b/pages/store/index.js index fd8bd29..8bcca23 100644 --- a/pages/store/index.js +++ b/pages/store/index.js @@ -7,29 +7,19 @@ Page({ * 页面的初始数据 */ data: { - list:[ - { - name:'傲娇薄荷•斯基', - tag:'夏日续命草', - url:'https://res.catter.cn/pub/2025/12/04/20251204113223290.png', - count:1, - status:0 - }, - { - name:'呆萌多肉•丸子', - tag:'佛系晒太阳', - url:'https://res.catter.cn/pub/2025/12/04/20251204113419078.png', - count:2, - status:1 - } - ] + points:0, + list:[], + inviteCode:"" }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + const inviteCode = wx.getStorageSync('inviteCode') + this.setData({ + inviteCode: inviteCode + }) }, /** @@ -47,11 +37,24 @@ Page({ }, fetchList(){ - api('/claim/list','POST',{current:0,pageSize:10,name:'',keyword:''},'json').then(res => { - if (res.code === 200){ - console.log(res); + api('/personal/personal', 'GET').then(res => { + if (res.code === 200) { + const tmps = res.data + this.setData({ + points: tmps.pointsCount + }) + api('/claim/list','POST',{current:0,pageSize:10,name:'',keyword:''},'json').then(res => { + if (res.code === 200){ + const tmps = res.data.list.map(e => { + e.status = e.points < this.data.points ? 0:1 + return e + }) + this.setData({list:tmps}) + } + }) } }) + }, /** @@ -86,6 +89,18 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage() { + return { + title: '发现一个宝藏养花神器', + imageUrl: "https://res.catter.cn/pub/2025/12/08/20251208112039694.png", + path: '/pages/index/index?inviteCode=' + this.data.inviteCode + }; + }, + onShareTimeline() { + return { + title: '发现一个宝藏养花神器', + imageUrl: "https://res.catter.cn/pub/2025/12/08/20251208112039694.png", + path: '/pages/index/index?inviteCode=' + this.data.inviteCode + }; } }) \ No newline at end of file diff --git a/pages/store/index.wxml b/pages/store/index.wxml index f200040..f9c8491 100644 --- a/pages/store/index.wxml +++ b/pages/store/index.wxml @@ -2,17 +2,17 @@ - 我的阳光值 1 枚 + 我的阳光值 {{points}} - 邀请好友获取更多兑换币 + - - 需要 {{item.count}} 兑换币 + + 需要 {{item.points}} 阳光值 {{item.name}} diff --git a/pages/store/index.wxss b/pages/store/index.wxss index 4eb7f39..afe5f6f 100644 --- a/pages/store/index.wxss +++ b/pages/store/index.wxss @@ -4,4 +4,16 @@ grid-template-columns: auto auto; grid-row-gap: 8px; grid-column-gap: 8px; +} + +button::after { + border: none; +} + +.avatar-wrapper { + padding: 0; + font-size: 16px !important; + color: orange !important; + background-color: transparent !important; + } \ No newline at end of file