优化页面
This commit is contained in:
@@ -3,120 +3,131 @@ const common_vendor = require("../../../common/vendor.js");
|
||||
const components_request = require("../../../components/request.js");
|
||||
const components_formatDate = require("../../../components/formatDate.js");
|
||||
const common_assets = require("../../../common/assets.js");
|
||||
const Recompose = () => "./recompose/recompose2.js";
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
return {
|
||||
pkList: [],
|
||||
userinfo: {},
|
||||
page: 0,
|
||||
//页码
|
||||
size: 10,
|
||||
//每页条数
|
||||
list: [],
|
||||
// 列表数据
|
||||
detailsdata: {}
|
||||
//详情数据
|
||||
createModule: null,
|
||||
parentMessage: null
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.userinfo = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:107", this.userinfo);
|
||||
this.getpkList();
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.pkList();
|
||||
this.createModule = this.$refs.createModule;
|
||||
},
|
||||
methods: {
|
||||
onRefresherRefresh() {
|
||||
this.page = 0;
|
||||
this.list = [];
|
||||
this.pkList();
|
||||
onBack() {
|
||||
common_vendor.index.navigateBack(
|
||||
{
|
||||
delta: 1
|
||||
}
|
||||
);
|
||||
},
|
||||
async goDetail(item) {
|
||||
common_vendor.index.showLoading({
|
||||
title: "加载中...",
|
||||
mask: true
|
||||
formatDate: components_formatDate.formatDate,
|
||||
getpkList() {
|
||||
components_request.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;
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:137", this.pkList);
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:139", res.msg);
|
||||
}
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:83", "id", item.id);
|
||||
const res = await components_request.request({
|
||||
url: "pk/pkInfoDetail",
|
||||
},
|
||||
onRecompose(item) {
|
||||
this.createModule.open();
|
||||
this.parentMessage = item;
|
||||
},
|
||||
onExpurgate(item) {
|
||||
components_request.request({
|
||||
url: "pk/deletePkDataWithId",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: item.id
|
||||
},
|
||||
userInfo: true
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:92", "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/Mine/minecomponents/pkInformation.vue:97", "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() {
|
||||
const res = await components_request.request({
|
||||
url: "pk/pkList",
|
||||
method: "POST",
|
||||
data: {
|
||||
status: 0,
|
||||
page: this.page,
|
||||
size: this.size
|
||||
},
|
||||
userInfo: false
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "删除成功",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
this.getpkList();
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:164", res.msg);
|
||||
}
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:131", res);
|
||||
if (res.code === 200) {
|
||||
this.list.push(...res.data);
|
||||
common_vendor.index.__f__("log", "at pages/Mine/minecomponents/pkInformation.vue:134", this.list);
|
||||
}
|
||||
},
|
||||
onScrollToLower() {
|
||||
this.page++;
|
||||
this.pkList();
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Recompose
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_uni_card = common_vendor.resolveComponent("uni-card");
|
||||
_component_uni_card();
|
||||
const _component_Recompose = common_vendor.resolveComponent("Recompose");
|
||||
(_component_uni_card + _component_Recompose)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f($data.list, (item, index, i0) => {
|
||||
a: common_assets._imports_0$1,
|
||||
b: common_assets._imports_1,
|
||||
c: common_vendor.o$1((...args) => $options.onBack && $options.onBack(...args)),
|
||||
d: common_vendor.f($data.pkList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.anchorIcon,
|
||||
b: common_vendor.t(item.anchorId),
|
||||
c: item.sex === "2"
|
||||
a: common_vendor.t(item.anchorId),
|
||||
b: item.sex === "2"
|
||||
}, item.sex === "2" ? {
|
||||
d: common_assets._imports_0$3
|
||||
c: common_assets._imports_0$2
|
||||
} : {
|
||||
e: common_assets._imports_1$1
|
||||
d: common_assets._imports_1$2
|
||||
}, {
|
||||
e: common_vendor.t(item.sex === "1" ? "男" : "女"),
|
||||
f: item.sex === "1" ? 1 : "",
|
||||
g: item.sex === "2" ? 1 : "",
|
||||
h: common_vendor.t($options.formatDate(item.pkTime)),
|
||||
i: common_vendor.t(item.coin + "K"),
|
||||
j: common_vendor.o$1(($event) => $options.goDetail(item)),
|
||||
k: "36b7ee78-0-" + i0
|
||||
h: common_vendor.t(item.country),
|
||||
i: common_vendor.t(item.coin),
|
||||
j: common_vendor.t($options.formatDate(item.pkTime)),
|
||||
k: item.status === 0
|
||||
}, item.status === 0 ? {
|
||||
l: common_assets._imports_5$1,
|
||||
m: common_vendor.o$1(($event) => $options.onRecompose(item), index),
|
||||
n: common_assets._imports_6,
|
||||
o: common_vendor.o$1(($event) => $options.onExpurgate(item), index)
|
||||
} : {}, {
|
||||
p: index,
|
||||
q: "36b7ee78-0-" + i0
|
||||
});
|
||||
}),
|
||||
b: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
|
||||
c: common_vendor.o$1((...args) => $options.onScrollToLower && $options.onScrollToLower(...args))
|
||||
e: common_assets._imports_4$1,
|
||||
f: common_vendor.o$1((...args) => _ctx.onRefresherRefresh && _ctx.onRefresherRefresh(...args)),
|
||||
g: common_vendor.o$1((...args) => _ctx.onScrollToLower && _ctx.onScrollToLower(...args)),
|
||||
h: common_vendor.sr("createModule", "36b7ee78-1"),
|
||||
i: common_vendor.p({
|
||||
message: $data.parentMessage
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-36b7ee78"]]);
|
||||
|
||||
Reference in New Issue
Block a user