hs-admin-ui 17.0.2 → 17.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/h5.mjs CHANGED
@@ -1,21 +1,25 @@
1
- import { bp as z, a3 as O, aA as G, bx as W, aY as X, ax as Z, ay as f, H as v, aU as J, aS as K, a as Q, E as N, I as ee } from "./vendor-BCnlL5Mb.js";
2
- import { defineComponent as B, shallowRef as ae, reactive as M, computed as A, watch as te, resolveComponent as le, resolveDirective as ne, withDirectives as oe, createElementBlock as T, openBlock as V, createElementVNode as p, createBlock as F, createCommentVNode as re, createVNode as n, unref as e, withCtx as d, createTextVNode as S, ref as x, onMounted as se, onUnmounted as de, toDisplayString as P, Fragment as ie, renderList as ue } from "vue";
3
- import { _ as H } from "./lodash-FlWkeY7g.js";
4
- import { Z as pe, _ as Y, $ as R, a0 as ce } from "./business-BHAErSNU.js";
5
- const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" }, fe = /* @__PURE__ */ B({
1
+ import { bp as ElUpload, a3 as ElButton, aA as ElIcon, bx as location_default, aY as ElScrollbar, ax as ElForm, ay as ElFormItem, H as ElInput, aU as ElRadioGroup, aS as ElRadio, a as ElMessageBox, E as ElMessage, I as ElLoading } from "./vendor-DgfWUdiw.js";
2
+ import { defineComponent, shallowRef, reactive, computed, watch, resolveComponent, resolveDirective, withDirectives, createElementBlock, openBlock, createElementVNode, createBlock, createCommentVNode, createVNode, unref, withCtx, createTextVNode, ref, onMounted, onUnmounted, toDisplayString, Fragment, renderList } from "vue";
3
+ import { _ } from "./lodash-D9wEYdiM.js";
4
+ import { Z as request, _ as _export_sfc, $ as request$1, a0 as getUrlParams } from "./business-BjiJZ1r_.js";
5
+ const _hoisted_1$1 = { class: "upload-wrapper" };
6
+ const _hoisted_2$1 = { class: "upload-wrapper-inner" };
7
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6
8
  __name: "Upload",
7
9
  props: {
8
10
  action: {
9
11
  type: String,
10
- required: !0
12
+ required: true
11
13
  },
12
14
  proxy: {
13
15
  type: String,
14
- required: !0
16
+ required: true
15
17
  },
16
18
  headers: {
17
19
  type: Object,
18
- default: () => ({})
20
+ default: () => {
21
+ return {};
22
+ }
19
23
  },
20
24
  limit: {
21
25
  type: Number,
@@ -23,73 +27,83 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
23
27
  }
24
28
  },
25
29
  emits: ["success"],
