优化页面

This commit is contained in:
pengxiaolong
2025-06-04 22:36:28 +08:00
parent a40b5b88c9
commit d766790f04
52 changed files with 2371 additions and 787 deletions

View File

@@ -1,5 +1,9 @@
<template>
<view class="container">
<view class="bg">
<image class="bgImg" src="../../static/HomeBackground.png" mode="scaleToFill" />
</view>
<view class="PersonalInformation">
<view class="header">
<image :src="userinfo.headerIcon" mode="scaleToFill" class="headerIcon" />
@@ -11,21 +15,97 @@
<image class="SettingsIcon" src="../../static/Settings.png" mode="scaleToFill" />
</view>
</view>
<!-- PK信息 -->
<view class="content">
<view class="PKInformation" >
<view class="title">
<view class="titleText">PK信息</view>
<view class="titleLine"></view>
<view class="titleMore"
@click="pkInformation"
>更多PK信息<image
style="width: 10.5rpx; height: 20.04rpx; margin-left: 10rpx"
src="../../static/More.png"
mode="scaleToFill"
/>
</view>
</view>
<view class="card">
<view class="cardContent" v-for="(item,index) in pkInformationdata" :key="index">
<view class="cardImg">
<image :src="item.anchorIcon" mode="scaleToFill" />
</view>
<view class="Time">{{ formatDate(item.pkTime) }}</view>
<view class="gold"> {{item.coin}}K</view>
</view>
</view>
</view>
<!-- PK记录 -->
<view class="myPkRecord" >
<view class="title">
<view class="titleText">我的PK记录</view>
<view class="titleLine"></view>
<view class="myPkRecordMore"
@click="pkRecord">更多PK记录<image
style="width: 10.5rpx; height: 20.04rpx; margin-left: 10rpx"
src="../../static/More.png"
mode="scaleToFill"
/>
</view>
</view>
<view class="card">
<view class="cardContent">
<view class="cardImg">
<image src="" mode="scaleToFill" />
</view>
<!-- <view class="Failure">
失败
</view> -->
<view class="Result"> 胜利 </view>
<view class="Session"> 共一场 </view>
<view class="Time"> 20:30 </view>
</view>
</view>
</view>
<view>
<view class="logout" @click="pkInformation">pk信息</view>
</view>
<view>
<view class="logout" @click="pkRecord">我的pk记录</view>
</view>
<view>
<view class="logout" @click="contact">联系客服</view>
</view>
<view>
<view class="logout" @click="logout">退出登录</view>
<view class="PKInformation">
<view class="title">
<view class="titleText">专属客服</view>
<view class="titleLine"></view>
</view>
</view>
<view class="card">
<view class="service" @click="contact">
<image
style="width: 48.28rpx; height: 48.09rpx"
src="../../static/service.png"
mode="scaleToFill"
/>
<view class="cardtext">联系客服</view>
</view>
<view class="service">
<image
style="width: 48.28rpx; height: 48.09rpx"
src="../../static/Agreement.png"
mode="scaleToFill"
/>
<view class="cardtext">服务协议</view>
</view>
<view class="service" @click="logout">
<image
style="width: 48.28rpx; height: 48.09rpx"
src="../../static/logout.png"
mode="scaleToFill"
/>
<view class="cardtext">退出登录</view>
</view>
</view>
</view>
</view>
<view class="copyright">版权所有 © 2025 ...................</view>
<view class="copyright">版权所有 © 2025 ...................</view>
<view class="tabBar">
<tabBar></tabBar>
</view>
@@ -33,10 +113,15 @@
<script>
import tabBar from "../../components/tabBar/tabBar";
import request from "../../components/request.js";
import formatDate from "../../components/formatDate.js";
export default {
data() {
return {
userinfo: {},
pkInformationdata: [],
myPkRecorddata: [],
};
},
onShow() {
@@ -44,31 +129,80 @@ export default {
key: "userinfo",
success: (res) => {
this.userinfo = res.data;
console.log(this.userinfo);
this.getpkInformation();
this.getmyPkRecord();
},
});
},
methods: {
formatDate: formatDate,
//获取pk信息
getpkInformation(){
const res = request({
url: "user/queryMyAllPkData",
method: "POST",
data: {
userId: this.userinfo.id,
page:0,
size:4
},
userInfo: false,
}).then((res) => {
if (res.code == 200) {
this.pkInformationdata = res.data;
console.log(this.pkInformationdata);
}else {
console.log(res.msg);
}
});
},
//获取pk记录
getmyPkRecord(){
const ress = request({
url: "user/handlePkInfo",
method: "POST",
data: {
type:1,
userId: this.userinfo.id,
page:0,
size:4
},
userInfo: false,
}).then((res) => {
if (res.code == 200) {
this.myPkRecorddata = res.data;
console.log(this.myPkRecorddata);
}else {
console.log(res.msg);
}
});
},
// 跳转到PK信息页面
pkInformation() {
uni.navigateTo({
url: "/pages/Mine/minecomponents/pkInformation",
});
},
// 跳转到PK记录页面
pkRecord() {
uni.navigateTo({
url: "/pages/Mine/minecomponents/pkRecord",
});
},
// 跳转到联系客服页面
contact() {
uni.navigateTo({
url: "/pages/Mine/minecomponents/contact",
});
},
// 跳转到设置页面
goSetting() {
uni.navigateTo({
url: "/pages/Setting/Setting",
});
},
// 退出登录
logout() {
uni.removeStorage({
key: "chatInfo",
@@ -84,8 +218,8 @@ export default {
});
uni.reLaunch({
url: "/pages/login/login",
});
}
});
},
},
components: {
tabBar,
@@ -94,63 +228,185 @@ export default {
</script>
<style scoped>
.container {
.bg {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.bgImg {
width: 100%;
height: 100%;
}
.PersonalInformation {
position: absolute;
top: 150rpx;
left: 0;
right: 0;
height: 144.5rpx;
display: flex;
align-items: center;
}
.header {
width: 144.5rpx;
height: 144.5rpx;
border-radius: 72.25rpx;
background-color: #fff;
margin-left: 32.5rpx;
margin-right: 39.5rpx;
}
.Settings {
width: 46rpx;
height: 46rpx;
margin-left: 360rpx;
}
.SettingsIcon {
width: 100%;
height: 100%;
}
.name {
font-size: 36.26rpx;
font-weight: 500;
color: #161616;
}
.content {
position: absolute;
top: 294.5rpx;
left: 0;
right: 0;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
width: 100%;
background: linear-gradient(to bottom, #11cb2a6e, #2574fc6d);
}
.PersonalInformation {
margin-top: 200rpx;
.PKInformation {
margin-top: 48.5rpx;
}
.myPkRecord {
margin-top: 48.5rpx;
}
.title {
width: 682rpx;
height: 33.4rpx;
display: flex;
align-items: center;
width: 100%;
}
.header {
background: #ffffff;
margin-left: 50rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
.titleText {
font-size: 34.35rpx;
font-weight: bold;
color: #100e0f;
}
.headerIcon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
.titleLine {
width: 40.08rpx;
height: 14.31rpx;
margin-left: -40rpx;
margin-top: 25rpx;
border-radius: 7.16rpx 0rpx 7.16rpx 7.16rpx;
background-color: #91e3e48b;
}
.name {
.titleMore {
margin-left: 410rpx;
font-size: 28.63rpx;
color: #333333;
}
.myPkRecordMore {
margin-left: 340rpx;
font-size: 28.63rpx;
color: #333333;
}
.card {
width: 689.03rpx;
height: 208.02rpx;
background-color: #fff;
border-radius: 10rpx;
margin-top: 26.5rpx;
display: flex;
align-items: center;
}
.card .cardContent:first-child {
margin-left: 30rpx;
}
.Settings {
margin-left: 370rpx;
width: 50rpx;
height: 50rpx;
.cardContent {
width: 100rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-left: 83rpx;
}
.SettingsIcon {
width: 50rpx;
height: 50rpx;
}
.logout{
margin-top: 20rpx;
width: 100vw;
.cardImg {
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
color: #000000;
font-size: 36rpx;
background: #ffffff;
border-top: 1px solid #000000;
border-bottom: 1px solid #000000;
border-radius: 40rpx;
background-color: rgb(205, 205, 205);
}
.Time {
font-size: 18rpx;
text-align: center;
margin-top: 10rpx;
}
.gold {
font-size: 18rpx;
text-align: center;
margin-top: 10rpx;
}
.Failure {
width: 56.3rpx;
height: 29.58rpx;
background-image: url("../../static/maleimg.png");
background-position-x: center;
background-position-y: center;
background-repeat: no-repeat;
background-size: 100% 100%;
color: #ffffff;
font-size: 17.18rpx;
text-align: center;
line-height: 29.58rpx;
margin-top: -20rpx;
}
.Result {
width: 56.3rpx;
height: 29.58rpx;
background-image: url("../../static/femaleimg.png");
background-position-x: center;
background-position-y: center;
background-repeat: no-repeat;
background-size: 100% 100%;
color: #ffffff;
font-size: 17.18rpx;
text-align: center;
line-height: 29.58rpx;
margin-top: -20rpx;
}
.Session {
font-weight: bold;
font-size: 18rpx;
margin-top: 10rpx;
}
.service {
width: 200rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.cardtext {
margin-top: 20rpx;
font-size: 28.63rpx;
color: #333333;
font-weight: 400;
}
.copyright{
position: absolute;
bottom: 250rpx;
width: 100%;
font-size: 23rpx;
color: #929292;
text-align: center;
color: #ffffff;
font-size: 24rpx;
z-index: 999;
position: fixed;
bottom: 250rpx;
left: 0;
right: 0;
height: 50rpx;
}
</style>

View File

@@ -1,205 +1,230 @@
<template>
<view class="pkRecord">
<view>返回</view>
<view>pk信息</view>
<view></view>
<view class="pk-information">
<view class="bg">
<image class="bgImg" src="../../../static/HomeBackground.png" mode="scaleToFill" />
</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="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">性别</view>
</view>
<view class="RoomID">PK时间:&nbsp;{{ formatDate(item.pkTime) }}</view>
<view>国家</view>
<view>性别</view>
<view class="Charm">金币:</view>
<view class="charmValue"> {{ item.coin + "K" }}</view>
<view class="Return" @click="onBack">
<image class="ReturnImg" src="../../../static/Return.png" mode="scaleToFill" />
</view>
<view class="content">
<scroll-view
scroll-y="true"
class="scroll"
refresher-enabled="true"
refresher-threshold="40"
@refresherrefresh="onRefresherRefresh"
lower-threshold="100"
@scrolltolower="onScrollToLower"
>
<uni-card class="card" v-for="(item, index) in pkList" :key="index">
<view class="Profile">
<image style="width: 89.12rpx; height: 89.12rpx" src="" mode="scaleToFill" />
</view>
</view>
<!-- `````````````````````````````````````````````````````` -->
</view>
</uni-card>
</scroll-view>
<view class="Individual">
<view class="Name">{{ item.anchorId }}</view>
<view class="Label">
<view>
<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>
<view class="state">{{ item.country }}</view>
<view class="species">
<image
style="width: 28.63rpx; height: 28.63rpx"
src="../../../static/species.png"
mode="scaleToFill"
/>
<view class="species-text">金币:</view>
<view class="species-num">{{ item.coin }}K</view>
</view>
</view>
<view class="time">PK时间:{{ formatDate(item.pkTime) }}</view>
</view>
<view class="handle" v-if="item.status === 0">
<view class="recompose" @click="onRecompose(item)">
<image
style="width: 46rpx; height: 46rpx"
src="../../../static/recompose.png"
mode="scaleToFill"
/>
</view>
<view class="expurgate" @click="onExpurgate(item)">
<image
style="width: 46rpx; height: 46rpx"
src="../../../static/expurgate.png"
mode="scaleToFill"
/>
</view>
</view>
</uni-card>
</scroll-view>
</view>
</view>
<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";
export default {
inject: ["$global"],
data() {
return {
page: 0, //页码
size: 10, //每页条数
list: [], // 列表数据
detailsdata: {}, //详情数据
pkList: [],
userinfo: {},
page: 0,
createModule: null,
parentMessage: null,
};
},
onLoad() {
uni.getStorage({
key: "userinfo",
success: (res) => {
this.userinfo = res.data;
console.log(this.userinfo);
this.getpkList();
},
});
},
mounted() {
// 页面加载完成后请求数据
this.pkList();
this.createModule = this.$refs.createModule; // 挂载后赋值
},
methods: {
onRefresherRefresh() {
this.page = 0;
this.list = [];
this.pkList();
onBack() {
uni.navigateBack(
{
delta: 1,
}
);
},
async goDetail(item) {
uni.showLoading({
title: "加载中...",
mask: true,
formatDate: formatDate,
getpkList() {
const res = request({
url: "user/queryMyAllPkData",
method: "POST",
data: {
userId: this.userinfo.id,
page: this.page,
size: 10,
},
userInfo: false,
}).then((res) => {
if (res.code == 200) {
this.pkList = res.data;
console.log(this.pkList);
} else {
console.log(res.msg);
}
});
console.log("id", item.id);
const res = await request({
url: "pk/pkInfoDetail",
},
onRecompose(item) {
this.createModule.open()
this.parentMessage = item
},
onExpurgate(item){
const res = request({
url: "pk/deletePkDataWithId",
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: "加载失败",
userInfo: false,
}).then((res) => {
if (res.code == 200) {
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,
this.getpkList()
} else {
console.log(res.msg);
}
});
console.log(res);
if (res.code === 200) {
this.list.push(...res.data);
console.log(this.list);
}
},
onScrollToLower() {
this.page++;
this.pkList();
},
}
},
components: {
Recompose ,
},
};
</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;
}
.scroll {
height: 90%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.bg {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.content-list {
display: flex;
align-items: center;
width: 712rpx;
.bgImg {
width: 100%;
height: 100%;
}
.Return {
position: absolute;
top: 100rpx;
left: 35rpx;
width: 46rpx;
height: 46rpx;
}
.ReturnImg {
width: 100%;
height: 100%;
}
.scroll {
position: absolute;
top: 200rpx;
left: 0;
right: 0;
height: 1300rpx;
width: 100%;
}
.card {
width: 695rpx;
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;
background-color: aqua;
}
.content-list-info {
display: flex;
align-items: center;
margin-left: 30rpx;
margin-top: 11.5rpx;
}
.cardname {
font-size: 31rpx;
color: #161616;
line-height: 38rpx;
.Profile {
width: 89rpx;
height: 89rpx;
border-radius: 50rpx;
background-color: #cccccc;
margin-left: 27.5rpx;
}
.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;
background: url(../../../static/maleimg.png) no-repeat center;
width: 56.3rpx;
height: 29.58rpx;
background-size: 100% 100%;
@@ -208,7 +233,7 @@ export default {
margin-right: 10rpx;
}
.Genderfemale {
background: url(../../static/femaleimg.png) no-repeat center;
background: url(../../../static/femaleimg.png) no-repeat center;
width: 56.3rpx;
height: 29.58rpx;
background-size: 100% 100%;
@@ -216,22 +241,76 @@ export default {
align-items: center;
margin-right: 10rpx;
}
.RoomID {
.Individual {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 37rpx;
}
.Name {
font-size: 30.53rpx;
color: #161616;
font-weight: 500;
}
.time {
margin-top: 13rpx;
font-size: 23rpx;
color: #a3a3a3;
line-height: 38rpx;
}
.Charm {
.state {
height: 30rpx;
background: #f6f6f6;
border-radius: 14rpx;
line-height: 30rpx;
font-size: 17rpx;
color: #666666;
padding: 0 15rpx;
}
.Label {
margin-top: 15rpx;
display: flex;
}
.age {
font-size: 17rpx;
color: #ffffff;
margin-left: 10rpx;
}
.Genderimg {
width: 14.22rpx;
height: 14.22rpx;
margin-left: 10rpx;
}
.species {
display: flex;
margin-left: 10rpx;
}
.species-text {
font-size: 23rpx;
color: #a3a3a3;
line-height: 38rpx;
margin-right: 12rpx;
margin-left: 20rpx;
}
.charmValue {
.species-num {
font-size: 23rpx;
color: #161616;
line-height: 38rpx;
font-weight: 600;
font-weight: bold;
}
.handle {
display: flex;
}
.recompose {
width: 46rpx;
height: 46rpx;
margin-left: 90rpx;
}
.expurgate {
width: 46rpx;
height: 46rpx;
margin-left: 40rpx;
}
.createModule{
position: fixed;
bottom: 0;
right: 0;
z-index: 998;
width: 100vw;
}
</style>

View File

@@ -0,0 +1,499 @@
<template><view v-if="Display" :class="[Display ? 'create-module' : 'close-animation ', 'Mask']" @click="open()">
<view @click.stop class="containers">
<view class="container">
<image
class="Fork"
@click="open()"
src="../../../../static/Fork.png"
mode="scaleToFill"
/>
<view class="Titlecss">
<view class="Star"></view>
<view class="Title"></view>
<view class="Star"></view>
</view>
<!-- <view class="Individual"> -->
<view class="NameAnchor">
<input
class="NameAnchorcss"
cursor-color="#666666"
placeholder-style="color:#666666"
@input="NameAnchor"
placeholder="主播名称"
/>
<view v-if="nameAnchor === '' && Hint === true" class="Hint"
>请填写主播名称</view
>
</view>
<!-- </view> -->
<view class="Accountnumber">
<view class="Coins country">
<wht-select
style="width: 350rpx"
backgroundColor="#ffffff"
placeholderColor="#666666"
textColor="#666666"
borderColor="#ffffff"
@change="country"
:options="Country"
:filterable = "filterable"
placeholder="请选择国家"
/>
<view v-if="countrys === '' && Hint === true" class="Hint">请选择国家</view>
</view>
<view class="Gender">
<view class="Gendercs">
<view class="Gendercss">
<wht-select
style="width: 300rpx"
backgroundColor="#ffffff"
placeholderColor="#666666"
textColor="#666666"
borderColor="#ffffff"
@change="gender"
:options="Gender"
placeholder="性别"
/>
</view>
<view class="Gendericoncss">
<image
v-if="genders === 0"
class="Gendericon"
src="../../../../static/ask.png"
mode="scaleToFill"
/>
<image
v-if="genders === 1"
class="Gendericon"
src="../../../../static/man.png"
mode="scaleToFill"
/>
<image
v-if="genders === 2"
class="Gendericon"
src="../../../../static/girl.png"
mode="scaleToFill"
/>
</view>
</view>
<view v-if="genders === 0 && Hint === true" class="Hintcss">请选择性别</view>
</view>
</view>
<view class="goldCoin">
<view class="number-box">
<view class="number-box-title">金币数量:</view>
<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
>
</view>
<view class="time">
<uni-datetime-picker
type="datetime"
hide-second="true"
v-model="datetimesingle"
/>
<view v-if="datetimesingle === '' && Hint === true" class="Hint"
>请选择日期</view
>
</view>
<!-- ···············································标记2············································ -->
<view class="goldCoin">
<view class="number-box">
<view class="number-box-title">选择场数:</view>
<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
>
</view>
<!-- ··························································································· -->
<view class="Remarkscss">
<uni-easyinput
type="textarea"
v-model="remarks"
placeholder="备注"
></uni-easyinput>
</view>
<view class="Publish">
<button @click="Publish()" class="Publishcss">发布</button>
</view>
</view>
</view>
</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";
export default {
data() {
return {
genders: 0, //性别
Gender: [
{ label: "男", value: 1 },
{ label: "女", value: 2 },
],
Country: optionsArray,
countrys: "", //国家
nameAnchor: "", //主播名称
numberCoins: "", //金币数量
session: "", //场数
remarks: "", //备注
Display: false,
Hint: false,
datetimesingle: "", //日期
id: null, //用户id
sendingTime: "", //发送时间
filterable: true, //是否可搜索
};
},
props: {
message
},
mounted() {
uni.getStorage({
key: "userinfo",
success: (res) => {
this.id = res.data.id;
},
});
},
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;
}
},
open() {
if (this.Display) {
this.Display = false;
this.Hint = false;
this.nameAnchor = "";
this.genders = "";
this.numberCoins = "";
this.remarks = "";
this.datetimesingle = "";
this.countrys = "";
this.session = "";
} else {
this.Display = true;
}
},
//获取主播名称
NameAnchor: function (event) {
this.nameAnchor = event.target.value;
},
async Publish() {
console.log("````````````````````````````````````````````",message);
//判断是否为空
if (
this.nameAnchor === "" ||
this.genders === "" ||
this.numberCoins === "" ||
this.countrys === "" ||
this.datetimesingle === ""||
this.session === ""
) {
this.Hint = true;
return;
}
//格式化日期
const isoString = this.datetimesingle.replace(" ", "T");
const timestamp = Date.parse(isoString);
if (isNaN(timestamp)) {
throw new Error(`Invalid date format: ${this.datetimesingle}`);
}
this.sendingTime = Math.floor(timestamp / 1000);
const secondsTimestamp = Math.floor(Date.now() / 1000);
if (this.sendingTime < secondsTimestamp) {
uni.showToast({
title: "日期不能早于当前时间",
icon: "none",
duration: 2000,
});
return;
}
//发送请求
uni.showLoading({
title: "发布中...",
mask: true,
});
const res = await request({
url: "pk/addPkData",
method: "POST",
data: {
anchorId: this.nameAnchor,
pkTime: this.sendingTime,
sex: this.genders,
country: this.countrys,
coin: this.numberCoins,
remark: this.remarks,
status: 0,
senderId: this.id,
anchorIcon: "",
pkNumber: this.session,
},
userInfo: true,
});
if (res.code === 200) {
this.Display = false;
this.Hint = false;
this.nameAnchor = "";
this.genders = 0;
this.numberCoins = "";
this.remarks = "";
this.datetimesingle = "";
this.session = "";
uni.hideLoading();
uni.showToast({
title: "发布成功",
icon: "success",
duration: 2000,
});
} else {
uni.hideLoading();
uni.showToast({
title: "发布失败",
icon: "none",
duration: 2000,
});
}
},
},
};
</script>
<style scoped>
/* 定义动画 */
/* 原始进入动画 */
@keyframes slide-in {
from { transform: translateY(100%); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
/* 新增关闭动画 */
@keyframes slide-out {
from { transform: translateY(0); opacity: 1; }
to { transform: translateY(-100%); opacity: 0; }
}
/* 进入动画类 */
.create-module {
animation: slide-in 0.3s ease-in-out;
}
/* 关闭动画类 */
.close-animation {
animation: slide-out 0.3s ease-in-out forwards;
}
.Mask {
width: 100vw;
height: 100vh;
background: #00000076;
display: flex;
flex-direction: column-reverse;
}
.Hint {
color: rgb(255, 0, 0);
font-size: 20rpx;
margin-left: 30rpx;
margin-top: 10rpx;
}
.Hintcss{
color: rgb(255, 0, 0);
font-size: 20rpx;
margin-left: 30rpx;
margin-top: 20rpx;
}
.containers {
background-color: #ffffff;
border-radius: 50rpx;
}
.container {
display: flex;
background-image: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/bgv.png);
background-size: 100% 100%;
flex-direction: column;
width: 100%;
height: 1300rpx;
border-radius: 50rpx;
box-shadow: 0 0 10rpx #ccc;
}
.Fork {
width: 46rpx;
height: 46rpx;
margin-top: 20rpx;
/* margin-bottom: 40rpx; */
margin-left: 90%;
}
.Titlecss{
width: 100%;
height: 70rpx;
display: flex;
justify-content: center;
align-items: center;
}
.Star{
width: 50rpx;
height: 50rpx;
background-image: url(../../../../static/star.png);
background-size: 100% 100%;
}
.Title {
width: 430rpx;
height: 70rpx;
background-image: url(../../../../static/Publishpk.png);
background-size: 100% 200%;
background-position: 30% 0%;
margin-left: 26rpx;
margin-right: -65rpx;
}
.Individual {
display: flex;
/* justify-content: center; */
}
.NameAnchor {
width: 90%;
margin: 40rpx;
}
.time {
width: 90%;
margin-left: 5%;
margin-top: 50rpx;
}
.NameAnchorcss {
width: 99%;
height: 85rpx;
background-color: #ffffff;
border: 1rpx solid #BFBFBF;
border-radius: 10rpx;
text-align: center;
}
.Gender {
width: 310rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.Gendercs{
display: flex;
justify-content: center;
/* align-items: center; */
}
.Gendercss{
width: 200rpx;
height: 60rpx;
}
.Gendericoncss{
display: flex;
justify-content: center;
align-items: center;
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #ff9d0067;
margin-left: 20rpx;
margin-top: 10rpx;
}
.Gendericon{
width: 40rpx;
height: 40rpx;
/* margin-top: 10rpx;
margin-right: 40rpx; */
}
.Accountnumber {
display: flex;
justify-content: center;
margin-bottom: 60rpx;
margin-top: 50rpx;
}
.Coins {
width: 330rpx;
height: 65rpx;
/* display: flex; */
margin-right: 50rpx;
/* flex-direction: column; */
}
.country {
margin-left:10rpx;
}
.goldCoin {
width: 100%;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
}
.number-box {
display: flex;
justify-content: center;
text-align: center;
}
.number-box-title {
color: #191919;
font-size: 30rpx;
margin-right: 22rpx;
margin-left: 17rpx;
}
.number-box-unit {
color: #03ABA8;
width: 48rpx;
height: 48rpx;
border: 1rpx solid #03ABA8;
border-radius: 50%;
line-height: 48rpx;
text-align: center;
/* color: #003cff5a; */
}
.Remarkscss {
width: 90%;
margin-top: 30rpx;
margin-left: 5%;
margin-right: 5%;
margin-bottom: 50rpx;
border-radius: 10rpx;
}
.Publish {
margin-bottom: 40rpx;
width: 90%;
margin-left: 5%;
}
.Publishcss {
background-image: linear-gradient(135deg, #4FCACD, #5FDBDE);
/* color: #33ff00; */
color: #ffffff;
font-weight: bold;
border-radius: 50rpx;
}
</style>

View File

@@ -36,12 +36,12 @@
<wht-select
style="width: 350rpx"
backgroundColor="#ffffff"
placeholderColor="#ffffff"
placeholderColor="#666666"
textColor="#666666"
borderColor="#ffffff"
@change="country"
:options="Country"
filterable= true
:filterable = "filterable"
placeholder="请选择国家"
/>
<view v-if="countrys === '' && Hint === true" class="Hint">请选择国家</view>
@@ -103,7 +103,6 @@
type="datetime"
hide-second="true"
v-model="datetimesingle"
@change="changeLog"
/>
<view v-if="datetimesingle === '' && Hint === true" class="Hint"
>请选择日期</view
@@ -113,10 +112,10 @@
<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="session"></uni-number-box>
<view class="number-box-title"></view>
</view>
<view v-if="numberCoins === '' && Hint === true" class="Hint"
<view v-if="session === '' && Hint === true" class="Hint"
>请填写场数</view
>
</view>
@@ -152,12 +151,14 @@ export default {
countrys: "", //国家
nameAnchor: "", //主播名称
numberCoins: "", //金币数量
session: "", //场数
remarks: "", //备注
Display: false,
Hint: false,
datetimesingle: "", //日期
id: null, //用户id
sendingTime: "", //发送时间
filterable: true, //是否可搜索
};
},
mounted() {
@@ -195,6 +196,7 @@ export default {
this.remarks = "";
this.datetimesingle = "";
this.countrys = "";
this.session = "";
} else {
this.Display = true;
}
@@ -211,7 +213,8 @@ export default {
this.genders === "" ||
this.numberCoins === "" ||
this.countrys === "" ||
this.datetimesingle === ""
this.datetimesingle === ""||
this.session === ""
) {
this.Hint = true;
return;
@@ -251,6 +254,7 @@ export default {
status: 0,
senderId: this.id,
anchorIcon: "",
pkNumber: this.session,
},
userInfo: true,
});
@@ -262,6 +266,7 @@ export default {
this.numberCoins = "";
this.remarks = "";
this.datetimesingle = "";
this.session = "";
uni.hideLoading();
uni.showToast({
title: "发布成功",
@@ -387,7 +392,6 @@ export default {
border: 1rpx solid #BFBFBF;
border-radius: 10rpx;
text-align: center;
color:#ffffff;
}
.Gender {
width: 310rpx;