index-8c9a6d7f.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. import {
  2. D as _,
  3. d as I,
  4. U as R,
  5. x as E,
  6. y as V,
  7. a as u,
  8. A as l,
  9. F as g,
  10. C as s,
  11. V as B,
  12. E as C
  13. } from './index-20bdb712.js';
  14. import { A as P } from './index-064e7df8.js';
  15. import { F as W } from './index-61a6f012.js';
  16. import { C as f } from './index-6930c802.js';
  17. import { F as o } from './index-7f161d6e.js';
  18. import './index-e6baae88.js';
  19. import './index-a4ff0f6f.js';
  20. const S = '_container_1484w_1',
  21. x = '_titleIcon_1484w_9',
  22. L = '_title_1484w_9',
  23. T = '_tagWrap_1484w_24',
  24. q = '_tag_1484w_24',
  25. M = '_contentWrap_1484w_45',
  26. N = '_content_1484w_45',
  27. Y = '_icon_1484w_56',
  28. k = '_group_1484w_62',
  29. z = '_radio_1484w_77',
  30. G = '_tips_1484w_88',
  31. $ = '_submit_1484w_98',
  32. J = '_submitIcon_1484w_108',
  33. O = '_successWrap_1484w_113',
  34. X = '_p1_1484w_120',
  35. j = '_p2_1484w_125',
  36. H = '_btnWrap_1484w_130',
  37. Q = '_btnTitle_1484w_141',
  38. K = '_btnDes_1484w_150',
  39. Z = '_btn_1484w_130',
  40. t = {
  41. container: S,
  42. titleIcon: x,
  43. title: L,
  44. tagWrap: T,
  45. tag: q,
  46. contentWrap: M,
  47. content: N,
  48. icon: Y,
  49. group: k,
  50. radio: z,
  51. tips: G,
  52. submit: $,
  53. submitIcon: J,
  54. successWrap: O,
  55. p1: X,
  56. p2: j,
  57. btnWrap: H,
  58. btnTitle: Q,
  59. btnDes: K,
  60. btn: Z
  61. },
  62. ee = '' + new URL('icon_school-246e55f8.png', import.meta.url).href,
  63. ue = '' + new URL('icon_person-e885956c.png', import.meta.url).href,
  64. ae = '' + new URL('icon_submit-1b1e3ed1.png', import.meta.url).href,
  65. te = '' + new URL('logo-f2c1f146.png', import.meta.url).href,
  66. ne = '' + new URL('icon_p1-49eb8f11.png', import.meta.url).href,
  67. oe = '' + new URL('icon_p2-ecea3fa8.png', import.meta.url).href,
  68. le = () => _.get('/edu-app/open/sysArea/queryAllProvince'),
  69. se = r => _.post('/edu-app/open/school/add', { data: r }),
  70. re = r => _.post('/edu-app/open/sendSms', { data: r, requestType: 'form' }),
  71. be = I({
  72. name: 'SchoolRegister',
  73. setup() {
  74. const r = R(),
  75. d = {
  76. nature: [
  77. { label: '公立', value: 'PUBLIC' },
  78. { label: '私立', value: 'PRIVATE' }
  79. ],
  80. types: [
  81. { label: '小学', value: 'PRIMARY' },
  82. { label: '初中', value: 'JUNIOR' },
  83. { label: '小初一体', value: 'PRIMARY_JUNIOR' }
  84. ],
  85. grades: [
  86. { label: '六年制', value: 'SIX_YEAR_SYSTEM' },
  87. { label: '五年制', value: 'FIVE_YEAR_SYSTEM' }
  88. ],
  89. genaral: [
  90. { label: '男', value: '1' },
  91. { label: '女', value: '0' }
  92. ]
  93. },
  94. a = E({
  95. name: '',
  96. regionCode: '',
  97. cityCode: '',
  98. provinceCode: '',
  99. schoolNature: 'PUBLIC',
  100. schoolType: 'PRIMARY',
  101. gradeYear: 'SIX_YEAR_SYSTEM',
  102. emergencyContact: '',
  103. emergencyContactPhone: '',
  104. educationalAdministrationUsername: '',
  105. educationalAdministrationPhone: '',
  106. genaral: '1',
  107. code: '',
  108. buyGoods: !0,
  109. tenantId: r.query.id || '',
  110. sourceForm: 'TEACHER'
  111. }),
  112. n = E({
  113. cityName: '',
  114. showArea: !1,
  115. success: !1,
  116. areaList: {},
  117. sendMsg: '发送验证码'
  118. }),
  119. v = e => {
  120. const p = {},
  121. b = {},
  122. h = {};
  123. return (
  124. e.forEach(c => {
  125. p[c.code] = c.name;
  126. }),
  127. e.forEach(c => {
  128. var i;
  129. (i = c.areas) == null ||
  130. i.forEach(m => {
  131. b[m.code] = m.name;
  132. });
  133. }),
  134. e.forEach(c => {
  135. var i;
  136. (i = c.areas) == null ||
  137. i.forEach(m => {
  138. var F;
  139. (F = m.areas) == null ||
  140. F.forEach(A => {
  141. h[A.code] = A.name;
  142. });
  143. });
  144. }),
  145. { province_list: p, city_list: b, county_list: h }
  146. );
  147. },
  148. y = () => {
  149. le().then(e => {
  150. (e == null ? void 0 : e.code) === 200 &&
  151. ((n.areaList = v(e.data)),
  152. console.log('🚀 ~ data.areaList:', n.areaList));
  153. });
  154. };
  155. V(() => {
  156. y();
  157. });
  158. const w = async () => {
  159. try {
  160. await re({
  161. clientId: 'cooleshow-student',
  162. type: 'REGISTER',
  163. mobile: a.educationalAdministrationPhone
  164. }),
  165. D(),
  166. C('验证码已发送');
  167. } catch (e) {
  168. n.sendMsg = '重新发送';
  169. }
  170. },
  171. D = () => {
  172. n.sendMsg = '30s';
  173. let e = 30;
  174. setInterval(() => {
  175. e--,
  176. (n.sendMsg = `${e}s后重新发送`),
  177. e <= 0 && (n.sendMsg = '重新发送');
  178. }, 1e3);
  179. },
  180. U = async () => {
  181. const e = await se({ ...a });
  182. (e == null ? void 0 : e.code) === 200 &&
  183. (C('提交成功'), (n.success = !0));
  184. };
  185. return () =>
  186. u('div', { class: t.container }, [
  187. u('img', { class: t.titleIcon, src: te }, null),
  188. u('div', { class: t.title }, [r.query.name]),
  189. u('div', { class: t.tagWrap }, [
  190. u('div', { class: t.tag }, [
  191. u('span', null, [l('·')]),
  192. l(' 音乐数字课堂学校登记 '),
  193. u('span', null, [l('·')])
  194. ])
  195. ]),
  196. u('div', { class: t.contentWrap }, [
  197. u('div', { class: t.content }, [
  198. u(
  199. W,
  200. { onSubmit: () => U() },
  201. {
  202. default: () => [
  203. u(
  204. f,
  205. { class: t.group },
  206. {
  207. default: () => [
  208. u('img', { src: ee, class: t.icon }, null),
  209. u(
  210. o,
  211. {
  212. border: !0,
  213. name: 'name',
  214. label: '学校全称',
  215. rows: '1',
  216. autosize: !0,
  217. type: 'textarea',
  218. placeholder: '请输入学校全称',
  219. inputAlign: 'right',
  220. modelValue: a.name,
  221. 'onUpdate:modelValue': e => (a.name = e),
  222. rules: [
  223. { required: !0, message: '请输入学校全称' }
  224. ]
  225. },
  226. null
  227. ),
  228. u(
  229. o,
  230. {
  231. isLink: !0,
  232. border: !0,
  233. label: '所属城市',
  234. placeholder: '请选择',
  235. readonly: !0,
  236. inputAlign: 'right',
  237. modelValue: n.cityName,
  238. 'onUpdate:modelValue': e => (n.cityName = e),
  239. onClick: () => (n.showArea = !0),
  240. rules: [{ required: !0, message: '请选择' }]
  241. },
  242. null
  243. ),
  244. u(
  245. o,
  246. {
  247. center: !0,
  248. border: !0,
  249. name: 'schoolNature',
  250. label: '办学性质'
  251. },
  252. {
  253. input: () =>
  254. u(g, null, [
  255. d.nature.map(e =>
  256. u(
  257. s,
  258. {
  259. class: t.radio,
  260. size: 'small',
  261. color:
  262. e.value === a.schoolNature
  263. ? '#198CFE'
  264. : '',
  265. onClick: () =>
  266. (a.schoolNature = e.value)
  267. },
  268. { default: () => [e.label] }
  269. )
  270. )
  271. ])
  272. }
  273. ),
  274. u(
  275. o,
  276. {
  277. center: !0,
  278. border: !0,
  279. label: '学校类型',
  280. labelWidth: '70px'
  281. },
  282. {
  283. input: () =>
  284. u(g, null, [
  285. d.types.map(e =>
  286. u(
  287. s,
  288. {
  289. class: t.radio,
  290. size: 'small',
  291. color:
  292. e.value === a.schoolType
  293. ? '#198CFE'
  294. : '',
  295. onClick: () => (a.schoolType = e.value)
  296. },
  297. { default: () => [e.label] }
  298. )
  299. )
  300. ])
  301. }
  302. ),
  303. u(
  304. o,
  305. { center: !0, border: !0, label: '学年制' },
  306. {
  307. input: () =>
  308. u(g, null, [
  309. d.grades.map(e =>
  310. u(
  311. s,
  312. {
  313. class: t.radio,
  314. size: 'small',
  315. color:
  316. e.value === a.gradeYear
  317. ? '#198CFE'
  318. : '',
  319. onClick: () => (a.gradeYear = e.value)
  320. },
  321. { default: () => [e.label] }
  322. )
  323. )
  324. ])
  325. }
  326. )
  327. ]
  328. }
  329. ),
  330. u(
  331. f,
  332. { class: t.group },
  333. {
  334. default: () => [
  335. u('img', { src: ue, class: t.icon }, null),
  336. u(
  337. o,
  338. {
  339. border: !0,
  340. name: 'emergencyContact',
  341. label: '校长姓名',
  342. placeholder: '请输入校长姓名',
  343. inputAlign: 'right',
  344. maxlength: 6,
  345. modelValue: a.emergencyContact,
  346. 'onUpdate:modelValue': e =>
  347. (a.emergencyContact = e),
  348. rules: [
  349. { required: !0, message: '请输入校长姓名' }
  350. ]
  351. },
  352. null
  353. ),
  354. u(
  355. o,
  356. {
  357. border: !0,
  358. name: 'emergencyContactPhone',
  359. label: '校长联系方式',
  360. maxlength: 11,
  361. placeholder: '请输入校长手机号码',
  362. inputAlign: 'right',
  363. modelValue: a.emergencyContactPhone,
  364. 'onUpdate:modelValue': e =>
  365. (a.emergencyContactPhone = e),
  366. rules: [
  367. { required: !0, message: '请输入校长手机号码' },
  368. {
  369. pattern: /^1[3456789]\d{9}$/,
  370. message: '请输入正确的手机号码'
  371. }
  372. ]
  373. },
  374. null
  375. ),
  376. u(
  377. o,
  378. {
  379. border: !0,
  380. name: 'educationalAdministrationUsername',
  381. label: '负责人姓名',
  382. placeholder: '请输入负责人姓名',
  383. inputAlign: 'right',
  384. maxlength: 6,
  385. modelValue: a.educationalAdministrationUsername,
  386. 'onUpdate:modelValue': e =>
  387. (a.educationalAdministrationUsername = e),
  388. rules: [
  389. { required: !0, message: '请输入负责人姓名' }
  390. ]
  391. },
  392. null
  393. ),
  394. u(
  395. o,
  396. {
  397. border: !0,
  398. name: 'educationalAdministrationPhone',
  399. label: '负责人联系方式',
  400. labelWidth: '40%',
  401. inputAlign: 'right',
  402. placeholder: '请输入负责人手机号码',
  403. maxlength: 11,
  404. modelValue: a.educationalAdministrationPhone,
  405. 'onUpdate:modelValue': e =>
  406. (a.educationalAdministrationPhone = e),
  407. rules: [
  408. {
  409. required: !0,
  410. message: '请输入负责人手机号码'
  411. },
  412. {
  413. pattern: /^1[3456789]\d{9}$/,
  414. message: '请输入正确的手机号码'
  415. }
  416. ]
  417. },
  418. null
  419. ),
  420. u(
  421. o,
  422. { center: !0, border: !0, label: '性别' },
  423. {
  424. input: () =>
  425. u(g, null, [
  426. d.genaral.map(e =>
  427. u(
  428. s,
  429. {
  430. class: t.radio,
  431. size: 'small',
  432. color:
  433. e.value === a.genaral
  434. ? '#198CFE'
  435. : '',
  436. onClick: () => (a.genaral = e.value)
  437. },
  438. { default: () => [e.label] }
  439. )
  440. )
  441. ])
  442. }
  443. ),
  444. u(
  445. o,
  446. {
  447. border: !0,
  448. center: !0,
  449. name: 'code',
  450. label: '验证码',
  451. placeholder: '请输入验证码',
  452. modelValue: a.code,
  453. 'onUpdate:modelValue': e => (a.code = e),
  454. maxlength: 6,
  455. rules: [{ required: !0, message: '请输入验证码' }]
  456. },
  457. {
  458. button: () =>
  459. u(
  460. s,
  461. {
  462. size: 'small',
  463. type: 'primary',
  464. color: '#198CFE',
  465. onClick: () => w()
  466. },
  467. { default: () => [n.sendMsg] }
  468. )
  469. }
  470. ),
  471. u('div', { style: { padding: '10px 16px' } }, [
  472. u('div', { class: t.tips }, [
  473. l(
  474. '负责人即为该学校酷乐秀音乐数字课堂老师端管理员,手机号即为酷乐秀音乐数字课堂老师端账号,默认密码为:ktyq+手机号后四位'
  475. )
  476. ])
  477. ])
  478. ]
  479. }
  480. ),
  481. u(
  482. s,
  483. {
  484. class: t.submit,
  485. round: !0,
  486. block: !0,
  487. 'native-type': 'submit'
  488. },
  489. {
  490. default: () => [
  491. u('img', { class: t.submitIcon, src: ae }, null)
  492. ]
  493. }
  494. )
  495. ]
  496. }
  497. ),
  498. u(
  499. B,
  500. {
  501. show: n.showArea,
  502. 'onUpdate:show': e => (n.showArea = e),
  503. position: 'bottom'
  504. },
  505. {
  506. default: () => [
  507. u(
  508. P,
  509. {
  510. areaList: n.areaList,
  511. onCancel: () => (n.showArea = !1),
  512. onConfirm: ({ selectedOptions: e }) => {
  513. (a.provinceCode = e[0].value),
  514. (a.cityCode = e[1].value),
  515. (a.regionCode = e[2].value),
  516. (n.cityName = e.map(p => p.text).join('-')),
  517. (n.showArea = !1);
  518. }
  519. },
  520. null
  521. )
  522. ]
  523. }
  524. ),
  525. u(
  526. B,
  527. {
  528. class: 'popup-custom van-scale',
  529. transition: 'van-scale',
  530. closeOnClickOverlay: !1,
  531. show: n.success,
  532. 'onUpdate:show': e => (n.success = e)
  533. },
  534. {
  535. default: () => [
  536. u('div', { class: t.successWrap }, [
  537. u('img', { class: t.p1, src: ne }, null),
  538. u('img', { class: t.p2, src: oe }, null),
  539. u('div', { class: t.btnWrap }, [
  540. u('div', { class: t.btnTitle }, [l('您已成功登记')]),
  541. u('div', { class: t.btnDes }, [
  542. l('欢迎您使用酷乐秀音乐数字课堂~')
  543. ]),
  544. u(
  545. s,
  546. { class: t.btn, type: 'primary', round: !0 },
  547. { default: () => [l('我知道了')] }
  548. )
  549. ])
  550. ])
  551. ]
  552. }
  553. )
  554. ])
  555. ])
  556. ]);
  557. }
  558. });
  559. export { be as default };