You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
191 lines
3.8 KiB
191 lines
3.8 KiB
<template>
|
|
<view class="creatorDetail">
|
|
<view class="avatar-box">
|
|
<view class="avatar-top">
|
|
<view class="avatar-left-box">
|
|
<image :src="creatorInfo.img" mode=""></image>
|
|
<text>{{creatorInfo.scanCode}}</text>
|
|
</view>
|
|
<view class="avatar-right-box">
|
|
<image src="../../static/img/share.svg" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="avatar-box-text">
|
|
<text>{{creatorInfo.intro}}</text>
|
|
</view>
|
|
<view class="avatar-box-tag">
|
|
<view class="avatar-box-tag-left">
|
|
<view class="tag-left-box">
|
|
<text>{{creatorInfo.imgTotalNum}}</text>
|
|
<text>图片</text>
|
|
</view>
|
|
<view class="tag-left-box">
|
|
<text>{{creatorInfo.imgCollectionNum}}</text>
|
|
<text>收藏</text>
|
|
</view>
|
|
<view class="tag-left-box">
|
|
<text>{{creatorInfo.imgLikeNum}}</text>
|
|
<text>喜欢</text>
|
|
</view>
|
|
</view>
|
|
<view class="avatar-box-tag-right">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="middle">
|
|
<uni-segmented-control :current="current" :values="arrList" @clickItem="onClickItem" styleType="text"
|
|
activeColor="#11A8FD"></uni-segmented-control>
|
|
</view>
|
|
<view class="bottom">
|
|
<image :src="item.imgUrl" mode="" v-for="(item,index) in creatorInfo.imgList" :key="index"
|
|
:style="'width:'+imgWidth+';height:'+imgHeight" @click="targetDetail(item)"></image>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
tiktokUserDetails
|
|
} from '@/api/creator.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
creatorInfo: {},
|
|
current: 0,
|
|
arrList: ['背景图', '头像', '表情包'],
|
|
imgWidth: 0, // 图片宽
|
|
imgHeight: 0, // 图片高
|
|
}
|
|
},
|
|
created() {
|
|
uni.getSystemInfo({
|
|
success: res => {
|
|
console.log(res)
|
|
this.imgWidth = res.windowWidth - 60 + 'rpx'
|
|
this.imgHeight = (res.windowWidth - 60) * 2 - 30 + 'rpx'
|
|
}
|
|
})
|
|
uni.getStorage({
|
|
key: 'creatorDetail',
|
|
success: res => {
|
|
console.log('getStorage', res)
|
|
this.creatorInfo = res.data
|
|
}
|
|
})
|
|
},
|
|
methods: {
|
|
onClickItem(e) {
|
|
console.log('点击', e)
|
|
},
|
|
// 前往详情页
|
|
targetDetail(item) {
|
|
console.log('跳转', item)
|
|
if (item.id) {
|
|
uni.setStorage({
|
|
key: 'detailId',
|
|
data: item.id,
|
|
success() {
|
|
console.log(111111)
|
|
uni.redirectTo({
|
|
url: './imgDetail'
|
|
})
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less">
|
|
.creatorDetail {
|
|
.avatar-box {
|
|
padding: 20rpx 20rpx;
|
|
background: #11A8FD;
|
|
|
|
.avatar-top {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
height: 120rpx;
|
|
|
|
.avatar-left-box {
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
|
|
image {
|
|
width: 80rpx;
|
|
height: 80rpx;
|
|
border-radius: 80rpx;
|
|
}
|
|
|
|
text {
|
|
font-size: 14px;
|
|
color: #fff;
|
|
margin-left: 20rpx;
|
|
}
|
|
}
|
|
|
|
.avatar-right-box {
|
|
image {
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
}
|
|
}
|
|
}
|
|
|
|
.avatar-box-text {
|
|
color: #fff;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.avatar-box-tag {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-top: 24rpx;
|
|
|
|
.avatar-box-tag-left {
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
|
|
.tag-left-box {
|
|
width: 120rpx;
|
|
|
|
text {
|
|
display: block;
|
|
color: #fff;
|
|
font-size: 12px;
|
|
}
|
|
|
|
text:last-child {
|
|
margin-top: 8rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.middle {
|
|
.segmented-control {
|
|
border-radius: 8rpx 8rpx 0 0;
|
|
background-color: rgba(17, 168, 253, 0.1);
|
|
}
|
|
}
|
|
|
|
.bottom {
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
|
|
image {
|
|
margin-top: 40rpx;
|
|
margin-left: 40rpx;
|
|
border-radius: 16rpx;
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|