|
|
|
@ -4,7 +4,7 @@ |
|
|
|
<view class="mainwrap2"> |
|
|
|
<view class="perinfo"> <span class="type-name"><img :src="avatarUrl"></img></span> |
|
|
|
<view class="dycd"> <span class="myname">{{name}}</span> |
|
|
|
<view class="myitem"> <span @click="showMedal()">勋章:{{medalNum}}<i></i></span> <span>挑战历史:{{challengeNum}}</span> </view> |
|
|
|
<view class="myitem"> <span @click="showMedal()">勋章:{{medalNum}}<i :style="{'background-color':active == 0 ?'red':'none'}"></i></span> <span>挑战历史:{{challengeNum}}</span> </view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="banbox_sec perinfo"> |
|
|
|
@ -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' |
|
|
|
}) |
|
|
|
|