myInvoice.js
4.16 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
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const common_hotel = require("../../common/hotel.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.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: "myInvoice",
setup(__props) {
const app = getApp();
const list = common_vendor.ref([]);
common_vendor.ref(null);
const isLoadMore = common_vendor.ref(false);
common_vendor.ref(true);
const loadStatus = common_vendor.ref("loading");
const contentText = common_vendor.ref({
contentdown: "点击查看更多",
contentrefresh: "正在加载...",
contentnomore: "没有更多数据了"
});
const queryparam = common_vendor.ref({
pageNum: 1,
pageSize: 10
});
const currUser = common_vendor.index.getStorageSync("currUser");
common_vendor.onShow(() => {
list.value = [];
getList();
});
common_vendor.onLoad((option) => {
});
function clickLoadMore() {
if (loadStatus.value == "nomore") {
return;
}
queryparam.value.pageNum += 1;
getList();
}
function getList() {
console.log("currUser", currUser);
isLoadMore.value = false;
const venueId = app.globalData.venue.id;
common_hotel.getInvoiceByUserId(currUser.userId, venueId).then((res) => {
common_vendor._.each(res.rows, (r) => {
list.value.push(r);
});
if (res.total < 10) {
isLoadMore.value = false;
} else if (res.total < queryparam.value.pageSize * queryparam.value.pageNum) {
isLoadMore.value = true;
loadStatus.value = "nomore";
} else {
isLoadMore.value = true;
loadStatus.value = "more";
}
});
}
function showDetail(b) {
let path = `/pages_hotel/hotel/invoiceDetail?invoiceId=${b.id}`;
common_vendor.index.navigateTo({
url: path
});
}
function editDetail(b) {
common_hotel.getActivityDetail(b.activeId).then((res) => {
let path = `/pages_hotel/hotel/addInvoice?invoiceId=${b.id}&isEdit=true&kpType=${res.data.kpType}`;
common_vendor.index.navigateTo({
url: path
});
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(list.value, (b, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(b.createTime),
b: b.invoiceForm == "1"
}, b.invoiceForm == "1" ? {} : {}, {
c: b.invoiceForm == "2"
}, b.invoiceForm == "2" ? {} : {}, {
d: b.invoiceForm == "3"
}, b.invoiceForm == "3" ? {} : {}, {
e: common_vendor.t(b.total),
f: b.isInvoice == "1"
}, b.isInvoice == "1" ? {} : {}, {
g: b.isInvoice == "0"
}, b.isInvoice == "0" ? {} : {}, {
h: b.isInvoice == "3"
}, b.isInvoice == "3" ? {} : {}, {
i: b.isInvoice == "2"
}, b.isInvoice == "2" ? {} : {}, {
j: b.isInvoice == "0"
}, b.isInvoice == "0" ? {
k: common_vendor.o(($event) => editDetail(b), b.id)
} : {}, {
l: common_vendor.o(($event) => showDetail(b), b.id),
m: b.id
});
}),
b: common_vendor.p({
status: loadStatus.value,
["content-text"]: contentText.value
}),
c: isLoadMore.value,
d: common_vendor.o(clickLoadMore),
e: list.value.length == 0
}, list.value.length == 0 ? {
f: common_assets._imports_0$4
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4c905687"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/myInvoice.vue"]]);
wx.createPage(MiniProgramPage);