168 lines
5.4 KiB
JavaScript
168 lines
5.4 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const components_request = require("../../components/request.js");
|
|
const components_formatDate = require("../../components/formatDate.js");
|
|
const components_TimeFormatting = require("../../components/TimeFormatting.js");
|
|
const tabBar = () => "../../components/tabBar/tabBar.js";
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
userinfo: {},
|
|
pkInformationdata: [],
|
|
myPkRecorddata: []
|
|
};
|
|
},
|
|
onShow() {
|
|
common_vendor.index.getStorage({
|
|
key: "userinfo",
|
|
success: (res) => {
|
|
this.userinfo = res.data;
|
|
common_vendor.index.__f__("log", "at pages/Mine/Mine.vue:136", this.userinfo);
|
|
this.getpkInformation();
|
|
this.getmyPkRecord();
|
|
}
|
|
});
|
|
},
|
|
methods: {
|
|
formatDate: components_formatDate.formatDate,
|
|
TimeFormatting: components_TimeFormatting.TimeFormatting,
|
|
//获取pk信息
|
|
getpkInformation() {
|
|
components_request.request({
|
|
url: "user/queryMyAllPkData",
|
|
method: "POST",
|
|
data: {
|
|
userId: this.userinfo.id,
|
|
page: 0,
|
|
size: 4
|
|
},
|
|
userInfo: true
|
|
}).then((res) => {
|
|
if (res.code == 200) {
|
|
this.pkInformationdata = res.data;
|
|
common_vendor.index.__f__("log", "at pages/Mine/Mine.vue:159", this.pkInformationdata);
|
|
} else {
|
|
common_vendor.index.__f__("log", "at pages/Mine/Mine.vue:161", res.msg);
|
|
}
|
|
});
|
|
},
|
|
//获取pk记录
|
|
getmyPkRecord() {
|
|
components_request.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;
|
|
common_vendor.index.__f__("log", "at pages/Mine/Mine.vue:180", this.myPkRecorddata);
|
|
} else {
|
|
common_vendor.index.__f__("log", "at pages/Mine/Mine.vue:182", res.msg);
|
|
}
|
|
});
|
|
},
|
|
// 跳转到PK信息页面
|
|
pkInformation() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/Mine/minecomponents/pkInformation"
|
|
});
|
|
},
|
|
// 跳转到PK记录页面
|
|
pkRecord() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/Mine/minecomponents/pkRecord"
|
|
});
|
|
},
|
|
// 跳转到联系客服页面
|
|
contact() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/Mine/minecomponents/contact"
|
|
});
|
|
},
|
|
// 跳转到设置页面
|
|
goSetting() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/Setting/Setting"
|
|
});
|
|
},
|
|
// 跳转到服务协议页面
|
|
serviceProtocol() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/Mine/minecomponents/serviceProtocol"
|
|
});
|
|
},
|
|
// 退出登录
|
|
logout() {
|
|
common_vendor.index.clearStorage();
|
|
common_vendor.A.logout();
|
|
common_vendor.index.reLaunch({
|
|
url: "/pages/login/login"
|
|
});
|
|
}
|
|
},
|
|
components: {
|
|
tabBar
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_tabBar2 = common_vendor.resolveComponent("tabBar");
|
|
_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: $data.userinfo.headerIcon,
|
|
b: common_vendor.t($data.userinfo.nickName),
|
|
c: common_vendor.o$1((...args) => $options.goSetting && $options.goSetting(...args)),
|
|
d: common_vendor.o$1((...args) => $options.pkInformation && $options.pkInformation(...args)),
|
|
e: $data.pkInformationdata.length !== 0
|
|
}, $data.pkInformationdata.length !== 0 ? {
|
|
f: common_vendor.f($data.pkInformationdata, (item, index, i0) => {
|
|
return {
|
|
a: item.anchorIcon,
|
|
b: common_vendor.t($options.formatDate(item.pkTime)),
|
|
c: common_vendor.t(item.coin),
|
|
d: index
|
|
};
|
|
})
|
|
} : {}, {
|
|
g: $data.pkInformationdata.length === 0
|
|
}, $data.pkInformationdata.length === 0 ? {} : {}, {
|
|
h: common_vendor.o$1((...args) => $options.pkRecord && $options.pkRecord(...args)),
|
|
i: $data.myPkRecorddata.length !== 0
|
|
}, $data.myPkRecorddata.length !== 0 ? {
|
|
j: common_vendor.f($data.myPkRecorddata, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: item.anchorIconA,
|
|
b: item.winnerAnchorId !== item.anchorIdA
|
|
}, item.winnerAnchorId !== item.anchorIdA ? {} : item.winnerAnchorId === item.anchorIdA ? {} : {}, {
|
|
c: item.winnerAnchorId === item.anchorIdA,
|
|
d: common_vendor.t(item.pkNumber),
|
|
e: common_vendor.t($options.TimeFormatting(item.pkTime)),
|
|
f: index
|
|
});
|
|
})
|
|
} : {}, {
|
|
k: $data.myPkRecorddata.length === 0
|
|
}, $data.myPkRecorddata.length === 0 ? {} : {}, {
|
|
l: common_vendor.o$1((...args) => $options.contact && $options.contact(...args)),
|
|
m: common_vendor.o$1((...args) => $options.serviceProtocol && $options.serviceProtocol(...args)),
|
|
n: common_vendor.o$1((...args) => $options.logout && $options.logout(...args)),
|
|
o: common_vendor.p({
|
|
tabIndex: 4
|
|
})
|
|
});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-402ad917"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Mine/Mine.js.map
|