myBill.js
4.34 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
"use strict";
const common_vendor = require("../../common/vendor.js");
const myCenter_center_api = require("../center_api.js");
require("../../common/request.js");
require("../../common/login.js");
require("../../config.js");
require("../../common/aes.js");
if (!Array) {
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
const _easycom_uni_tag2 = common_vendor.resolveComponent("uni-tag");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uni_segmented_control2 + _easycom_uni_tag2 + _easycom_uni_popup2)();
}
const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
const _easycom_uni_tag = () => "../../uni_modules/uni-tag/components/uni-tag/uni-tag.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uni_segmented_control + _easycom_uni_tag + _easycom_uni_popup)();
}
const _sfc_main = {
__name: "myBill",
setup(__props) {
const app = getApp();
const items = common_vendor.ref([
"培训",
"订单"
]);
const current = common_vendor.ref(1);
const bankShow = common_vendor.ref(null);
const bankInfo = common_vendor.ref({});
const list = common_vendor.ref([]);
common_vendor.onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
});
function init() {
myCenter_center_api.getMyOrder().then((res) => {
list.value = res.rows;
});
}
function onClickItem(e) {
console.log(e);
if (e.currentIndex == 0) {
common_vendor.index.navigateTo({
url: `/myCenter/mytrain/mytrain`
});
}
}
function goTrainDetail(id) {
common_vendor.index.navigateTo({
url: `/myCenter/mytrain/orderDetail?id=${id}`
});
}
function showFeeInfo(item) {
bankInfo.value = JSON.parse(item.receivingInfo);
bankShow.value.open();
}
function copyPlat() {
let str = `单位名称:${bankInfo.value.name};开户行:${bankInfo.value.bank};账户:${bankInfo.value.account};`;
common_vendor.index.setClipboardData({
data: str,
success: function() {
common_vendor.index.showToast({
title: "已复制",
icon: "none"
});
}
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(onClickItem),
b: common_vendor.p({
current: current.value,
styleType: "text",
values: items.value,
activeColor: "#AD181F"
}),
c: common_vendor.f(list.value, (n, k0, i0) => {
var _a;
return {
a: common_vendor.t(n.name),
b: common_vendor.f((_a = n.projectsStr) == null ? void 0 : _a.split(","), (p, k1, i1) => {
return {
a: p,
b: "d125aa21-1-" + i0 + "-" + i1,
c: common_vendor.p({
type: "warning",
inverted: true,
size: "small",
text: p
})
};
}),
c: common_vendor.t(n.signTimeRange),
d: common_vendor.t(n.trainTimeRange),
e: common_vendor.t(n.address),
f: common_vendor.o(($event) => showFeeInfo(n), n.id),
g: common_vendor.o(($event) => goTrainDetail(n.id), n.id),
h: n.id
};
}),
d: list.value.length == 0
}, list.value.length == 0 ? {} : {}, {
e: common_vendor.t(bankInfo.value.name),
f: common_vendor.t(bankInfo.value.bank),
g: common_vendor.t(bankInfo.value.account),
h: common_vendor.o(copyPlat),
i: common_vendor.o((...args) => _ctx.sure && _ctx.sure(...args)),
j: common_vendor.sr(bankShow, "d125aa21-2", {
"k": "bankShow"
}),
k: common_vendor.p({
type: "bottom",
["background-color"]: "#fff"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d125aa21"], ["__file", "/Users/yangyang/ztx_wx_minapp/myCenter/mytrain/myBill.vue"]]);
wx.createPage(MiniProgramPage);