优化
This commit is contained in:
@@ -1,17 +1,266 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const components_request = require("../../../../components/request.js");
|
||||
const components_TimeFormatting = require("../../../../components/TimeFormatting.js");
|
||||
const components_goEasyTool_tool = require("../../../../components/goEasyTool/tool.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
props: {
|
||||
oppositeId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
myId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
nickname: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
avatar: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
data() {
|
||||
return {
|
||||
select: null,
|
||||
// 选择主播对象(1:对方主播,0:自己主播)
|
||||
mylist: [],
|
||||
// 自己主播列表
|
||||
oppositlist: [],
|
||||
// 对方主播列表
|
||||
selectedId: null,
|
||||
// 选择的主播id
|
||||
selectIndex: null,
|
||||
// 选择的主播索引
|
||||
myselect: null,
|
||||
// 自己选择的主播对象
|
||||
oppositselect: null,
|
||||
// 对方选择的主播对象
|
||||
list: []
|
||||
// 渲染的主播列表
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getAnchorList(this.oppositeId);
|
||||
this.getAnchorList(this.myId);
|
||||
},
|
||||
methods: {
|
||||
// 方法定义
|
||||
//发送pk消息
|
||||
send() {
|
||||
components_request.request({
|
||||
url: "pk/createPkRecord",
|
||||
method: "POST",
|
||||
data: {
|
||||
pkIdA: this.oppositselect.id,
|
||||
pkIdB: this.myselect.id,
|
||||
userIdA: this.oppositeId,
|
||||
userIdB: this.myId,
|
||||
pkTime: this.oppositselect.pkTime,
|
||||
pkNumber: this.oppositselect.pkNumber,
|
||||
anchorIdA: this.oppositselect.anchorId,
|
||||
anchorIdB: this.myselect.anchorId,
|
||||
anchorIconA: this.oppositselect.anchorIcon,
|
||||
anchorIconB: this.myselect.anchorIcon,
|
||||
piIdA: this.oppositselect.id,
|
||||
piIdB: this.myselect.id
|
||||
},
|
||||
userInfo: true
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const customData = {
|
||||
id: res.data.id,
|
||||
pkIdA: this.oppositselect.id,
|
||||
pkIdB: this.myselect.id
|
||||
};
|
||||
let order = {
|
||||
customData,
|
||||
link: "https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/pk.png",
|
||||
text: "PK邀请消息"
|
||||
};
|
||||
let type = "pk";
|
||||
components_goEasyTool_tool.sendCustomMessage(
|
||||
this.$goeasy,
|
||||
type,
|
||||
this.oppositeId,
|
||||
order,
|
||||
this.avatar,
|
||||
this.nickname
|
||||
).then((res2) => {
|
||||
this.$emit("refreshMessage", { message: res2 });
|
||||
});
|
||||
this.$refs.confirmpopup.close();
|
||||
this.$refs.oppositepopup.close();
|
||||
this.myselect = null;
|
||||
this.oppositselect = null;
|
||||
common_vendor.index.showToast({
|
||||
title: "发送成功",
|
||||
icon: "none"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmClose() {
|
||||
this.$refs.confirmpopup.close();
|
||||
},
|
||||
//发送pk消息
|
||||
sendMessage() {
|
||||
if (this.myselect && this.oppositselect) {
|
||||
this.$refs.confirmpopup.open("center");
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "请选择相应的主播",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
//选中
|
||||
Select(id, index) {
|
||||
if (this.selectedId === id) {
|
||||
this.selectedId = null;
|
||||
this.selectIndex = null;
|
||||
} else {
|
||||
this.selectedId = this.selectedId === id ? null : id;
|
||||
this.selectIndex = index;
|
||||
}
|
||||
},
|
||||
//取消
|
||||
close() {
|
||||
this.$refs.oppositepopup.close();
|
||||
},
|
||||
//确定
|
||||
invite() {
|
||||
if (this.selectedId) {
|
||||
if (this.select == 1) {
|
||||
this.oppositselect = this.oppositlist[this.selectIndex];
|
||||
this.selectedId = null;
|
||||
this.selectIndex = null;
|
||||
} else {
|
||||
this.myselect = this.mylist[this.selectIndex];
|
||||
this.selectedId = null;
|
||||
this.selectIndex = null;
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "请选择主播",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
this.$refs.oppositepopup.close();
|
||||
},
|
||||
TimeFormatting: components_TimeFormatting.TimeFormatting,
|
||||
//获取主播列表
|
||||
getAnchorList(id) {
|
||||
components_request.request({
|
||||
url: "pk/listUninvitedPublishedAnchorsByUserId",
|
||||
method: "POST",
|
||||
data: {
|
||||
userId: id
|
||||
},
|
||||
userInfo: false
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (id == this.myId) {
|
||||
this.mylist = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/index/chat/moreMessageComponents/InvitationComponents.vue:325", "mylist", this.mylist);
|
||||
} else {
|
||||
this.oppositlist = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/index/chat/moreMessageComponents/InvitationComponents.vue:328", "oppositlist", this.oppositlist);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
showPopup(select) {
|
||||
if (select == 1) {
|
||||
this.list = this.oppositlist;
|
||||
} else {
|
||||
this.list = this.mylist;
|
||||
}
|
||||
this.select = select;
|
||||
this.$refs.oppositepopup.open("center");
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
_easycom_uni_popup2();
|
||||
}
|
||||
const _easycom_uni_popup = () => "../../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_popup();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {};
|
||||
return common_vendor.e({
|
||||
a: $data.oppositselect != null
|
||||
}, $data.oppositselect != null ? {
|
||||
b: $data.oppositselect.anchorIcon,
|
||||
c: common_vendor.t($data.oppositselect.anchorId),
|
||||
d: common_vendor.t($options.TimeFormatting($data.oppositselect.pkTime)),
|
||||
e: common_vendor.t($data.oppositselect.coin)
|
||||
} : {}, {
|
||||
f: $data.oppositselect == null
|
||||
}, $data.oppositselect == null ? {} : {}, {
|
||||
g: common_vendor.o(($event) => $options.showPopup(1)),
|
||||
h: $data.myselect != null
|
||||
}, $data.myselect != null ? {
|
||||
i: $data.myselect.anchorIcon,
|
||||
j: common_vendor.t($data.myselect.anchorId),
|
||||
k: common_vendor.t($options.TimeFormatting($data.myselect.pkTime)),
|
||||
l: common_vendor.t($data.myselect.coin)
|
||||
} : {}, {
|
||||
m: $data.myselect == null
|
||||
}, $data.myselect == null ? {} : {}, {
|
||||
n: common_vendor.o(($event) => $options.showPopup(0)),
|
||||
o: common_vendor.o(($event) => $options.sendMessage()),
|
||||
p: common_vendor.o(() => {
|
||||
}),
|
||||
q: common_vendor.t($data.select == 1 ? "点击选择您要参与PK的对方主播" : "点击选择您要参与的主播"),
|
||||
r: $data.list.length > 0
|
||||
}, $data.list.length > 0 ? {
|
||||
s: common_vendor.f($data.list, (item, index, i0) => {
|
||||
return {
|
||||
a: item.anchorIcon,
|
||||
b: common_vendor.t(item.anchorId),
|
||||
c: common_vendor.t($options.TimeFormatting(item.pkTime)),
|
||||
d: common_vendor.t(item.coin),
|
||||
e: common_vendor.o(($event) => $options.Select(item.id, index), index),
|
||||
f: $data.selectedId === item.id ? "#b8ff8c74" : "#ffffff",
|
||||
g: index
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
t: $data.list.length == 0
|
||||
}, $data.list.length == 0 ? {
|
||||
v: common_vendor.t($data.select == 1 ? "对方还没有发布过pk" : "您还没有发布过pk")
|
||||
} : {}, {
|
||||
w: common_vendor.o(($event) => $options.invite()),
|
||||
x: common_vendor.o(($event) => $options.close()),
|
||||
y: common_vendor.sr("oppositepopup", "a505124c-0"),
|
||||
z: common_vendor.o(_ctx.change),
|
||||
A: common_vendor.p({
|
||||
["background-color"]: "#fff",
|
||||
["border-radius"]: "30px"
|
||||
}),
|
||||
B: common_vendor.o(($event) => $options.send()),
|
||||
C: common_vendor.o(($event) => $options.confirmClose()),
|
||||
D: common_vendor.sr("confirmpopup", "a505124c-1"),
|
||||
E: common_vendor.o(_ctx.change),
|
||||
F: common_vendor.p({
|
||||
["background-color"]: "#fff",
|
||||
["border-radius"]: "30px"
|
||||
})
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a505124c"]]);
|
||||
wx.createComponent(Component);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"uni-popup": "../../../../uni_modules/uni-popup/components/uni-popup/uni-popup"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,271 @@
|
||||
|
||||
.chat-more-message-invitation.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 40rpx;
|
||||
.chat-more-message-invitation-title.data-v-a505124c {
|
||||
font-size: 60rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
text-align: center;
|
||||
line-height: 100rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 70rpx;
|
||||
letter-spacing: 5rpx;
|
||||
font-style: italic;
|
||||
background-image: linear-gradient(135deg, #4fcacd, #5fdbde); /* 渐变方向和颜色 */
|
||||
-webkit-background-clip: text; /* Chrome/Safari */
|
||||
background-clip: text; /* Firefox/Edge */
|
||||
color: transparent; /* 文字本身透明,显示背景渐变 */
|
||||
-webkit-text-fill-color: transparent; /* 兼容旧版 Webkit */
|
||||
}
|
||||
.chat-more-message-invitation.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
|
||||
}
|
||||
.oppositeAnchor.data-v-a505124c {
|
||||
width: 600rpx;
|
||||
height: 150rpx;
|
||||
background-color: rgb(255, 255, 255);
|
||||
border-radius: 20rpx;
|
||||
margin-top: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
border: 2rpx solid #e4e4e4;
|
||||
}
|
||||
.footervs.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.footervs_left.data-v-a505124c {
|
||||
font-size: 50rpx;
|
||||
color: #ff65e5;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
.footervs_right.data-v-a505124c {
|
||||
font-size: 50rpx;
|
||||
color: #65e8ff;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
.popup-title.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
color: #000;
|
||||
font-size: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 100rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.popup-content-text.data-v-a505124c {
|
||||
width: 600rpx;
|
||||
height: 450rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.popup-content-text-content.data-v-a505124c{
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
.popup-content.data-v-a505124c {
|
||||
width: 700rpx;
|
||||
height: 730rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chard1.png);
|
||||
background-position: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
/* card */
|
||||
.scroll.data-v-a505124c {
|
||||
width: 600rpx;
|
||||
height: 450rpx;
|
||||
border-radius: 10px;
|
||||
/* background-color: #f5f5f5; */
|
||||
}
|
||||
.scroll.data-v-a505124c ::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
display: none;
|
||||
}
|
||||
.nodata.data-v-a505124c {
|
||||
width: 600rpx;
|
||||
height: 450rpx;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
line-height: 450rpx;
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
.card-content.data-v-a505124c {
|
||||
/* 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);
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.card-select-select.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
color: rgb(127, 127, 127);
|
||||
}
|
||||
.card-select.data-v-a505124c {
|
||||
/* width: 445rpx; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
/* border: 2px solid #afafaf; */
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
color: rgb(127, 127, 127);
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.noselect.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
text-align: center;
|
||||
line-height: 150rpx;
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
.Avatarimg.data-v-a505124c {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #dddddd;
|
||||
margin-right: 20rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.Avatarimg-select.data-v-a505124c {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #dddddd;
|
||||
margin-right: 20rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.avatar.data-v-a505124c {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.NameMoney.data-v-a505124c {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.TimeMoney.data-v-a505124c {
|
||||
width: 300rpx;
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
font-size: 27rpx;
|
||||
color: #161616;
|
||||
}
|
||||
.NameMoney_Name.data-v-a505124c {
|
||||
width: 400rpx;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
font-size: 27rpx;
|
||||
color: #161616;
|
||||
white-space: nowrap; /* 防止换行 */
|
||||
overflow: hidden; /* 隐藏溢出内容 */
|
||||
text-overflow: ellipsis; /* 显示省略号 */
|
||||
}
|
||||
.NameMoney_Name-select.data-v-a505124c {
|
||||
width: 500rpx;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #161616;
|
||||
white-space: nowrap; /* 防止换行 */
|
||||
overflow: hidden; /* 隐藏溢出内容 */
|
||||
text-overflow: ellipsis; /* 显示省略号 */
|
||||
}
|
||||
.TimeMoney_Time.data-v-a505124c {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.pkTimeimg.data-v-a505124c {
|
||||
width: 31.49rpx;
|
||||
height: 31.49rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.goldimg.data-v-a505124c {
|
||||
width: 31.49rpx;
|
||||
height: 35rpx;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
.goldnb.data-v-a505124c {
|
||||
display: flex;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
.popup-btn.data-v-a505124c {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
.invite.data-v-a505124c {
|
||||
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.data-v-a505124c {
|
||||
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;
|
||||
}
|
||||
.Sendpkbtn.data-v-a505124c {
|
||||
width: 90%;
|
||||
height: 100rpx;
|
||||
margin-top: 50rpx;
|
||||
background-image: linear-gradient(135deg, #4fcacd, #5fdbde);
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
border-radius: 60rpx;
|
||||
font-size: 35rpx;
|
||||
text-align: center;
|
||||
line-height: 100rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 6rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user