优化页面
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
:filterable="filterable"
|
||||
placeholder="请选择国家"
|
||||
:value="countrys"
|
||||
@blur="blur"
|
||||
/>
|
||||
<view
|
||||
v-if="countrys === '' || (countrys === null && Hint === true)"
|
||||
@@ -70,24 +71,24 @@
|
||||
@change="gender"
|
||||
:options="Gender"
|
||||
placeholder="性别"
|
||||
:value="message.sex === '1' ? 1 : 2"
|
||||
:value="genders"
|
||||
/>
|
||||
</view>
|
||||
<view class="Gendericoncss">
|
||||
<image
|
||||
v-if="genders === 0 || message.sex === '0'"
|
||||
v-if="genders === 0 "
|
||||
class="Gendericon"
|
||||
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/ask.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<image
|
||||
v-if="genders === 1 || message.sex === '1'"
|
||||
v-if="genders === 1"
|
||||
class="Gendericon"
|
||||
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/man.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<image
|
||||
v-if="genders === 2 || message.sex === '2'"
|
||||
v-if="genders === 2"
|
||||
class="Gendericon"
|
||||
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/girl.png"
|
||||
mode="scaleToFill"
|
||||
@@ -158,37 +159,43 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹窗 -->
|
||||
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
|
||||
<!-- 弹窗 -->
|
||||
<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" />
|
||||
<scroll-view
|
||||
show-scrollbar="false"
|
||||
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="NameMoney">
|
||||
<view class="TimeMoney">
|
||||
<view class="NameMoney_Name">{{ item.anchorId }}</view>
|
||||
</view>
|
||||
<view class="TimeMoney">
|
||||
<view class="TimeMoney_country">{{ item.country }}</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 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>
|
||||
@@ -224,6 +231,8 @@ export default {
|
||||
AnchorList: [], //主播列表
|
||||
selectedId: null, //选择的主播
|
||||
selectedIddata: null, //选择的主播数据
|
||||
AnchorProfilePicture: "", //选择的主播头像
|
||||
senderId: "", //发送者id
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -237,27 +246,21 @@ export default {
|
||||
this.session = newQuestion.pkNumber;
|
||||
this.remarks = newQuestion.remark;
|
||||
this.datetimesingle = formatDate(newQuestion.pkTime);
|
||||
this.id = newQuestion.senderId;
|
||||
this.id = newQuestion.id;
|
||||
this.nameAnchor = newQuestion.anchorId;
|
||||
this.countrys = newQuestion.country;
|
||||
this.genders = newQuestion.sex === "1" ? 1 : 2;
|
||||
this.AnchorProfilePicture = newQuestion.anchorIcon.split("/").pop();
|
||||
this.senderId = newQuestion.senderId;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
uni.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.id = res.data.id;
|
||||
},
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//关闭弹窗
|
||||
close() {
|
||||
//关闭弹窗
|
||||
close() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
//确认选择
|
||||
invite(){
|
||||
invite() {
|
||||
if (this.selectedId) {
|
||||
this.nameAnchor = this.selectedIddata.anchorId;
|
||||
this.AnchorProfilePicture = this.selectedIddata.headerIcon;
|
||||
@@ -273,8 +276,8 @@ export default {
|
||||
//选中的主播
|
||||
Select(id, item) {
|
||||
if (this.selectedId !== id) {
|
||||
this.selectedId = id;
|
||||
this.selectedIddata = item;
|
||||
this.selectedId = id;
|
||||
this.selectedIddata = item;
|
||||
} else {
|
||||
this.selectedId = null;
|
||||
this.selectedIddata = null;
|
||||
@@ -299,9 +302,9 @@ export default {
|
||||
});
|
||||
},
|
||||
//选择我的主播
|
||||
chooseMyStreamer(){
|
||||
chooseMyStreamer() {
|
||||
this.$refs.popup.open("center");
|
||||
this.getAnchorList()
|
||||
this.getAnchorList();
|
||||
},
|
||||
//性别
|
||||
gender(item) {
|
||||
@@ -324,22 +327,51 @@ export default {
|
||||
if (this.Display) {
|
||||
this.Display = false;
|
||||
this.Hint = false;
|
||||
this.nameAnchor = "";
|
||||
this.genders = 0;
|
||||
this.numberCoins = "";
|
||||
this.remarks = "";
|
||||
this.datetimesingle = "";
|
||||
this.countrys = "";
|
||||
this.session = "";
|
||||
} else {
|
||||
this.Display = true;
|
||||
}
|
||||
},
|
||||
//获取主播名称
|
||||
NameAnchor: function (event) {
|
||||
this.nameAnchor = event.target.value;
|
||||
//获取主播名称以及头像地址
|
||||
blur(event) {
|
||||
if (this.nameAnchor !== event.target.value) {
|
||||
this.nameAnchor = event.target.value;
|
||||
uni.showLoading({
|
||||
title: "正在验证主播",
|
||||
mask: true,
|
||||
});
|
||||
uni.request({
|
||||
url: "https://python.yolojt.com/api/" + this.nameAnchor,
|
||||
success: (res) => {
|
||||
if (res.data.code === 200) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "查询成功",
|
||||
icon: "none",
|
||||
duration: 3000,
|
||||
});
|
||||
this.AnchorProfilePicture = res.data.data;
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "未查询到该主播",
|
||||
icon: "none",
|
||||
duration: 3000,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none",
|
||||
duration: 3000,
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
async Publish() {
|
||||
//判断是否为空
|
||||
if (
|
||||
@@ -382,22 +414,24 @@ export default {
|
||||
}
|
||||
//发送请求
|
||||
uni.showLoading({
|
||||
title: "发布中...",
|
||||
title: "修改中...",
|
||||
mask: true,
|
||||
});
|
||||
console.log(this.senderId,this.sendingTime, this.nameAnchor, this.genders, this.numberCoins, this.remarks, this.id, this.AnchorProfilePicture, this.session);
|
||||
|
||||
const res = await request({
|
||||
url: "pk/addPkData",
|
||||
url: "pk/updatePkInfoById",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.id,
|
||||
anchorId: this.nameAnchor,
|
||||
pkTime: this.sendingTime,
|
||||
sex: this.genders,
|
||||
country: this.countrys,
|
||||
coin: this.numberCoins,
|
||||
remark: this.remarks,
|
||||
status: 0,
|
||||
senderId: this.id,
|
||||
anchorIcon: "",
|
||||
senderId: this.senderId,
|
||||
anchorIcon: this.AnchorProfilePicture,
|
||||
pkNumber: this.session,
|
||||
},
|
||||
userInfo: true,
|
||||
@@ -412,15 +446,16 @@ export default {
|
||||
this.datetimesingle = "";
|
||||
this.session = "";
|
||||
uni.hideLoading();
|
||||
this.$emit('Refresh');
|
||||
uni.showToast({
|
||||
title: "发布成功",
|
||||
title: "修改成功",
|
||||
icon: "success",
|
||||
duration: 2000,
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "发布失败",
|
||||
title: "修改失败",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
@@ -604,10 +639,10 @@ export default {
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
.Coins {
|
||||
width: 330rpx;
|
||||
width: 400rpx;
|
||||
height: 65rpx;
|
||||
/* display: flex; */
|
||||
margin-right: 50rpx;
|
||||
margin-right: 10rpx;
|
||||
/* flex-direction: column; */
|
||||
}
|
||||
.country {
|
||||
@@ -663,7 +698,7 @@ export default {
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.popup-container{
|
||||
.popup-container {
|
||||
width: 600rpx;
|
||||
height: 800rpx;
|
||||
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
|
||||
@@ -674,18 +709,18 @@ export default {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.popup-title{
|
||||
.popup-title {
|
||||
color: #161616;
|
||||
font-size: 36.26rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.scroll{
|
||||
.scroll {
|
||||
width: 90%;
|
||||
height: 500rpx;
|
||||
}
|
||||
.card{
|
||||
.card {
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
.card-content {
|
||||
@@ -734,7 +769,7 @@ export default {
|
||||
overflow: hidden; /* 隐藏溢出内容 */
|
||||
text-overflow: ellipsis; /* 显示省略号 */
|
||||
}
|
||||
.TimeMoney_country{
|
||||
.TimeMoney_country {
|
||||
margin-top: 10rpx;
|
||||
width: 400rpx;
|
||||
text-align: left;
|
||||
@@ -771,14 +806,14 @@ export default {
|
||||
border-bottom-right-radius: 50rpx;
|
||||
border: 1rpx solid #03aba8;
|
||||
}
|
||||
.no-data{
|
||||
.no-data {
|
||||
width: 90%;
|
||||
height: 500rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.no-data-text{
|
||||
.no-data-text {
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
|
||||
Reference in New Issue
Block a user