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 {