index-8c1bf190.js 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  1. import {
  2. ac as E,
  3. c as X,
  4. b as W,
  5. m as Z,
  6. t as z,
  7. d as w,
  8. ad as K,
  9. e as N,
  10. w as $,
  11. X as j,
  12. a as e,
  13. k as Q,
  14. D as C,
  15. E as _,
  16. V as b,
  17. A as i,
  18. L as ee,
  19. r as U,
  20. x,
  21. C as B,
  22. z as te,
  23. N as k,
  24. y as M,
  25. R as oe,
  26. F as q,
  27. U as se,
  28. q as ae,
  29. P as S,
  30. I as G,
  31. Q as ne
  32. } from './index-0b3380a9.js';
  33. import { M as ue } from './index-919c5bf7.js';
  34. import { M as le } from './index-c2e562a2.js';
  35. import { F as ie, O as de } from './index-1cec3df4.js';
  36. import {
  37. R,
  38. C as I,
  39. u as Y,
  40. S as re
  41. } from './student-register-store-f0e25580.js';
  42. import { F } from './index-451fefb3.js';
  43. import { I as P } from './index-02bb440b.js';
  44. import { P as V } from './index-3d730154.js';
  45. import { O as ce } from './index-211c0d06.js';
  46. import { C as L } from './index-a7cda64a.js';
  47. import { C as T } from './index-e2c278c3.js';
  48. import { T as O } from './index-f87aeb09.js';
  49. import './plyr-a24de5e8.js';
  50. import './Checker-a18684d0.js';
  51. function pe(t, n) {
  52. const { days: r } = n;
  53. let { hours: a, minutes: u, seconds: d, milliseconds: f } = n;
  54. if (
  55. (t.includes('DD') ? (t = t.replace('DD', E(r))) : (a += r * 24),
  56. t.includes('HH') ? (t = t.replace('HH', E(a))) : (u += a * 60),
  57. t.includes('mm') ? (t = t.replace('mm', E(u))) : (d += u * 60),
  58. t.includes('ss') ? (t = t.replace('ss', E(d))) : (f += d * 1e3),
  59. t.includes('S'))
  60. ) {
  61. const h = E(f, 3);
  62. t.includes('SSS')
  63. ? (t = t.replace('SSS', h))
  64. : t.includes('SS')
  65. ? (t = t.replace('SS', h.slice(0, 2)))
  66. : (t = t.replace('S', h.charAt(0)));
  67. }
  68. return t;
  69. }
  70. const [me, ge] = X('count-down'),
  71. fe = {
  72. time: W(0),
  73. format: Z('HH:mm:ss'),
  74. autoStart: z,
  75. millisecond: Boolean
  76. };
  77. var he = w({
  78. name: me,
  79. props: fe,
  80. emits: ['change', 'finish'],
  81. setup(t, { emit: n, slots: r }) {
  82. const {
  83. start: a,
  84. pause: u,
  85. reset: d,
  86. current: f
  87. } = K({
  88. time: +t.time,
  89. millisecond: t.millisecond,
  90. onChange: o => n('change', o),
  91. onFinish: () => n('finish')
  92. }),
  93. h = N(() => pe(t.format, f.value)),
  94. y = () => {
  95. d(+t.time), t.autoStart && a();
  96. };
  97. return (
  98. $(() => t.time, y, { immediate: !0 }),
  99. j({ start: a, pause: u, reset: y }),
  100. () =>
  101. e('div', { role: 'timer', class: ge() }, [
  102. r.default ? r.default(f.value) : h.value
  103. ])
  104. );
  105. }
  106. });
  107. const _e = Q(he),
  108. Ce = '_studentSection_3dvma_7',
  109. ye = '_goodsSection_3dvma_25',
  110. Se = '_titleTool_3dvma_36',
  111. ve = '_titleBuy_3dvma_45',
  112. Ae = '_goodsCell_3dvma_52',
  113. Fe = '_noSelected_3dvma_57',
  114. be = '_selected_3dvma_58',
  115. Ee = '_img_3dvma_78',
  116. Te = '_brandName_3dvma_91',
  117. we = '_model_3dvma_101',
  118. De = '_sbtnGroup_3dvma_111',
  119. Be = '_btnDetail_3dvma_123',
  120. Ie = '_btnVideo_3dvma_124',
  121. xe = '_priceCell_3dvma_164',
  122. Pe = '_sPriceGroup_3dvma_167',
  123. Ne = '_tg_3dvma_175',
  124. ke = '_giftCell_3dvma_198',
  125. Ge = '_gift_3dvma_198',
  126. Re = '_iconGift_3dvma_216',
  127. Ve = '_goodsEmpty_3dvma_221',
  128. Le = '_shopImg_3dvma_230',
  129. Oe = '_goodsContainer_3dvma_234',
  130. Ue = '_tips_3dvma_242',
  131. Me = '_goSelect_3dvma_247',
  132. qe = '_addButton_3dvma_266',
  133. Ye = '_paymentContainer_3dvma_285',
  134. He = '_needPrice_3dvma_295',
  135. Je = '_allPrice_3dvma_308',
  136. Xe = '_videoPopup_3dvma_327',
  137. s = {
  138. 'student-register': '_student-register_3dvma_1',
  139. studentSection: Ce,
  140. goodsSection: ye,
  141. titleTool: Se,
  142. titleBuy: ve,
  143. goodsCell: Ae,
  144. noSelected: Fe,
  145. selected: be,
  146. delete: '_delete_3dvma_59',
  147. img: Ee,
  148. brandName: Te,
  149. model: we,
  150. sbtnGroup: De,
  151. btnDetail: Be,
  152. btnVideo: Ie,
  153. priceCell: xe,
  154. sPriceGroup: Pe,
  155. tg: Ne,
  156. giftCell: ke,
  157. gift: Ge,
  158. iconGift: Re,
  159. goodsEmpty: Ve,
  160. shopImg: Le,
  161. goodsContainer: Oe,
  162. tips: Ue,
  163. goSelect: Me,
  164. addButton: qe,
  165. paymentContainer: Ye,
  166. needPrice: He,
  167. allPrice: Je,
  168. videoPopup: Xe
  169. },
  170. We =
  171. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=',
  172. Ze = '' + new URL('shop-empty-6c02d334.png', import.meta.url).href,
  173. ze = '_registerModal_ra8en_1',
  174. Ke = '_infoTitle_ra8en_7',
  175. $e = '_registerForm_ra8en_13',
  176. je = '_tips_ra8en_20',
  177. Qe = '_codeText_ra8en_40',
  178. et = '_submitBtn_ra8en_45',
  179. v = {
  180. registerModal: ze,
  181. infoTitle: Ke,
  182. registerForm: $e,
  183. tips: je,
  184. codeText: Qe,
  185. submitBtn: et
  186. },
  187. tt = '' + new URL('info-title-1f45c1de.png', import.meta.url).href,
  188. ot = '_imgCode_mq980_1',
  189. st = '_codeTitle_mq980_4',
  190. at = '_img_mq980_1',
  191. nt = '_imgChange_mq980_16',
  192. ut = '_field_mq980_23',
  193. lt = '_imgCodePopup_mq980_27',
  194. A = {
  195. imgCode: ot,
  196. codeTitle: st,
  197. img: at,
  198. imgChange: nt,
  199. field: ut,
  200. imgCodePopup: lt
  201. },
  202. it = w({
  203. name: 'o-img-code',
  204. props: {
  205. value: Boolean,
  206. phone: [String, Number],
  207. type: { type: String, default: 'LOGIN' }
  208. },
  209. emits: ['close', 'sendCode'],
  210. data() {
  211. return {
  212. isSuffix: '/edu-app',
  213. showStatus: !1,
  214. identifyingCode: null,
  215. code: ''
  216. };
  217. },
  218. mounted() {
  219. (this.showStatus = this.value), this.sendImgCode();
  220. },
  221. watch: {
  222. value(t) {
  223. this.showStatus = t;
  224. },
  225. code(t) {
  226. t.length >= 4 && this.checkVerifyLoginImage();
  227. }
  228. },
  229. methods: {
  230. async sendImgCode() {
  231. const { data: t } = await C.get(this.isSuffix + '/open/sendImgCode', {
  232. requestType: 'form',
  233. hideLoading: !0,
  234. params: { phone: this.phone }
  235. });
  236. this.identifyingCode = t;
  237. },
  238. async updateIdentifyingCode() {
  239. this.sendImgCode();
  240. },
  241. async checkVerifyLoginImage() {
  242. try {
  243. if (this.code.length < 4) return;
  244. await C.post('/edu-app/open/verifyImgCode', {
  245. requestType: 'form',
  246. hideLoading: !0,
  247. data: { phone: this.phone, code: this.code }
  248. }),
  249. await C.post('/edu-app/open/sendSms', {
  250. requestType: 'form',
  251. hideLoading: !0,
  252. data: {
  253. clientId: 'cooleshow-student',
  254. type: 'REGISTER',
  255. mobile: this.phone
  256. }
  257. }),
  258. setTimeout(() => {
  259. _('验证码已发送');
  260. }, 100),
  261. this.$emit('close'),
  262. this.$emit('sendCode');
  263. } catch (t) {
  264. (this.code = ''), this.updateIdentifyingCode();
  265. }
  266. }
  267. },
  268. render() {
  269. return e(
  270. b,
  271. {
  272. show: this.showStatus,
  273. class: A.imgCodePopup,
  274. closeOnClickOverlay: !1,
  275. onClose: () => {
  276. this.$emit('close');
  277. },
  278. closeable: !0,
  279. closeIcon: 'close'
  280. },
  281. {
  282. default: () => [
  283. e('div', { class: A.imgCode }, [
  284. e('p', { class: A.codeTitle }, [i('输入图形验证码')]),
  285. e(R, null, {
  286. default: () => [
  287. e(
  288. I,
  289. { span: '14' },
  290. {
  291. default: () => [
  292. e(
  293. F,
  294. {
  295. placeholder: '请输入验证码',
  296. modelValue: this.code,
  297. 'onUpdate:modelValue': t => (this.code = t),
  298. class: A.field,
  299. autocomplete: 'off'
  300. },
  301. null
  302. )
  303. ]
  304. }
  305. ),
  306. e(
  307. I,
  308. { span: '10', class: A.img },
  309. {
  310. default: () => [
  311. e(
  312. P,
  313. {
  314. src: this.identifyingCode,
  315. onClick: () => this.updateIdentifyingCode()
  316. },
  317. {
  318. loading: () =>
  319. e(ee, { type: 'spinner', size: '20' }, null)
  320. }
  321. )
  322. ]
  323. }
  324. )
  325. ]
  326. }),
  327. e(
  328. R,
  329. { style: { display: 'flex', justifyContent: 'end' } },
  330. {
  331. default: () => [
  332. e(
  333. I,
  334. { span: '10' },
  335. {
  336. default: () => [
  337. e(
  338. 'span',
  339. {
  340. class: A.imgChange,
  341. onClick: () => this.updateIdentifyingCode()
  342. },
  343. [i('看不清?换一换')]
  344. )
  345. ]
  346. }
  347. )
  348. ]
  349. }
  350. )
  351. ])
  352. ]
  353. }
  354. );
  355. }
  356. }),
  357. dt = Y(),
  358. H = [];
  359. for (let t = 1; t <= 40; t++) H.push({ text: t + '班', value: t });
  360. const rt = w({
  361. name: 'register-modal',
  362. props: {
  363. schoolId: { type: String, default: '' },
  364. gradeYear: { type: String, default: '' },
  365. schoolType: { type: String, default: '' }
  366. },
  367. emits: ['close', 'submit'],
  368. setup(t, { emit: n }) {
  369. const r = U(),
  370. a = N(() => {
  371. let l = [];
  372. const p = [
  373. { text: '一年级', value: 1 },
  374. { text: '二年级', value: 2 },
  375. { text: '三年级', value: 3 },
  376. { text: '四年级', value: 4 },
  377. { text: '五年级', value: 5 }
  378. ],
  379. c = [{ text: '六年级', value: 6 }],
  380. g = [
  381. { text: '七年级', value: 7 },
  382. { text: '八年级', value: 8 },
  383. { text: '九年级', value: 9 }
  384. ];
  385. return (
  386. t.gradeYear === 'FIVE_YEAR_SYSTEM'
  387. ? l.push([...p])
  388. : t.gradeYear === 'SIX_YEAR_SYSTEM'
  389. ? l.push([...p, ...c])
  390. : t.gradeYear === 'THREE_YEAR_SYSTEM'
  391. ? l.push([...g])
  392. : t.gradeYear === 'FORE_YEAR_SYSTEM'
  393. ? l.push([...c, ...g])
  394. : l.push([...p, ...c, ...g]),
  395. console.log(l, t.schoolType, t.gradeYear),
  396. l
  397. );
  398. }),
  399. u = x({
  400. countDownStatus: !0,
  401. countDownTime: 1e3 * 120,
  402. modelValue: !1,
  403. imgCodeStatus: !1,
  404. gradeNumText: '',
  405. currentClassText: '',
  406. gradeStatus: !1,
  407. classStatus: !1,
  408. loading: !1
  409. }),
  410. d = x({
  411. autoRegister: !0,
  412. client_id: 'cooleshow-student',
  413. client_secret: 'cooleshow-student',
  414. extra: { nickname: '', currentGradeNum: '', currentClass: '' },
  415. grant_type: 'password',
  416. loginType: 'SMS',
  417. password: '',
  418. username: ''
  419. }),
  420. f = () => {
  421. (u.countDownStatus = !1),
  422. te(() => {
  423. r.value.start();
  424. });
  425. },
  426. h = () => {
  427. if (!k(d.username)) return _('请输入正确的手机号码');
  428. u.imgCodeStatus = !0;
  429. },
  430. y = () => {
  431. (u.countDownStatus = !0), r.value.reset();
  432. },
  433. o = async () => {
  434. try {
  435. if (m()) return;
  436. u.loading = !0;
  437. const { extra: l, ...p } = d,
  438. { data: c } = await C.post('/edu-app/userlogin', {
  439. hideLoading: !1,
  440. requestType: 'form',
  441. data: {
  442. ...p,
  443. extra: JSON.stringify({ ...l, schoolId: t.schoolId })
  444. }
  445. });
  446. dt.setToken(c.token_type + ' ' + c.access_token),
  447. n('close'),
  448. n('submit');
  449. } catch (l) {
  450. } finally {
  451. u.loading = !1;
  452. }
  453. },
  454. m = () => {
  455. if (k(d.username))
  456. if (d.password)
  457. if (d.extra.nickname)
  458. if (d.extra.currentGradeNum) {
  459. if (!d.password) return _('请选择所在班级'), !0;
  460. } else return _('请选择所在年级'), !0;
  461. else return _('请输入学生姓名'), !0;
  462. else return _('请输入验证码'), !0;
  463. else return _('请输入正确的手机号码'), !0;
  464. return !1;
  465. };
  466. return () =>
  467. e('div', { class: v.registerModal }, [
  468. e('img', { src: tt, class: v.infoTitle }, null),
  469. e(
  470. ie,
  471. { labelAlign: 'top', class: v.registerForm },
  472. {
  473. default: () => [
  474. e(
  475. F,
  476. {
  477. clearable: !0,
  478. label: '联系方式(直接监护人)',
  479. placeholder: '请输入手机号码',
  480. type: 'tel',
  481. autocomplete: 'off',
  482. modelValue: d.username,
  483. 'onUpdate:modelValue': l => (d.username = l),
  484. maxlength: 11
  485. },
  486. {
  487. label: () =>
  488. e('div', null, [
  489. i('联系方式(直接监护人)'),
  490. e('p', { class: v.tips }, [
  491. i('手机号是数字化器乐课堂的唯一登录账户')
  492. ])
  493. ])
  494. }
  495. ),
  496. e(
  497. F,
  498. {
  499. center: !0,
  500. clearable: !0,
  501. label: '验证码',
  502. placeholder: '请输入验证码',
  503. autocomplete: 'off',
  504. type: 'number',
  505. modelValue: d.password,
  506. 'onUpdate:modelValue': l => (d.password = l),
  507. maxlength: 6
  508. },
  509. {
  510. button: () =>
  511. u.countDownStatus
  512. ? e('span', { class: v.codeText, onClick: h }, [
  513. i('获取验证码')
  514. ])
  515. : e(
  516. _e,
  517. {
  518. ref: l => (r.value = l),
  519. 'auto-start': !1,
  520. time: u.countDownTime,
  521. onFinish: y,
  522. format: 'ss秒'
  523. },
  524. null
  525. )
  526. }
  527. ),
  528. e(
  529. F,
  530. {
  531. clearable: !0,
  532. label: '学生姓名',
  533. placeholder: '请输入学生姓名',
  534. autocomplete: 'off',
  535. modelValue: d.extra.nickname,
  536. 'onUpdate:modelValue': l => (d.extra.nickname = l)
  537. },
  538. null
  539. ),
  540. e(
  541. F,
  542. {
  543. clearable: !0,
  544. label: '所在年级',
  545. placeholder: '请选择年级',
  546. isLink: !0,
  547. readonly: !0,
  548. clickable: !1,
  549. modelValue: u.gradeNumText,
  550. onClick: () => (u.gradeStatus = !0)
  551. },
  552. null
  553. ),
  554. e(
  555. F,
  556. {
  557. clearable: !0,
  558. label: '所在班级',
  559. placeholder: '请选择班级',
  560. isLink: !0,
  561. readonly: !0,
  562. clickable: !1,
  563. modelValue: u.currentClassText,
  564. onClick: () => (u.classStatus = !0)
  565. },
  566. null
  567. )
  568. ]
  569. }
  570. ),
  571. e(
  572. de,
  573. {
  574. center: !0,
  575. modelValue: u.modelValue,
  576. 'onUpdate:modelValue': l => (u.modelValue = l),
  577. prototcolType: 'REGISTER'
  578. },
  579. null
  580. ),
  581. e(
  582. B,
  583. {
  584. type: 'primary',
  585. class: v.submitBtn,
  586. color: 'linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)',
  587. block: !0,
  588. onClick: o,
  589. disabled: u.loading,
  590. loading: u.loading
  591. },
  592. { default: () => [i('确认')] }
  593. ),
  594. u.imgCodeStatus
  595. ? e(
  596. it,
  597. {
  598. value: u.imgCodeStatus,
  599. 'onUpdate:value': l => (u.imgCodeStatus = l),
  600. phone: d.username,
  601. onClose: () => {
  602. u.imgCodeStatus = !1;
  603. },
  604. onSendCode: f
  605. },
  606. null
  607. )
  608. : null,
  609. e(
  610. b,
  611. {
  612. show: u.gradeStatus,
  613. 'onUpdate:show': l => (u.gradeStatus = l),
  614. position: 'bottom',
  615. round: !0,
  616. safeAreaInsetBottom: !0,
  617. lazyRender: !1,
  618. class: 'popupBottomSearch'
  619. },
  620. {
  621. default: () => [
  622. e(
  623. V,
  624. {
  625. showToolbar: !0,
  626. columns: a.value,
  627. onCancel: () => (u.gradeStatus = !1),
  628. onConfirm: l => {
  629. const p = l.selectedOptions[0];
  630. (d.extra.currentGradeNum = p.value),
  631. (u.gradeNumText = p.text),
  632. (u.gradeStatus = !1);
  633. }
  634. },
  635. null
  636. )
  637. ]
  638. }
  639. ),
  640. e(
  641. b,
  642. {
  643. show: u.classStatus,
  644. 'onUpdate:show': l => (u.classStatus = l),
  645. position: 'bottom',
  646. round: !0,
  647. class: 'popupBottomSearch'
  648. },
  649. {
  650. default: () => [
  651. e(
  652. V,
  653. {
  654. showToolbar: !0,
  655. columns: H,
  656. onCancel: () => (u.classStatus = !1),
  657. onConfirm: l => {
  658. const p = l.selectedOptions[0];
  659. (d.extra.currentClass = p.value),
  660. (u.currentClassText = p.text),
  661. (u.classStatus = !1);
  662. }
  663. },
  664. null
  665. )
  666. ]
  667. }
  668. )
  669. ]);
  670. }
  671. }),
  672. J = t => {
  673. if (t === null) return null;
  674. const n = Object.assign({}, t);
  675. return (
  676. Object.keys(n).forEach(
  677. r => (n[r] = typeof t[r] == 'object' ? J(t[r]) : t[r])
  678. ),
  679. Array.isArray(t) ? ((n.length = t.length), Array.from(n)) : n
  680. );
  681. },
  682. ct = '_wxPopupDialog_1sfd3_1',
  683. pt = '_popupContainer_1sfd3_16',
  684. mt = '_title1_1sfd3_22',
  685. gt = '_popupTips_1sfd3_29',
  686. D = { wxPopupDialog: ct, popupContainer: pt, title1: mt, popupTips: gt },
  687. ft = w({
  688. name: 'm-wx-tip',
  689. props: {
  690. show: { type: Boolean, default: !0 },
  691. title: { type: String, default: '温馨提示' },
  692. message: { type: String, default: '请使用微信打开' }
  693. },
  694. setup(t) {
  695. const n = U(!1);
  696. return (
  697. M(() => {
  698. if (!oe().weixin && t.show) {
  699. n.value = !0;
  700. return;
  701. }
  702. }),
  703. () =>
  704. e(q, null, [
  705. e(
  706. b,
  707. {
  708. show: n.value,
  709. 'onUpdate:show': r => (n.value = r),
  710. round: !0,
  711. style: { width: '88%' },
  712. closeOnClickOverlay: !1,
  713. class: D.wxPopupDialog
  714. },
  715. {
  716. default: () => [
  717. e('div', { class: D.popupContainer }, [
  718. e('p', { class: D.title1 }, [t.title]),
  719. e('p', { class: D.popupTips }, [t.message])
  720. ])
  721. ]
  722. }
  723. )
  724. ])
  725. );
  726. }
  727. }),
  728. It = w({
  729. name: 'student-register',
  730. setup() {
  731. const t = se(),
  732. n = Y(),
  733. r = ae();
  734. n.setShoolId(t.query.sId);
  735. const a = x({
  736. schoolId: t.query.sId,
  737. popupShow: !1,
  738. popupRegister: !1,
  739. details: [],
  740. schoolType: '',
  741. gradeYear: '',
  742. bugGoods: !1,
  743. submitLoading: !1,
  744. dialogStatus: !1,
  745. dialogMessage: '',
  746. dialogConfig: {},
  747. code: ''
  748. }),
  749. u = async () => {
  750. try {
  751. const { data: o } = await C.get('/edu-app/userPaymentOrder/unpaid');
  752. o.id &&
  753. ((a.dialogMessage = '您有待支付的订单,是否继续支付'),
  754. (a.dialogStatus = !0),
  755. (a.dialogConfig = o));
  756. } catch (o) {}
  757. },
  758. d = async () => {
  759. try {
  760. const { data: o } = await C.get(
  761. '/edu-app/open/userOrder/registerGoods/' + a.schoolId,
  762. { noAuthorization: !0 }
  763. );
  764. n.setVip(o.details || []),
  765. (a.details = J(o.details || [])),
  766. (a.bugGoods = o.bugGoods),
  767. (a.schoolType = o.schoolType),
  768. (a.gradeYear = o.gradeYear),
  769. console.log(n.getGoods);
  770. } catch (o) {}
  771. },
  772. f = N(() => {
  773. let o = 0,
  774. m = 0;
  775. return (
  776. n.getVip.forEach(c => {
  777. (o += Number(c.currentPrice)), (m += Number(c.originalPrice));
  778. }),
  779. n.getGoods.forEach(c => {
  780. (o += Number(c.price) * c.quantity),
  781. (m += Number(c.originalPrice) * c.quantity);
  782. }),
  783. { amount: o, originAmount: m }
  784. );
  785. }),
  786. h = o => {
  787. ne({ message: '是否删除该商品', confirmButtonColor: '#FF8633' }).then(
  788. () => {
  789. n.deleteGoods(o.goodsId);
  790. }
  791. );
  792. },
  793. y = async () => {
  794. try {
  795. if (((a.submitLoading = !0), await u(), a.dialogStatus)) {
  796. a.submitLoading = !1;
  797. return;
  798. }
  799. const o = await C.get(
  800. '/edu-app/userPaymentOrder/registerStatus/' + a.schoolId
  801. ),
  802. m = n.getVip,
  803. l = n.getGoods;
  804. if (o.data.hasBuyCourse && m.length > 0) {
  805. setTimeout(() => {
  806. _('您已购买数字化器乐学练工具,请勿重复购买');
  807. }, 100);
  808. return;
  809. }
  810. if (m.length <= 0 && l.length <= 0) {
  811. setTimeout(() => {
  812. _('请选择需要购买的商品');
  813. }, 100);
  814. return;
  815. }
  816. const p = [];
  817. m.forEach(g => {
  818. p.push({
  819. goodsId: g.goodsId,
  820. goodsNum: 1,
  821. goodsType: g.goodsType,
  822. paymentCashAmount: g.currentPrice,
  823. paymentCouponAmount: 0
  824. });
  825. }),
  826. l.forEach(g => {
  827. p.push({
  828. goodsId: g.productId,
  829. goodsNum: g.quantity,
  830. goodsType: 'INSTRUMENTS',
  831. paymentCashAmount: g.price,
  832. paymentCouponAmount: 0,
  833. goodsSkuId: g.productSkuId
  834. });
  835. });
  836. const { data: c } = await C.post(
  837. '/edu-app/userPaymentOrder/executeOrder',
  838. {
  839. hideLoading: !1,
  840. data: {
  841. paymentType: 'adapay',
  842. bizId: a.schoolId,
  843. orderType: 'SCHOOL_REGISTER',
  844. paymentCashAmount: f.value.amount || 0,
  845. paymentCouponAmount: 0,
  846. goodsInfos: p,
  847. orderName: '学生登记',
  848. orderDesc: '学生登记'
  849. }
  850. }
  851. );
  852. r.push({
  853. path: '/order-detail',
  854. query: {
  855. pm: 1,
  856. config: JSON.stringify({
  857. ...c.paymentConfig,
  858. paymentType: c.paymentType
  859. }),
  860. orderNo: c.orderNo
  861. }
  862. });
  863. } finally {
  864. a.submitLoading = !1;
  865. }
  866. };
  867. return (
  868. M(() => {
  869. d();
  870. }),
  871. () =>
  872. e('div', { class: s['student-register'] }, [
  873. e(
  874. 'div',
  875. { class: s.studentSection, style: { marginTop: '18px' } },
  876. [
  877. e('div', { class: s.titleTool }, null),
  878. a.details.map(o =>
  879. e(
  880. L,
  881. {
  882. class: s.goodsSection,
  883. onClick: () => {
  884. n.selectedVip(o.goodsId)
  885. ? n.deleteVip(o.goodsId)
  886. : n.setVip([o]);
  887. }
  888. },
  889. {
  890. default: () => [
  891. e(
  892. T,
  893. { border: !1, class: s.goodsCell },
  894. {
  895. icon: () =>
  896. e(P, { class: s.img, src: o.goodsUrl }, null),
  897. title: () =>
  898. e('div', { class: s.section }, [
  899. e('div', { class: s.sectionContent }, [
  900. e('h2', null, [
  901. o.goodsName,
  902. e(
  903. O,
  904. { class: s.brandName },
  905. { default: () => [i('12个月')] }
  906. )
  907. ]),
  908. e('p', { class: [s.model] }, [o.description]),
  909. e('div', { class: s.sbtnGroup }, [
  910. e(
  911. 'span',
  912. {
  913. class: s.btnDetail,
  914. onClick: m => {
  915. m.stopPropagation(),
  916. r.push('/student-digital-tools');
  917. }
  918. },
  919. [i('查看详情')]
  920. ),
  921. e(
  922. 'span',
  923. {
  924. class: s.btnVideo,
  925. onClick: m => {
  926. m.stopPropagation(),
  927. (a.popupShow = !0);
  928. }
  929. },
  930. [i('介绍视频')]
  931. )
  932. ])
  933. ]),
  934. e(
  935. 'i',
  936. {
  937. class: n.selectedVip(o.goodsId)
  938. ? s.selected
  939. : s.noSelected
  940. },
  941. null
  942. )
  943. ])
  944. }
  945. ),
  946. e(
  947. T,
  948. { border: !1, class: s.priceCell },
  949. {
  950. title: () =>
  951. e('div', { class: s.sPriceGroup }, [
  952. e('div', { class: s.tg }, [
  953. i('团购价:'),
  954. e('span', null, [
  955. e('i', null, [i('¥ ')]),
  956. S(o.currentPrice)
  957. ])
  958. ]),
  959. e('del', null, [i('¥'), S(o.originalPrice)])
  960. ])
  961. }
  962. ),
  963. e(
  964. T,
  965. { border: !1, class: s.giftCell },
  966. {
  967. title: () =>
  968. e('div', { class: s.gift }, [
  969. e('img', { src: We, class: s.iconGift }, null),
  970. i('现在购买赠送 '),
  971. e('span', null, [o.membershipDays || 0]),
  972. i('天有效期')
  973. ])
  974. }
  975. )
  976. ]
  977. }
  978. )
  979. )
  980. ]
  981. ),
  982. a.bugGoods &&
  983. e(q, null, [
  984. e('div', { class: s.studentSection }, [
  985. e('div', { class: s.titleBuy }, null),
  986. n.getGoods && n.getGoods.length <= 0
  987. ? e('div', { class: s.goodsEmpty }, [
  988. e('img', { src: Ze, class: s.shopImg }, null),
  989. e('div', { class: s.goodsContainer }, [
  990. e('h2', null, [
  991. i('为你的'),
  992. e('span', null, [i('音乐之旅')]),
  993. i('做好准备')
  994. ]),
  995. e('p', { class: s.tips }, [i('快去选购乐器吧~')]),
  996. e(
  997. B,
  998. {
  999. class: s.goSelect,
  1000. type: 'primary',
  1001. onClick: () => {
  1002. r.push('/goods-list');
  1003. }
  1004. },
  1005. {
  1006. default: () => [
  1007. i('进入商城选购'),
  1008. e(G, { name: 'arrow' }, null)
  1009. ]
  1010. }
  1011. )
  1012. ])
  1013. ])
  1014. : n.getGoods.map(o =>
  1015. e(
  1016. L,
  1017. { class: s.goodsSection },
  1018. {
  1019. default: () => [
  1020. e(
  1021. T,
  1022. { border: !1, class: s.goodsCell },
  1023. {
  1024. icon: () =>
  1025. e(P, { class: s.img, src: o.pic }, null),
  1026. title: () =>
  1027. e('div', { class: s.section }, [
  1028. e('div', { class: s.sectionContent }, [
  1029. e('h2', null, [
  1030. o.name,
  1031. e(
  1032. O,
  1033. { class: s.brandName },
  1034. { default: () => [o.brandName] }
  1035. )
  1036. ]),
  1037. e('p', { class: [s.model] }, [
  1038. i('规格:'),
  1039. o.spDataJson
  1040. ]),
  1041. e('p', { class: [s.model] }, [
  1042. o.productSn
  1043. ]),
  1044. e(
  1045. re,
  1046. {
  1047. min: 1,
  1048. max: 99,
  1049. modelValue: o.quantity,
  1050. 'onUpdate:modelValue': m =>
  1051. (o.quantity = m)
  1052. },
  1053. null
  1054. )
  1055. ]),
  1056. e(
  1057. 'i',
  1058. {
  1059. class: s.delete,
  1060. onClick: () => h(o)
  1061. },
  1062. null
  1063. )
  1064. ])
  1065. }
  1066. ),
  1067. e(
  1068. T,
  1069. { border: !1, class: s.priceCell },
  1070. {
  1071. title: () =>
  1072. e('div', { class: s.sPriceGroup }, [
  1073. e('div', { class: s.tg }, [
  1074. i('团购价:'),
  1075. e('span', null, [
  1076. e('i', null, [i('¥ ')]),
  1077. S(o.price)
  1078. ])
  1079. ]),
  1080. e('del', null, [
  1081. i('¥'),
  1082. S(o.originalPrice)
  1083. ])
  1084. ])
  1085. }
  1086. )
  1087. ]
  1088. }
  1089. )
  1090. )
  1091. ]),
  1092. n.getGoods &&
  1093. n.getGoods.length > 0 &&
  1094. e(
  1095. B,
  1096. {
  1097. class: s.addButton,
  1098. block: !0,
  1099. onClick: () => {
  1100. r.push('/goods-list');
  1101. }
  1102. },
  1103. {
  1104. default: () => [
  1105. e(G, { name: 'add-o' }, null),
  1106. i('进入商城选购')
  1107. ]
  1108. }
  1109. )
  1110. ]),
  1111. e(
  1112. ue,
  1113. { position: 'bottom' },
  1114. {
  1115. default: () => [
  1116. e('div', { class: s.paymentContainer }, [
  1117. e('div', { class: s.payemntPrice }, [
  1118. e('span', { class: s.needPrice }, [
  1119. e('i', { style: 'font-style: normal' }, [i('¥ ')]),
  1120. e('span', null, [S(f.value.amount)])
  1121. ]),
  1122. e('del', { class: s.allPrice }, [
  1123. i('¥ '),
  1124. S(f.value.originAmount)
  1125. ])
  1126. ]),
  1127. e(
  1128. 'div',
  1129. {
  1130. class: s.paymentBtn,
  1131. onClick: () => {
  1132. n.getToken ? y() : (a.popupRegister = !0);
  1133. }
  1134. },
  1135. [
  1136. e(
  1137. B,
  1138. {
  1139. disabled: a.submitLoading,
  1140. loading: a.submitLoading
  1141. },
  1142. { default: () => [i('确认购买')] }
  1143. )
  1144. ]
  1145. )
  1146. ])
  1147. ]
  1148. }
  1149. ),
  1150. e(
  1151. b,
  1152. {
  1153. show: a.popupShow,
  1154. 'onUpdate:show': o => (a.popupShow = o),
  1155. class: s.videoPopup
  1156. },
  1157. {
  1158. default: () => [
  1159. a.popupShow &&
  1160. e(
  1161. le,
  1162. {
  1163. src: 'https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4'
  1164. },
  1165. null
  1166. )
  1167. ]
  1168. }
  1169. ),
  1170. e(
  1171. b,
  1172. {
  1173. show: a.popupRegister,
  1174. 'onUpdate:show': o => (a.popupRegister = o),
  1175. class: s.registerPopup,
  1176. position: 'bottom',
  1177. round: !0
  1178. },
  1179. {
  1180. default: () => [
  1181. e(
  1182. rt,
  1183. {
  1184. schoolId: a.schoolId,
  1185. schoolType: a.schoolType,
  1186. gradeYear: a.gradeYear,
  1187. onClose: () => (a.popupRegister = !1),
  1188. onSubmit: y
  1189. },
  1190. null
  1191. )
  1192. ]
  1193. }
  1194. ),
  1195. e(
  1196. ce,
  1197. {
  1198. title: '提示',
  1199. show: a.dialogStatus,
  1200. 'onUpdate:show': o => (a.dialogStatus = o),
  1201. message: a.dialogMessage,
  1202. confirmButtonText: '继续支付',
  1203. cancelButtonText: '取消订单',
  1204. showCancelButton: !0,
  1205. onConfirm: () => {
  1206. const o = a.dialogConfig.paymentConfig;
  1207. r.push({
  1208. path: '/order-detail',
  1209. query: {
  1210. pm: 1,
  1211. config: JSON.stringify(o.paymentConfig),
  1212. orderNo: o.orderNo
  1213. }
  1214. });
  1215. },
  1216. onCancel: async () => {
  1217. try {
  1218. await C.post(
  1219. '/edu-app/userPaymentOrder/cancelPayment/' +
  1220. a.dialogConfig.orderNo
  1221. );
  1222. } catch (o) {}
  1223. }
  1224. },
  1225. null
  1226. ),
  1227. e(ft, null, null)
  1228. ])
  1229. );
  1230. }
  1231. });
  1232. export { It as default };