From f9790ca44452da16a232f9ebb77035b9f0fef1d5 Mon Sep 17 00:00:00 2001 From: yanyan Date: Mon, 11 Mar 2024 10:35:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E7=82=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my/my.vue | 24 ++++++++++++++++++++++-- static/base_css.css | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/pages/my/my.vue b/pages/my/my.vue index 970da93..1403108 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -4,7 +4,7 @@ {{name}} - 勋章:{{medalNum}} 挑战历史:{{challengeNum}} + 勋章:{{medalNum}} 挑战历史:{{challengeNum}} @@ -80,6 +80,7 @@ export default { data() { return { + active:1, medalNum:0, challengeNum:0, page: "", @@ -98,6 +99,7 @@ this.getSwiperList() this.getFunctionList() this.getMyMedalList() + this.getStatus() }, onShow() { this.page = "my" @@ -129,6 +131,17 @@ // uni.$showMsg('数据请求成功!') }, + async getStatus() { + + const { + data: res + } = await uni.$http.post('/small/wechat/getActiveStatus',{guid:this.userId}) + if (!res.success) return uni.$showMsg() + if(res.data!=null){ + this.active = res.data.active; + } + // uni.$showMsg('数据请求成功!') + }, async getChallengeTotal() { const { @@ -167,7 +180,14 @@ this.functionList = res.data; // uni.$showMsg('数据请求成功!') }, - showMedal(){ + async showMedal(){ + if (this.active == 0){ + const { + data: res + } = await uni.$http.post('/small/wechat/editActiveStatus',{guid:this.userId,active:1}) + if (!res.success) return uni.$showMsg() + this.active = 1; + } uni.navigateTo({ url:'/subpkg/medal/medal' }) diff --git a/static/base_css.css b/static/base_css.css index cad2d02..dfe2280 100644 --- a/static/base_css.css +++ b/static/base_css.css @@ -442,7 +442,7 @@ h3.contit span { width: 8px; height: 8px; border-radius: 100%; - background-color: #fb3737; + /* background-color: #fb3737; */ } .mset {