mycenter.js
3.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
"use strict";
const common_vendor = require("../../common/vendor.js");
require("../../common/api.js");
const common_match = require("../../common/match.js");
require("../../common/login.js");
require("../../common/request.js");
require("../../config.js");
if (!Array) {
const _easycom_uni_list_item2 = common_vendor.resolveComponent("uni-list-item");
const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list");
(_easycom_uni_list_item2 + _easycom_uni_list2)();
}
const _easycom_uni_list_item = () => "../../uni_modules/uni-list/components/uni-list-item/uni-list-item.js";
const _easycom_uni_list = () => "../../uni_modules/uni-list/components/uni-list/uni-list.js";
if (!Math) {
(_easycom_uni_list_item + _easycom_uni_list)();
}
const _sfc_main = {
__name: "mycenter",
setup(__props) {
common_vendor.ref("/static/v1.png");
common_vendor.ref({});
common_vendor.ref({});
const user = common_vendor.ref({});
common_vendor.ref("");
const avatarUrl = common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref(null);
common_vendor.ref(false);
common_vendor.ref(true);
const app = getApp();
common_vendor.ref(false);
common_vendor.onShow(() => {
if (app.globalData.isLogin) {
init();
} else {
app.firstLoadCallback = () => {
init();
};
}
});
function init() {
const currUser = common_vendor.index.getStorageSync("currUser");
user.value = currUser;
avatarUrl.value = user.value.avatar;
}
function onChooseavatar(e) {
common_match.uploadFile(e).then((data) => {
avatarUrl.value = data.data;
common_match.updateAvatar({ avatarUrl: avatarUrl.value }).then((res) => {
common_vendor.index.showToast({
title: "头像保存成功",
icon: "none",
duration: 2e3
});
common_vendor.index.setStorageSync("currUser", res.data);
});
});
}
function goBills() {
let path = "/pages_hotel/hotel/myBills";
common_vendor.index.navigateTo({
url: path
});
}
function goMyInvoiceBill() {
let path = "/pages_hotel/hotel/myInvoice";
common_vendor.index.navigateTo({
url: path
});
}
function goAboutUs() {
let path = "/pages_hotel/hotel/aboutUs";
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
return {
a: avatarUrl.value,
b: common_vendor.o(onChooseavatar),
c: common_vendor.t(user.value.nickName),
d: common_vendor.o(goBills),
e: common_vendor.p({
border: false,
title: "我的订单",
showArrow: true,
clickable: "true"
}),
f: common_vendor.o(goMyInvoiceBill),
g: common_vendor.p({
border: false,
title: "我的发票",
showArrow: true,
clickable: "true"
}),
h: common_vendor.o(goAboutUs),
i: common_vendor.p({
border: false,
title: "关于赛事助手",
showArrow: true,
clickable: "true"
}),
j: common_vendor.p({
border: false
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fa9c8f88"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/mycenter.vue"]]);
wx.createPage(MiniProgramPage);