hs-admin-ui 17.0.2 → 17.0.3

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