126 lines
3.9 KiB
JavaScript
126 lines
3.9 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const components_request = require("../request.js");
|
|
const components_formatDate = require("../formatDate.js");
|
|
const common_assets = require("../../common/assets.js");
|
|
const _sfc_main = {
|
|
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) {
|
|
common_vendor.index.showLoading({
|
|
title: "加载中...",
|
|
mask: true
|
|
});
|
|
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:75", "id", item.id);
|
|
const res = await components_request.request({
|
|
url: "pk/pkInfoDetail",
|
|
method: "POST",
|
|
data: {
|
|
id: item.id
|
|
},
|
|
userInfo: true
|
|
});
|
|
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:84", "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 components/contentList/contentList.vue:89", "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
|
|
});
|
|
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:123", res);
|
|
if (res.code === 200) {
|
|
this.list.push(...res.data);
|
|
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:126", this.list);
|
|
}
|
|
},
|
|
onScrollToLower() {
|
|
this.page++;
|
|
this.pkList();
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _component_uni_card = common_vendor.resolveComponent("uni-card");
|
|
_component_uni_card();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: common_vendor.f($data.list, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: item.anchorIcon,
|
|
b: common_vendor.t(item.anchorId),
|
|
c: item.sex === "2"
|
|
}, item.sex === "2" ? {
|
|
d: common_assets._imports_0$2
|
|
} : {
|
|
e: common_assets._imports_1$1
|
|
}, {
|
|
f: common_vendor.t(item.sex === "1" ? "男" : "女"),
|
|
g: item.sex === "1" ? 1 : "",
|
|
h: item.sex === "2" ? 1 : "",
|
|
i: common_vendor.t($options.formatDate(item.pkTime)),
|
|
j: common_vendor.t(item.coin + "K"),
|
|
k: common_vendor.o$1(($event) => $options.goDetail(item)),
|
|
l: "4813d59a-0-" + i0
|
|
});
|
|
}),
|
|
b: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
|
|
c: common_vendor.o$1((...args) => $options.onScrollToLower && $options.onScrollToLower(...args))
|
|
};
|
|
}
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4813d59a"]]);
|
|
wx.createComponent(Component);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/contentList/contentList.js.map
|