bills.js
4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_api = require("../../common/api.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
if (!Array) {
const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
_easycom_uni_load_more2();
}
const _easycom_uni_load_more = () => "../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
if (!Math) {
_easycom_uni_load_more();
}
const _sfc_main = {
__name: "bills",
setup(__props) {
const billsList = common_vendor.ref([]);
common_vendor.ref(null);
const isLoadMore = common_vendor.ref(false);
const loadStatus = common_vendor.ref("loading");
const contentText = common_vendor.ref({
contentdown: "点击查看更多",
contentrefresh: "正在加载...",
contentnomore: "没有更多数据了"
});
const queryparam = common_vendor.ref({
pageNum: 1,
pageSize: 10
});
common_vendor.onShow(() => {
billsList.value = [];
getBills();
});
function clickLoadMore() {
if (loadStatus.value == "nomore") {
return;
}
queryparam.value.pageNum += 1;
getBills();
}
function getBills() {
isLoadMore.value = false;
common_api.getMalist(queryparam.value).then((res) => {
common_vendor._.each(res.rows, (r) => {
billsList.value.push(r);
});
if (res.total < queryparam.value.pageSize * queryparam.value.pageNum) {
isLoadMore.value = true;
loadStatus.value = "nomore";
} else {
isLoadMore.value = true;
loadStatus.value = "more";
}
});
}
function goBooking(b) {
let path = `/pages/index/booking?id=${b.id}`;
common_vendor.index.navigateTo({
url: path
});
}
function showDetail(b) {
let path = `/pages/usercenter/billsDetail?id=${b.id}`;
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(billsList.value, (b, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(b.orderCode),
b: b.verificationCode
}, b.verificationCode ? {
c: common_vendor.t(b.verificationCode)
} : {}, {
d: b.siteName
}, b.siteName ? {
e: common_vendor.t(b.projectName || b.sonList[0].projectName),
f: common_vendor.t(b.siteName)
} : {}, {
g: b.orderDate
}, b.orderDate ? {
h: common_vendor.t(b.orderDate),
i: common_vendor.t(b.orderTimePeriod.replace(/,/, "-"))
} : {}, {
j: b.payStatus == 1
}, b.payStatus == 1 ? {
k: common_vendor.t(b.payStatusStr)
} : {
l: common_vendor.t(b.payStatusStr)
}, {
m: b.payStatus == 0 && b.parentType == 2
}, b.payStatus == 0 && b.parentType == 2 ? {} : {}, {
n: b.payStatus == 0
}, b.payStatus == 0 ? {
o: common_vendor.t(b.orderAmount)
} : {}, {
p: b.payStatus > 0
}, b.payStatus > 0 ? {
q: common_vendor.t(b.finalOrderAmount)
} : {}, {
r: b.payStatus == 2 || b.payStatus == 3
}, b.payStatus == 2 || b.payStatus == 3 ? {
s: common_vendor.t(b.refundAmount)
} : {}, {
t: b.payStatusStr == "未支付" && b.parentType != 2
}, b.payStatusStr == "未支付" && b.parentType != 2 ? {
v: common_vendor.o(($event) => goBooking(b), b.id)
} : {}, {
w: common_vendor.o(($event) => showDetail(b), b.id),
x: b.id
});
}),
b: common_vendor.p({
status: loadStatus.value,
["content-text"]: contentText.value
}),
c: isLoadMore.value,
d: common_vendor.o(clickLoadMore),
e: billsList.value.length == 0
}, billsList.value.length == 0 ? {} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c100b881"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages/usercenter/bills.vue"]]);
wx.createPage(MiniProgramPage);