优化页面
This commit is contained in:
@@ -1,218 +0,0 @@
|
||||
<template>
|
||||
<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">{{ item.sex === "1" ? "男" : "女" }}</view>
|
||||
</view>
|
||||
<view class="RoomID">PK时间: {{ formatDate(item.pkTime) }}</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>
|
||||
.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>
|
||||
@@ -117,7 +117,10 @@ function handlePush(item, index) {
|
||||
return;
|
||||
}
|
||||
if (item.text === "消息") {
|
||||
uni.navigateTo({ url: "/TUIKit/components/TUIConversation/index" });
|
||||
uni.navigateTo({
|
||||
url: "/TUIKit/components/TUIConversation/index",
|
||||
animationType: 'none',
|
||||
});
|
||||
}else {
|
||||
uni.switchTab({
|
||||
url: item.pagePath,
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
@click="MakeAppointmentPK"
|
||||
:class="{ Selectcss: !Select, NoSelectcss: Select }"
|
||||
class="RealTime"
|
||||
>预约PK</view
|
||||
>PK大厅</view
|
||||
>
|
||||
<view
|
||||
@click="RealTimePk"
|
||||
:class="{ Selectcss: Select, NoSelectcss: !Select }"
|
||||
class="MakeAppointment"
|
||||
>实时PK</view
|
||||
>今日PK</view
|
||||
>
|
||||
<view @click="screening" class="Screening">筛选</view>
|
||||
<image @click="Search" src="../../static/Searching.png" class="filter-icon" />
|
||||
<!-- <view @click="screening" class="Screening">筛选</view>
|
||||
<image @click="Search" src="../../static/Searching.png" class="filter-icon" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user