<template>
|
<view class="my">
|
<view class="my_cate">
|
<view class="my_cate_list">
|
<view class="my_cate_list_item" v-for="(item, index) in cate" :key="index" @click="change(index)">
|
<text :class="i === index ? 'activeFont' : ''">{{item}}</text>
|
<view class="active" v-if="i === index"></view>
|
</view>
|
</view>
|
</view>
|
<!-- 关注列表 -->
|
<template v-if="i === 0 || i === 2">
|
<view class="my_ipt" v-if="i === 0">
|
<view class="my_ipt_icon">
|
<uni-icons type="search" size="18" color="#999999"></uni-icons>
|
</view>
|
<input type="search" placeholder="搜索已关注的人" placeholder-style="font-size: 28rpx; font-weight: 500; color: #999999;" />
|
</view>
|
<view class="my_text" v-else>你关注的ta也关注了</view>
|
<view class="my_list">
|
<view class="my_list_item" v-for="(item, index) in 5" :key="index">
|
<view class="my_list_item_left">
|
<image src="@/static/uni.png" mode="widthFix"></image>
|
<view class="my_list_item_left_info">
|
<text>爱意藏上海</text>
|
<text>90后咖啡爱好者,梦想是分梦想是分</text>
|
</view>
|
</view>
|
<!-- <view class="my_list_item_right">已关注</view> -->
|
<view class="my_list_item_right1" @click="open">关注</view>
|
</view>
|
</view>
|
</template>
|
<!-- 收藏列表 -->
|
<template v-else-if="i === 1">
|
<view class="my_list1">
|
<shopItem />
|
<shopItem />
|
<shopItem />
|
</view>
|
</template>
|
<!-- 取消关注 -->
|
<uni-popup ref="popup" background-color="#fff">
|
<view class="popup">
|
<view class="popup_text">确认不再关注?</view>
|
<view class="popup_box">
|
<view class="popup_box_item" @click="close">取消</view>
|
<view class="popup_box_item">确认</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import shopItem from '@/components/ShopItem/index.vue'
|
export default {
|
data() {
|
return {
|
i: 0,
|
cate: ['关注', '收藏', '推荐']
|
}
|
},
|
components: {
|
shopItem
|
},
|
methods: {
|
change(index) {
|
this.i = index
|
},
|
open() {
|
this.$refs.popup.open('center')
|
},
|
close() {
|
this.$refs.popup.close()
|
}
|
}
|
}
|
</script>
|
|
<style>
|
page {
|
background-color: #ffffff !important;
|
}
|
.uni-popup__wrapper {
|
border-radius: 24rpx !important;
|
}
|
</style>
|
|
<style lang="scss" scoped>
|
.my {
|
width: 100%;
|
padding: 24rpx 32rpx;
|
box-sizing: border-box;
|
.my_cate {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
.my_cate_list {
|
width: 60%;
|
display: flex;
|
align-items: center;
|
.my_cate_list_item {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #666666;
|
}
|
.activeFont {
|
font-size: 32rpx !important;
|
font-weight: 500 !important;
|
color: #333333 !important;
|
}
|
.active {
|
width: 40rpx;
|
height: 4rpx;
|
background: #D20A0A;
|
border-radius: 12rpx;
|
margin-top: 8rpx;
|
}
|
}
|
}
|
}
|
.my_ipt {
|
width: 100%;
|
height: 64rpx;
|
background: #F5F5F5;
|
border-radius: 32rpx;
|
margin-top: 24rpx;
|
display: flex;
|
align-items: center;
|
padding: 0 28rpx;
|
box-sizing: border-box;
|
.my_ipt_icon {
|
width: 28rpx;
|
flex-shrink: 0;
|
margin-right: 12rpx;
|
}
|
input {
|
flex: 1;
|
height: 100%;
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #000000;
|
}
|
}
|
.my_list {
|
margin-top: 32rpx;
|
display: flex;
|
flex-direction: column;
|
.my_list_item {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom: 32rpx;
|
&:last-child {
|
margin-bottom: 0 !important;
|
}
|
.my_list_item_left {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
image {
|
flex-shrink: 0;
|
width: 100rpx;
|
height: 100rpx;
|
border-radius: 50%;
|
margin-right: 20rpx;
|
}
|
.my_list_item_left_info {
|
width: 364rpx;
|
height: 100rpx;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-around;
|
text {
|
width: 100%;
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
&:nth-child(1) {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
&:nth-child(2) {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
}
|
}
|
}
|
}
|
.my_list_item_right {
|
flex-shrink: 0;
|
width: 128rpx;
|
height: 48rpx;
|
line-height: 48rpx;
|
text-align: center;
|
border-radius: 27rpx;
|
border: 2rpx solid #999999;
|
font-size: 28rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
margin-left: 74rpx;
|
}
|
.my_list_item_right1 {
|
flex-shrink: 0;
|
width: 128rpx;
|
height: 48rpx;
|
line-height: 48rpx;
|
text-align: center;
|
border-radius: 27rpx;
|
font-size: 28rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #FFFFFF;
|
margin-left: 74rpx;
|
background: linear-gradient(270deg, #D20A0A 0%, #D95A5A 100%);
|
}
|
}
|
}
|
.my_list1 {
|
width: 100%;
|
margin-top: 24rpx;
|
display: flex;
|
justify-content: space-between;
|
flex-wrap: wrap;
|
}
|
.my_text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
margin-top: 38rpx;
|
}
|
.popup {
|
width: 518rpx;
|
background: #FFFFFF;
|
border-radius: 24rpx;
|
.popup_text {
|
width: 100%;
|
text-align: center;
|
margin: 46rpx 0;
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
.popup_box {
|
width: 100%;
|
height: 85rpx;
|
display: flex;
|
align-items: center;
|
border-top: 2rpx solid #C8C8C8;
|
.popup_box_item {
|
flex: 1;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
&:first-child {
|
border-right: 2rpx solid #C8C8C8;
|
}
|
}
|
}
|
}
|
}
|
</style>
|