societyMy.js
7.6 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const api_user = require("../../api/user.js");
const store_modules_tabbar = require("../../store/modules/tabbar.js");
const store_modules_user = require("../../store/modules/user.js");
if (!Array) {
const _easycom_up_navbar2 = common_vendor.resolveComponent("up-navbar");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_form_item2 = common_vendor.resolveComponent("up-form-item");
const _easycom_up_form2 = common_vendor.resolveComponent("up-form");
const _easycom_up_tabbar_item2 = common_vendor.resolveComponent("up-tabbar-item");
const _easycom_up_tabbar2 = common_vendor.resolveComponent("up-tabbar");
(_easycom_up_navbar2 + _easycom_up_input2 + _easycom_up_form_item2 + _easycom_up_form2 + _easycom_up_tabbar_item2 + _easycom_up_tabbar2)();
}
const _easycom_up_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_form_item = () => "../../uni_modules/uview-plus/components/u-form-item/u-form-item.js";
const _easycom_up_form = () => "../../uni_modules/uview-plus/components/u-form/u-form.js";
const _easycom_up_tabbar_item = () => "../../uni_modules/uview-plus/components/u-tabbar-item/u-tabbar-item.js";
const _easycom_up_tabbar = () => "../../uni_modules/uview-plus/components/u-tabbar/u-tabbar.js";
if (!Math) {
(_easycom_up_navbar + _easycom_up_input + _easycom_up_form_item + _easycom_up_form + _easycom_up_tabbar_item + _easycom_up_tabbar)();
}
const _sfc_main = {
__name: "societyMy",
setup(__props) {
const { userInfo, Logout, getUser } = store_modules_user.useUserStore();
const useTabbar = store_modules_tabbar.useTabbarStore();
common_vendor.ref(true);
const customStyle = {
height: "80rpx",
backgroundColor: "#F9F9F9",
paddingLeft: "40rpx"
};
const placeholderStyle = {
color: "#bbb",
fontSize: "28rpx"
};
const userFormRef = common_vendor.ref(null);
const rules = {
name: [
{ required: true, message: "请输入姓名", trigger: ["blur", "change"] },
{ min: 2, max: 6, message: "名字应在2到6个字", trigger: ["blur", "change"] },
{
validator: (rule, value, callback) => {
return common_vendor.index.$u.test.chinese(value);
},
message: "请输入中文",
// 触发器可以同时用blur和change
trigger: ["change", "blur"]
}
],
identificationNumber: [
{ required: true, message: "请输入身份证号", trigger: ["blur", "change"] },
{
validator: (rule, value, callback) => {
return common_vendor.index.$u.test.idCard(value);
},
message: "身份证号码不正确",
// 触发器可以同时用blur和change
trigger: ["change", "blur"]
}
],
phonenumber: [
{ required: true, message: "请输入手机号", trigger: ["blur", "change"] },
{
validator: (rule, value, callback) => {
return common_vendor.index.$u.test.mobile(value);
},
message: "手机号码不正确",
// 触发器可以同时用blur和change
trigger: ["change", "blur"]
}
]
};
common_vendor.onReady(() => {
userFormRef.value.setRules(rules);
});
const loginOut = () => {
common_vendor.index.showModal({
title: "提示",
content: "是否退出登录",
success: async (res) => {
if (res.confirm) {
await Logout();
common_vendor.index.$u.toast("退出成功");
common_vendor.index.redirectTo({
url: "/pages/login/login"
});
} else if (res.cancel) {
common_vendor.index.__f__("log", "at pages/societyMy/societyMy.vue:151", "用户点击取消");
}
}
});
};
const goOrder = (index) => {
common_vendor.index.navigateTo({
url: "/pages/societyOrder/societyOrder?type=" + index
});
};
const goRouter = (index) => {
useTabbar.societyCurrent = index;
common_vendor.index.redirectTo({
url: "/pages/societyHome/societyHome"
});
};
const changeStatus = async (status) => {
userInfo.jobStatus = status;
await api_user.updateUserInfo(userInfo);
await getUser();
common_vendor.index.$u.toast("更新成功");
};
return (_ctx, _cache) => {
return {
a: common_vendor.p({
placeholder: true,
leftIconSize: 0,
bgColor: "transparent"
}),
b: common_assets._imports_0$1,
c: common_vendor.o(($event) => common_vendor.unref(userInfo).nickName = $event),
d: common_vendor.p({
shape: "circle",
border: "none",
fontSize: "28rpx",
color: "#bbb",
placeholderStyle,
customStyle,
placeholder: "请输入真实姓名",
modelValue: common_vendor.unref(userInfo).nickName
}),
e: common_vendor.p({
prop: "name"
}),
f: common_assets._imports_1$1,
g: common_vendor.o(($event) => common_vendor.unref(userInfo).identificationNumber = $event),
h: common_vendor.p({
shape: "circle",
border: "none",
fontSize: "28rpx",
color: "#bbb",
placeholderStyle,
customStyle,
placeholder: "请输入身份证号",
modelValue: common_vendor.unref(userInfo).identificationNumber
}),
i: common_vendor.p({
prop: "identificationNumber"
}),
j: common_assets._imports_2,
k: common_vendor.o(($event) => common_vendor.unref(userInfo).phonenumber = $event),
l: common_vendor.p({
shape: "circle",
border: "none",
fontSize: "28rpx",
color: "#bbb",
placeholderStyle,
customStyle,
placeholder: "请输入手机号码",
modelValue: common_vendor.unref(userInfo).phonenumber
}),
m: common_vendor.p({
prop: "phonenumber"
}),
n: common_vendor.sr(userFormRef, "5648f2a8-1", {
"k": "userFormRef"
}),
o: common_vendor.p({
model: common_vendor.unref(userInfo)
}),
p: common_vendor.unref(userInfo).jobStatus === "0" ? 1 : "",
q: common_vendor.o(($event) => changeStatus("0")),
r: common_vendor.unref(userInfo).jobStatus === "1" ? 1 : "",
s: common_vendor.o(($event) => changeStatus("1")),
t: common_vendor.o(($event) => goOrder(0)),
v: common_vendor.o(($event) => goOrder(1)),
w: common_vendor.o(($event) => goOrder(2)),
x: common_vendor.o(($event) => goOrder(4)),
y: common_vendor.o(($event) => goOrder(3)),
z: common_vendor.o(loginOut),
A: common_vendor.o(goRouter),
B: common_vendor.p({
text: "主页",
icon: "home",
badge: common_vendor.unref(useTabbar).societyTotal
}),
C: common_vendor.p({
text: "我的",
icon: "account"
}),
D: common_vendor.p({
value: common_vendor.unref(useTabbar).societyCurrent,
activeColor: "#3680FE",
inactiveColor: "#707070"
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5648f2a8"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/societyMy/societyMy.js.map