26
- setup(c, { emit: b }) {
27
- const m = c, L = b, I = ae(), o = M({
28
- loading: !1,
29
- preview: !1,
30
+ setup(__props, { emit: __emit }) {
31
+ const props = __props;
32
+ const emit = __emit;
33
+ const uploadRef = shallowRef();
34
+ const state = reactive({
35
+ loading: false,
36
+ preview: false,
30
37
  index: 0,
31
- headers: m.headers,
38
+ headers: props.headers,
32
39
  fileList: []
33
- }), g = A(() => o.fileList.map((u) => u.url));
34
- te(
35
- () => o.fileList.length,
36
- (u) => {
40
+ });
41
+ const fileList = computed(() => state.fileList.map((i) => i.url));
42
+ watch(
43
+ () => state.fileList.length,
44
+ (val) => {
37
45
  setTimeout(() => {
38
- const s = document.querySelector(".upload-wrapper .el-upload--picture-card");
39
- s && (s.style.display = u >= m.limit && u > 0 ? "none" : "inline-flex");
46
+ const el = document.querySelector(`.upload-wrapper .el-upload--picture-card`);
47
+ if (el) {
48
+ el.style.display = val >= props.limit && val > 0 ? "none" : "inline-flex";
49
+ }
40
50
  }, 100);
41
51
  },
42
52
  {
43
- immediate: !0
53
+ immediate: true
44
54
  }
45
55
  );
46
- async function w() {
47
- if (H.isEmpty(m.headers))
48
- return pe({
49
- url: `${window.location.origin}/${m.proxy}/pub_token/mobile_attach_push`
50
- }).then((u) => {
51
- o.headers = {
52
- Authorization: `Bearer ${u == null ? void 0 : u.access_token}`
53
- };
54
- });
56
+ async function beforeUpload() {
57
+ if (!_.isEmpty(props.headers)) return;
58
+ return request({
59
+ url: `${window.location.origin}/${props.proxy}/pub_token/mobile_attach_push`
60
+ }).then((res) => {
61
+ state.headers = {
62
+ Authorization: `Bearer ${res == null ? void 0 : res.access_token}`
63
+ };
64
+ });
55
65
  }
56
- function t(u) {
57
- o.index = o.fileList.findIndex((s) => s.url === u.url), o.preview = !0;
66
+ function onPreview(uploadFile) {
67
+ state.index = state.fileList.findIndex((i) => i.url === uploadFile.url);
68
+ state.preview = true;
58
69
  }
59
- async function i() {
60
- o.loading = !0, I.value.submit();
70
+ async function submitUpload() {
71
+ state.loading = true;
72
+ uploadRef.value.submit();
61
73
  }
62
- function U(u, s, C) {
63
- o.loading = !1, L("success", { result: u, file: s, files: C });
74
+ function onSuccess(result, file, files) {
75
+ state.loading = false;
76
+ emit("success", { result, file, files });
64
77
  }
65
- return (u, s) => {
66
- const C = le("el-image-viewer"), $ = ne("loading");
67
- return oe((V(), T("div", me, [
68
- p("div", ge, [
69
- n(e(z), {
78
+ return (_ctx, _cache) => {
79
+ const _component_el_image_viewer = resolveComponent("el-image-viewer");
80
+ const _directive_loading = resolveDirective("loading");
81
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$1, [
82
+ createElementVNode("div", _hoisted_2$1, [
83
+ createVNode(unref(ElUpload), {
70
84
  ref_key: "uploadRef",
71
- ref: I,
72
- "file-list": o.fileList,
73
- "onUpdate:fileList": s[0] || (s[0] = (E) => o.fileList = E),
85
+ ref: uploadRef,
86
+ "file-list": state.fileList,
87
+ "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => state.fileList = $event),
74
88
  "list-type": "picture-card",
75
89
  accept: "image/*",
76
90
  name: "file",
77
- action: c.action,
78
- headers: o.headers,
79
- limit: c.limit,
80
- "auto-upload": !1,
81
- "on-preview": t,
82
- "before-upload": w,
83
- "on-success": U
91
+ action: __props.action,
92
+ headers: state.headers,
93
+ limit: __props.limit,
94
+ "auto-upload": false,
95
+ "on-preview": onPreview,
96
+ "before-upload": beforeUpload,
97
+ "on-success": onSuccess
84
98
  }, {
85
- default: d(() => [...s[2] || (s[2] = [
86
- p("svg", {
99
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
100
+ createElementVNode("svg", {
87
101
  width: "34",
88
102
  height: "34",
89
103
  viewBox: "0 0 100 100",
90
104
  xmlns: "http://www.w3.org/2000/svg"
91
105
  }, [
92
- p("rect", {
106
+ createElementVNode("rect", {
93
107
  x: "45",
94
108
  y: "20",
95
109
  width: "10",
@@ -97,7 +111,7 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
97
111
  rx: "2",
98
112
  fill: "#1677ff"
99
113
  }),
100
- p("rect", {
114
+ createElementVNode("rect", {
101
115
  x: "20",
102
116
  y: "45",
103
117
  width: "60",
@@ -110,34 +124,37 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
110
124
  _: 1
111
125
  }, 8, ["file-list", "action", "headers", "limit"])
112
126
  ]),
113
- o.preview ? (V(), F(C, {
127
+ state.preview ? (openBlock(), createBlock(_component_el_image_viewer, {
114
128
  key: 0,
115
- "url-list": g.value,
129
+ "url-list": fileList.value,
116
130
  "show-progress": "",
117
- "initial-index": o.index,
118
- onClose: s[1] || (s[1] = (E) => o.preview = !1)
119
- }, null, 8, ["url-list", "initial-index"])) : re("", !0),
120
- n(e(O), {
131
+ "initial-index": state.index,
132
+ onClose: _cache[1] || (_cache[1] = ($event) => state.preview = false)
133
+ }, null, 8, ["url-list", "initial-index"])) : createCommentVNode("", true),
134
+ createVNode(unref(ElButton), {
121
135
  size: "large",
122
136
  type: "primary",
123
- onClick: i
137
+ onClick: submitUpload
124
138
  }, {
125
- default: d(() => [...s[3] || (s[3] = [
126
- S("上传", -1)
139
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
140
+ createTextVNode("上传", -1)
127
141
  ])]),
128
142
  _: 1
129
143
  })
130
144
  ])), [
131
- [$, o.loading]
145
+ [_directive_loading, state.loading]
132
146
  ]);
133
147
  };
134
148
  }
135
- }), he = /* @__PURE__ */ Y(fe, [["__scopeId", "data-v-e6f86e2e"]]), ve = [
149
+ });
150
+ const Upload = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-e6f86e2e"]]);
151
+ const GENDER_OPTIONS = [
136
152
  { label: "男", value: "男" },
137
153
  { label: "女", value: "女" }
138
- ], h = {
154
+ ];
155
+ const VALIDATION_RULES = {
139
156
  name: {
140
- required: !0,
157
+ required: true,
141
158
  message: "请输入姓名",
142
159
  trigger: "blur"
143
160
  },
@@ -148,7 +165,7 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
148
165
  trigger: "blur"
149
166
  },
150
167
  phone: {
151
- required: !0,
168
+ required: true,
152
169
  message: "请输入手机号",
153
170
  trigger: "blur"
154
171
  },
@@ -168,7 +185,7 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
168
185
  trigger: "blur"
169
186
  },
170
187
  captcha: {
171
- required: !0,
188
+ required: true,
172
189
  message: "请输入验证码",
173
190
  trigger: "blur"
174
191
  },
@@ -177,7 +194,8 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
177
194
  message: "验证码为6位",
178
195
  trigger: "blur"
179
196
  }
180
- }, y = {
197
+ };
198
+ const PLACEHOLDERS = {
181
199
  name: "请输入姓名",
182
200
  phone: "请输入手机号",
183
201
  idCard: "请输入身份证号",
@@ -185,27 +203,41 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
185
203
  address: "请输入地址",
186
204
  remark: "请输入备注",
187
205
  captcha: "请输入验证码"
188
- }, k = {
206
+ };
207
+ const FIELD_LIMITS = {
189
208
  phone: 11,
190
209
  idCard: 18,
191
210
  age: 3,
192
211
  captcha: 6
193
- }, ye = {
194
- name: [h.name, h.nameLength],
195
- phone: [h.phone, h.phonePattern],
196
- idCard: [h.idCardPattern],
197
- age: [h.agePattern],
198
- captcha: [h.captcha, h.captchaLength]
199
- }, _e = { class: "member-register-page" }, be = { class: "page-header" }, we = { class: "page-subtitle" }, Ce = { class: "form-container" }, xe = { class: "form-content" }, Ve = { class: "sms-code-wrapper" }, Ie = { class: "submit-area" }, Ee = /* @__PURE__ */ B({
212
+ };
213
+ const rules = {
214
+ name: [VALIDATION_RULES.name, VALIDATION_RULES.nameLength],
215
+ phone: [VALIDATION_RULES.phone, VALIDATION_RULES.phonePattern],
216
+ idCard: [VALIDATION_RULES.idCardPattern],
217
+ age: [VALIDATION_RULES.agePattern],
218
+ captcha: [VALIDATION_RULES.captcha, VALIDATION_RULES.captchaLength]
219
+ };
220
+ const _hoisted_1 = { class: "member-register-page" };
221
+ const _hoisted_2 = { class: "page-header" };
222
+ const _hoisted_3 = { class: "page-subtitle" };
223
+ const _hoisted_4 = { class: "form-container" };
224
+ const _hoisted_5 = { class: "form-content" };
225
+ const _hoisted_6 = { class: "sms-code-wrapper" };
226
+ const _hoisted_7 = { class: "submit-area" };
227
+ const _sfc_main = /* @__PURE__ */ defineComponent({
200
228
  __name: "MemberRegister",
201
229
  props: {
202
230
  proxy: {
203
231
  type: String,
204
- required: !1
232
+ required: false
205
233
  }
206
234
  },
207
- setup(c) {
208
- const { countdownText: b, isCountingDown: m, stopCountdown: L, sendSmsCode: I } = $(), o = x(), g = x(!1), w = c, t = M({
235
+ setup(__props) {
236
+ const { countdownText, isCountingDown, stopCountdown, sendSmsCode } = useSmsCode();
237
+ const formRef = ref();
238
+ const loading = ref(false);
239
+ const props = __props;
240
+ const form = reactive({
209
241
  name: "",
210
242
  gender: "男",
211
243
  phone: "",
@@ -214,314 +246,370 @@ const me = { class: "upload-wrapper" }, ge = { class: "upload-wrapper-inner" },
214
246
  address: "",
215
247
  remark: "",
216
248
  captcha: ""
217
- }), i = M({
249
+ });
250
+ const companyInfo = reactive({
218
251
  topCompanyId: "",
219
252
  companyId: "",
220
253
  companyName: "",
221
254
  defaultMemberType: "",
222
255
  discount: 0
223
- }), U = async () => {
224
- if (!o.value) return !1;
256
+ });
257
+ const validateForm = async () => {
258
+ if (!formRef.value) return false;
225
259
  try {
226
- return await o.value.validate();
260
+ return await formRef.value.validate();
227
261
  } catch {
228
- return !1;
262
+ return false;
229
263
  }
230
- }, u = async () => {
231
- if (!await U()) return;
232
- g.value = !0;
233
- const a = {
234
- vip_name: t.name,
235
- sex: t.gender,
236
- telephone: t.phone,
237
- identity_card: t.idCard,
238
- age: t.age,
239
- address: t.address,
240
- remark: t.remark,
241
- valid_code: t.captcha,
242
- vip_type: i.defaultMemberType,
243
- top_company_id: i.topCompanyId,
244
- company_id: i.companyId,
245
- discount: i.discount
264
+ };
265
+ const handleSubmit = async () => {
266
+ const isValid = await validateForm();
267
+ if (!isValid) return;
268
+ loading.value = true;
269
+ const data = {
270
+ vip_name: form.name,
271
+ sex: form.gender,
272
+ telephone: form.phone,
273
+ identity_card: form.idCard,
274
+ age: form.age,
275
+ address: form.address,
276
+ remark: form.remark,
277
+ valid_code: form.captcha,
278
+ vip_type: companyInfo.defaultMemberType,
279
+ top_company_id: companyInfo.topCompanyId,
280
+ company_id: companyInfo.companyId,
281
+ discount: companyInfo.discount
246
282
  };
247
283
  try {
248
- await R.post(`${w.proxy}/pub/add_vip_info`, a), Q.alert("注册成功!", "提示", {
249
- closeOnClickModal: !1,
284
+ await request$1.post(`${props.proxy}/pub/add_vip_info`, data);
285
+ ElMessageBox.alert("注册成功!", "提示", {
286
+ closeOnClickModal: false,
250
287
  // 禁止点击遮罩关闭
251
- closeOnPressEscape: !1,
288
+ closeOnPressEscape: false,
252
289
  // 禁止 ESC 关闭
253
- showClose: !1,
290
+ showClose: false,
254
291
  // 不显示右上角 ×
255
- showConfirmButton: !1
292
+ showConfirmButton: false
256
293
  // 不显示确认按钮
257
294
  });
258
- } catch {
295
+ } catch (error) {
259
296
  } finally {
260
- g.value = !1;
297
+ loading.value = false;
261
298
  }
262
- }, s = async () => {
299
+ };
300
+ const getVipPriceSet = async () => {
263
301
  try {
264
- return (await R.get(`${w.proxy}/pub/get_list_vip_price_set?top_company_id=${i.topCompanyId}`)).data;
265
- } catch {
266
- N.error("获取默认会员等级失败");
302
+ const response = await request$1.get(`${props.proxy}/pub/get_list_vip_price_set?top_company_id=${companyInfo.topCompanyId}`);
303
+ return response.data;
304
+ } catch (error) {
305
+ ElMessage.error("获取默认会员等级失败");
267
306
  }
268
- }, C = async () => {
269
- const r = ce();
270
- i.topCompanyId = r.top_company_id || "", i.companyId = r.company_id || "", i.companyName = r.company_name || "";
271
- const a = await s();
272
- i.defaultMemberType = (a == null ? void 0 : a.id) || "", i.discount = (a == null ? void 0 : a.discount) || 0;
273
307
  };
274
- function $() {
275
- const r = x(0), a = x(null), l = 60, _ = x(!1), D = A(() => r.value > 0 ? `${r.value}秒后重新发送` : "获取验证码"), j = () => {
276
- r.value = l, _.value = !0, a.value = setInterval(() => {
277
- r.value--, r.value <= 0 && q();
308
+ const dataLoad = async () => {
309
+ const urlParams = getUrlParams();
310
+ companyInfo.topCompanyId = urlParams["top_company_id"] || "";
311
+ companyInfo.companyId = urlParams["company_id"] || "";
312
+ companyInfo.companyName = urlParams["company_name"] || "";
313
+ const defaultMemberType = await getVipPriceSet();
314
+ companyInfo.defaultMemberType = (defaultMemberType == null ? void 0 : defaultMemberType.id) || "";
315
+ companyInfo.discount = (defaultMemberType == null ? void 0 : defaultMemberType.discount) || 0;
316
+ };
317
+ function useSmsCode() {
318
+ const countdown = ref(0);
319
+ const countdownTimer = ref(null);
320
+ const COUNTDOWN_SECONDS = 60;
321
+ const isCountingDown2 = ref(false);
322
+ const countdownText2 = computed(() => {
323
+ if (countdown.value > 0) {
324
+ return `${countdown.value}秒后重新发送`;
325
+ }
326
+ return "获取验证码";
327
+ });
328
+ const startCountdown = () => {
329
+ countdown.value = COUNTDOWN_SECONDS;
330
+ isCountingDown2.value = true;
331
+ countdownTimer.value = setInterval(() => {
332
+ countdown.value--;
333
+ if (countdown.value <= 0) {
334
+ stopCountdown2();
335
+ }
278
336
  }, 1e3);
279
- }, q = () => {
280
- a.value && (clearInterval(a.value), a.value = null), r.value = 0, _.value = !1;
281
337
  };
282
- return {
283
- countdownText: D,
284
- isCountingDown: _,
285
- stopCountdown: q,
286
- sendSmsCode: async () => {
287
- if (_.value || !o.value) return;
288
- if (!await o.value.validateField("phone")) {
289
- N.warning("请先输入正确的手机号");
290
- return;
291
- }
292
- g.value = !0;
293
- try {
294
- await R.post(`${w.proxy}/pub/send_sms_vip_valid_code`, {
295
- telephone: t.phone,
296
- top_company_id: i.topCompanyId,
297
- company_id: i.companyId
298
- }), N.success("验证码发送成功"), j();
299
- } catch {
300
- } finally {
301
- g.value = !1;
302
- }
338
+ const stopCountdown2 = () => {
339
+ if (countdownTimer.value) {
340
+ clearInterval(countdownTimer.value);
341
+ countdownTimer.value = null;
342
+ }
343
+ countdown.value = 0;
344
+ isCountingDown2.value = false;
345
+ };
346
+ const sendSmsCode2 = async () => {
347
+ if (isCountingDown2.value) {
348
+ return;
303
349
  }
350
+ if (!formRef.value) return;
351
+ const isValid = await formRef.value.validateField("phone");
352
+ if (!isValid) {
353
+ ElMessage.warning("请先输入正确的手机号");
354
+ return;
355
+ }
356
+ loading.value = true;
357
+ try {
358
+ await request$1.post(`${props.proxy}/pub/send_sms_vip_valid_code`, {
359
+ telephone: form.phone,
360
+ top_company_id: companyInfo.topCompanyId,
361
+ company_id: companyInfo.companyId
362
+ });
363
+ ElMessage.success("验证码发送成功");
364
+ startCountdown();
365
+ } catch (error) {
366
+ } finally {
367
+ loading.value = false;
368
+ }
369
+ };
370
+ return {
371
+ countdownText: countdownText2,
372
+ isCountingDown: isCountingDown2,
373
+ stopCountdown: stopCountdown2,
374
+ sendSmsCode: sendSmsCode2
304
375
  };
305
376
  }
306
- function E() {
307
- if (t.idCard.length === 18) {
308
- const r = t.idCard.substring(6, 14), a = parseInt(r.substring(0, 4)), l = parseInt(r.substring(4, 6)), _ = parseInt(r.substring(6, 8)), D = (/* @__PURE__ */ new Date()).getFullYear() - a - ((/* @__PURE__ */ new Date()).getMonth() + 1 < l || (/* @__PURE__ */ new Date()).getMonth() + 1 === l && (/* @__PURE__ */ new Date()).getDate() < _ ? 1 : 0);
309
- t.age = D.toString(), t.gender = Number(t.idCard.charAt(16)) % 2 === 0 ? "女" : "男";
377
+ function handleIdCardInputEnd() {
378
+ if (form.idCard.length === 18) {
379
+ const birthDate = form.idCard.substring(6, 14);
380
+ const birthYear = parseInt(birthDate.substring(0, 4));
381
+ const birthMonth = parseInt(birthDate.substring(4, 6));
382
+ const birthDay = parseInt(birthDate.substring(6, 8));
383
+ const age = (/* @__PURE__ */ new Date()).getFullYear() - birthYear - ((/* @__PURE__ */ new Date()).getMonth() + 1 < birthMonth || (/* @__PURE__ */ new Date()).getMonth() + 1 === birthMonth && (/* @__PURE__ */ new Date()).getDate() < birthDay ? 1 : 0);
384
+ form.age = age.toString();
385
+ form.gender = Number(form.idCard.charAt(16)) % 2 === 0 ? "女" : "男";
310
386
  }
311
387
  }
312
- return se(() => {
313
- C();
314
- }), de(() => {
315
- L();
316
- }), (r, a) => (V(), T("div", _e, [
317
- p("header", be, [
318
- a[8] || (a[8] = p("h1", { class: "page-title" }, "会员信息登记", -1)),
319
- p("p", we, [
320
- n(e(G), null, {
321
- default: d(() => [
322
- n(e(W))
323
- ]),
324
- _: 1
325
- }),
326
- p("span", null, P(i.companyName), 1)
327
- ])
328
- ]),
329
- p("main", Ce, [
330
- n(e(X), { class: "form-scroll" }, {
331
- default: d(() => [
332
- p("div", xe, [
333
- n(e(Z), {
334
- ref_key: "formRef",
335
- ref: o,
336
- model: t,
337
- rules: e(ye),
338
- "label-position": "left",
339
- "label-width": "70px",
340
- class: "member-form"
341
- }, {
342
- default: d(() => [
343
- n(e(f), {
344
- label: "姓名",
345
- prop: "name"
346
- }, {
347
- default: d(() => [
348
- n(e(v), {
349
- modelValue: t.name,
350
- "onUpdate:modelValue": a[0] || (a[0] = (l) => t.name = l),
351
- placeholder: e(y).name,
352
- clearable: ""
353
- }, null, 8, ["modelValue", "placeholder"])
354
- ]),
355
- _: 1
356
- }),
357
- n(e(f), {
358
- label: "手机号",
359
- prop: "phone"
360
- }, {
361
- default: d(() => [
362
- n(e(v), {
363
- modelValue: t.phone,
364
- "onUpdate:modelValue": a[1] || (a[1] = (l) => t.phone = l),
365
- type: "tel",
366
- placeholder: e(y).phone,
367
- maxlength: e(k).phone,
368
- clearable: ""
369
- }, null, 8, ["modelValue", "placeholder", "maxlength"])
370
- ]),
371
- _: 1
372
- }),
373
- n(e(f), {
374
- label: "身份证号",
375
- prop: "idCard"
376
- }, {
377
- default: d(() => [
378
- n(e(v), {
379
- modelValue: t.idCard,
380
- "onUpdate:modelValue": a[2] || (a[2] = (l) => t.idCard = l),
381
- onInput: E,
382
- placeholder: e(y).idCard,
383
- maxlength: e(k).idCard,
384
- clearable: ""
385
- }, null, 8, ["modelValue", "placeholder", "maxlength"])
386
- ]),
387
- _: 1
388
- }),
389
- n(e(f), {
390
- label: "性别",
391
- prop: "gender"
392
- }, {
393
- default: d(() => [
394
- n(e(J), {
395
- modelValue: t.gender,
396
- "onUpdate:modelValue": a[3] || (a[3] = (l) => t.gender = l),
397
- class: "gender-radio-group"
398
- }, {
399
- default: d(() => [
400
- (V(!0), T(ie, null, ue(e(ve), (l) => (V(), F(e(K), {
401
- key: l.value,
402
- value: l.value,
403
- border: ""
404
- }, {
405
- default: d(() => [
406
- S(P(l.label), 1)
407
- ]),
408
- _: 2
409
- }, 1032, ["value"]))), 128))
410
- ]),
411
- _: 1
412
- }, 8, ["modelValue"])
413
- ]),
414
- _: 1
415
- }),
416
- n(e(f), {
417
- label: "年龄",
418
- prop: "age"
419
- }, {
420
- default: d(() => [
421
- n(e(v), {
422
- type: "number",
423
- modelValue: t.age,
424
- "onUpdate:modelValue": a[4] || (a[4] = (l) => t.age = l),
425
- placeholder: e(y).age,
426
- maxlength: e(k).age,
427
- clearable: ""
428
- }, null, 8, ["modelValue", "placeholder", "maxlength"])
429
- ]),
430
- _: 1
431
- }),
432
- n(e(f), {
433
- label: "地址",
434
- prop: "address"
435
- }, {
436
- default: d(() => [
437
- n(e(v), {
438
- modelValue: t.address,
439
- "onUpdate:modelValue": a[5] || (a[5] = (l) => t.address = l),
440
- placeholder: e(y).address,
441
- clearable: ""
442
- }, null, 8, ["modelValue", "placeholder"])
443
- ]),
444
- _: 1
445
- }),
446
- n(e(f), {
447
- label: "备注",
448
- prop: "remark"
449
- }, {
450
- default: d(() => [
451
- n(e(v), {
452
- modelValue: t.remark,
453
- "onUpdate:modelValue": a[6] || (a[6] = (l) => t.remark = l),
454
- placeholder: e(y).remark,
455
- clearable: ""
456
- }, null, 8, ["modelValue", "placeholder"])
457
- ]),
458
- _: 1
459
- }),
460
- n(e(f), {
461
- label: "验证码",
462
- prop: "captcha"
463
- }, {
464
- default: d(() => [
465
- p("div", Ve, [
466
- n(e(v), {
467
- modelValue: t.captcha,
468
- "onUpdate:modelValue": a[7] || (a[7] = (l) => t.captcha = l),
469
- placeholder: e(y).captcha,
470
- maxlength: e(k).captcha,
471
- clearable: "",
472
- class: "sms-code-input"
473
- }, null, 8, ["modelValue", "placeholder", "maxlength"]),
474
- n(e(O), {
475
- type: "primary",
476
- disabled: e(m),
477
- loading: g.value,
478
- class: "sms-code-btn",
479
- onClick: e(I)
388
+ onMounted(() => {
389
+ dataLoad();
390
+ });
391
+ onUnmounted(() => {
392
+ stopCountdown();
393
+ });
394
+ return (_ctx, _cache) => {
395
+ return openBlock(), createElementBlock("div", _hoisted_1, [
396
+ createElementVNode("header", _hoisted_2, [
397
+ _cache[8] || (_cache[8] = createElementVNode("h1", { class: "page-title" }, "会员信息登记", -1)),
398
+ createElementVNode("p", _hoisted_3, [
399
+ createVNode(unref(ElIcon), null, {
400
+ default: withCtx(() => [
401
+ createVNode(unref(location_default))
402
+ ]),
403
+ _: 1
404
+ }),
405
+ createElementVNode("span", null, toDisplayString(companyInfo.companyName), 1)
406
+ ])
407
+ ]),
408
+ createElementVNode("main", _hoisted_4, [
409
+ createVNode(unref(ElScrollbar), { class: "form-scroll" }, {
410
+ default: withCtx(() => [
411
+ createElementVNode("div", _hoisted_5, [
412
+ createVNode(unref(ElForm), {
413
+ ref_key: "formRef",
414
+ ref: formRef,
415
+ model: form,
416
+ rules: unref(rules),
417
+ "label-position": "left",
418
+ "label-width": "70px",
419
+ class: "member-form"
420
+ }, {
421
+ default: withCtx(() => [
422
+ createVNode(unref(ElFormItem), {
423
+ label: "姓名",
424
+ prop: "name"
425
+ }, {
426
+ default: withCtx(() => [
427
+ createVNode(unref(ElInput), {
428
+ modelValue: form.name,
429
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.name = $event),
430
+ placeholder: unref(PLACEHOLDERS).name,
431
+ clearable: ""
432
+ }, null, 8, ["modelValue", "placeholder"])
433
+ ]),
434
+ _: 1
435
+ }),
436
+ createVNode(unref(ElFormItem), {
437
+ label: "手机号",
438
+ prop: "phone"
439
+ }, {
440
+ default: withCtx(() => [
441
+ createVNode(unref(ElInput), {
442
+ modelValue: form.phone,
443
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.phone = $event),
444
+ type: "tel",
445
+ placeholder: unref(PLACEHOLDERS).phone,
446
+ maxlength: unref(FIELD_LIMITS).phone,
447
+ clearable: ""
448
+ }, null, 8, ["modelValue", "placeholder", "maxlength"])
449
+ ]),
450
+ _: 1
451
+ }),
452
+ createVNode(unref(ElFormItem), {
453
+ label: "身份证号",
454
+ prop: "idCard"
455
+ }, {
456
+ default: withCtx(() => [
457
+ createVNode(unref(ElInput), {
458
+ modelValue: form.idCard,
459
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.idCard = $event),
460
+ onInput: handleIdCardInputEnd,
461
+ placeholder: unref(PLACEHOLDERS).idCard,
462
+ maxlength: unref(FIELD_LIMITS).idCard,
463
+ clearable: ""
464
+ }, null, 8, ["modelValue", "placeholder", "maxlength"])
465
+ ]),
466
+ _: 1
467
+ }),
468
+ createVNode(unref(ElFormItem), {
469
+ label: "性别",
470
+ prop: "gender"
471
+ }, {
472
+ default: withCtx(() => [
473
+ createVNode(unref(ElRadioGroup), {
474
+ modelValue: form.gender,
475
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.gender = $event),
476
+ class: "gender-radio-group"
480
477
  }, {
481
- default: d(() => [
482
- S(P(e(b)), 1)
478
+ default: withCtx(() => [
479
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(GENDER_OPTIONS), (option) => {
480
+ return openBlock(), createBlock(unref(ElRadio), {
481
+ key: option.value,
482
+ value: option.value,
483
+ border: ""
484
+ }, {
485
+ default: withCtx(() => [
486
+ createTextVNode(toDisplayString(option.label), 1)
487
+ ]),
488
+ _: 2
489
+ }, 1032, ["value"]);
490
+ }), 128))
483
491
  ]),
484
492
  _: 1
485
- }, 8, ["disabled", "loading", "onClick"])
486
- ])
487
- ]),
488
- _: 1
489
- })
490
- ]),
491
- _: 1
492
- }, 8, ["model", "rules"]),
493
- p("div", Ie, [
494
- n(e(O), {
495
- type: "primary",
496
- round: "",
497
- class: "submit-btn",
498
- loading: g.value,
499
- onClick: u
500
- }, {
501
- default: d(() => [...a[9] || (a[9] = [
502
- S(" 提交 ", -1)
503
- ])]),
493
+ }, 8, ["modelValue"])
494
+ ]),
495
+ _: 1
496
+ }),
497
+ createVNode(unref(ElFormItem), {
498
+ label: "年龄",
499
+ prop: "age"
500
+ }, {
501
+ default: withCtx(() => [
502
+ createVNode(unref(ElInput), {
503
+ type: "number",
504
+ modelValue: form.age,
505
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.age = $event),
506
+ placeholder: unref(PLACEHOLDERS).age,
507
+ maxlength: unref(FIELD_LIMITS).age,
508
+ clearable: ""
509
+ }, null, 8, ["modelValue", "placeholder", "maxlength"])
510
+ ]),
511
+ _: 1
512
+ }),
513
+ createVNode(unref(ElFormItem), {
514
+ label: "地址",
515
+ prop: "address"
516
+ }, {
517
+ default: withCtx(() => [
518
+ createVNode(unref(ElInput), {
519
+ modelValue: form.address,
520
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => form.address = $event),
521
+ placeholder: unref(PLACEHOLDERS).address,
522
+ clearable: ""
523
+ }, null, 8, ["modelValue", "placeholder"])
524
+ ]),
525
+ _: 1
526
+ }),
527
+ createVNode(unref(ElFormItem), {
528
+ label: "备注",
529
+ prop: "remark"
530
+ }, {
531
+ default: withCtx(() => [
532
+ createVNode(unref(ElInput), {
533
+ modelValue: form.remark,
534
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => form.remark = $event),
535
+ placeholder: unref(PLACEHOLDERS).remark,
536
+ clearable: ""
537
+ }, null, 8, ["modelValue", "placeholder"])
538
+ ]),
539
+ _: 1
540
+ }),
541
+ createVNode(unref(ElFormItem), {
542
+ label: "验证码",
543
+ prop: "captcha"
544
+ }, {
545
+ default: withCtx(() => [
546
+ createElementVNode("div", _hoisted_6, [
547
+ createVNode(unref(ElInput), {
548
+ modelValue: form.captcha,
549
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => form.captcha = $event),
550
+ placeholder: unref(PLACEHOLDERS).captcha,
551
+ maxlength: unref(FIELD_LIMITS).captcha,
552
+ clearable: "",
553
+ class: "sms-code-input"
554
+ }, null, 8, ["modelValue", "placeholder", "maxlength"]),
555
+ createVNode(unref(ElButton), {
556
+ type: "primary",
557
+ disabled: unref(isCountingDown),
558
+ loading: loading.value,
559
+ class: "sms-code-btn",
560
+ onClick: unref(sendSmsCode)
561
+ }, {
562
+ default: withCtx(() => [
563
+ createTextVNode(toDisplayString(unref(countdownText)), 1)
564
+ ]),
565
+ _: 1
566
+ }, 8, ["disabled", "loading", "onClick"])
567
+ ])
568
+ ]),
569
+ _: 1
570
+ })
571
+ ]),
504
572
  _: 1
505
- }, 8, ["loading"])
573
+ }, 8, ["model", "rules"]),
574
+ createElementVNode("div", _hoisted_7, [
575
+ createVNode(unref(ElButton), {
576
+ type: "primary",
577
+ round: "",
578
+ class: "submit-btn",
579
+ loading: loading.value,
580
+ onClick: handleSubmit
581
+ }, {
582
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [
583
+ createTextVNode(" 提交 ", -1)
584
+ ])]),
585
+ _: 1
586
+ }, 8, ["loading"])
587
+ ])
506
588
  ])
507
- ])
508
- ]),
509
- _: 1
510
- })
511
- ])
512
- ]));
589
+ ]),
590
+ _: 1
591
+ })
592
+ ])
593
+ ]);
594
+ };
513
595
  }
514
- }), ke = /* @__PURE__ */ Y(Ee, [["__scopeId", "data-v-992af5c2"]]), Se = {
515
- Upload: he,
516
- MemberRegister: ke
596
+ });
597
+ const MemberRegister = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-992af5c2"]]);
598
+ const H5Components = {
599
+ Upload,
600
+ MemberRegister
517
601
  };
518
- function Le(c) {
519
- for (const [b, m] of Object.entries(Se))
520
- c.component(`H${b}`, m);
602
+ function installBusiness(app) {
603
+ for (const [key, component] of Object.entries(H5Components)) {
604
+ app.component(`H${key}`, component);
605
+ }
521
606
  }
522
- function Me(c) {
523
- H.has(c, "_context.directives.loading") || c.directive("loading", ee.directive), c.use(Le);
607
+ function useHsAdminUi(app) {
608
+ if (!_.has(app, "_context.directives.loading")) {
609
+ app.directive("loading", ElLoading.directive);
610
+ }
611
+ app.use(installBusiness);
524
612
  }
525
613
  export {
526
- Me as useHsAdminUi
614
+ useHsAdminUi
527
615
  };