mytrain.js
1.86 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
"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");
_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: "mytrain",
setup(__props) {
const app = getApp();
const items = common_vendor.ref([
"培训",
"订单"
]);
const current = common_vendor.ref(0);
const list = common_vendor.ref([]);
common_vendor.onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
});
function init() {
myCenter_center_api.getMyTrain().then((res) => {
list.value = res.rows;
});
}
function onClickItem(e) {
console.log(e);
if (e.currentIndex == 1) {
common_vendor.index.navigateTo({
url: `/myCenter/mytrain/myBill`
});
}
}
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: list.value.length == 0
}, list.value.length == 0 ? {} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/yangyang/ztx_wx_minapp/myCenter/mytrain/mytrain.vue"]]);
wx.createPage(MiniProgramPage);