优化页面
This commit is contained in:
31
pages/Mine/minecomponents/contact.vue
Normal file
31
pages/Mine/minecomponents/contact.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<view class="contact">
|
||||
<h1>联系方式</h1>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: 'Hello'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 页面加载时执行
|
||||
},
|
||||
methods: {
|
||||
// 方法定义
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.contact{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
237
pages/Mine/minecomponents/pkInformation.vue
Normal file
237
pages/Mine/minecomponents/pkInformation.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<view class="pkRecord">
|
||||
<view>返回</view>
|
||||
<view>pk信息</view>
|
||||
<view></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="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时间: {{ formatDate(item.pkTime) }}</view>
|
||||
<view>国家</view>
|
||||
<view>性别</view>
|
||||
<view class="Charm">金币:</view>
|
||||
<view class="charmValue"> {{ item.coin + "K" }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- `````````````````````````````````````````````````````` -->
|
||||
</view>
|
||||
</uni-card>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "../../../components/request.js";
|
||||
import formatDate from "../../../components/formatDate.js";
|
||||
export default {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
return {
|
||||
page: 0, //页码
|
||||
size: 10, //每页条数
|
||||
list: [], // 列表数据
|
||||
detailsdata: {}, //详情数据
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 页面加载完成后请求数据
|
||||
this.pkList();
|
||||
},
|
||||
methods: {
|
||||
onRefresherRefresh() {
|
||||
this.page = 0;
|
||||
this.list = [];
|
||||
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);
|
||||
}
|
||||
},
|
||||
onScrollToLower() {
|
||||
this.page++;
|
||||
this.pkList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</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;
|
||||
}
|
||||
.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;
|
||||
background-color: aqua;
|
||||
}
|
||||
.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>
|
||||
125
pages/Mine/minecomponents/pkRecord.vue
Normal file
125
pages/Mine/minecomponents/pkRecord.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<view class="pkRecord">
|
||||
<view>返回</view>
|
||||
<view>pk记录</view>
|
||||
<view></view>
|
||||
</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="content">
|
||||
<view class="Anchor">
|
||||
<view class="avatar">主播1头像(赢方头像框王冠)</view>
|
||||
<view class="AnchorInfo">
|
||||
<view>主播昵称</view>
|
||||
<view>pk时间</view>
|
||||
<view>实际打了多少金币</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
VS
|
||||
</view>
|
||||
<view class="Anchor">
|
||||
<view class="AnchorInfo">
|
||||
<view>主播昵称</view>
|
||||
<view>pk时间</view>
|
||||
<view>实际打了多少金币</view>
|
||||
</view>
|
||||
<view class="avatar">主播1头像</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</uni-card>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 页面加载时执行
|
||||
},
|
||||
methods: {
|
||||
// 方法定义
|
||||
}
|
||||
}
|
||||
</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>
|
||||
Reference in New Issue
Block a user