index.tsx 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408
  1. import {
  2. Image,
  3. Cell,
  4. Tag,
  5. Button,
  6. Popup,
  7. showToast,
  8. Form,
  9. Field,
  10. CountDown,
  11. RadioGroup,
  12. Radio,
  13. Picker,
  14. closeToast,
  15. Popover,
  16. Area,
  17. CellGroup,
  18. showConfirmDialog
  19. } from 'vant';
  20. import {
  21. computed,
  22. defineComponent,
  23. nextTick,
  24. onMounted,
  25. onUnmounted,
  26. reactive,
  27. ref
  28. } from 'vue';
  29. import qs from 'query-string';
  30. import {
  31. state as baseState,
  32. goWechatAuth,
  33. setLogin,
  34. setLoginInit
  35. } from '@/state';
  36. import styles from './index.module.less';
  37. import MSticky from '@/components/m-sticky';
  38. // import MVideo from '@/components/m-video';
  39. import { useRoute, useRouter } from 'vue-router';
  40. import { useStudentRegisterStore } from '@/store/modules/student-register-store';
  41. import request from '@/helpers/request';
  42. import { browser, checkPhone, getUrlCode, moneyFormat } from '@/helpers/utils';
  43. import deepClone from '@/helpers/deep-clone';
  44. import OWxTip from '@/components/m-wx-tip';
  45. import MDialog from '@/components/m-dialog';
  46. // import f1 from './images/new/f-1.png';
  47. // import f2 from './images/new/f-2.png';
  48. // import f3 from './images/new/f-3.png';
  49. // import iconTip2 from './images/new/icon-tip2.png';
  50. // import functionBg from './images/new/function-bg.png';
  51. // import tuangou from './images/new/tuangou.png';
  52. // import icon3 from './images/new/icon-3.png';
  53. // import icon5 from './images/new/icon-5.png';
  54. // import icon10 from './images/new/icon-10.png';
  55. // import icon6 from './images/new/icon-6.png';
  56. // import giftTip from './images/new/icon-9.png';
  57. // import iconGift from './images/new/icon-gift.png';
  58. // import vipGiftTIps from './images/new/vip_gift_tips.png';
  59. import dayjs from 'dayjs';
  60. // import MMessageTip from '@/components/m-message-tip';
  61. import { CurrentTime, useCountDown } from '@vant/use';
  62. import MImgCode from '@/components/m-img-code';
  63. import { useInterval, useIntervalFn } from '@vueuse/core';
  64. import MMessageTip from '@/components/m-message-tip';
  65. import SelectStudent from '@/views/student-register/modal/select-student';
  66. import { api_sysAreaQueryAllProvince } from '@/views/school-register/api';
  67. import CodeDialog from '../modal/code-dialog';
  68. import MSearch from '@/components/m-search';
  69. const classList: any = [];
  70. for (let i = 1; i <= 40; i++) {
  71. classList.push({ text: i + '班', value: i });
  72. }
  73. const GRADE_ENUM = {
  74. '1': '一年级',
  75. '2': '二年级',
  76. '3': '三年级',
  77. '4': '四年级',
  78. '5': '五年级',
  79. '6': '六年级',
  80. '7': '七年级',
  81. '8': '八年级',
  82. '9': '九年级'
  83. } as any;
  84. const getGradeList = (gradeYear?: string, instrumentCode?: string) => {
  85. let tempList: any = [];
  86. const five = [
  87. { text: '一年级', value: 1, instrumentCode },
  88. { text: '二年级', value: 2, instrumentCode },
  89. { text: '三年级', value: 3, instrumentCode },
  90. { text: '四年级', value: 4, instrumentCode },
  91. { text: '五年级', value: 5, instrumentCode }
  92. ];
  93. const one = [{ text: '六年级', value: 6, instrumentCode }];
  94. const three = [
  95. { text: '七年级', value: 7, instrumentCode },
  96. { text: '八年级', value: 8, instrumentCode },
  97. { text: '九年级', value: 9, instrumentCode }
  98. ];
  99. if (gradeYear === 'FIVE_YEAR_SYSTEM') {
  100. tempList.push(...[...five]);
  101. } else if (gradeYear === 'SIX_YEAR_SYSTEM') {
  102. tempList.push(...[...five, ...one]);
  103. } else if (gradeYear === 'THREE_YEAR_SYSTEM') {
  104. tempList.push(...[...three]);
  105. } else if (gradeYear === 'FORE_YEAR_SYSTEM') {
  106. tempList.push(...[...one, ...three]);
  107. } else {
  108. tempList.push(...[...five, ...one, ...three]);
  109. }
  110. return tempList;
  111. };
  112. export default defineComponent({
  113. name: 'activation-register',
  114. setup() {
  115. const route = useRoute();
  116. const studentRegisterStore = useStudentRegisterStore();
  117. const router = useRouter();
  118. // 初始化学校编号
  119. // studentRegisterStore.setShoolId(route.query.sId as any);
  120. const countDownRef = ref();
  121. const forms = reactive({
  122. schoolId: null as any,
  123. schoolAreaId: null, // 学校区域编号
  124. activationCode: null as any, // 互通码
  125. paymentType: '', // 支付类型
  126. paymentChannel: '',
  127. multi_user_limit: 1, // 限制注册学生数量
  128. // popupShow: false,
  129. registerDetails: {} as any,
  130. details: [] as any[],
  131. // schoolType: '', // 学校类型
  132. gradeYear: '', // 学制
  133. schoolInstrumentSetType: null as any,
  134. // bugGoods: false, // 是否购买AI
  135. isRegister: 'create' as 'create' | 'update' | '', // 是否注册学生
  136. isDisabled: false,
  137. isTipRegister: false, // 是否显示名字不一致 - 默认显示
  138. isChangeSchool: false, // 是否切换学校
  139. schoolStatus: false,
  140. schoolPopupShow: false,
  141. schoolLoading: false,
  142. schoolPopupIndex: [] as any,
  143. schoolAreaList: [] as any,
  144. provinceCode: null,
  145. cityCode: null,
  146. regionCode: null,
  147. showResultPopup: false,
  148. reslutPopupType: '' as any,
  149. resultPopupContent: '',
  150. registerType: '', // 报名类型
  151. detailVip: {} as any,
  152. giftVipDay: 0, // 赠送天数
  153. submitLoading: false,
  154. // showMore: true,
  155. showTips: false,
  156. showButton: false,
  157. showMessage: '请使用微信扫描二维码',
  158. countDownStatus: true,
  159. countDownTime: 1000 * 120, // 倒计时时间
  160. // modelValue: false, // 是否选中协议
  161. imgCodeStatus: false,
  162. gradeNumText: '',
  163. currentClassText: '',
  164. schoolName: '',
  165. areaName: '',
  166. gradeStatus: false,
  167. classStatus: false,
  168. loading: false,
  169. showConfirmPopup: false, // 二次确认用户信息
  170. showPicker: false,
  171. areaList: [] as any,
  172. tipStatus: true,
  173. dialogConfirmStatus: false,
  174. contract_sign: false, // 是否实名认证
  175. countDownTimePay: 60 * 1000,
  176. dialogConfig: {} as any,
  177. showSelectStudent: false, // 选择学生
  178. studentList: [], // 手机号关联学生列表
  179. studentItem: {} as any, // 选择的学生
  180. joinType: 'digitalize' as 'digitalize' | 'tradition',
  181. gradeList: [] as any,
  182. classList: [] as any,
  183. saveUserId: null as any,
  184. saveId: null as any,
  185. openId: null as any,
  186. code: null as any,
  187. registerExpireTime: null as any, // 结束时间
  188. instrumentCode: null as any, // 乐器编码
  189. activeOverTime: 0, // 活动结束时间
  190. activeOverStatus: true, // 活动是否结束 默认已结束
  191. gradePopupShow: false,
  192. gradePopupIndex: [] as any, // 年级下拉索引
  193. classPopupShow: false,
  194. classPopupIndex: [] as any // 班级下拉索引
  195. });
  196. const otherParams = reactive({
  197. showOtherSchool: false,
  198. showCloseButton: true, // 是否显示关闭按钮
  199. showOtherMessage: '',
  200. /** limit 超限制,change 更换学生,nickname 名称不一致 member 会员购买, payment 支付方式 */
  201. otherType: '' as 'limit' | 'change' | 'nickname' | 'member' | 'payment',
  202. showCancelButton: true,
  203. cancelButtonColor: '',
  204. cancelButtonText: '取消',
  205. showConfirmButton: true,
  206. confirmButtonColor: '',
  207. confirmButtonText: '确定',
  208. messageAlign: 'left' as 'center' | 'left' | 'right'
  209. });
  210. const state = reactive({
  211. showQrcode: false,
  212. qrCodeUrl: '',
  213. pay_channel: '',
  214. orderInfo: {} as any, // 订单信息
  215. authShow: false,
  216. orderNo: null as any,
  217. config: {} as any,
  218. paymentStatus: false,
  219. orderTimer: null as any
  220. });
  221. /*
  222. 新用户:
  223. autoRegister: true
  224. loginType: 'SMS'
  225. 已存在用户:
  226. autoRegister: false
  227. loginType: 'TOKEN'
  228. password: xxx
  229. */
  230. const studentInfo = reactive({
  231. autoRegister: true,
  232. multiUser: true, // 是否为多用户
  233. client_id: 'cooleshow-student',
  234. client_secret: 'cooleshow-student',
  235. extra: {
  236. nickname: '',
  237. currentGradeNum: '' as any,
  238. currentClass: '' as any,
  239. gender: 1 as any,
  240. registerType: null as any, // 报名类型
  241. giftVipDay: 0 // 赠送会员天数
  242. },
  243. grant_type: 'password',
  244. loginType: 'SMS',
  245. password: '',
  246. username: ''
  247. });
  248. // 页面定时
  249. const pageTimer = useInterval(1000, { controls: true });
  250. pageTimer.pause();
  251. const overCountDown = useCountDown({
  252. time: forms.activeOverTime,
  253. onFinish() {
  254. forms.activeOverStatus = true;
  255. if (forms.submitLoading) return;
  256. applyOver();
  257. }
  258. });
  259. /** 报名结束提示 */
  260. const applyOver = () => {
  261. forms.showTips = true;
  262. // forms.showMessage = '团购时间已截止,感谢您的参与';
  263. forms.showMessage =
  264. '<p style="color: #F44541">报名已截止,感谢您的参与</p>';
  265. forms.showButton = false;
  266. };
  267. const onCodeSend = () => {
  268. forms.countDownStatus = false;
  269. nextTick(() => {
  270. countDownRef.value.start();
  271. });
  272. };
  273. const onSendCode = () => {
  274. // 发送验证码
  275. if (!checkPhone(studentInfo.username)) {
  276. return showToast('请输入正确的手机号码');
  277. }
  278. forms.imgCodeStatus = true;
  279. };
  280. const validatePhone = computed(() => {
  281. return checkPhone(studentInfo.username) ? true : false;
  282. });
  283. const onFinished = () => {
  284. forms.countDownStatus = true;
  285. countDownRef.value.reset();
  286. };
  287. // 格式化提示状态
  288. const changeTipStatus = (register: boolean, school: boolean) => {
  289. forms.isTipRegister = register;
  290. forms.isChangeSchool = school;
  291. };
  292. const checkForm = (status = true) => {
  293. if (!checkPhone(studentInfo.username)) {
  294. status && showToast('请输入正确的手机号码');
  295. return true;
  296. } else if (!studentInfo.password) {
  297. status && showToast('请输入验证码');
  298. return true;
  299. } else if (!studentInfo.extra.nickname) {
  300. status && showToast('请输入学生姓名');
  301. return true;
  302. } else if (![0, 1].includes(studentInfo.extra.gender)) {
  303. status && showToast('请选择性别');
  304. return true;
  305. } else if (!studentInfo.extra.currentGradeNum) {
  306. status && showToast('请选择所在年级');
  307. return true;
  308. } else if (!studentInfo.extra.currentClass) {
  309. status && showToast('请选择所在班级');
  310. return true;
  311. } else if (!forms.activationCode) {
  312. status && showToast('请输入互通码');
  313. return true;
  314. }
  315. return false;
  316. };
  317. //
  318. const checkSubmit = () => {
  319. const { extra } = studentInfo;
  320. if (
  321. forms.studentItem.nickname !== extra.nickname &&
  322. forms.isTipRegister
  323. ) {
  324. otherParams.showOtherMessage =
  325. '学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号';
  326. otherParams.showOtherSchool = true;
  327. otherParams.showCancelButton = true;
  328. otherParams.showCloseButton = true;
  329. otherParams.cancelButtonColor =
  330. 'linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)';
  331. otherParams.cancelButtonText = '新建学生';
  332. otherParams.confirmButtonColor =
  333. 'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
  334. otherParams.confirmButtonText = '修改信息';
  335. otherParams.otherType = 'nickname';
  336. otherParams.messageAlign = 'left';
  337. return true;
  338. }
  339. // 判断新建学员是否上限了
  340. if (
  341. forms.isRegister === 'create' &&
  342. forms.studentList.length >= forms.multi_user_limit
  343. ) {
  344. otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
  345. otherParams.showOtherSchool = true;
  346. otherParams.showCancelButton = false;
  347. otherParams.showCloseButton = true;
  348. otherParams.confirmButtonColor =
  349. 'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
  350. otherParams.confirmButtonText = '我知道了';
  351. otherParams.otherType = 'limit';
  352. otherParams.messageAlign = 'center';
  353. return true;
  354. }
  355. return false;
  356. };
  357. /**
  358. * 登记成功之后购买
  359. */
  360. const onSubmit = async () => {
  361. forms.submitLoading = true;
  362. try {
  363. if (checkForm() || checkSubmit()) {
  364. forms.submitLoading = false;
  365. return;
  366. }
  367. const { extra, loginType, autoRegister, password, multiUser, ...res } =
  368. studentInfo;
  369. /*
  370. 新用户:
  371. autoRegister: true
  372. loginType: 'SMS'
  373. 已存在用户:
  374. autoRegister: false
  375. loginType: 'TOKEN'
  376. password: xxx
  377. */
  378. let tLoginType = loginType,
  379. tAutoRegister = autoRegister,
  380. tPassword = password,
  381. tMultiUser = multiUser;
  382. if (forms.isRegister === 'update') {
  383. tLoginType = 'TOKEN';
  384. tAutoRegister = false;
  385. tPassword = forms.studentItem.token;
  386. tMultiUser = false;
  387. }
  388. const result = await request.post('/edu-app/userlogin', {
  389. requestType: 'form',
  390. data: {
  391. loginType: tLoginType,
  392. autoRegister: tAutoRegister,
  393. password: tPassword,
  394. multiUser: tMultiUser,
  395. ...res,
  396. extra: JSON.stringify({
  397. ...extra,
  398. // giftVipDay:
  399. // forms.detailVip.membershipDays || 0 + forms.giftVipDay || 0,
  400. schoolId: forms.schoolId
  401. })
  402. }
  403. });
  404. if (result.code !== 200) {
  405. if (result.code === 5436) {
  406. forms.showTips = true;
  407. forms.showMessage = '二维码已经失效,详情请咨询学校老师';
  408. forms.showButton = false;
  409. } else if (result.code === 5435) {
  410. forms.showTips = true;
  411. forms.showMessage = result.message;
  412. forms.showButton = true;
  413. }
  414. // else if (result.code === 5437) {
  415. // forms.showTips = true;
  416. // forms.showMessage =
  417. // '<p style="color: #F44541">报名已截止,感谢您的参与</p>'; //result.message;
  418. // forms.showButton = false;
  419. // }
  420. } else {
  421. studentRegisterStore.setToken(
  422. result.data.token_type + ' ' + result.data.access_token
  423. );
  424. setLoginInit();
  425. // let joinType = 'NOT_REGISTER';
  426. // if (forms.joinType === 'digitalize') {
  427. // joinType = 'SELECT_INSTRUMENT';
  428. // }
  429. // if (forms.joinType === 'tradition') {
  430. // joinType = 'NOT_BUY_INSTRUMENT';
  431. // }
  432. // 获取用户信息
  433. const res = await request.get('/edu-app/user/getUserInfo', {
  434. requestType: 'form'
  435. });
  436. setLogin(res.data);
  437. // await onRegisterSubmit();
  438. await updateStudentInfo();
  439. }
  440. } catch {
  441. // 重置信息 - 如果是新建则不提示
  442. changeTipStatus(forms.isRegister === 'create' ? false : true, false);
  443. } finally {
  444. forms.submitLoading = false;
  445. }
  446. };
  447. const updateStudentInfo = async () => {
  448. try {
  449. const { extra, username } = studentInfo;
  450. const registerResult = await request.post('/edu-app/student/register', {
  451. data: {
  452. clientType: 'STUDENT',
  453. ...extra,
  454. activationCode: forms.activationCode,
  455. schoolId: forms.schoolId,
  456. schoolAreaId: forms.schoolAreaId,
  457. // giftVipFlag: forms.registerDetails.giftVipFlag || false,
  458. // giftVipDay: forms.giftVipDay || 0,
  459. schoolVerify: false,
  460. // firstVipDay: forms.detailVip.membershipDays || 0,
  461. mobile: username,
  462. newRegUser: forms.isRegister === 'create' ? true : false
  463. }
  464. });
  465. if (registerResult.code !== 200) {
  466. if (registerResult.code === 5436) {
  467. forms.showTips = true;
  468. forms.showMessage = '二维码已经失效,详情请咨询学校老师';
  469. forms.showButton = false;
  470. } else if (registerResult.code === 5435) {
  471. forms.showTips = true;
  472. forms.showMessage = registerResult.message;
  473. forms.showButton = true;
  474. } else if (registerResult.code === 5437) {
  475. forms.showTips = true;
  476. forms.showMessage =
  477. '<p style="color: #F44541">报名已截止,感谢您的参与</p>'; //result.message;
  478. forms.showButton = false;
  479. } else if (registerResult.code === 5442) {
  480. forms.showResultPopup = true;
  481. forms.reslutPopupType = 'EXPIRED';
  482. forms.resultPopupContent = registerResult.message;
  483. } else if (registerResult.code === 5443) {
  484. forms.showResultPopup = true;
  485. forms.reslutPopupType = 'CANCELLED';
  486. forms.resultPopupContent = registerResult.message;
  487. }
  488. return false;
  489. } else {
  490. forms.showResultPopup = true;
  491. forms.reslutPopupType = 'ACTIVATING';
  492. return true;
  493. }
  494. } catch {}
  495. };
  496. const getUserInfos = async () => {
  497. if (
  498. studentInfo.password.length !== 6 ||
  499. !checkPhone(studentInfo.username)
  500. ) {
  501. return;
  502. }
  503. try {
  504. // 15907120131;
  505. const { data } = await request.get(
  506. `/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
  507. );
  508. forms.studentList = data || [];
  509. if (forms.studentList.length > 0) {
  510. const firstStudent: any = forms.studentList[0];
  511. forms.studentItem = firstStudent;
  512. studentInfo.extra.nickname = firstStudent.nickname;
  513. const tempArea = [] as any;
  514. if (firstStudent.provinceName) {
  515. tempArea.push(firstStudent.provinceName);
  516. forms.provinceCode = firstStudent.provinceCode;
  517. }
  518. if (firstStudent.cityName) {
  519. tempArea.push(firstStudent.cityName);
  520. forms.cityCode = firstStudent.cityCode;
  521. }
  522. if (firstStudent.regionName) {
  523. tempArea.push(firstStudent.regionName);
  524. forms.regionCode = firstStudent.regionCode;
  525. }
  526. forms.areaName = tempArea.join(' ');
  527. forms.schoolName = firstStudent.schoolName;
  528. forms.schoolId = firstStudent.schoolId;
  529. forms.schoolAreaId = firstStudent.schoolAreaId;
  530. const tempGrade: any = forms.gradeList || [];
  531. tempGrade?.forEach((i: any) => {
  532. if (i.value === firstStudent.currentGradeNum) {
  533. forms.instrumentCode = i.instrumentCode;
  534. forms.gradeNumText = i.text;
  535. studentInfo.extra.currentGradeNum = firstStudent.currentGradeNum;
  536. if (forms.schoolInstrumentSetType === 'CLASS') {
  537. forms.classList = i.classList;
  538. }
  539. }
  540. });
  541. forms.classList.forEach((i: any) => {
  542. if (i.value === firstStudent.currentClass) {
  543. forms.currentClassText = i.text;
  544. studentInfo.extra.currentClass = firstStudent.currentClass;
  545. }
  546. });
  547. studentInfo.extra.gender = firstStudent.gender;
  548. forms.isRegister = 'update';
  549. changeTipStatus(true, false);
  550. } else {
  551. forms.isRegister = 'create';
  552. changeTipStatus(false, false);
  553. forms.studentItem = [];
  554. }
  555. } catch {
  556. //
  557. }
  558. };
  559. /** 手机号变更时清空验证码信息,用户信息 */
  560. const phoneChangeEmptyInfo = () => {
  561. studentInfo.password = '';
  562. studentInfo.extra.nickname = '';
  563. studentInfo.extra.currentGradeNum = '';
  564. studentInfo.extra.currentClass = '';
  565. studentInfo.extra.gender = 1;
  566. forms.areaName = '';
  567. forms.schoolName = '';
  568. forms.currentClassText = '';
  569. forms.gradeNumText = '';
  570. forms.studentList = []; // 手机号关联学生列表
  571. forms.studentItem = {}; // 选择的学生
  572. forms.isRegister = 'create'; // 是否注册学生
  573. forms.isTipRegister = false; // 是否显示名字不一致 - 默认显示
  574. forms.isChangeSchool = false; // 是否切换学校
  575. };
  576. const formateArea = (area: any[]) => {
  577. const province_list: { [_: string]: string } = {};
  578. const city_list: { [_: string]: string } = {};
  579. const county_list: { [_: string]: string } = {};
  580. area.forEach((item: any) => {
  581. province_list[item.code] = item.name;
  582. });
  583. area.forEach((item: any) => {
  584. item.areas?.forEach((city: any) => {
  585. city_list[city.code] = city.name;
  586. });
  587. });
  588. area.forEach((item: any) => {
  589. item.areas?.forEach((city: any) => {
  590. city.areas?.forEach((county: any) => {
  591. county_list[county.code] = county.name;
  592. });
  593. });
  594. });
  595. return {
  596. province_list,
  597. city_list,
  598. county_list
  599. };
  600. };
  601. const getAreaList = () => {
  602. api_sysAreaQueryAllProvince().then(res => {
  603. if (res?.code === 200) {
  604. forms.areaList = formateArea(res.data);
  605. }
  606. });
  607. };
  608. const getSchoolAreaList = async (name?: string) => {
  609. forms.schoolLoading = true;
  610. try {
  611. const { data } = await request.post('/edu-app/open/schoolArea/list', {
  612. data: {
  613. name,
  614. testFlag: true,
  615. provinceCode: forms.provinceCode,
  616. cityCode: forms.cityCode,
  617. regionCode: forms.regionCode
  618. }
  619. });
  620. forms.schoolAreaList = data;
  621. } catch {
  622. //
  623. }
  624. forms.schoolLoading = false;
  625. };
  626. // 格式化互通码
  627. const maskMiddleDigits = (str: string) => {
  628. if (!str) {
  629. return '';
  630. }
  631. let numPart = str.match(/\d+/); // 提取数字部分
  632. if (numPart) {
  633. let start = str.indexOf(numPart[0]); // 数字部分的起始索引
  634. let end = start + numPart[0].length; // 数字部分的结束索引
  635. let maskedStr =
  636. str.substring(0, start) +
  637. '*'.repeat(numPart[0].length) +
  638. str.substring(end);
  639. return maskedStr;
  640. }
  641. return str;
  642. };
  643. onMounted(async () => {
  644. try {
  645. const code: any = route.query.code;
  646. if (code) {
  647. forms.activationCode = window.atob(code);
  648. }
  649. } catch {
  650. //
  651. }
  652. getAreaList();
  653. try {
  654. // 获取支付类型
  655. const { data } = await request.get(
  656. '/edu-app/open/paramConfig/queryByParamNameList',
  657. {
  658. requestType: 'form',
  659. params: {
  660. paramNames: 'multi_user_limit'
  661. }
  662. }
  663. );
  664. if (data && Array.isArray(data)) {
  665. data.forEach((item: any) => {
  666. if (item.paramName === 'multi_user_limit') {
  667. forms.multi_user_limit = item.paramValue
  668. ? Number(item.paramValue)
  669. : 1;
  670. }
  671. });
  672. }
  673. } catch {}
  674. forms.gradeList = getGradeList();
  675. forms.classList = classList;
  676. });
  677. return () => (
  678. <div class={styles['student-register']}>
  679. <div class={styles.studentRegisterContainer}>
  680. <div class={[styles.studentSection]}>
  681. <Form labelAlign="left" class={styles.registerForm}>
  682. <Field
  683. clearable={false}
  684. label="联系方式"
  685. placeholder="请输入手机号码"
  686. type="tel"
  687. required
  688. autocomplete="off"
  689. inputAlign="right"
  690. v-model={studentInfo.username}
  691. maxlength={11}
  692. onUpdate:modelValue={() => {
  693. phoneChangeEmptyInfo();
  694. }}></Field>
  695. <Field
  696. center
  697. clearable={false}
  698. required
  699. inputAlign="right"
  700. label="验证码"
  701. placeholder="请输入验证码"
  702. autocomplete="off"
  703. type="number"
  704. v-model={studentInfo.password}
  705. maxlength={6}
  706. onUpdate:modelValue={(val: any) => {
  707. getUserInfos();
  708. }}>
  709. {{
  710. button: () =>
  711. forms.countDownStatus ? (
  712. <span
  713. class={[
  714. styles.codeText,
  715. !validatePhone.value ? styles.codeTextDisabled : ''
  716. ]}
  717. onClick={onSendCode}>
  718. 获取验证码
  719. </span>
  720. ) : (
  721. <CountDown
  722. ref={(el: any) => (countDownRef.value = el)}
  723. auto-start={false}
  724. class={styles.countDown}
  725. time={forms.countDownTime}
  726. onFinish={onFinished}
  727. format="ss秒后重试"
  728. />
  729. )
  730. }}
  731. </Field>
  732. <Field
  733. clearable={false}
  734. required
  735. inputAlign="right"
  736. label="学生姓名"
  737. placeholder="请输入学生姓名"
  738. autocomplete="off"
  739. maxlength={14}
  740. v-model={studentInfo.extra.nickname}>
  741. {{
  742. extra: () =>
  743. forms.studentList.length > 1 && (
  744. <div
  745. class={[
  746. styles.selectStudentGroup,
  747. forms.showSelectStudent &&
  748. styles.selectStudentGroupChecked
  749. ]}
  750. onClick={() => (forms.showSelectStudent = true)}>
  751. <span>
  752. {forms.studentItem.userId ? '切换' : '新增'}
  753. </span>
  754. </div>
  755. )
  756. }}
  757. </Field>
  758. <Field
  759. clearable={false}
  760. required
  761. inputAlign="right"
  762. label="学生性别"
  763. placeholder="请选择性别"
  764. autocomplete="off">
  765. {{
  766. input: () => (
  767. <RadioGroup
  768. checked-color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
  769. v-model={studentInfo.extra.gender}
  770. direction="horizontal">
  771. <Tag
  772. size="large"
  773. type="primary"
  774. color={
  775. !(studentInfo.extra.gender === 1)
  776. ? '#F5F6FA'
  777. : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
  778. }
  779. textColor={
  780. !(studentInfo.extra.gender === 1) ? '#626264' : '#fff'
  781. }
  782. class={styles.radioSection}>
  783. <Radio class={styles.radioItem} name={1}></Radio>男
  784. </Tag>
  785. <Tag
  786. size="large"
  787. type="primary"
  788. color={
  789. !(studentInfo.extra.gender === 0)
  790. ? '#F5F6FA'
  791. : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
  792. }
  793. textColor={
  794. !(studentInfo.extra.gender === 0) ? '#626264' : '#fff'
  795. }
  796. class={styles.radioSection}>
  797. <Radio class={styles.radioItem} name={0}></Radio>女
  798. </Tag>
  799. </RadioGroup>
  800. )
  801. }}
  802. </Field>
  803. <Field
  804. clearable={false}
  805. required
  806. inputAlign="right"
  807. label="所在地区"
  808. placeholder="请选择所在地区"
  809. isLink={forms.isRegister !== 'update'}
  810. readonly
  811. clickable={false}
  812. modelValue={forms.areaName}
  813. onClick={() => {
  814. if (forms.isRegister !== 'update') forms.showPicker = true;
  815. // forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
  816. }}
  817. />
  818. <Field
  819. clearable={false}
  820. required
  821. inputAlign="right"
  822. label="互通学校"
  823. placeholder="请选择互通学校"
  824. isLink={forms.isRegister !== 'update'}
  825. readonly
  826. clickable={false}
  827. modelValue={forms.schoolName}
  828. onClick={() => {
  829. if (forms.isRegister === 'update') return;
  830. if (!forms.areaName) {
  831. showToast('请选择地区');
  832. return;
  833. }
  834. forms.schoolStatus = true;
  835. if (forms.schoolAreaId) {
  836. forms.schoolPopupIndex = [forms.schoolAreaId];
  837. }
  838. // forms.gradeStatus = true;
  839. // forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
  840. }}
  841. />
  842. <Field
  843. clearable={false}
  844. required
  845. inputAlign="right"
  846. label="所在年级"
  847. placeholder="请选择年级"
  848. isLink={forms.isRegister !== 'update'}
  849. readonly
  850. clickable={false}
  851. modelValue={forms.gradeNumText}
  852. onClick={() => {
  853. if (forms.isRegister !== 'update') {
  854. forms.gradePopupIndex = [studentInfo.extra.currentGradeNum];
  855. forms.gradeStatus = true;
  856. }
  857. }}
  858. />
  859. <Field
  860. clearable={false}
  861. required
  862. inputAlign="right"
  863. label="所在班级"
  864. placeholder="请选择班级"
  865. isLink={forms.isRegister !== 'update'}
  866. readonly
  867. clickable={false}
  868. modelValue={forms.currentClassText}
  869. onClick={() => {
  870. if (forms.isRegister == 'update') {
  871. return;
  872. }
  873. if (
  874. forms.schoolInstrumentSetType === 'CLASS' &&
  875. forms.classList.length <= 0
  876. ) {
  877. showToast('请先选择年级');
  878. return;
  879. }
  880. forms.classPopupIndex = [studentInfo.extra.currentClass];
  881. forms.classStatus = true;
  882. }}
  883. />
  884. {/* maskMiddleDigits */}
  885. {route.query.code ? (
  886. <Field
  887. clearable={false}
  888. required
  889. inputAlign="right"
  890. label="互通码"
  891. readonly={route.query.code ? true : false}
  892. modelValue={maskMiddleDigits(forms.activationCode)}
  893. />
  894. ) : (
  895. <Field
  896. clearable={false}
  897. required
  898. inputAlign="right"
  899. label="互通码"
  900. placeholder="请选择互通码"
  901. autocomplete="off"
  902. v-model={forms.activationCode}
  903. />
  904. )}
  905. </Form>
  906. </div>
  907. <MSticky position="bottom">
  908. <div class={styles.paymentContainer}>
  909. <Button
  910. onClick={() => {
  911. // onSubmit();
  912. if (checkForm() || checkSubmit()) {
  913. forms.submitLoading = false;
  914. return;
  915. }
  916. forms.showConfirmPopup = true;
  917. }}
  918. round
  919. block
  920. disabled={forms.submitLoading}
  921. loading={forms.submitLoading}>
  922. 提交
  923. </Button>
  924. </div>
  925. </MSticky>
  926. </div>
  927. {forms.imgCodeStatus ? (
  928. <MImgCode
  929. v-model:value={forms.imgCodeStatus}
  930. phone={studentInfo.username}
  931. type="REGISTER"
  932. onClose={() => {
  933. forms.imgCodeStatus = false;
  934. }}
  935. onSendCode={onCodeSend}
  936. />
  937. ) : null}
  938. {/* 互通学校 */}
  939. <Popup
  940. v-model:show={forms.schoolStatus}
  941. position="bottom"
  942. round
  943. safeAreaInsetBottom
  944. lazyRender={false}
  945. class={'popupBottomSearch'}
  946. onOpen={() => {
  947. forms.schoolPopupShow = true;
  948. }}
  949. onClosed={() => {
  950. forms.schoolPopupShow = false;
  951. }}>
  952. {forms.schoolPopupShow && (
  953. <div>
  954. <Picker
  955. showToolbar
  956. v-model={forms.schoolPopupIndex}
  957. columns={forms.schoolAreaList}
  958. loading={forms.schoolLoading}
  959. columnsFieldNames={{
  960. text: 'name',
  961. value: 'id'
  962. }}
  963. onCancel={() => (forms.schoolStatus = false)}
  964. onConfirm={(val: any) => {
  965. const selectedOption = val.selectedOptions[0];
  966. forms.schoolId = null;
  967. forms.schoolAreaId = selectedOption.id;
  968. forms.schoolName = selectedOption.name;
  969. forms.schoolStatus = false;
  970. }}>
  971. {{
  972. 'columns-top': (
  973. <MSearch
  974. placeholder="请输入学校名称"
  975. onSearch={(val: any) => {
  976. getSchoolAreaList(val);
  977. }}
  978. />
  979. )
  980. }}
  981. </Picker>
  982. </div>
  983. )}
  984. </Popup>
  985. {/* 年级 */}
  986. <Popup
  987. v-model:show={forms.gradeStatus}
  988. position="bottom"
  989. round
  990. safeAreaInsetBottom
  991. lazyRender={false}
  992. class={'popupBottomSearch'}
  993. onOpen={() => {
  994. forms.gradePopupShow = true;
  995. }}
  996. onClosed={() => {
  997. forms.gradePopupShow = false;
  998. }}>
  999. {forms.gradePopupShow && (
  1000. <Picker
  1001. showToolbar
  1002. v-model={forms.gradePopupIndex}
  1003. columns={forms.gradeList}
  1004. onCancel={() => (forms.gradeStatus = false)}
  1005. onConfirm={(val: any) => {
  1006. const selectedOption = val.selectedOptions[0];
  1007. studentInfo.extra.currentGradeNum = selectedOption.value;
  1008. forms.gradeNumText = selectedOption.text;
  1009. forms.gradeStatus = false;
  1010. if (
  1011. ['SCHOOL', 'GRADE'].includes(forms.schoolInstrumentSetType)
  1012. ) {
  1013. forms.instrumentCode = selectedOption.instrumentCode;
  1014. }
  1015. if (forms.schoolInstrumentSetType === 'CLASS') {
  1016. forms.classList = selectedOption.classList;
  1017. }
  1018. if (
  1019. ['CLASS', 'GRADE'].includes(forms.schoolInstrumentSetType)
  1020. ) {
  1021. forms.currentClassText = '';
  1022. studentInfo.extra.currentClass = '';
  1023. }
  1024. }}
  1025. />
  1026. )}
  1027. </Popup>
  1028. {/* 班级 */}
  1029. <Popup
  1030. v-model:show={forms.classStatus}
  1031. position="bottom"
  1032. round
  1033. class={'popupBottomSearch'}
  1034. onOpen={() => {
  1035. forms.classPopupShow = true;
  1036. }}
  1037. onClosed={() => {
  1038. forms.classPopupShow = false;
  1039. }}>
  1040. {forms.classPopupShow && (
  1041. <Picker
  1042. showToolbar
  1043. v-model={forms.classPopupIndex}
  1044. columns={forms.classList}
  1045. onCancel={() => (forms.classStatus = false)}
  1046. onConfirm={(val: any) => {
  1047. const selectedOption = val.selectedOptions[0];
  1048. studentInfo.extra.currentClass = selectedOption.value;
  1049. forms.currentClassText = selectedOption.text;
  1050. forms.classStatus = false;
  1051. if (['CLASS'].includes(forms.schoolInstrumentSetType)) {
  1052. forms.instrumentCode = selectedOption.instrumentCode;
  1053. }
  1054. }}
  1055. />
  1056. )}
  1057. </Popup>
  1058. {/* 是否在微信中打开 */}
  1059. <OWxTip
  1060. show={forms.showTips}
  1061. message={forms.showMessage}
  1062. showButton={forms.showButton}
  1063. buttonText="刷新"
  1064. onConfirm={() => window.location.reload()}
  1065. />
  1066. <MMessageTip
  1067. show={otherParams.showOtherSchool}
  1068. // showCloseButton={otherParams.showCloseButton}
  1069. messageAlign={otherParams.messageAlign}
  1070. message={otherParams.showOtherMessage}
  1071. showCancelButton={otherParams.showCancelButton}
  1072. cancelButtonColor={otherParams.cancelButtonColor}
  1073. cancelButtonText={otherParams.cancelButtonText}
  1074. confirmButtonColor={otherParams.confirmButtonColor}
  1075. confirmButtonText={otherParams.confirmButtonText}
  1076. onClose={() => (otherParams.showOtherSchool = false)}
  1077. onCancel={async () => {
  1078. otherParams.showOtherSchool = false;
  1079. if (otherParams.otherType === 'nickname') {
  1080. forms.isRegister = 'create'; // 新建
  1081. changeTipStatus(false, false);
  1082. onSubmit();
  1083. } else if (otherParams.otherType === 'member') {
  1084. const updateStatus = await updateStudentInfo();
  1085. if (!updateStatus) return;
  1086. //取消支付,判断是否有结束时间,是否已经结束
  1087. if (forms.registerExpireTime && forms.activeOverStatus) {
  1088. applyOver();
  1089. }
  1090. } else if (otherParams.otherType === 'payment') {
  1091. forms.joinType = 'tradition';
  1092. }
  1093. }}
  1094. onConfirm={async () => {
  1095. otherParams.showOtherSchool = false;
  1096. // 名字
  1097. if (otherParams.otherType === 'nickname') {
  1098. forms.isRegister = 'update'; // 修改
  1099. changeTipStatus(false, false);
  1100. // 直接注册
  1101. onSubmit();
  1102. } else if (otherParams.otherType === 'change') {
  1103. // 学校更换
  1104. forms.isChangeSchool = true;
  1105. // 直接注册
  1106. onSubmit();
  1107. } else if (otherParams.otherType === 'limit') {
  1108. // 人数超限制
  1109. changeTipStatus(
  1110. forms.isRegister === 'create' && !forms.studentItem.userId
  1111. ? false
  1112. : true,
  1113. false
  1114. );
  1115. } else if (otherParams.otherType === 'member') {
  1116. // await paymentContinue();
  1117. }
  1118. }}
  1119. />
  1120. <Popup
  1121. v-model:show={forms.showSelectStudent}
  1122. round
  1123. position="bottom"
  1124. safeAreaInsetBottom
  1125. closeable>
  1126. <SelectStudent
  1127. studentItem={forms.studentItem}
  1128. list={forms.studentList}
  1129. onClose={() => (forms.showSelectStudent = false)}
  1130. onConfirm={(val: any) => {
  1131. if (val.userId) {
  1132. forms.studentItem = val;
  1133. const firstStudent = val;
  1134. studentInfo.extra.nickname = firstStudent.nickname;
  1135. const tempGrade: any = forms.gradeList || [];
  1136. const tempArea = [] as any;
  1137. if (firstStudent.provinceName) {
  1138. tempArea.push(firstStudent.provinceName);
  1139. forms.provinceCode = firstStudent.provinceCode;
  1140. }
  1141. if (firstStudent.cityName) {
  1142. tempArea.push(firstStudent.cityName);
  1143. forms.cityCode = firstStudent.cityCode;
  1144. }
  1145. if (firstStudent.regionName) {
  1146. tempArea.push(firstStudent.regionName);
  1147. forms.regionCode = firstStudent.regionCode;
  1148. }
  1149. forms.areaName = tempArea.join(' ');
  1150. forms.schoolName = firstStudent.schoolName;
  1151. forms.schoolId = firstStudent.schoolId;
  1152. forms.schoolAreaId = firstStudent.schoolAreaId;
  1153. studentInfo.extra.currentGradeNum = null;
  1154. forms.gradeNumText = '';
  1155. forms.instrumentCode = '';
  1156. tempGrade?.forEach((i: any) => {
  1157. if (i.value === firstStudent.currentGradeNum) {
  1158. forms.instrumentCode = i.instrumentCode;
  1159. forms.gradeNumText = i.text;
  1160. studentInfo.extra.currentGradeNum =
  1161. firstStudent.currentGradeNum;
  1162. if (forms.schoolInstrumentSetType === 'CLASS') {
  1163. forms.classList = i.classList;
  1164. }
  1165. }
  1166. });
  1167. studentInfo.extra.currentClass = null;
  1168. forms.currentClassText = '';
  1169. forms.classList.forEach((i: any) => {
  1170. if (i.value === firstStudent.currentClass) {
  1171. forms.currentClassText = i.text;
  1172. studentInfo.extra.currentClass = firstStudent.currentClass;
  1173. }
  1174. });
  1175. studentInfo.extra.gender = firstStudent.gender;
  1176. forms.isRegister = 'update';
  1177. changeTipStatus(true, false);
  1178. forms.showSelectStudent = false;
  1179. } else {
  1180. // 判断新建学员是否上限了
  1181. if (forms.studentList.length >= forms.multi_user_limit) {
  1182. otherParams.showOtherMessage = `同一手机号最多创建${forms.multi_user_limit}个学生`;
  1183. otherParams.showOtherSchool = true;
  1184. otherParams.showCancelButton = false;
  1185. otherParams.showCloseButton = true;
  1186. otherParams.confirmButtonColor =
  1187. 'linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)';
  1188. otherParams.confirmButtonText = '我知道了';
  1189. otherParams.otherType = 'limit';
  1190. otherParams.messageAlign = 'center';
  1191. return true;
  1192. } else {
  1193. forms.studentItem = val;
  1194. forms.isRegister = 'create';
  1195. changeTipStatus(false, false);
  1196. studentInfo.extra.nickname = '';
  1197. studentInfo.extra.currentGradeNum = '';
  1198. studentInfo.extra.currentClass = '';
  1199. studentInfo.extra.gender = 1;
  1200. forms.currentClassText = '';
  1201. forms.gradeNumText = '';
  1202. forms.showSelectStudent = false;
  1203. }
  1204. }
  1205. }}
  1206. />
  1207. </Popup>
  1208. <Popup
  1209. v-model:show={forms.showPicker}
  1210. position="bottom"
  1211. round
  1212. class={'popupBottomSearch'}>
  1213. <Area
  1214. areaList={forms.areaList}
  1215. onCancel={() => (forms.showPicker = false)}
  1216. onConfirm={({ selectedOptions }) => {
  1217. forms.provinceCode = selectedOptions[0].value;
  1218. forms.cityCode = selectedOptions[1].value;
  1219. forms.regionCode = selectedOptions[2].value;
  1220. // data.cityName = selectedOptions
  1221. // .map((item: any) => item.text)
  1222. // .join(' ');
  1223. forms.areaName = selectedOptions
  1224. .map((item: any) => item.text)
  1225. .join(' ');
  1226. forms.showPicker = false;
  1227. forms.schoolAreaId = null;
  1228. forms.schoolName = '';
  1229. getSchoolAreaList();
  1230. }}
  1231. />
  1232. </Popup>
  1233. <Popup
  1234. show={forms.showConfirmPopup}
  1235. style={{
  1236. background: 'transparent',
  1237. overflow: 'visible !important'
  1238. }}>
  1239. <CodeDialog type="INFO" showButton={false}>
  1240. <div class={styles.studentInfo}>
  1241. <Cell
  1242. border={false}
  1243. title="学生姓名"
  1244. value={studentInfo.username}></Cell>
  1245. <Cell
  1246. border={false}
  1247. title="学生性别"
  1248. value={studentInfo.extra.gender === 1 ? '男' : '女'}></Cell>
  1249. <Cell
  1250. border={false}
  1251. title="所在地区"
  1252. value={forms.areaName}></Cell>
  1253. <Cell
  1254. border={false}
  1255. title="互通学校"
  1256. value={forms.schoolName}></Cell>
  1257. <Cell
  1258. border={false}
  1259. title="所在年级"
  1260. value={forms.gradeNumText}></Cell>
  1261. <Cell
  1262. border={false}
  1263. title="所在班级"
  1264. value={forms.currentClassText}></Cell>
  1265. {route.query.code && (
  1266. <Cell
  1267. border={false}
  1268. title="互通码"
  1269. value={forms.activationCode}></Cell>
  1270. )}
  1271. </div>
  1272. <div class={styles.studentBtnGroup}>
  1273. <Button
  1274. round
  1275. block
  1276. onClick={() => (forms.showConfirmPopup = false)}>
  1277. 取消
  1278. </Button>
  1279. <Button
  1280. round
  1281. block
  1282. disabled={forms.submitLoading}
  1283. loading={forms.submitLoading}
  1284. color="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)"
  1285. onClick={() => {
  1286. forms.showConfirmPopup = false;
  1287. onSubmit();
  1288. }}>
  1289. 提交
  1290. </Button>
  1291. </div>
  1292. </CodeDialog>
  1293. </Popup>
  1294. <Popup
  1295. show={forms.showResultPopup}
  1296. style={{
  1297. background: 'transparent',
  1298. overflow: 'visible !important'
  1299. }}>
  1300. <CodeDialog
  1301. type={forms.reslutPopupType}
  1302. btnText={
  1303. forms.reslutPopupType === 'ACTIVATING'
  1304. ? '立即下载激活码'
  1305. : '我知道了'
  1306. }
  1307. onConfirm={() => {
  1308. //
  1309. if (forms.reslutPopupType === 'ACTIVATING') {
  1310. router.push('/download');
  1311. } else {
  1312. forms.showResultPopup = false;
  1313. }
  1314. }}>
  1315. {forms.reslutPopupType === 'ACTIVATING' && (
  1316. <p>
  1317. 请下载
  1318. <span style={{ color: '#2B85FF' }}>【音乐数字课堂App】</span>
  1319. ,使用手机号激活,实现音乐课堂互通互联
  1320. </p>
  1321. )}
  1322. {forms.reslutPopupType === 'CANCELLED' && (
  1323. <p style={{ textAlign: 'center' }}>{forms.resultPopupContent}</p>
  1324. )}
  1325. {forms.reslutPopupType === 'EXPIRED' && (
  1326. <p style={{ textAlign: 'center' }}>{forms.resultPopupContent}</p>
  1327. )}
  1328. </CodeDialog>
  1329. </Popup>
  1330. </div>
  1331. );
  1332. }
  1333. });