mycard.js
5.45 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
"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_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
_easycom_uni_segmented_control2();
}
const _easycom_uni_segmented_control = () => "../../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
if (!Math) {
_easycom_uni_segmented_control();
}
const _sfc_main = {
__name: "mycard",
setup(__props) {
const vTypeImg = common_vendor.ref("/static/v1.png");
const items = common_vendor.ref(["消费记录", "充值记录"]);
const current = common_vendor.ref(0);
const card = common_vendor.ref({});
const list1 = common_vendor.ref([]);
const list2 = common_vendor.ref([]);
common_vendor.index.getStorageSync("currUser");
common_vendor.onLoad(() => {
common_api.getOwnMemberInfo().then((res) => {
card.value = res.data;
getxfList();
});
});
common_vendor.onPullDownRefresh(() => {
common_api.getOwnMemberInfo().then((res) => {
card.value = res.data;
getxfList();
});
});
function onClickItem(e) {
console.log(e);
if (e.currentIndex === 0) {
getxfList();
} else if (e.currentIndex === 1) {
getxzList();
}
if (current.value !== e.currentIndex) {
current.value = e.currentIndex;
}
}
function getxfList() {
if (card.value.isVip) {
common_api.xfList({
memberId: card.value.info.id
}).then((res) => {
list1.value = res.rows;
});
}
}
function getxzList() {
if (card.value.isVip) {
common_api.czList({
memberId: card.value.info.id
}).then((res) => {
list2.value = res.rows;
});
}
}
function goRenew() {
let path = "/pages/usercenter/mycard/renew";
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: card.value.isVip
}, card.value.isVip ? {
b: vTypeImg.value,
c: common_vendor.t(card.value.info.cardTypeStr),
d: common_vendor.t(card.value.info.cardCode),
e: common_vendor.t(card.value.info.balance),
f: common_vendor.t((100 - card.value.info.discountPercent) / 10),
g: common_vendor.t(card.value.info.expirationTime),
h: common_vendor.o(goRenew)
} : {}, {
i: common_vendor.o(onClickItem),
j: common_vendor.p({
current: current.value,
values: items.value,
["style-type"]: "text",
["active-color"]: "#16C682"
}),
k: current.value === 0
}, current.value === 0 ? common_vendor.e({
l: common_vendor.f(list1.value, (item, index, i0) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
return common_vendor.e({
a: common_vendor.t(item.dataId),
b: common_vendor.t(item.consumeTypeStr),
c: (_a = item.siteOrder) == null ? void 0 : _a.payTime
}, ((_b = item.siteOrder) == null ? void 0 : _b.payTime) ? {
d: common_vendor.t(item.siteOrder.payTime)
} : ((_c = item.cptSignOrder) == null ? void 0 : _c.payTime) ? {
f: common_vendor.t((_d = item.cptSignOrder) == null ? void 0 : _d.payTime)
} : {
g: common_vendor.t(item.orderTime)
}, {
e: (_e = item.cptSignOrder) == null ? void 0 : _e.payTime,
h: (_f = item.siteOrder) == null ? void 0 : _f.verificationCode
}, ((_g = item.siteOrder) == null ? void 0 : _g.verificationCode) ? {
i: common_vendor.t(item.siteOrder.verificationCode)
} : {}, {
j: item.siteOrder
}, item.siteOrder ? {
k: common_vendor.t(item.siteOrder.siteName)
} : {}, {
l: common_vendor.t(item.dataValue),
m: (_h = item.siteOrder) == null ? void 0 : _h.refundAmount
}, ((_i = item.siteOrder) == null ? void 0 : _i.refundAmount) ? {
n: common_vendor.t(item.siteOrder.refundAmount)
} : {}, {
o: ((_j = item.cptSignOrder) == null ? void 0 : _j.payStatus) == "5"
}, ((_k = item.cptSignOrder) == null ? void 0 : _k.payStatus) == "5" ? {
p: common_vendor.t(item.cptSignOrder.organizerRefundAmount)
} : {}, {
q: index
});
}),
m: list1.value.length == 0
}, list1.value.length == 0 ? {} : {}) : {}, {
n: current.value === 1
}, current.value === 1 ? common_vendor.e({
o: common_vendor.f(list2.value, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.orderCode),
b: item.payTime
}, item.payTime ? {
c: common_vendor.t(item.payTime)
} : {}, {
d: common_vendor.t(item.payTypeStr),
e: common_vendor.t(item.orderValue),
f: index
});
}),
p: list2.value.length == 0
}, list2.value.length == 0 ? {} : {}) : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-408578a3"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages/usercenter/mycard/mycard.vue"]]);
wx.createPage(MiniProgramPage);