Browse Source

feature:1.0:添加获取粉丝数量喜欢收藏功能

feature-1.0
Penny 3 years ago
parent
commit
63b384147f
  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"> <view class="middle">
<uni-section title="我的数据" type="line" padding> <uni-section title="我的数据" type="line" padding>
<uni-group mode="card"> <uni-group mode="card">
<view>粉丝数 点赞数 收藏数 </view> <view>粉丝数 {{creatorFansLikeInfo.fansNum}} </view>
<view>点赞数 {{creatorFansLikeInfo.likeNum}}</view>
<view>收藏数 {{creatorFansLikeInfo.collectNum}} </view>
</uni-group> </uni-group>
</uni-section> </uni-section>
</view> </view>
@ -36,6 +38,9 @@
</template> </template>
<script> <script>
import {
getCreatorInfoFansLike
} from '@/api/userInfo.js'
export default { export default {
data() { data() {
return { return {
@ -66,6 +71,7 @@
}], }],
pageUrl: '', pageUrl: '',
userInfo: {}, userInfo: {},
creatorFansLikeInfo: {}
} }
}, },
created() { created() {
@ -86,6 +92,8 @@
this.userInfo = userInfo; this.userInfo = userInfo;
console.log('have userInfo') console.log('have userInfo')
} }
//
this.getCreatorInfoFansLike();
}, },
methods: { methods: {
change(e) { change(e) {
@ -99,6 +107,23 @@
url: this.pageUrl 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> </script>

Loading…
Cancel
Save