优化页面

This commit is contained in:
pengxiaolong
2025-06-13 22:13:15 +08:00
parent de99d32c01
commit 0f2a48b450
86 changed files with 4383 additions and 671 deletions

View File

@@ -19,6 +19,7 @@
</view>
<!-- <view class="Individual"> -->
<view class="AnchorSelection">
<view class="NameAnchor">
<input
class="NameAnchorcss"
@@ -27,12 +28,14 @@
@input="NameAnchor"
placeholder="主播名称"
@blur="blur"
:value="nameAnchor"
/>
<view v-if="nameAnchor === '' && Hint === true" class="Hint"
>请检查主播名称是否正确</view
>
</view>
<view class="AnchorSelectioncss" @click="chooseMyStreamer">选择我的主播</view>
</view>
<!-- </view> -->
<view class="Accountnumber">
@@ -140,6 +143,43 @@
</view>
</view>
</view>
<!-- 弹窗 -->
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
<view class="popup-container">
<view class="popup-title">选择我的主播</view>
<scroll-view scroll-y="true" class="scroll" v-if="AnchorList.length !== 0">
<!-- -->
<view class="card" v-for="(item, index) in AnchorList" :key="index">
<view
class="card-content"
@click="Select(item.id, item)"
:style="{
background: selectedId === item.id ? '#f6f6f6' : '#ffffff',
}"
>
<view class="Avatarimg">
<image class="avatar" :src="item.headerIcon" mode="scaleToFill" />
</view>
<view class="NameMoney">
<view class="TimeMoney">
<view class="NameMoney_Name">{{ item.anchorId }}</view>
</view>
<view class="TimeMoney">
<view class="TimeMoney_country">{{ item.country }}</view>
</view>
</view>
</view>
</view>
<!-- -->
</scroll-view>
<view v-if="AnchorList.length === 0" class="no-data"><view class="no-data-text">暂无数据</view></view>
<view class="popup-btn">
<button class="invite" type="primary" @click="invite()">确认</button>
<button class="cancel" type="default" @click="close()">取消</button>
</view>
</view>
</uni-popup>
</template>
<script>
import optionsArray from "../../components/NationalDictionary.js";
@@ -166,6 +206,9 @@ export default {
sendingTime: "", //发送时间
filterable: true, //是否可搜索
AnchorProfilePicture: "", //主播头像
AnchorList: [], //主播列表
selectedId: null, //选择的主播
selectedIddata: null, //选择的主播数据
};
},
mounted() {
@@ -177,6 +220,57 @@ export default {
});
},
methods: {
//关闭弹窗
close() {
this.$refs.popup.close();
},
//确认选择
invite(){
if (this.selectedId) {
this.nameAnchor = this.selectedIddata.anchorId;
this.AnchorProfilePicture = this.selectedIddata.headerIcon;
this.close();
} else {
uni.showToast({
title: "请选择主播",
icon: "none",
duration: 2000,
});
}
},
//选中的主播
Select(id, item) {
if (this.selectedId !== id) {
this.selectedId = id;
this.selectedIddata = item;
} else {
this.selectedId = null;
this.selectedIddata = null;
}
},
//获取主播列表
getAnchorList() {
const res = request({
url: "anchor/list",
method: "POST",
data: {
id: this.id,
},
userInfo: true,
}).then((res) => {
this.triggered = false;
if (res.code == 200) {
this.AnchorList = res.data;
} else {
console.log(res.msg);
}
});
},
//选择我的主播
chooseMyStreamer(){
this.$refs.popup.open("center");
this.getAnchorList()
},
//性别
gender(item) {
this.genders = item.value;
@@ -447,10 +541,14 @@ export default {
margin: 40rpx;
}
.time {
width: 90%;
width: 70%;
margin-left: 5%;
margin-top: 50rpx;
}
.AnchorSelection{
display: flex;
align-items: center;
}
.NameAnchorcss {
width: 99%;
height: 85rpx;
@@ -459,6 +557,18 @@ export default {
border-radius: 10rpx;
text-align: center;
}
.AnchorSelectioncss{
width: 30%;
height: 60rpx;
margin: 40rpx;
background-image: linear-gradient(135deg, #4fcacd, #5fdbde);
color: #ffffff;
font-weight: bold;
font-size: 18rpx;
text-align: center;
line-height: 60rpx;
border-radius: 20rpx;
}
.Gender {
width: 310rpx;
display: flex;
@@ -556,4 +666,124 @@ export default {
font-weight: bold;
border-radius: 50rpx;
}
.popup-container{
width: 600rpx;
height: 800rpx;
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
background-position: center;
border-radius: 10px;
background-repeat: no-repeat;
display: flex;
flex-direction: column;
align-items: center;
}
.popup-title{
color: #161616;
font-size: 36.26rpx;
font-weight: bold;
margin-bottom: 30rpx;
margin-top: 30rpx;
}
.scroll{
width: 90%;
height: 500rpx;
}
.card{
margin-top: 15rpx;
}
.card-content {
/* width: 445rpx; */
width: 100%;
height: 100rpx;
background-color: #ffffff;
/* border: 2px solid #afafaf; */
border-radius: 10rpx;
display: flex;
align-items: center;
font-size: 28rpx;
color: rgb(127, 127, 127);
}
.Avatarimg {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
background-color: #dddddd;
margin-right: 20rpx;
margin-left: 20rpx;
}
.avatar {
width: 100%;
height: 100%;
border-radius: 50%;
}
.NameMoney {
display: flex;
flex-direction: column;
}
.TimeMoney {
width: 300rpx;
display: flex;
font-weight: bold;
font-size: 27rpx;
color: #161616;
}
.NameMoney_Name {
width: 400rpx;
text-align: left;
font-weight: bold;
font-size: 27rpx;
color: #161616;
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出内容 */
text-overflow: ellipsis; /* 显示省略号 */
}
.TimeMoney_country{
margin-top: 10rpx;
width: 400rpx;
text-align: left;
font-size: 20rpx;
color: #666;
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出内容 */
text-overflow: ellipsis; /* 显示省略号 */
}
.popup-btn {
display: flex;
justify-content: space-around;
margin-top: 50rpx;
}
.invite {
width: 225.19rpx;
height: 78.24rpx;
font-size: 28.63rpx;
line-height: 80rpx;
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-bottom-right-radius: 50rpx;
background-image: linear-gradient(135deg, #4fcacd, #5fdbde);
}
.cancel {
width: 225.19rpx;
height: 78.24rpx;
font-size: 28.63rpx;
line-height: 80rpx;
margin-left: 30rpx;
color: #03aba8;
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
border-bottom-right-radius: 50rpx;
border: 1rpx solid #03aba8;
}
.no-data{
width: 90%;
height: 500rpx;
display: flex;
justify-content: center;
align-items: center;
}
.no-data-text{
color: #999;
font-size: 28rpx;
font-weight: bold;
}
</style>