优化页面
This commit is contained in:
219
unpackage/dist/dev/mp-weixin/pages/Home/Home.js
vendored
Normal file
219
unpackage/dist/dev/mp-weixin/pages/Home/Home.js
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_TUILogin = require("../../components/TUILogin.js");
|
||||
const components_request = require("../../components/request.js");
|
||||
const components_formatDate = require("../../components/formatDate.js");
|
||||
const stores_counter = require("../../stores/counter.js");
|
||||
const topNavigation = () => "../../components/topNavigation/topNavigation.js";
|
||||
const Advertisement = () => "../../components/Advertisement/Advertisement.js";
|
||||
const tabBar = () => "../../components/tabBar/tabBar.js";
|
||||
const counter = stores_counter.useCounterStore();
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
myuserSig: "",
|
||||
chatInfo: {},
|
||||
page: 0,
|
||||
//页码
|
||||
size: 10,
|
||||
//每页条数
|
||||
list: [],
|
||||
// 列表数据
|
||||
detailsdata: {},
|
||||
//详情数据
|
||||
triggered: false,
|
||||
//下拉刷新标识
|
||||
RealTimePklist: [],
|
||||
// PK大厅列表数据
|
||||
MakeAppointmentPKlist: [],
|
||||
// 今日PK列表数据
|
||||
listtype: 1
|
||||
// 列表类型 1 当天 2 大于当天
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.pkList({ type: 2 });
|
||||
this.pkList({ type: 1 });
|
||||
},
|
||||
onLoad() {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.info = res.data;
|
||||
counter.$patch({ myitem: this.info });
|
||||
common_vendor.index.getStorage({
|
||||
key: "myuserSig",
|
||||
success: (res2) => {
|
||||
this.myuserSig = res2.data;
|
||||
common_vendor.index.getStorage({
|
||||
key: "chatInfo",
|
||||
success: (res3) => {
|
||||
this.chatInfo = res3.data;
|
||||
common_vendor.index.__f__("log", "at pages/Home/Home.vue:111", "chatInfo", this.chatInfo);
|
||||
components_TUILogin.TUIlogin(this.chatInfo.appId, this.info.id, this.myuserSig.userSig);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.switchTab({ url: "/pages/Home/Home" });
|
||||
}, 1e3);
|
||||
},
|
||||
methods: {
|
||||
goMakeAppointmentPK() {
|
||||
this.listtype = 1;
|
||||
this.list = this.MakeAppointmentPKlist;
|
||||
},
|
||||
goRealTimePk() {
|
||||
this.listtype = 2;
|
||||
this.list = this.RealTimePklist;
|
||||
},
|
||||
goAdvertisement() {
|
||||
common_vendor.index.navigateTo({ url: "/pages/pkDetail/pkDetail" });
|
||||
},
|
||||
onRefresherRefresh() {
|
||||
this.page = 0;
|
||||
this.list = [];
|
||||
if (this.listtype === 1) {
|
||||
this.MakeAppointmentPKlist = [];
|
||||
} else {
|
||||
this.RealTimePklist = [];
|
||||
}
|
||||
this.triggered = true;
|
||||
this.pkList({ type: this.listtype });
|
||||
},
|
||||
async goDetail(item) {
|
||||
common_vendor.index.showLoading({
|
||||
title: "加载中...",
|
||||
mask: true
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Home/Home.vue:152", "id", item.id, this.info.id);
|
||||
const res = await components_request.request({
|
||||
url: "pk/pkInfoDetail",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: item.id,
|
||||
userId: this.info.id
|
||||
},
|
||||
userInfo: true
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Home/Home.vue:163", "res", res);
|
||||
this.detailsdata = res.data;
|
||||
if (res.code === 200) {
|
||||
if (res.data.length !== 0) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("log", "at pages/Home/Home.vue:168", "res.data", res.data);
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/pkDetail/pkDetail",
|
||||
success: (res2) => {
|
||||
res2.eventChannel.emit("itemDetail", {
|
||||
item: this.detailsdata
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
this.openPopupQuantity();
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "加载失败",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
},
|
||||
formatDate: components_formatDate.formatDate,
|
||||
async pkList(condition) {
|
||||
const res = await components_request.request({
|
||||
url: "pk/pkList",
|
||||
method: "POST",
|
||||
data: {
|
||||
status: 0,
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
condition,
|
||||
userId: this.info.id
|
||||
},
|
||||
userInfo: false
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Home/Home.vue:206", res);
|
||||
if (res.code === 200) {
|
||||
this.triggered = false;
|
||||
if (condition.type === 1) {
|
||||
this.MakeAppointmentPKlist.push(...res.data);
|
||||
if (condition.type == this.listtype) {
|
||||
this.list = this.MakeAppointmentPKlist;
|
||||
}
|
||||
} else {
|
||||
this.RealTimePklist.push(...res.data);
|
||||
if (condition.type == this.listtype) {
|
||||
this.list = this.RealTimePklist;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onScrollToLower() {
|
||||
this.page++;
|
||||
this.pkList({ type: this.listtype });
|
||||
},
|
||||
components: {
|
||||
topNavigation,
|
||||
Advertisement,
|
||||
tabBar
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_top_navigation = common_vendor.resolveComponent("top-navigation");
|
||||
const _component_advertisement = common_vendor.resolveComponent("advertisement");
|
||||
const _component_uni_card = common_vendor.resolveComponent("uni-card");
|
||||
const _easycom_tabBar2 = common_vendor.resolveComponent("tabBar");
|
||||
(_component_top_navigation + _component_advertisement + _component_uni_card + _easycom_tabBar2)();
|
||||
}
|
||||
const _easycom_tabBar = () => "../../components/tabBar/tabBar.js";
|
||||
if (!Math) {
|
||||
_easycom_tabBar();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o$1($options.goRealTimePk),
|
||||
b: common_vendor.o$1($options.goMakeAppointmentPK),
|
||||
c: common_vendor.o$1((...args) => $options.goAdvertisement && $options.goAdvertisement(...args)),
|
||||
d: $data.list.length !== 0
|
||||
}, $data.list.length !== 0 ? {
|
||||
e: common_vendor.f($data.list, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.anchorIcon,
|
||||
b: common_vendor.t(item.disPlayId),
|
||||
c: item.sex === "2"
|
||||
}, item.sex === "2" ? {} : {}, {
|
||||
d: common_vendor.t(item.sex === "1" ? "男" : "女"),
|
||||
e: item.sex === "1" ? 1 : "",
|
||||
f: item.sex === "2" ? 1 : "",
|
||||
g: common_vendor.t($options.formatDate(item.pkTime)),
|
||||
h: common_vendor.t(item.coin + "K"),
|
||||
i: common_vendor.o$1(($event) => $options.goDetail(item), index),
|
||||
j: index,
|
||||
k: "7ffebbf4-2-" + i0
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
f: $data.list.length === 0
|
||||
}, $data.list.length === 0 ? {} : {}, {
|
||||
g: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
|
||||
h: common_vendor.o$1((...args) => _ctx.onScrollToLower && _ctx.onScrollToLower(...args)),
|
||||
i: $data.triggered,
|
||||
j: common_vendor.p({
|
||||
tabIndex: 0
|
||||
})
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7ffebbf4"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Home/Home.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/pages/Home/Home.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/pages/Home/Home.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "首页",
|
||||
"usingComponents": {
|
||||
"top-navigation": "../../components/topNavigation/topNavigation",
|
||||
"advertisement": "../../components/Advertisement/Advertisement",
|
||||
"tab-bar": "../../components/tabBar/tabBar"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Home/Home.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Home/Home.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="page data-v-7ffebbf4"><image src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/HomeBackground.png" class="HomeBackground data-v-7ffebbf4"></image></view><view class="top-navigation-container data-v-7ffebbf4"><top-navigation class="data-v-7ffebbf4" bindRealTimePk="{{a}}" bindMakeAppointmentPK="{{b}}" u-i="7ffebbf4-0" bind:__l="__l"></top-navigation></view><view class="Advertisement data-v-7ffebbf4" bindtap="{{c}}"><advertisement class="data-v-7ffebbf4" u-i="7ffebbf4-1" bind:__l="__l"></advertisement></view><view class="contentList data-v-7ffebbf4"><scroll-view scroll-y="true" class="scroll data-v-7ffebbf4" refresher-enabled="true" refresher-threshold="40" bindrefresherrefresh="{{g}}" lower-threshold="100" bindscrolltolower="{{h}}" refresher-triggered="{{i}}"><block wx:if="{{d}}"><uni-card wx:for="{{e}}" wx:for-item="item" wx:key="j" class="data-v-7ffebbf4" u-s="{{['d']}}" u-i="{{item.k}}" bind:__l="__l"><view class="content-list data-v-7ffebbf4" bindtap="{{item.i}}"><image class="headShot data-v-7ffebbf4" src="{{item.a}}" mode="scaleToFill"/><view class="content-list-title data-v-7ffebbf4"><view class="cardname data-v-7ffebbf4">{{item.b}}</view><view class="content-list-info data-v-7ffebbf4"><view class="{{['data-v-7ffebbf4', item.e && 'Gendermale', item.f && 'Genderfemale']}}"><image wx:if="{{item.c}}" class="Genderimg data-v-7ffebbf4" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/female.png" mode="scaleToFill"/><image wx:else class="Genderimg data-v-7ffebbf4" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/male.png" mode="scaleToFill"/><view class="age data-v-7ffebbf4">{{item.d}}</view></view><view class="RoomID data-v-7ffebbf4">PK时间: {{item.g}}</view><view class="Charm data-v-7ffebbf4">金币:</view><view class="charmValue data-v-7ffebbf4">{{item.h}}</view></view></view></view></uni-card></block><view wx:if="{{f}}" class="no-content data-v-7ffebbf4">暂无内容</view></scroll-view></view><view class="tabBar data-v-7ffebbf4"><tab-bar wx:if="{{j}}" class="data-v-7ffebbf4" u-i="7ffebbf4-3" bind:__l="__l" u-p="{{j}}"></tab-bar></view>
|
||||
126
unpackage/dist/dev/mp-weixin/pages/Home/Home.wxss
vendored
Normal file
126
unpackage/dist/dev/mp-weixin/pages/Home/Home.wxss
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
|
||||
.page.data-v-7ffebbf4 {
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 1620rpx;
|
||||
}
|
||||
.HomeBackground.data-v-7ffebbf4 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
.top-navigation-container.data-v-7ffebbf4 {
|
||||
position: fixed;
|
||||
top: 160rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 114.5rpx;
|
||||
}
|
||||
.Advertisement.data-v-7ffebbf4 {
|
||||
position: fixed;
|
||||
top: 300rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
.contentList.data-v-7ffebbf4 {
|
||||
position: fixed;
|
||||
top: 412rpx;
|
||||
left: 0;
|
||||
bottom: 114.5rpx;
|
||||
width: 100%;
|
||||
/* height: 1300rpx; */
|
||||
}
|
||||
.scroll.data-v-7ffebbf4 {
|
||||
height: 90%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.content-list.data-v-7ffebbf4 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 712rpx;
|
||||
height: 161rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 15rpx;
|
||||
margin-bottom: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.headShot.data-v-7ffebbf4 {
|
||||
width: 101rpx;
|
||||
height: 101rpx;
|
||||
border-radius: 50rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 33rpx;
|
||||
}
|
||||
.content-list-info.data-v-7ffebbf4 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.cardname.data-v-7ffebbf4 {
|
||||
font-size: 31rpx;
|
||||
color: #161616;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.Genderimg.data-v-7ffebbf4 {
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
margin-left: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.age.data-v-7ffebbf4 {
|
||||
color: #ffffff;
|
||||
font-size: 14rpx;
|
||||
}
|
||||
.Gendermale.data-v-7ffebbf4 {
|
||||
background: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/maleimg.png) no-repeat center;
|
||||
width: 56.3rpx;
|
||||
height: 29.58rpx;
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.Genderfemale.data-v-7ffebbf4 {
|
||||
background: url(https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/femaleimg.png) no-repeat center;
|
||||
width: 56.3rpx;
|
||||
height: 29.58rpx;
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.RoomID.data-v-7ffebbf4 {
|
||||
font-size: 23rpx;
|
||||
color: #a3a3a3;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
.Charm.data-v-7ffebbf4 {
|
||||
font-size: 23rpx;
|
||||
color: #a3a3a3;
|
||||
line-height: 38rpx;
|
||||
margin-right: 12rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.charmValue.data-v-7ffebbf4 {
|
||||
font-size: 23rpx;
|
||||
color: #161616;
|
||||
line-height: 38rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.no-content.data-v-7ffebbf4{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 28rpx;
|
||||
color: #a3a3a3;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
Reference in New Issue
Block a user