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