diff --git a/pages/my/my.vue b/pages/my/my.vue index ca7c119..6b91f33 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -93,7 +93,6 @@ }; }, onLoad() { - console.log(this.userinfo) this.name = this.userinfo.nickName; this.avatarUrl = this.userinfo.avatarUrl; this.getSwiperList() diff --git a/subpkg/medal/medal.vue b/subpkg/medal/medal.vue index ac5f056..373b7aa 100644 --- a/subpkg/medal/medal.vue +++ b/subpkg/medal/medal.vue @@ -6,13 +6,30 @@ - 盛大鹏 + {{name}} 的勋章墙 - 已获得枚勋章 + 已获得枚勋章 - + + + + {{item[0].type}} + + + + + + {{data.name}} + + + + + + - + - - - - - + @@ -103,19 +95,22 @@ export default { data() { return { + prefix:"", + name:"", + avatarUrl:"", + medalNum:0, showMedal: true, - //奖章列表 - taskMedalList: [], - //我的奖章列表 - myMedalList: [], + medalList: null, }; }, computed: { - ...mapState('m_user', ['userId']) + ...mapState('m_user', ['userinfo','userId']) }, onLoad() { + this.prefix = uni.$http.baseUrl + this.name = this.userinfo.nickName; + this.avatarUrl = this.userinfo.avatarUrl; this.getMedalList(); - this.getMyMedalList() }, methods: { @@ -123,29 +118,10 @@ const { data: res - } = await uni.$http.post('/small/project/medal/listAll') + } = await uni.$http.post('/small/project/medal/medalInfo',this.userId) if (!res.success) return uni.$showMsg() - - res.data.forEach(item => { - item.iconPath = uni.$http.baseUrl + item.iconPath - this.taskMedalList.push(item.iconPath) - }) - - // uni.$showMsg('数据请求成功!') - }, - async getMyMedalList() { - - const { - data: res - } = await uni.$http.post('/small/wechat/showMyMedal', { - guid: this.userId, - }) - if (!res.success) return uni.$showMsg() - - res.data.forEach(item => { - item.iconPath = uni.$http.baseUrl + item.iconPath - this.myMedalList.push(item.iconPath) - }) + if (res.data == null ) return + this.medalList = res.data // uni.$showMsg('数据请求成功!') },