优化页面

This commit is contained in:
pengxiaolong
2025-06-05 23:50:08 +08:00
parent d766790f04
commit f4901f1312
49 changed files with 2391 additions and 912 deletions

View File

@@ -3,13 +3,59 @@
<image src="../../static/HomeBackground.png" class="HomeBackground"></image>
</view>
<view class="top-navigation-container">
<top-navigation></top-navigation>
<top-navigation
@RealTimePk="goRealTimePk"
@MakeAppointmentPK="goMakeAppointmentPK"
></top-navigation>
</view>
<view class="Advertisement" @click="goAdvertisement">
<advertisement></advertisement>
</view>
<view class="contentList">
<contentList></contentList>
<scroll-view
scroll-y="true"
class="scroll"
refresher-enabled="true"
refresher-threshold="40"
@refresherrefresh="onRefresherRefresh"
lower-threshold="100"
@scrolltolower="onScrollToLower"
:refresher-triggered="triggered"
>
<uni-card v-for="(item, index) in list">
<view class="content-list" @click="goDetail(item)">
<!-- `````````````````````````` -->
<image class="headShot" :src="item.anchorIcon" mode="scaleToFill" />
<!-- `````````````````````````````````````` -->
<view class="content-list-title">
<view class="cardname">{{ item.anchorId }}</view>
<view class="content-list-info">
<view
:class="{ Gendermale: item.sex === '1', Genderfemale: item.sex === '2' }"
>
<image
v-if="item.sex === '2'"
class="Genderimg"
src="../../static/female.png"
mode="scaleToFill"
/>
<image
v-else
class="Genderimg"
src="../../static/male.png"
mode="scaleToFill"
/>
<view class="age">{{ item.sex === "1" ? "男" : "女" }}</view>
</view>
<view class="RoomID">PK时间:&nbsp;{{ formatDate(item.pkTime) }}</view>
<view class="Charm">金币:</view>
<view class="charmValue"> {{ item.coin + "K" }}</view>
</view>
</view>
<!-- `````````````````````````````````````````````````````` -->
</view>
</uni-card>
</scroll-view>
</view>
<view class="tabBar">
<tabBar></tabBar>
@@ -19,11 +65,12 @@
<script>
import topNavigation from "../../components/topNavigation/topNavigation";
import Advertisement from "../../components/Advertisement/Advertisement";
import contentList from "../../components/contentList/contentList";
import tabBar from "../../components/tabBar/tabBar";
import TUIlogin from "../../components/TUILogin.js";
import { useCounterStore } from '@/stores/counter'
const counter = useCounterStore()
import request from "../../components/request.js";
import formatDate from "../../components/formatDate.js";
import { useCounterStore } from "@/stores/counter";
const counter = useCounterStore();
export default {
inject: ["$global"],
data() {
@@ -31,14 +78,23 @@ export default {
info: {},
myuserSig: "",
chatInfo: {},
page: 0, //页码
size: 10, //每页条数
list: [], // 列表数据
detailsdata: {}, //详情数据
triggered: false, //下拉刷新标识
};
},
mounted() {
// 页面加载完成后请求数据
this.pkList();
},
onLoad() {
uni.getStorage({
key: "userinfo",
success: (res) => {
this.info = res.data;
counter.$patch({ myitem:this.info})
counter.$patch({ myitem: this.info });
uni.getStorage({
key: "myuserSig",
success: (res) => {
@@ -61,18 +117,92 @@ export default {
});
},
});
},
methods: {
goRealTimePk() {
console.log("goRealTimePk");
},
goMakeAppointmentPK() {
console.log("goMakeAppointmentPK");
},
goAdvertisement() {
// this.$global.lastPage = getCurrentPages().router;
uni.navigateTo({ url: "/pages/pkDetail/pkDetail" });
},
onRefresherRefresh() {
this.page = 0;
this.list = [];
this.triggered = true;
this.pkList();
},
async goDetail(item) {
uni.showLoading({
title: "加载中...",
mask: true,
});
console.log("id", item.id);
const res = await request({
url: "pk/pkInfoDetail",
method: "POST",
data: {
id: item.id,
},
userInfo: true,
});
console.log("res", res);
this.detailsdata = res.data;
if (res.code === 200) {
if (res.data.length !== 0) {
uni.hideLoading();
console.log("res.data", res.data);
uni.navigateTo({
url: "/pages/pkDetail/pkDetail",
success: (res) => {
res.eventChannel.emit("itemDetail", {
item: this.detailsdata,
});
},
});
} else {
uni.hideLoading();
this.openPopupQuantity();
}
} else {
uni.hideLoading();
uni.showToast({
title: "加载失败",
icon: "none",
duration: 2000,
});
}
},
formatDate: formatDate,
async pkList() {
const res = await request({
url: "pk/pkList",
method: "POST",
data: {
status: 0,
page: this.page,
size: this.size,
},
userInfo: false,
});
console.log(res);
if (res.code === 200) {
this.list.push(...res.data);
console.log(this.list);
this.triggered = false;
}
},
onScrollToLower() {
this.page++;
this.pkList();
},
},
components: {
topNavigation,
Advertisement,
contentList,
tabBar,
},
};
@@ -110,10 +240,90 @@ export default {
}
.contentList {
position: fixed;
top: 400rpx;
top: 412rpx;
left: 0;
bottom: -30rpx;
bottom: 114.5rpx;
width: 100%;
/* height: 1300rpx; */
}
.scroll {
height: 90%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.content-list {
display: flex;
align-items: center;
width: 712rpx;
height: 161rpx;
background: #ffffff;
border-radius: 15rpx;
margin-bottom: 12rpx;
margin-left: 20rpx;
}
.headShot {
width: 101rpx;
height: 101rpx;
border-radius: 50rpx;
margin-left: 30rpx;
margin-right: 33rpx;
}
.content-list-info {
display: flex;
align-items: center;
}
.cardname {
font-size: 31rpx;
color: #161616;
line-height: 38rpx;
}
.Genderimg {
width: 15rpx;
height: 15rpx;
margin-left: 10rpx;
margin-right: 10rpx;
}
.age {
color: #ffffff;
font-size: 14rpx;
}
.Gendermale {
background: url(../../static/maleimg.png) no-repeat center;
width: 56.3rpx;
height: 29.58rpx;
background-size: 100% 100%;
display: flex;
align-items: center;
margin-right: 10rpx;
}
.Genderfemale {
background: url(../../static/femaleimg.png) no-repeat center;
width: 56.3rpx;
height: 29.58rpx;
background-size: 100% 100%;
display: flex;
align-items: center;
margin-right: 10rpx;
}
.RoomID {
font-size: 23rpx;
color: #a3a3a3;
line-height: 38rpx;
}
.Charm {
font-size: 23rpx;
color: #a3a3a3;
line-height: 38rpx;
margin-right: 12rpx;
margin-left: 20rpx;
}
.charmValue {
font-size: 23rpx;
color: #161616;
line-height: 38rpx;
font-weight: 600;
}
</style>

View File

@@ -0,0 +1,333 @@
<template>
<view class="details-pkrecords">
<view class="bg">
<image
class="bgImg"
src="../../../../static/HomeBackground.png"
mode="scaleToFill"
/>
</view>
<view class="Return" @click="onBack">
<image class="ReturnImg" src="../../../../static/Return.png" mode="scaleToFill" />
</view>
<view class="title">PK记录详情</view>
<view class="pkrecords">
<view class="card">
<!-- 主播A -->
<view class="AnchorA">
<view class="AnchorAImg">
<!-- 头像 -->
<image class="AnchorAImgcss" :src="item.anchorIconA" mode="scaleToFill" />
</view>
<!-- 皇冠 -->
<image
class="Crown"
src="../../../../static/Crown.png"
mode="scaleToFill"
v-if="item.winnerAnchorId == item.anchorIdA"
/>
<view class="AnchorAinfo">
<view class="AnchorAname"> {{ item.anchorIdA }} </view>
<view class="AnchorATime">{{ formatDate(item.pkTime) }}</view>
<view class="AnchorAICon">
<view class="AnchorAIContext">实际打金币:</view>
<view class="AnchorAIConNum">{{ item.userAcoin }}K</view>
</view>
</view>
</view>
<!-- 图标 -->
<view class="vstext">
<view class="Vtext">V</view>
<view class="Stext">S</view>
</view>
<!-- 主播B -->
<view class="AnchorB">
<view class="AnchorBinfo">
<view class="AnchorAname">{{ item.anchorIdB }} </view>
<view class="AnchorATime"> {{ formatDate(item.pkTime) }} </view>
<view class="AnchorAICon">
<view class="AnchorAIContext">实际打金币:</view>
<view class="AnchorAIConNum">{{ item.userBcoin }}K</view>
</view>
</view>
<view class="AnchorAImg">
<!-- 头像 -->
<image class="AnchorBImgcss" :src="item.anchorIconB" mode="scaleToFill" />
</view>
<!-- 皇冠 -->
<image
class="Crown"
src="../../../../static/Crown.png"
mode="scaleToFill"
v-if="item.winnerAnchorId == item.anchorIdB"
/>
</view>
</view>
<view class="pkrecords-content">
<scroll-view
scroll-y="true"
class="scroll"
>
<uni-card v-for="(items,index) in coinNumlist" :key="index">
<view class="contentcard">
<view class="contentcard-titleA":style="{'background-color': items.anchorIdA == items.winnerAnchorId ? '#00fbff5d' : '#ff000049'}">
<view>金币数量</view>
<view>{{items.anchorCoinA}}K</view>
</view>
<view class="contentcard-titleB" :style="{'background-color': items.anchorIdB == items.winnerAnchorId ? '#00fbff5d' : '#ff000049'}">
<view>金币数量</view>
<view>{{items.anchorCoinB}}K</view>
</view>
</view>
</uni-card>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import request from "../../../../components/request.js";
import formatDate from "../../../../components/formatDate.js";
export default {
data() {
return {
title: "Hello",
item: {},
coinNumlist: [{
winnerAnchorId: 1,
anchorIdA: 1,
anchorIdB: 2,
anchorCoinA: 2,
anchorCoinB: 3,
}],
};
},
onLoad(options) {
// 获取源页面的eventChannel对象
const eventChannel = this.getOpenerEventChannel();
// 监听itemDetail事件
eventChannel.on("itemDetail", (data) => {
this.item = data.item; // 将接收到的数据赋值给item
console.log("接收到的数据:", this.item);
// this.getCoinNum(this.item)
});
},
methods: {
// 获取具体金币数量
getCoinNum(item) {
const res = request({
url: "user/pkRecordDetail",
method: "POST",
data: {
id: item.id,
},
userInfo: true,
}).then((res) => {
if (res.code == 200) {
this.coinNumlist = res.data;
}else{
console.log("获取金币数量失败")
}
});
},
formatDate: formatDate,
// 返回上一页
onBack() {
uni.navigateBack({
delta: 1,
});
},
},
};
</script>
<style scoped>
.bg {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.bgImg {
width: 100%;
height: 100%;
}
.Return {
position: absolute;
top: 110rpx;
left: 35rpx;
width: 46rpx;
height: 46rpx;
}
.title {
position: absolute;
top: 120rpx;
left: 280rpx;
font-size: 34rpx;
color: #100e0f;
font-weight: 500;
}
.ReturnImg {
width: 100%;
height: 100%;
}
.pkrecords {
position: absolute;
top: 200rpx;
left: 0rpx;
right: 0rpx;
}
/* 卡片 */
.card {
width: 694.66rpx;
height: 161.26rpx;
border-radius: 15rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 28.55rpx;
margin-top: 12rpx;
}
.AnchorA {
display: flex;
align-items: center;
}
.AnchorB {
display: flex;
align-items: center;
}
.AnchorAImg {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
background-color: #b1b1b1;
display: flex;
}
.AnchorAinfo {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 20rpx;
}
.AnchorBinfo {
display: flex;
flex-direction: column;
justify-content: center;
margin-right: 20rpx;
}
.AnchorAname {
font-weight: 500;
font-size: 31rpx;
color: #161616;
}
.AnchorATime {
font-weight: 400;
font-size: 23rpx;
color: #a3a3a3;
margin-top: 12rpx;
}
.AnchorAICon {
display: flex;
margin-top: 12rpx;
}
.AnchorAIContext {
font-weight: 400;
font-size: 23rpx;
color: #a3a3a3;
}
.AnchorAIConNum {
font-weight: bold;
font-size: 23rpx;
color: #161616;
}
.AnchorAImgcss {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
border-top: #f7da60 solid 2rpx;
border-left: #ffeeab solid 2rpx;
border-bottom: #ffeeab solid 2rpx;
border-right: #f7da60 solid 2rpx;
}
.AnchorBImgcss {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
border-top: #ffc6ba solid 2rpx;
border-left: #ffc6ba solid 2rpx;
border-bottom: #5ddadd solid 2rpx;
border-right: #5ddadd solid 2rpx;
}
.Crown {
width: 45.8rpx;
height: 39.12rpx;
margin-left: -40rpx;
margin-top: -100rpx;
}
.vstext {
display: flex;
}
.Vtext {
font-size: 45.8rpx;
color: #f0836c;
font-weight: bold;
font-style: italic;
margin-left: 26rpx;
}
.Stext {
font-size: 45.8rpx;
color: #58d8db;
font-weight: bold;
font-style: italic;
margin-right: 26rpx;
}
.pkrecords-content {
position: absolute;
top: 240rpx;
left: 0;
right: 0;
display: flex;
flex-direction: column;
align-items: center;
}
.scroll{
width: 750rpx;
height: 1100rpx;
}
.contentcard{
width: 694.66rpx;
height: 161.26rpx;
border-radius: 15rpx;
background-color: #ffffff;
display: flex;
margin-left:28.55rpx;
margin-top: 13rpx;
}
.contentcard-titleA{
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-right: #100e0f solid 1rpx;
border-top-left-radius: 15rpx;
border-bottom-left-radius: 15rpx;
}
.contentcard-titleB{
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-top-right-radius: 15rpx;
border-bottom-right-radius: 15rpx;
}
</style>

View File

@@ -6,6 +6,7 @@
<view class="Return" @click="onBack">
<image class="ReturnImg" src="../../../static/Return.png" mode="scaleToFill" />
</view>
<view class="title">PK信息</view>
<view class="content">
<scroll-view
scroll-y="true"
@@ -15,6 +16,7 @@
@refresherrefresh="onRefresherRefresh"
lower-threshold="100"
@scrolltolower="onScrollToLower"
:refresher-triggered="triggered"
>
<uni-card class="card" v-for="(item, index) in pkList" :key="index">
<view class="Profile">
@@ -61,7 +63,8 @@
</view>
<view class="time">PK时间:{{ formatDate(item.pkTime) }}</view>
</view>
<view class="handle" v-if="item.status === 0">
<view class="handle">
<!-- <view class="handle" v-if="item.status === 0"> -->
<view class="recompose" @click="onRecompose(item)">
<image
style="width: 46rpx; height: 46rpx"
@@ -81,13 +84,13 @@
</scroll-view>
</view>
</view>
<Recompose ref="createModule" class="createModule" :message="parentMessage" ></Recompose>
<Recompose ref="createModule" class="createModule" :message="parentMessage"></Recompose>
</template>
<script>
import request from "../../../components/request.js";
import formatDate from "../../../components/formatDate.js";
import Recompose from "../minecomponents/recompose/recompose.vue";
import Recompose from "../minecomponents/recompose/recompose.vue";
export default {
data() {
@@ -97,6 +100,7 @@ export default {
page: 0,
createModule: null,
parentMessage: null,
triggered: false,
};
},
onLoad() {
@@ -113,12 +117,26 @@ export default {
this.createModule = this.$refs.createModule; // 挂载后赋值
},
methods: {
onRefresherRefresh() {
this.page = 0;
this.pkList = [];
this.getpkList();
this.triggered = true;
},
onScrollToLower() {
this.page++;
this.getpkList();
},
onRefresherRefres() {
this.page = 0;
this.pkList = [];
this.getpkList();
this.triggered = true;
},
onBack() {
uni.navigateBack(
{
delta: 1,
}
);
uni.navigateBack({
delta: 1,
});
},
formatDate: formatDate,
getpkList() {
@@ -133,18 +151,19 @@ export default {
userInfo: false,
}).then((res) => {
if (res.code == 200) {
this.pkList = res.data;
this.pkList.push(...res.data);
console.log(this.pkList);
this.triggered = false;
} else {
console.log(res.msg);
}
});
},
onRecompose(item) {
this.createModule.open()
this.parentMessage = item
this.parentMessage = item;
this.createModule.open();
},
onExpurgate(item){
onExpurgate(item) {
const res = request({
url: "pk/deletePkDataWithId",
method: "POST",
@@ -155,21 +174,19 @@ export default {
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "删除成功",
icon: "none",
duration: 2000,
});
this.getpkList()
title: "删除成功",
icon: "none",
duration: 2000,
});
this.getpkList();
} else {
console.log(res.msg);
}
});
}
},
},
components: {
Recompose ,
Recompose,
},
};
</script>
@@ -189,11 +206,19 @@ export default {
}
.Return {
position: absolute;
top: 100rpx;
top: 110rpx;
left: 35rpx;
width: 46rpx;
height: 46rpx;
}
.title {
position: absolute;
top: 120rpx;
left: 315rpx;
font-size: 34rpx;
color: #100e0f;
font-weight: 500;
}
.ReturnImg {
width: 100%;
height: 100%;
@@ -306,11 +331,11 @@ export default {
height: 46rpx;
margin-left: 40rpx;
}
.createModule{
position: fixed;
bottom: 0;
right: 0;
z-index: 998;
width: 100vw;
}
.createModule {
position: fixed;
bottom: 0;
right: 0;
z-index: 998;
width: 100vw;
}
</style>

View File

@@ -1,125 +1,417 @@
<template>
<view class="pkRecord">
<view>返回</view>
<view>pk记录</view>
<view></view>
<view class="pkRecord">
<view class="bg">
<image class="bgImg" src="../../../static/HomeBackground.png" mode="scaleToFill" />
</view>
<view class="Navigation">
<view class="PkPosted">我发布的PK</view>
<view>我邀请的PK</view>
</view>
<scroll-view
scroll-y="true"
class="scroll"
refresher-enabled="true"
refresher-threshold="40"
@refresherrefresh="onRefresherRefresh"
lower-threshold="100"
@scrolltolower="onScrollToLower"
>
<uni-card v-for="(item, index) in list">
<view class="Return" @click="onBack">
<image class="ReturnImg" src="../../../static/Return.png" mode="scaleToFill" />
</view>
<view class="title">PK记录</view>
<!-- 导航栏 -->
<view class="navigation">
<view class="navigationItem">
<view
class="navigationItemTitle"
@click="toggleActive(1)"
:class="{ active: current === 1 }"
>我发布的PK</view
>
<view
class="navigationItemTitle"
@click="toggleActive(2)"
:class="{ active: current === 2 }"
>我邀请的PK</view
>
</view>
<view
class="slide"
:style="{ left: sliderPosition + 'rpx', transition: 'left 0.3s ease-in-out' }"
>{{ slidetext }}</view
>
</view>
<!-- 内容 -->
<view class="content">
<view class="Anchor">
<view class="avatar">主播1头像(赢方头像框王冠)</view>
<view class="AnchorInfo">
<view>主播昵称</view>
<view>pk时间</view>
<view>实际打了多少金币</view>
<scroll-view
scroll-y="true"
class="scroll"
refresher-enabled="true"
refresher-threshold="40"
@refresherrefresh="onRefresherRefresh"
lower-threshold="100"
@scrolltolower="onScrollToLower"
:refresher-triggered="triggered"
>
<uni-card v-for="(item, index) in pkRecordlist" :key="index" >
<view class="card" @click="onItemClick(item)">
<!-- 主播A -->
<view class="AnchorA">
<view class="AnchorAImg">
<!-- 头像 -->
<image class="AnchorAImgcss" :src="item.anchorIconA" mode="scaleToFill" />
</view>
</view>
<view>
VS
</view>
<view class="Anchor">
<view class="AnchorInfo">
<view>主播昵称</view>
<view>pk时间</view>
<view>实际打了多少金币</view>
<!-- 皇冠 -->
<image class="Crown" src="../../../static/Crown.png" mode="scaleToFill" v-if="item.winnerAnchorId == item.anchorIdA"/>
<view class="AnchorAinfo">
<view class="AnchorAname"> {{ item.anchorIdA }} </view>
<view class="AnchorATime">{{ formatDate(item.pkTime) }}</view>
<view class="AnchorAICon">
<view class="AnchorAIContext">实际打金币:</view>
<view class="AnchorAIConNum">{{ item.userAcoin }}K</view>
</view>
</view>
<view class="avatar">主播1头像</view>
</view>
<!-- 图标 -->
<view class="vstext">
<view class="Vtext">V</view>
<view class="Stext">S</view>
</view>
<!-- 主播B -->
<view class="AnchorB">
<view class="AnchorBinfo">
<view class="AnchorAname">{{ item.anchorIdB }} </view>
<view class="AnchorATime"> {{ formatDate(item.pkTime) }} </view>
<view class="AnchorAICon">
<view class="AnchorAIContext">实际打金币:</view>
<view class="AnchorAIConNum">{{ item.userBcoin }}K</view>
</view>
</view>
<view class="AnchorAImg">
<!-- 头像 -->
<image class="AnchorBImgcss" :src="item.anchorIconB" mode="scaleToFill" />
</view>
<!-- 皇冠 -->
<image class="Crown" src="../../../static/Crown.png" mode="scaleToFill" v-if="item.winnerAnchorId == item.anchorIdB"/>
</view>
</view>
</uni-card>
</scroll-view>
</view>
</uni-card>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{},
{},
{},
{},
{},
{},
{},
{},
]
}
import request from "../../../components/request.js";
import formatDate from "../../../components/formatDate.js";
export default {
data() {
return {
triggered: false, // 下拉刷新状态
current: 1, // 初始激活状态
buttonWidth: 238.55, // 按钮宽度
gap: 0, // 按钮间距
slidetext: "我发布的PK", // 导航栏文字
pkmyRecordlist: [], // PK记录列表
pkInvitationRecordlist: [], // PK记录列表
pkRecordlist: [{
winnerId: "1",
pkTime: "1626211200",
anchorIdA: "123",
anchorIconA: "https://img.yzcdn.cn/vant/cat.jpeg",
userAcoin: "100",
anchorIdB: "456",
anchorIconB: "https://img.yzcdn.cn/vant/dog.jpeg",
userBcoin: "200",
senderA: "123",
senderB: "456",
},
{
winnerId: "2",
pkTime: "1626211200",
anchorIdA: "789",
anchorIconA: "https://img.yzcdn.cn/vant/cat.jpeg",
userAcoin: "100",
anchorIdB: "101",
anchorIconB: "https://img.yzcdn.cn/vant/dog.jpeg",
userBcoin: "200",
senderA: "789",
senderB: "101",
},
], // PK记录列表
userinfo: {}, // 用户信息
page: 0, // 页码
};
},
onLoad() {
uni.getStorage({
key: "userinfo",
success: (res) => {
this.userinfo = res.data;
this.getPkRecordList(1);
this.getPkRecordList(2);
},
onLoad() {
// 页面加载时执行
},
methods: {
// 方法定义
});
},
computed: {
sliderPosition() {
const { current, buttonWidth, gap } = this;
const containerPadding = 0; // 容器内边距
const offset = (buttonWidth + gap) * (current - 1);
return containerPadding + offset + 375;
},
},
methods: {
onRefresherRefresh() {
this.triggered = true;
this.page = 0;
this.getPkRecordList(this.current);
},
onScrollToLower() {
this.page++;
this.getPkRecordList(this.current);
},
onItemClick(item) {
uni.navigateTo({
url: "/pages/Mine/minecomponents/DetailsPKRecords/DetailsPKRecords",
success: (res) => {
res.eventChannel.emit("itemDetail", {
item: item,
});
},
});
},
onBack() {
uni.navigateBack(
{
delta: 1,
}
}
);
},
formatDate: formatDate,
//获取我发布的PK记录列表
getPkRecordList(type) {
const res = request({
url: "user/handlePkInfo",
method: "POST",
data: {
type: type,
userId: this.userinfo.id,
page: this.page,
size: 10,
},
userInfo: true,
}).then((res) => {
if (res.code === 200) {
this.triggered = false;
if (type === 1) {
this.pkmyRecordlist.push(...res.data);
console.log(this.pkRecordlist);
if (this.current === 1) {
this.pkRecordlist = this.pkmyRecordlist;
}
} else {
this.pkInvitationRecordlist.push(...res.data);
console.log(this.pkInvitationRecordlist);
if (this.current === 2) {
this.pkRecordlist = this.pkInvitationRecordlist;
}
}
} else {
console.log(res.msg);
}
});
},
//按钮点击
toggleActive(val) {
this.current = val;
this.slidetext = val === 1 ? "我发布的PK" : "我邀请的PK";
if (val === 1) {
this.pkRecordlist = this.pkmyRecordlist;
}else{
this.pkRecordlist = this.pkInvitationRecordlist;
}
},
},
};
</script>
<style scoped>
.pkRecord{
width: 100vw;
height: 200rpx;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
padding-top: 40rpx;
border-bottom: 1px solid #000000;
}
.content{
width: 100vw;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
border-bottom: 1px solid #eee;
}
.avatar{
width: 50px;
height: 50px;
border-radius: 50%;
font-size: 20rpx;
background-color: aqua;
}
.Anchor{
display: flex;
}
.AnchorInfo{
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 10rpx;
font-size: 20rpx;
}
.PkPosted{
text-align: center;
font-size: 30rpx;
height: 100rpx;
line-height: 100rpx;
width: 45%;
border-right: 1px solid #000000;
}
.Navigation{
width: 100vw;
display: flex;
justify-content: space-around;
align-items: center;
height: 100rpx;
background-color: #ffffff;
border-bottom: 1px solid #000000;
}
</style>
.bg {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.bgImg {
width: 100%;
height: 100%;
}
.Return {
position: absolute;
top: 110rpx;
left: 35rpx;
width: 46rpx;
height: 46rpx;
}
.title {
position: absolute;
top: 120rpx;
left: 315rpx;
font-size: 34rpx;
color: #100e0f;
font-weight: 500;
}
.ReturnImg {
width: 100%;
height: 100%;
}
/* 导航栏 */
.navigation {
position: absolute;
top: 200rpx;
left: 0rpx;
right: 0rpx;
height: 68.7rpx;
display: flex;
justify-content: center;
align-items: center;
}
.navigationItem {
width: 477.1rpx;
height: 68.7rpx;
border-radius: 50rpx;
background-color: #4fcacd;
display: flex;
justify-content: space-around;
align-items: center;
}
.navigationItemTitle {
font-weight: 500;
font-size: 31rpx;
color: #ffffff;
}
.slide {
position: absolute;
width: 238.55rpx;
height: 68.7rpx;
background-image: linear-gradient(135deg, #e4ffff, #ffffff);
border-radius: 50rpx;
text-align: center;
line-height: 68.7rpx;
font-weight: 500;
font-size: 31rpx;
color: #4fcacd;
margin-left: -238.55rpx;
}
.content {
position: absolute;
top: 300rpx;
left: 0rpx;
right: 0rpx;
bottom: 0rpx;
}
.scroll {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
/* 卡片 */
.card {
width: 694.66rpx;
height: 161.26rpx;
background-color: #ffffff;
border-radius: 15rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 28.55rpx;
margin-top: 12rpx;
}
.AnchorA {
display: flex;
align-items: center;
}
.AnchorB {
display: flex;
align-items: center;
}
.AnchorAImg {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
background-color: #b1b1b1;
display: flex;
}
.AnchorAinfo {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 20rpx;
}
.AnchorBinfo {
display: flex;
flex-direction: column;
justify-content: center;
margin-right: 20rpx;
}
.AnchorAname {
font-weight: 500;
font-size: 31rpx;
color: #161616;
}
.AnchorATime {
font-weight: 400;
font-size: 23rpx;
color: #a3a3a3;
margin-top: 12rpx;
}
.AnchorAICon {
display: flex;
margin-top: 12rpx;
}
.AnchorAIContext {
font-weight: 400;
font-size: 23rpx;
color: #a3a3a3;
}
.AnchorAIConNum {
font-weight: bold;
font-size: 23rpx;
color: #161616;
}
.AnchorAImgcss {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
border-top: #f7da60 solid 2rpx;
border-left: #ffeeab solid 2rpx;
border-bottom: #ffeeab solid 2rpx;
border-right: #f7da60 solid 2rpx;
}
.AnchorBImgcss {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
border-top: #ffc6ba solid 2rpx;
border-left: #ffc6ba solid 2rpx;
border-bottom: #5ddadd solid 2rpx;
border-right: #5ddadd solid 2rpx;
}
.Crown{
width: 45.8rpx;
height: 39.12rpx;
margin-left: -40rpx;
margin-top: -100rpx;
}
.vstext {
display: flex;
}
.Vtext {
font-size: 45.8rpx;
color: #f0836c;
font-weight: bold;
font-style: italic;
margin-left: 26rpx;
}
.Stext {
font-size: 45.8rpx;
color: #58d8db;
font-weight: bold;
font-style: italic;
margin-right: 26rpx;
}
</style>

View File

@@ -22,8 +22,9 @@
placeholder-style="color:#666666"
@input="NameAnchor"
placeholder="主播名称"
:value="nameAnchor"
/>
<view v-if="nameAnchor === '' && Hint === true" class="Hint"
<view v-if="nameAnchor === ''|| nameAnchor === null && Hint === true" class="Hint"
>请填写主播名称</view
>
</view>
@@ -43,8 +44,9 @@
:options="Country"
:filterable = "filterable"
placeholder="请选择国家"
:value="countrys"
/>
<view v-if="countrys === '' && Hint === true" class="Hint">请选择国家</view>
<view v-if="countrys === ''|| countrys===null && Hint === true" class="Hint">请选择国家</view>
</view>
<view class="Gender">
<view class="Gendercs">
@@ -58,30 +60,31 @@
@change="gender"
:options="Gender"
placeholder="性别"
:value="message.sex === '1'?1:2"
/>
</view>
<view class="Gendericoncss">
<image
v-if="genders === 0"
v-if="genders === 0 || message.sex === '0'"
class="Gendericon"
src="../../../../static/ask.png"
mode="scaleToFill"
/>
<image
v-if="genders === 1"
v-if="genders === 1||message.sex === '1'"
class="Gendericon"
src="../../../../static/man.png"
mode="scaleToFill"
/>
<image
v-if="genders === 2"
v-if="genders === 2||message.sex === '2'"
class="Gendericon"
src="../../../../static/girl.png"
mode="scaleToFill"
/>
</view>
</view>
<view v-if="genders === 0 && Hint === true" class="Hintcss">请选择性别</view>
<view v-if="genders === 0 || genders===null && Hint === true" class="Hintcss">请选择性别</view>
</view>
</view>
@@ -89,11 +92,11 @@
<view class="goldCoin">
<view class="number-box">
<view class="number-box-title">金币数量:</view>
<uni-number-box background="#03ABA8" v-model="numberCoins"></uni-number-box>
<uni-number-box background="#03ABA8" v-model="numberCoins" ></uni-number-box>
<view class="number-box-title">单位:</view>
<view class="number-box-unit">K</view>
</view>
<view v-if="numberCoins === '' && Hint === true" class="Hint"
<view v-if="numberCoins === ''|| numberCoins === null && Hint === true" class="Hint"
>请填写金币数量</view
>
</view>
@@ -104,7 +107,7 @@
hide-second="true"
v-model="datetimesingle"
/>
<view v-if="datetimesingle === '' && Hint === true" class="Hint"
<view v-if="datetimesingle === ''|| datetimesingle === null && Hint === true" class="Hint"
>请选择日期</view
>
</view>
@@ -115,7 +118,7 @@
<uni-number-box background="#03ABA8" v-model="session"></uni-number-box>
<view class="number-box-title"></view>
</view>
<view v-if="session === '' && Hint === true" class="Hint"
<view v-if="session === ''|| session === null && Hint === true" class="Hint"
>请填写场数</view
>
</view>
@@ -136,14 +139,16 @@
</view>
</template>
<script>
import message from "@tencentcloud/chat-uikit-uniapp/locales/en/message.js";
import optionsArray from "../../../../components/NationalDictionary.js";
import request from "../../../../components/request.js";
import formatDate from "../../../../components/formatDate.js";
export default {
data() {
return {
genders: 0, //性别
genders: "", //性别
Gender: [
{ label: "男", value: 1 },
{ label: "女", value: 2 },
@@ -152,18 +157,32 @@ export default {
countrys: "", //国家
nameAnchor: "", //主播名称
numberCoins: "", //金币数量
session: "", //场数
remarks: "", //备注
session: '', //场数
remarks: '', //备注
Display: false,
Hint: false,
datetimesingle: "", //日期
id: null, //用户id
datetimesingle: '', //日期
id: "", //用户id
sendingTime: "", //发送时间
filterable: true, //是否可搜索
};
},
props: {
message
message:{
type: Object,
}
},
watch: {
message(newQuestion, oldQuestion) {
this.numberCoins = newQuestion.coin;
this.session = newQuestion.pkNumber;
this.remarks = newQuestion.remark;
this.datetimesingle = formatDate(newQuestion.pkTime);
this.id = newQuestion.senderId;
this.nameAnchor = newQuestion.anchorId;
this.countrys = newQuestion.country;
this.genders = newQuestion.sex === "1" ? 1 : 2;
}
},
mounted() {
uni.getStorage({
@@ -174,22 +193,23 @@ export default {
});
},
methods: {
//性别
gender(item) {
this.genders = item.value;
console.log(item);
},
//日期
country(item) {
this.countrys = item.value;
console.log(item);
},
handleOverlayClick(event) {
if (event.target === this.$el) {
this.Display = false;
this.Hint = false;
}
},
// //主播名称
// handleOverlayClick(event) {
// if (event.target === this.$el) {
// this.Display = false;
// this.Hint = false;
// }
// },
open() {
if (this.Display) {
this.Display = false;
@@ -211,16 +231,15 @@ export default {
},
async Publish() {
console.log("````````````````````````````````````````````",message);
//判断是否为空
if (
this.nameAnchor === "" ||
this.genders === "" ||
this.numberCoins === "" ||
this.countrys === "" ||
this.datetimesingle === ""||
this.session === ""
this.nameAnchor == "" && this.nameAnchor == null ||
this.genders == "" && this.genders == null ||
this.numberCoins =="" && this.numberCoins == null ||
this.datetimesingle == "" && this.datetimesingle == null ||
this.countrys == "" && his.countrys == null ||
this.datetimesingle == "" && this.datetimesingle == null ||
this.session == "" && this.session == null
) {
this.Hint = true;
return;