index.tsx 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438
  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. } from 'vant';
  16. import {
  17. computed,
  18. defineComponent,
  19. nextTick,
  20. onMounted,
  21. onUnmounted,
  22. reactive,
  23. ref
  24. } from 'vue';
  25. import qs from 'query-string';
  26. import {
  27. state as baseState,
  28. goWechatAuth,
  29. setLogin,
  30. setLoginInit
  31. } from '@/state';
  32. import styles from './index.module.less';
  33. import MSticky from '@/components/m-sticky';
  34. // import MVideo from '@/components/m-video';
  35. import { useRoute, useRouter } from 'vue-router';
  36. import { useStudentRegisterStore } from '@/store/modules/student-register-store';
  37. import request from '@/helpers/request';
  38. import { browser, checkPhone, getUrlCode, moneyFormat } from '@/helpers/utils';
  39. import deepClone from '@/helpers/deep-clone';
  40. import OWxTip from '@/components/m-wx-tip';
  41. import MDialog from '@/components/m-dialog';
  42. // import f1 from './images/new/f-1.png';
  43. // import f2 from './images/new/f-2.png';
  44. // import f3 from './images/new/f-3.png';
  45. // import iconTip2 from './images/new/icon-tip2.png';
  46. // import functionBg from './images/new/function-bg.png';
  47. import tuangou from './images/new/tuangou.png';
  48. import icon3 from './images/new/icon-3.png';
  49. import icon5 from './images/new/icon-5.png';
  50. import icon6 from './images/new/icon-6.png';
  51. import giftTip from './images/new/icon-4.png';
  52. import iconGift from './images/new/icon-gift.png';
  53. import dayjs from 'dayjs';
  54. // import MMessageTip from '@/components/m-message-tip';
  55. import { CurrentTime, useCountDown } from '@vant/use';
  56. import Payment from '../adapay/payment';
  57. import QrcodePayment from './qrcode-payment';
  58. import MImgCode from '@/components/m-img-code';
  59. import { beforeSubmit } from './order-state';
  60. import { useInterval, useIntervalFn } from '@vueuse/core';
  61. import MPopup from '@/components/m-popup';
  62. import UserAuth from './component/user-auth';
  63. const classList: any = [];
  64. for (let i = 1; i <= 40; i++) {
  65. classList.push({ text: i + '班', value: i });
  66. }
  67. const GRADE_ENUM = {
  68. '1': '一年级',
  69. '2': '二年级',
  70. '3': '三年级',
  71. '4': '四年级',
  72. '5': '五年级',
  73. '6': '六年级',
  74. '7': '七年级',
  75. '8': '八年级',
  76. '9': '九年级'
  77. } as any;
  78. const getGradeList = (gradeYear: string) => {
  79. let tempList: any = [];
  80. const five = [
  81. { text: '一年级', value: 1 },
  82. { text: '二年级', value: 2 },
  83. { text: '三年级', value: 3 },
  84. { text: '四年级', value: 4 },
  85. { text: '五年级', value: 5 }
  86. ];
  87. const one = [{ text: '六年级', value: 6 }];
  88. const three = [
  89. { text: '七年级', value: 7 },
  90. { text: '八年级', value: 8 },
  91. { text: '九年级', value: 9 }
  92. ];
  93. if (gradeYear === 'FIVE_YEAR_SYSTEM') {
  94. tempList.push(...[...five]);
  95. } else if (gradeYear === 'SIX_YEAR_SYSTEM') {
  96. tempList.push(...[...five, ...one]);
  97. } else if (gradeYear === 'THREE_YEAR_SYSTEM') {
  98. tempList.push(...[...three]);
  99. } else if (gradeYear === 'FORE_YEAR_SYSTEM') {
  100. tempList.push(...[...one, ...three]);
  101. } else {
  102. tempList.push(...[...five, ...one, ...three]);
  103. }
  104. return tempList;
  105. };
  106. export default defineComponent({
  107. name: 'student-register',
  108. setup() {
  109. const route = useRoute();
  110. const studentRegisterStore = useStudentRegisterStore();
  111. const router = useRouter();
  112. // 初始化学校编号
  113. studentRegisterStore.setShoolId(route.query.sId as any);
  114. const countDownRef = ref();
  115. const forms = reactive({
  116. schoolId: route.query.sId as any,
  117. paymentType: '', // 支付类型
  118. // popupShow: false,
  119. details: [] as any[],
  120. // schoolType: '', // 学校类型
  121. gradeYear: '', // 学制
  122. schoolInstrumentSetType: null as any,
  123. // bugGoods: false, // 是否购买AI
  124. registerType: '', // 报名类型
  125. detailVip: {} as any,
  126. giftVipDay: 0, // 赠送天数
  127. submitLoading: false,
  128. // showMore: true,
  129. showTips: false,
  130. showButton: false,
  131. showMessage: '请使用微信打开',
  132. countDownStatus: true,
  133. countDownTime: 1000 * 120, // 倒计时时间
  134. // modelValue: false, // 是否选中协议
  135. imgCodeStatus: false,
  136. gradeNumText: '',
  137. currentClassText: '',
  138. gradeStatus: false,
  139. classStatus: false,
  140. loading: false,
  141. dialogStatus: false,
  142. dialogMessage: '',
  143. dialogConfirmStatus: false,
  144. contract_sign: false, // 是否实名认证
  145. countDownTimePay: 60 * 1000,
  146. dialogConfig: {} as any,
  147. showOtherSchool: false,
  148. showOtherMessage: '',
  149. joinType: '' as 'digitalize' | 'tradition',
  150. gradeList: [] as any,
  151. classList: [] as any,
  152. saveId: null as any,
  153. openId: null as any,
  154. code: null as any,
  155. intervalFnRef: null as any, // 页面订时器
  156. registerExpireTime: null as any, // 结束时间
  157. instrumentCode: null as any, // 乐器编码
  158. activeOverTime: 0, // 活动结束时间
  159. activeOverStatus: true // 活动是否结束 默认已结束
  160. });
  161. const state = reactive({
  162. showQrcode: false,
  163. qrCodeUrl: '',
  164. pay_channel: '',
  165. orderInfo: {} as any, // 订单信息
  166. authShow: false,
  167. orderNo: null as any,
  168. config: {} as any,
  169. paymentStatus: false,
  170. orderTimer: null as any
  171. });
  172. const studentInfo = reactive({
  173. autoRegister: true,
  174. client_id: 'cooleshow-student',
  175. client_secret: 'cooleshow-student',
  176. extra: {
  177. nickname: '',
  178. currentGradeNum: '',
  179. currentClass: '',
  180. gender: 1,
  181. registerType: null as any, // 报名类型
  182. giftVipDay: 0 // 赠送会员天数
  183. },
  184. grant_type: 'password',
  185. loginType: 'SMS',
  186. password: '',
  187. username: ''
  188. });
  189. // 页面定时
  190. const pageTimer = useInterval(1000, { controls: true });
  191. pageTimer.pause();
  192. const countDown = useCountDown({
  193. // 倒计时 60 秒
  194. time: forms.countDownTimePay,
  195. onChange(current: CurrentTime) {
  196. forms.dialogMessage = `有待支付订单,请在${Math.ceil(
  197. current.total / 1000
  198. )}s后重试`;
  199. },
  200. onFinish() {
  201. forms.dialogStatus = false;
  202. }
  203. });
  204. const overCountDown = useCountDown({
  205. time: forms.activeOverTime,
  206. onFinish() {
  207. if (forms.submitLoading) return;
  208. forms.showTips = true;
  209. forms.showMessage = '团购时间已截止,感谢您的参与';
  210. forms.showButton = false;
  211. forms.activeOverStatus = true;
  212. }
  213. });
  214. const onCodeSend = () => {
  215. forms.countDownStatus = false;
  216. nextTick(() => {
  217. countDownRef.value.start();
  218. });
  219. };
  220. const onSendCode = () => {
  221. // 发送验证码
  222. if (!checkPhone(studentInfo.username)) {
  223. return showToast('请输入正确的手机号码');
  224. }
  225. forms.imgCodeStatus = true;
  226. };
  227. const validatePhone = computed(() => {
  228. return checkPhone(studentInfo.username) ? true : false;
  229. });
  230. const onFinished = () => {
  231. forms.countDownStatus = true;
  232. countDownRef.value.reset();
  233. };
  234. const orderType = computed(() => {
  235. return state.orderInfo.orderType;
  236. });
  237. const getRegisterGoods = async () => {
  238. try {
  239. const { data } = await request.get(
  240. '/edu-app/open/userOrder/registerGoods/' + forms.schoolId,
  241. {
  242. noAuthorization: true // 是否请求接口的时候添加toekn
  243. }
  244. );
  245. // 默认选中商品
  246. studentRegisterStore.setVip(data.details || []);
  247. forms.details = deepClone(data.details || []);
  248. forms.registerExpireTime = data.registerExpireTime; // '2024-03-26 21:10:52'; //
  249. if (forms.registerExpireTime) {
  250. if (dayjs(new Date()).isBefore(forms.registerExpireTime)) {
  251. // 活动没有结束
  252. forms.activeOverStatus = false;
  253. // 默认返回毫秒
  254. forms.activeOverTime = dayjs(forms.registerExpireTime).diff(
  255. dayjs(new Date())
  256. );
  257. overCountDown.reset(forms.activeOverTime);
  258. overCountDown.start();
  259. } else {
  260. forms.showTips = true;
  261. forms.showMessage = '团购时间已截止,感谢您的参与';
  262. forms.showButton = false;
  263. forms.activeOverStatus = true;
  264. }
  265. }
  266. if (forms.details.length > 0) {
  267. forms.detailVip = forms.details[0];
  268. // forms.giftVipDay = forms.details[0].membershipDays;
  269. }
  270. forms.giftVipDay = data.giftVipDay || 0;
  271. forms.gradeYear = data.gradeYear;
  272. forms.schoolInstrumentSetType = data.schoolInstrumentSetType;
  273. forms.registerType = data.registerType;
  274. studentInfo.extra.registerType = data.registerType;
  275. const schoolInstrumentList = data.schoolInstrumentList || [];
  276. if (data.schoolInstrumentSetType === 'SCHOOL') {
  277. forms.gradeList = getGradeList(data.gradeYear);
  278. forms.classList = classList;
  279. } else if (data.schoolInstrumentSetType === 'GRADE') {
  280. schoolInstrumentList.forEach((item: any) => {
  281. forms.gradeList.push({
  282. text: GRADE_ENUM[item.gradeNum],
  283. value: item.gradeNum,
  284. instrumentId: item.instrumentId,
  285. instrumentCode: item.instrumentCode
  286. });
  287. });
  288. forms.classList = classList;
  289. } else if (data.schoolInstrumentSetType === 'CLASS') {
  290. // 班级
  291. const tempGradeList: any[] = [];
  292. schoolInstrumentList.forEach((item: any) => {
  293. if (!tempGradeList.includes(item.gradeNum)) {
  294. tempGradeList.push(item.gradeNum);
  295. }
  296. });
  297. const lastGradeList: any[] = [];
  298. tempGradeList.forEach((temp: any) => {
  299. const list = {
  300. text: GRADE_ENUM[temp],
  301. value: temp,
  302. instrumentId: '',
  303. instrumentCode: '',
  304. instrumentName: '',
  305. classList: [] as any
  306. };
  307. schoolInstrumentList.forEach((item: any) => {
  308. if (temp === item.gradeNum) {
  309. list.instrumentId = item.instrumentId;
  310. list.instrumentCode = item.instrumentCode;
  311. list.instrumentName = item.instrumentName;
  312. list.classList.push({
  313. text: item.classNum + '班',
  314. value: item.classNum
  315. });
  316. }
  317. });
  318. // 排序班级
  319. list.classList.sort((a: any, b: any) => a.value - b.value);
  320. lastGradeList.push(list);
  321. });
  322. forms.gradeList = lastGradeList;
  323. forms.classList = [];
  324. } else {
  325. forms.gradeList = getGradeList(data.gradeYear);
  326. forms.classList = classList;
  327. }
  328. if (browser().weixin) {
  329. // if (
  330. // data.schoolStatus === 0 &&
  331. // forms.schoolId == '1770035687490105346'
  332. // ) {
  333. // forms.showTips = true;
  334. // forms.showMessage = '团购时间已截止,感谢您的参与';
  335. // forms.showButton = false;
  336. // return;
  337. // }
  338. if (data.registerType !== 'BUG_GOODS' || data.schoolStatus === 0) {
  339. forms.showTips = true;
  340. forms.showMessage = '二维码已经失效,详情请咨询学校老师';
  341. forms.showButton = false;
  342. return;
  343. }
  344. } else {
  345. forms.showTips = true;
  346. }
  347. } catch {}
  348. };
  349. // 计算金额
  350. const calcPrice = computed(() => {
  351. let amount: number = 0; //现价
  352. let originAmount: number = 0; // 原价
  353. const vipList: any[] = studentRegisterStore.getVip;
  354. vipList.forEach((vip: any) => {
  355. amount += Number(vip.currentPrice);
  356. originAmount += Number(vip.originalPrice);
  357. });
  358. // const goodsList: any[] = studentRegisterStore.getGoods;
  359. // goodsList.forEach((good: any) => {
  360. // amount += Number(good.price) * good.quantity;
  361. // originAmount += Number(good.originalPrice) * good.quantity;
  362. // });
  363. return {
  364. amount,
  365. originAmount
  366. };
  367. });
  368. const checkForm = () => {
  369. if (!checkPhone(studentInfo.username)) {
  370. showToast('请输入正确的手机号码');
  371. return true;
  372. } else if (!studentInfo.password) {
  373. showToast('请输入验证码');
  374. return true;
  375. } else if (!studentInfo.extra.nickname) {
  376. showToast('请输入学生姓名');
  377. return true;
  378. } else if (!studentInfo.extra.currentGradeNum) {
  379. showToast('请选择所在年级');
  380. return true;
  381. } else if (!studentInfo.extra.currentClass) {
  382. showToast('请选择所在班级');
  383. return true;
  384. }
  385. return false;
  386. };
  387. // 登记成功之后购买
  388. const onSubmit = async () => {
  389. forms.submitLoading = true;
  390. try {
  391. if (checkForm()) {
  392. forms.submitLoading = false;
  393. return;
  394. }
  395. const { extra, ...res } = studentInfo;
  396. const result = await request.post('/edu-app/userlogin', {
  397. requestType: 'form',
  398. data: {
  399. ...res,
  400. extra: JSON.stringify({
  401. ...extra,
  402. giftVipDay:
  403. forms.detailVip.membershipDays || 0 + forms.giftVipDay || 0,
  404. schoolId: forms.schoolId
  405. })
  406. }
  407. });
  408. if (result.code !== 200) {
  409. if (result.code === 5436) {
  410. forms.showTips = true;
  411. forms.showMessage = '二维码已经失效,详情请咨询学校老师';
  412. forms.showButton = false;
  413. } else if (result.code === 5435) {
  414. forms.showTips = true;
  415. forms.showMessage = result.message;
  416. forms.showButton = true;
  417. } else if (result.code === 5435) {
  418. forms.showTips = true;
  419. forms.showMessage = result.message;
  420. forms.showButton = false;
  421. }
  422. } else {
  423. studentRegisterStore.setToken(
  424. result.data.token_type + ' ' + result.data.access_token
  425. );
  426. setLoginInit();
  427. let joinType = 'NOT_REGISTER';
  428. if (forms.joinType === 'digitalize') {
  429. joinType = 'SELECT_INSTRUMENT';
  430. }
  431. if (forms.joinType === 'tradition') {
  432. joinType = 'NOT_BUY_INSTRUMENT';
  433. }
  434. // 更新时间
  435. await updateStat(
  436. pageTimer.counter.value,
  437. joinType,
  438. result.data.userId,
  439. forms.schoolId
  440. );
  441. pageTimer.counter.value = 0;
  442. // 传统方式
  443. if (forms.joinType === 'tradition') {
  444. setTimeout(() => {
  445. showToast('报名成功');
  446. router.push('/download');
  447. }, 100);
  448. return;
  449. }
  450. // 获取用户信息
  451. const res = await request.get('/edu-app/user/getUserInfo', {
  452. requestType: 'form'
  453. });
  454. setLogin(res.data);
  455. await onRegisterSubmit();
  456. }
  457. } finally {
  458. }
  459. forms.submitLoading = false;
  460. };
  461. // 登记成功之后购买
  462. const onRegisterSubmit = async () => {
  463. try {
  464. // 请求是否有待支付订单,如果有则自动关闭
  465. const status = await paymentOrderUnpaid();
  466. if (status) return;
  467. const schoolInfo = await request.get(
  468. '/edu-app/userPaymentOrder/registerStatus/' + forms.schoolId
  469. );
  470. const vipList = studentRegisterStore.getVip;
  471. if (schoolInfo.data.hasBuyCourse && vipList.length > 0) {
  472. forms.dialogConfirmStatus = true;
  473. return;
  474. }
  475. await paymentContinue();
  476. } catch {
  477. //
  478. }
  479. };
  480. const getUserInfos = async () => {
  481. if (
  482. studentInfo.password.length !== 6 ||
  483. !checkPhone(studentInfo.username)
  484. ) {
  485. return;
  486. }
  487. try {
  488. // 15907120131;
  489. const { data } = await request.get(
  490. `/edu-app/open/student/studentInfo?mobile=${studentInfo.username}&code=${studentInfo.password}&type=REGISTER`
  491. );
  492. if (data) {
  493. if (!studentInfo.extra.nickname) {
  494. studentInfo.extra.nickname = data.nickname;
  495. }
  496. if (!studentInfo.extra.currentGradeNum) {
  497. const tempGrade: any = forms.gradeList || [];
  498. console.log(tempGrade, 'tempGrade');
  499. tempGrade?.forEach((i: any) => {
  500. if (i.value === data.currentGradeNum) {
  501. forms.instrumentCode = i.instrumentCode;
  502. forms.gradeNumText = i.text;
  503. studentInfo.extra.currentGradeNum = data.currentGradeNum;
  504. }
  505. });
  506. }
  507. if (!studentInfo.extra.currentClass) {
  508. forms.classList.forEach((i: any) => {
  509. if (i.value === data.currentClass) {
  510. forms.currentClassText = i.text;
  511. studentInfo.extra.currentClass = data.currentClass;
  512. }
  513. });
  514. }
  515. studentInfo.extra.gender =
  516. studentInfo.extra.gender !== data.gender
  517. ? data.gender
  518. : studentInfo.extra.gender;
  519. }
  520. } catch {
  521. //
  522. }
  523. };
  524. // 查询未支付订单
  525. const paymentOrderUnpaid = async () => {
  526. let result = false;
  527. try {
  528. const { data } = await request.get('/edu-app/userPaymentOrder/unpaid');
  529. // 判断是否有待支付订单
  530. if (!data.id) return false;
  531. // 判断是否可以取消订单
  532. if (data.cancelPayment) {
  533. await request.post(
  534. '/edu-app/userPaymentOrder/cancelPayment/' + data.orderNo
  535. );
  536. return false;
  537. } else {
  538. forms.countDownTime = data.cancelTimes;
  539. countDown.reset(Number(data.cancelTimes));
  540. countDown.start();
  541. forms.dialogMessage = `有待支付订单,请在${Math.ceil(
  542. countDown.current.value.total / 1000
  543. )}s后重试`;
  544. forms.dialogStatus = true;
  545. forms.dialogConfig = data;
  546. result = true;
  547. }
  548. } catch {
  549. //
  550. }
  551. return result;
  552. };
  553. const paymentContinue = async () => {
  554. try {
  555. const vipList = studentRegisterStore.getVip;
  556. const goodsList = studentRegisterStore.getGoods;
  557. const params: any[] = [];
  558. vipList.forEach((vip: any) => {
  559. params.push({
  560. giftVipDay: vip.membershipDays,
  561. goodsId: vip.goodsId,
  562. goodsNum: 1,
  563. goodsType: vip.goodsType,
  564. paymentCashAmount: vip.currentPrice, // 现金支付金额
  565. paymentCouponAmount: 0 // 优惠券金额
  566. });
  567. });
  568. goodsList.forEach((goods: any) => {
  569. params.push({
  570. goodsId: goods.productId,
  571. goodsNum: goods.quantity,
  572. goodsType: 'INSTRUMENTS',
  573. paymentCashAmount: goods.price, // 现金支付金额
  574. paymentCouponAmount: 0, // 优惠券金额
  575. goodsSkuId: goods.productSkuId
  576. });
  577. });
  578. // 创建订单
  579. const result = await request.post(
  580. '/edu-app/userPaymentOrder/executeOrder',
  581. {
  582. // hideLoading: false,
  583. data: {
  584. buryId: forms.saveId,
  585. registerType: forms.registerType,
  586. paymentType: forms.paymentType,
  587. bizId: forms.schoolId, // 乐团编号
  588. orderType: 'SCHOOL_REGISTER',
  589. paymentCashAmount: calcPrice.value.amount || 0,
  590. paymentCouponAmount: 0,
  591. goodsInfos: params,
  592. orderName: '学生登记',
  593. orderDesc: '学生登记'
  594. }
  595. }
  596. );
  597. if (result.code === 5436) {
  598. forms.showTips = true;
  599. forms.showMessage = '二维码已经失效,详情请咨询学校老师';
  600. forms.showButton = false;
  601. } else if (result.code === 5435) {
  602. forms.showTips = true;
  603. forms.showMessage = result.message;
  604. forms.showButton = true;
  605. } else {
  606. state.config = {
  607. ...result.data.paymentConfig,
  608. paymentType: result.data.paymentType
  609. };
  610. state.orderNo = result.data.orderNo;
  611. await lastSubmit();
  612. }
  613. } catch (e: any) {
  614. console.log(e, 'any');
  615. }
  616. };
  617. const lastSubmit = async () => {
  618. try {
  619. const users = baseState.user.data;
  620. // 判断是否需要实名认证, 姓名,卡号 - 参数设置可以控制
  621. if (
  622. forms.contract_sign &&
  623. (!users?.account.realName || !users?.account.idCardNo)
  624. ) {
  625. state.authShow = true;
  626. return;
  627. }
  628. const { data } = await request.post(
  629. '/edu-app/userPaymentOrder/updateReceiveAddress',
  630. {
  631. // hideLoading: false,
  632. data: {
  633. orderNo: state.orderNo,
  634. orderType: 'SCHOOL_REGISTER'
  635. }
  636. }
  637. );
  638. state.pay_channel = data.paymentChannel;
  639. if (data.status !== 'WAIT_PAY' && data.status !== 'PAYING') {
  640. router.replace({
  641. path: '/payment-result',
  642. query: {
  643. orderNo: state.orderNo
  644. }
  645. });
  646. } else {
  647. onCallback();
  648. }
  649. } catch {
  650. //
  651. }
  652. };
  653. /**
  654. * @description 回调,判断是否有支付渠道,如果有则直接去支付
  655. * @returns void
  656. */
  657. const onCallback = () => {
  658. const pt = state.pay_channel;
  659. // 判断是否有支付方式
  660. if (pt) {
  661. const payCode: string = beforeSubmit(state.pay_channel);
  662. onConfirm({
  663. payCode,
  664. pay_channel: pt
  665. });
  666. } else {
  667. if (orderType.value === 'VIP') {
  668. state.paymentStatus = true;
  669. } else {
  670. // 直接去拉取微信支付
  671. onConfirm({
  672. payCode: 'payResult',
  673. pay_channel: 'wx_pub'
  674. });
  675. }
  676. }
  677. };
  678. const onConfirm = (val: any) => {
  679. const config: any = state.config;
  680. state.pay_channel = val.pay_channel;
  681. const params = qs.stringify({
  682. pay_channel: val.pay_channel,
  683. wxAppId: config.wxAppId,
  684. alipayAppId: config.alipayAppId,
  685. paymentType: forms.paymentType,
  686. body: config.body,
  687. price: config.price,
  688. orderNo: config.merOrderNo,
  689. userId: config.userId
  690. });
  691. // console.log(params, state.config);
  692. // return;
  693. if (val.payCode === 'payResult') {
  694. window.location.href =
  695. window.location.origin + '/classroom-app/#/payResult?' + params;
  696. } else {
  697. state.qrCodeUrl =
  698. window.location.origin + '/classroom-app/#/payDefine?' + params;
  699. state.showQrcode = true;
  700. state.paymentStatus = false;
  701. setTimeout(() => {
  702. getPaymentOrderStatus();
  703. }, 300);
  704. }
  705. };
  706. // 放弃支付时,则取消订单
  707. const onBackOut = async () => {
  708. try {
  709. await request.post(
  710. '/edu-app/userPaymentOrder/cancelPayment/' + state.orderNo
  711. );
  712. // router.back();
  713. } catch {
  714. //
  715. }
  716. };
  717. // 轮询查询订单状态
  718. const getPaymentOrderStatus = async () => {
  719. // 循环查询订单
  720. // const orderNo = state.orderNo
  721. const orderTimer = setInterval(async () => {
  722. // 判断是否在当前路由,如果不是则清除定时器
  723. if (route.name != 'student-register-form') {
  724. clearInterval(orderTimer);
  725. return;
  726. }
  727. state.orderTimer = orderTimer;
  728. try {
  729. const { data } = await request.post(
  730. '/edu-app/open/userOrder/paymentStatus/' + state.orderNo,
  731. {
  732. hideLoading: true
  733. }
  734. );
  735. if (data.status !== 'WAIT_PAY' && data.status !== 'PAYING') {
  736. // 默认关闭支付二维码弹窗
  737. state.showQrcode = false;
  738. clearInterval(state.orderTimer);
  739. setTimeout(() => {
  740. router.replace({
  741. path: '/payment-result',
  742. query: {
  743. orderNo: state.orderNo
  744. }
  745. });
  746. }, 100);
  747. }
  748. } catch {
  749. //
  750. clearInterval(state.orderTimer);
  751. }
  752. }, 5000);
  753. };
  754. // 实名认证成功
  755. const onAuthSuccess = () => {
  756. //
  757. state.authShow = false;
  758. paymentContinue(); // 实名成功后自动支付
  759. };
  760. /**
  761. * 页面停留时间
  762. * @param pageBrowseTime 停留时间
  763. * @param joinType 加入方式
  764. * @param userId 用户编号
  765. * @param schoolId 学校编号
  766. */
  767. const updateStat = async (
  768. pageBrowseTime = 5,
  769. joinType?: string,
  770. userId?: string,
  771. schoolId?: string
  772. ) => {
  773. try {
  774. const { data } = await request.post(
  775. '/edu-app/open/studentRegisterPointRecord/update',
  776. {
  777. data: {
  778. id: forms.saveId,
  779. useTime: pageBrowseTime, // 固定10秒
  780. joinType,
  781. userId,
  782. schoolId
  783. }
  784. }
  785. );
  786. forms.saveId = data;
  787. } catch {
  788. //
  789. }
  790. };
  791. const getAppIdAndCode = async (url?: string) => {
  792. try {
  793. const { data } = await request.get(
  794. '/edu-app/open/paramConfig/wechatAppId'
  795. );
  796. // 判断是否有微信appId
  797. if (data) {
  798. closeToast();
  799. goWechatAuth(data, url);
  800. }
  801. } catch {
  802. //
  803. }
  804. };
  805. if (browser().weixin) {
  806. //授权
  807. const openId = sessionStorage.getItem('active-open-id');
  808. forms.openId = openId;
  809. const code = getUrlCode();
  810. if (!code) {
  811. const newUrl =
  812. window.location.origin +
  813. window.location.pathname +
  814. '#' +
  815. route.path +
  816. '?' +
  817. qs.stringify({
  818. ...route.query
  819. });
  820. getAppIdAndCode(newUrl);
  821. return '';
  822. } else {
  823. forms.code = code;
  824. }
  825. }
  826. const formatTimerTo = (num: number): string => {
  827. if (num > 9) {
  828. return num + '';
  829. } else {
  830. return '0' + num;
  831. }
  832. };
  833. onMounted(async () => {
  834. try {
  835. getRegisterGoods();
  836. // 判断是否获取微信code码
  837. if (!forms.code) return;
  838. const { data } = await request.post(
  839. '/edu-app/open/studentRegisterPointRecord/save',
  840. {
  841. data: {
  842. code: forms.code,
  843. schoolId: forms.schoolId,
  844. openId: forms.openId
  845. }
  846. }
  847. );
  848. forms.saveId = data.id;
  849. forms.openId = data.openId;
  850. sessionStorage.setItem('active-open-id', data.openId);
  851. // 间隔多少时间同步数据
  852. forms.intervalFnRef = useIntervalFn(async () => {
  853. // 页面时间恢复
  854. pageTimer.counter.value = 0;
  855. pageTimer.resume();
  856. // 同步数据时先进行有效时间进行保存
  857. await updateStat();
  858. }, 5000);
  859. } catch {}
  860. });
  861. onUnmounted(() => {
  862. forms.intervalFnRef?.pause(); // 暂停回调
  863. });
  864. return () => (
  865. <div class={styles['student-register']}>
  866. <div class={styles.studentRegisterContainer}>
  867. {!forms.activeOverStatus && (
  868. <div class={styles.countdownSection}>
  869. <div class={styles.timer}>
  870. <img src={icon3} class={styles.timerTitle} />
  871. <div class={styles.timerAll}>
  872. <span>{formatTimerTo(overCountDown.current.value.days)}</span>
  873. <span>
  874. {formatTimerTo(overCountDown.current.value.hours)}
  875. </span>
  876. <span>
  877. {formatTimerTo(overCountDown.current.value.minutes)}
  878. </span>
  879. <span>
  880. {formatTimerTo(overCountDown.current.value.seconds)}
  881. </span>
  882. </div>
  883. </div>
  884. <div class={styles.timerTip}>
  885. 请在规定时间内报名,超过截止时间,将无法使用个人账号
  886. </div>
  887. </div>
  888. )}
  889. <div
  890. class={[styles.studentSection, styles.studentSectionForm]}
  891. // style={{ display: 'none' }}
  892. >
  893. <div class={styles.title1}></div>
  894. <Form labelAlign="left" class={styles.registerForm}>
  895. <Field
  896. clearable={false}
  897. label="联系方式(直接监护人)"
  898. placeholder="请输入手机号码"
  899. type="tel"
  900. required
  901. autocomplete="off"
  902. inputAlign="right"
  903. class={styles.username}
  904. v-model={studentInfo.username}
  905. border={false}
  906. maxlength={11}>
  907. {{
  908. label: () => (
  909. <div>
  910. 联系方式
  911. {/* (直接监护人) */}
  912. <p class={styles.tips}>(直接监护人)</p>
  913. </div>
  914. )
  915. }}
  916. </Field>
  917. <div class={['van-hairline--bottom', styles.fieldTipsGroup]}>
  918. <div class={[styles.fieldTips]}>
  919. 手机号是音乐数字课堂的唯一登录账户
  920. </div>
  921. </div>
  922. <Field
  923. center
  924. clearable={false}
  925. required
  926. inputAlign="right"
  927. label="验证码"
  928. placeholder="请输入验证码"
  929. autocomplete="off"
  930. type="number"
  931. v-model={studentInfo.password}
  932. maxlength={6}
  933. onUpdate:modelValue={(val: any) => {
  934. getUserInfos();
  935. }}>
  936. {{
  937. button: () =>
  938. forms.countDownStatus ? (
  939. <span
  940. class={[
  941. styles.codeText,
  942. !validatePhone.value ? styles.codeTextDisabled : ''
  943. ]}
  944. onClick={onSendCode}>
  945. 获取验证码
  946. </span>
  947. ) : (
  948. <CountDown
  949. ref={(el: any) => (countDownRef.value = el)}
  950. auto-start={false}
  951. class={styles.countDown}
  952. time={forms.countDownTime}
  953. onFinish={onFinished}
  954. format="ss秒后重试"
  955. />
  956. )
  957. }}
  958. </Field>
  959. <Field
  960. clearable={false}
  961. required
  962. inputAlign="right"
  963. label="学生姓名"
  964. placeholder="请输入学生姓名"
  965. autocomplete="off"
  966. maxlength={14}
  967. v-model={studentInfo.extra.nickname}
  968. />
  969. <Field
  970. clearable={false}
  971. required
  972. inputAlign="right"
  973. label="学生性别"
  974. placeholder="请选择性别"
  975. autocomplete="off"
  976. // v-model={studentInfo.extra.nickname}
  977. >
  978. {{
  979. input: () => (
  980. <RadioGroup
  981. checked-color="linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)"
  982. v-model={studentInfo.extra.gender}
  983. direction="horizontal">
  984. <Tag
  985. size="large"
  986. type="primary"
  987. color={
  988. !(studentInfo.extra.gender === 1)
  989. ? '#F5F6FA'
  990. : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
  991. }
  992. textColor={
  993. !(studentInfo.extra.gender === 1) ? '#626264' : '#fff'
  994. }
  995. class={styles.radioSection}>
  996. <Radio class={styles.radioItem} name={1}></Radio>男
  997. </Tag>
  998. <Tag
  999. size="large"
  1000. type="primary"
  1001. color={
  1002. !(studentInfo.extra.gender === 0)
  1003. ? '#F5F6FA'
  1004. : 'linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)'
  1005. }
  1006. textColor={
  1007. !(studentInfo.extra.gender === 0) ? '#626264' : '#fff'
  1008. }
  1009. class={styles.radioSection}>
  1010. <Radio class={styles.radioItem} name={0}></Radio>女
  1011. </Tag>
  1012. </RadioGroup>
  1013. )
  1014. }}
  1015. </Field>
  1016. <Field
  1017. clearable={false}
  1018. required
  1019. inputAlign="right"
  1020. label="所在年级"
  1021. placeholder="请选择年级"
  1022. isLink
  1023. readonly
  1024. clickable={false}
  1025. modelValue={forms.gradeNumText}
  1026. onClick={() => (forms.gradeStatus = true)}
  1027. />
  1028. <Field
  1029. clearable={false}
  1030. required
  1031. inputAlign="right"
  1032. label="所在班级"
  1033. placeholder="请选择班级"
  1034. isLink
  1035. readonly
  1036. clickable={false}
  1037. modelValue={forms.currentClassText}
  1038. onClick={() => {
  1039. if (
  1040. forms.schoolInstrumentSetType === 'CLASS' &&
  1041. forms.classList.length <= 0
  1042. ) {
  1043. showToast('请先选择年级');
  1044. return;
  1045. }
  1046. forms.classStatus = true;
  1047. }}
  1048. />
  1049. {forms.giftVipDay > 0 ? (
  1050. <div class={styles.memberNumer}>
  1051. <img src={iconGift} class={styles.iconGift} />
  1052. <p>
  1053. 注册成功即可获得乐器AI学练工具
  1054. <span>{forms.giftVipDay || 0}</span>天有效期
  1055. </p>
  1056. </div>
  1057. ) : (
  1058. ''
  1059. )}
  1060. </Form>
  1061. </div>
  1062. <div class={styles.studentSection}>
  1063. <div class={styles.title2}></div>
  1064. <div class={styles.goodsGroup}>
  1065. <div
  1066. class={[
  1067. styles.goodsItem,
  1068. styles.digitalize,
  1069. forms.joinType === 'digitalize' && styles.checked
  1070. ]}
  1071. onClick={() => {
  1072. if (!forms.gradeNumText) {
  1073. showToast('请先选择所在年级');
  1074. return;
  1075. }
  1076. forms.joinType = 'digitalize';
  1077. }}>
  1078. <div class={styles.goodsInner}>
  1079. <i class={styles.proposalTip}></i>
  1080. 数字化方式
  1081. </div>
  1082. </div>
  1083. <div
  1084. class={[
  1085. styles.goodsItem,
  1086. styles.tradition,
  1087. forms.joinType === 'tradition' && styles.checked
  1088. ]}
  1089. onClick={() => {
  1090. if (!forms.gradeNumText) {
  1091. showToast('请先选择所在年级');
  1092. return;
  1093. }
  1094. forms.joinType = 'tradition';
  1095. }}>
  1096. <div class={styles.goodsInner}>传统方式</div>
  1097. </div>
  1098. </div>
  1099. </div>
  1100. {forms.joinType === 'digitalize' && (
  1101. <div class={[styles.goodsExtra]}>
  1102. <i class={styles.iconArrow}></i>
  1103. <Cell border={false} class={styles.goodsCell}>
  1104. {{
  1105. icon: () => <Image class={styles.img} src={tuangou} />,
  1106. title: () => (
  1107. <div class={styles.section}>
  1108. <div class={styles.sectionContent}>
  1109. <h2>
  1110. {/* {forms.detailVip.goodsName} */}
  1111. <img src={icon5} class={styles.goodsName} />
  1112. <Tag class={styles.brandName}>
  1113. {/* {forms.detailVip.brandName} */}
  1114. 12个月
  1115. </Tag>
  1116. </h2>
  1117. <p class={[styles.model]}>
  1118. {/* 解决学生不会练、不知练的对错、家长无法辅导、无需再额外请老师 */}
  1119. {/* {forms.detailVip.description} */}
  1120. <p>
  1121. <i></i>解决学生不会练、不知练的对错
  1122. </p>
  1123. <p>
  1124. <i></i>家长无法辅导、无需再额外请老师
  1125. </p>
  1126. </p>
  1127. {/* <span class={styles.sendInstrument}>赠送课堂乐器</span> */}
  1128. <img src={icon6} class={styles.sendInstrument} />
  1129. </div>
  1130. </div>
  1131. )
  1132. }}
  1133. </Cell>
  1134. {forms.detailVip.membershipDays ? (
  1135. <div class={styles.memberNumer}>
  1136. <img src={iconGift} class={styles.iconGift} />
  1137. <p>
  1138. 现在购买赠送乐器AI学练工具
  1139. <span>{forms.detailVip.membershipDays || 0}</span>天有效期
  1140. </p>
  1141. </div>
  1142. ) : (
  1143. ''
  1144. )}
  1145. </div>
  1146. )}
  1147. {forms.joinType === 'tradition' && (
  1148. <div class={styles.goodsTradition}>
  1149. <i class={styles.iconArrow}></i>
  1150. <div class={styles.goodsTitle}></div>
  1151. <div class={styles.steps}>
  1152. <div class={styles.step}>
  1153. <span class={styles.nums}>
  1154. <span class={styles.numInner}>1</span>
  1155. </span>
  1156. <div class={styles.stepContent}>
  1157. <span>AI工具标准:</span>
  1158. 可以学练音乐教材中的乐曲,通过手机应用商店准备。
  1159. </div>
  1160. </div>
  1161. {forms.instrumentCode === 'Panpipes' && (
  1162. <div class={styles.step}>
  1163. <span class={styles.nums}>
  1164. <span class={styles.numInner}>2</span>
  1165. </span>
  1166. <div class={styles.stepContent}>
  1167. <span>乐器标准:</span>
  1168. 管数不限,建议20管以上C调加嘴排箫(音域宽,能演奏更多复杂乐曲,不需要重复更换),黑色,要选择单一原调(调性多学生很难掌握),价格由学生根据自身情况确定。
  1169. </div>
  1170. </div>
  1171. )}
  1172. </div>
  1173. </div>
  1174. )}
  1175. {forms.joinType && (
  1176. <MSticky position="bottom">
  1177. <div class={styles.paymentContainer}>
  1178. {forms.joinType === 'digitalize' && (
  1179. <>
  1180. <div class={styles.payemntPrice}>
  1181. <img src={giftTip} class={styles.giftTip} />
  1182. <div>
  1183. <span class={styles.needPrice}>
  1184. <i style="font-style: normal">¥ </i>
  1185. <span>{moneyFormat(calcPrice.value.amount)}</span>
  1186. <i style="font-style: normal">/年</i>
  1187. </span>
  1188. {calcPrice.value.originAmount >
  1189. calcPrice.value.amount ? (
  1190. <del class={styles.allPrice}>
  1191. ¥ {moneyFormat(calcPrice.value.originAmount)}
  1192. </del>
  1193. ) : (
  1194. ''
  1195. )}
  1196. </div>
  1197. </div>
  1198. <div
  1199. class={styles.paymentBtn}
  1200. onClick={() => {
  1201. onSubmit();
  1202. }}>
  1203. <Button
  1204. round
  1205. disabled={forms.submitLoading}
  1206. loading={forms.submitLoading}>
  1207. 立即支付
  1208. </Button>
  1209. </div>
  1210. </>
  1211. )}
  1212. {forms.joinType === 'tradition' && (
  1213. <div
  1214. class={styles.traditionBtn}
  1215. onClick={() => {
  1216. onSubmit();
  1217. }}>
  1218. <Button
  1219. round
  1220. disabled={forms.submitLoading}
  1221. loading={forms.submitLoading}>
  1222. 提交报名
  1223. </Button>
  1224. </div>
  1225. )}
  1226. </div>
  1227. </MSticky>
  1228. )}
  1229. </div>
  1230. {forms.imgCodeStatus ? (
  1231. <MImgCode
  1232. v-model:value={forms.imgCodeStatus}
  1233. phone={studentInfo.username}
  1234. type="REGISTER"
  1235. onClose={() => {
  1236. forms.imgCodeStatus = false;
  1237. }}
  1238. onSendCode={onCodeSend}
  1239. />
  1240. ) : null}
  1241. {/* 年级 */}
  1242. <Popup
  1243. v-model:show={forms.gradeStatus}
  1244. position="bottom"
  1245. round
  1246. safeAreaInsetBottom
  1247. lazyRender={false}
  1248. class={'popupBottomSearch'}>
  1249. <Picker
  1250. showToolbar
  1251. columns={forms.gradeList}
  1252. onCancel={() => (forms.gradeStatus = false)}
  1253. onConfirm={(val: any) => {
  1254. const selectedOption = val.selectedOptions[0];
  1255. studentInfo.extra.currentGradeNum = selectedOption.value;
  1256. forms.gradeNumText = selectedOption.text;
  1257. forms.instrumentCode = selectedOption.instrumentCode;
  1258. forms.gradeStatus = false;
  1259. if (forms.schoolInstrumentSetType === 'CLASS') {
  1260. forms.classList = selectedOption.classList;
  1261. }
  1262. if (['CLASS', 'GRADE'].includes(forms.schoolInstrumentSetType)) {
  1263. forms.currentClassText = '';
  1264. studentInfo.extra.currentClass = '';
  1265. }
  1266. }}
  1267. />
  1268. </Popup>
  1269. {/* 班级 */}
  1270. <Popup
  1271. v-model:show={forms.classStatus}
  1272. position="bottom"
  1273. round
  1274. class={'popupBottomSearch'}>
  1275. <Picker
  1276. showToolbar
  1277. columns={forms.classList}
  1278. onCancel={() => (forms.classStatus = false)}
  1279. onConfirm={(val: any) => {
  1280. const selectedOption = val.selectedOptions[0];
  1281. studentInfo.extra.currentClass = selectedOption.value;
  1282. forms.currentClassText = selectedOption.text;
  1283. forms.classStatus = false;
  1284. }}
  1285. />
  1286. </Popup>
  1287. {/* 已经购买过样品 */}
  1288. <MDialog
  1289. title="提示"
  1290. v-model:show={forms.dialogConfirmStatus}
  1291. message={'已购买会员,是否确认购买?'}
  1292. primaryColor="#FF8057"
  1293. allowHtml={true}
  1294. confirmButtonText="确定"
  1295. showCancelButton
  1296. onConfirm={async () => {
  1297. await paymentContinue();
  1298. }}
  1299. />
  1300. <MDialog
  1301. title="提示"
  1302. v-model:show={forms.dialogStatus}
  1303. message={forms.dialogMessage}
  1304. allowHtml={true}
  1305. primaryColor="#FF8057"
  1306. confirmButtonText="继续支付"
  1307. onConfirm={async () => {
  1308. countDown.pause();
  1309. const paymentConfig = forms.dialogConfig.paymentConfig;
  1310. state.config = paymentConfig?.paymentConfig;
  1311. state.orderNo = paymentConfig?.orderNo;
  1312. await lastSubmit();
  1313. }}
  1314. onCancel={(val: any) => {
  1315. countDown.pause();
  1316. }}
  1317. />
  1318. <Popup
  1319. show={state.paymentStatus}
  1320. closeOnClickOverlay={false}
  1321. position="bottom"
  1322. round
  1323. closeOnPopstate
  1324. safeAreaInsetBottom
  1325. style={{ minHeight: '30%' }}>
  1326. <Payment
  1327. paymentConfig={state.orderInfo}
  1328. onClose={() => (state.paymentStatus = false)}
  1329. onBackOut={onBackOut}
  1330. onConfirm={(val: any) => onConfirm(val)}
  1331. />
  1332. </Popup>
  1333. <Popup
  1334. v-model:show={state.showQrcode}
  1335. round
  1336. onClose={() => {
  1337. // 二维码关闭时清除定时器
  1338. clearInterval(state.orderTimer);
  1339. }}>
  1340. <QrcodePayment
  1341. url={state.qrCodeUrl}
  1342. pay_channel={state.pay_channel}
  1343. orderType={orderType.value}
  1344. />
  1345. </Popup>
  1346. <MPopup v-model:modelValue={state.authShow}>
  1347. <UserAuth onSuccess={onAuthSuccess} hideHeader={!browser().isApp} />
  1348. </MPopup>
  1349. {/* 是否在微信中打开 */}
  1350. <OWxTip
  1351. show={forms.showTips}
  1352. message={forms.showMessage}
  1353. showButton={forms.showButton}
  1354. buttonText="刷新"
  1355. onConfirm={() => window.location.reload()}
  1356. />
  1357. </div>
  1358. );
  1359. }
  1360. });