Browse Source

Merge remote-tracking branch 'origin/master' into master

feature-1.0
helming 3 years ago
parent
commit
d05bb00026
  1. 8
      api/userInfo.js
  2. 27
      pages/userInfo/userInfo.vue

8
api/userInfo.js

@ -179,5 +179,13 @@ export function getCreatorInfo(creatorId) {
})
}
// 获取艺术家粉丝喜欢收藏量
export function getCreatorInfoFansLike(creatorId) {
return request({
url: `${serviceTitle}${prefix}/queryCreatorFansLikeNum/${creatorId}`,
method: 'get'
})
}

27
pages/userInfo/userInfo.vue

@ -13,7 +13,9 @@
<view class="middle">
<uni-section title="我的数据" type="line" padding>
<uni-group mode="card">
<view>粉丝数 点赞数 收藏数 </view>
<view>粉丝数 {{creatorFansLikeInfo.fansNum}} </view>
<view>点赞数 {{creatorFansLikeInfo.likeNum}}</view>
<view>收藏数 {{creatorFansLikeInfo.collectNum}} </view>
</uni-group>
</uni-section>
</view>
@ -36,6 +38,9 @@
</template>
<script>
import {
getCreatorInfoFansLike
} from '@/api/userInfo.js'
export default {
data() {
return {
@ -66,6 +71,7 @@
}],
pageUrl: '',
userInfo: {},
creatorFansLikeInfo: {}
}
},
created() {
@ -86,6 +92,8 @@
this.userInfo = userInfo;
console.log('have userInfo')
}
//
this.getCreatorInfoFansLike();
},
methods: {
change(e) {
@ -99,6 +107,23 @@
url: this.pageUrl
});
},
//
async getCreatorInfoFansLike() {
let that = this;
const res = await getCreatorInfoFansLike(that.userInfo.id)
console.log('res', res)
if (res.data.code === 200) {
that.creatorFansLikeInfo = res.data.data
console.log('creatorFansLikeInfo', that.creatorFansLikeInfo)
} else {
uni.showModal({
content: '获取粉丝喜欢收藏数量数据加载失败!',
showCancel: false
});
}
},
},
}
</script>

Loading…
Cancel
Save