index.tsx 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  1. import { defineComponent, onMounted, onUnmounted, reactive, ref, nextTick, computed, watch } from 'vue';
  2. import styles from './index.module.less';
  3. import {
  4. Button,
  5. CellGroup,
  6. Field,
  7. Picker,
  8. Popup,
  9. closeToast,
  10. showToast,
  11. Loading,
  12. Form,
  13. CountDown,
  14. Cell,
  15. Area,
  16. } from 'vant';
  17. import { useRoute, useRouter } from 'vue-router';
  18. // import threeMan from './images/update/three-man.png'
  19. import OWxTip from '@/components/m-wx-tip';
  20. import { checkPhone } from '@/helpers/utils';
  21. import qs from 'query-string';
  22. import request from '@/helpers/request';
  23. import MImgCode from '@/components/m-img-code';
  24. import MSearch from '@/components/m-search';
  25. import submitBtn from './images/submit_icon.png'
  26. import signupBtn from './images/signup_icon.png'
  27. import signSusIcon from './images/sign_icon.png'
  28. import subSusIcon from './images/subsus_icon.png'
  29. import doneIcon from './images/done_icon.png'
  30. import { api_sysAreaQueryAllProvince, api_queryTennatArea } from '@/views/school-register/api';
  31. import useAuthCode from '@/hooks/useAuthCode';
  32. export default defineComponent({
  33. name: 'fill-questionnaire',
  34. setup() {
  35. const router = useRouter();
  36. const route = useRoute();
  37. const authCode = useAuthCode();
  38. const classList: any = [];
  39. for (let i = 1; i <= 40; i++) {
  40. classList.push({ text: i + '班', value: i });
  41. }
  42. const gradeList = [
  43. {
  44. text: '一年级',
  45. value: 1
  46. },
  47. {
  48. text: '二年级',
  49. value: 2
  50. },
  51. {
  52. text: '三年级',
  53. value: 3
  54. },
  55. {
  56. text: '四年级',
  57. value: 4
  58. },
  59. {
  60. text: '五年级',
  61. value: 5
  62. },
  63. {
  64. text: '六年级',
  65. value: 6
  66. },
  67. {
  68. text: '七年级',
  69. value: 7
  70. },
  71. {
  72. text: '八年级',
  73. value: 8
  74. },
  75. {
  76. text: '九年级',
  77. value: 9
  78. }
  79. ];
  80. const GRADE_ENUM = {
  81. '1': '一年级',
  82. '2': '二年级',
  83. '3': '三年级',
  84. '4': '四年级',
  85. '5': '五年级',
  86. '6': '六年级',
  87. '7': '七年级',
  88. '8': '八年级',
  89. '9': '九年级'
  90. } as any;
  91. const getGradeList = (gradeYear?: string, instrumentCode?: string) => {
  92. let tempList: any = [];
  93. const five = [
  94. { text: '一年级', value: 1, instrumentCode },
  95. { text: '二年级', value: 2, instrumentCode },
  96. { text: '三年级', value: 3, instrumentCode },
  97. { text: '四年级', value: 4, instrumentCode },
  98. { text: '五年级', value: 5, instrumentCode }
  99. ];
  100. const one = [{ text: '六年级', value: 6, instrumentCode }];
  101. const three = [
  102. { text: '七年级', value: 7, instrumentCode },
  103. { text: '八年级', value: 8, instrumentCode },
  104. { text: '九年级', value: 9, instrumentCode }
  105. ];
  106. if (gradeYear === 'FIVE_YEAR_SYSTEM') {
  107. tempList.push(...[...five]);
  108. } else if (gradeYear === 'SIX_YEAR_SYSTEM') {
  109. tempList.push(...[...five, ...one]);
  110. } else if (gradeYear === 'THREE_YEAR_SYSTEM') {
  111. tempList.push(...[...three]);
  112. } else if (gradeYear === 'FORE_YEAR_SYSTEM') {
  113. tempList.push(...[...one, ...three]);
  114. } else {
  115. tempList.push(...[...five, ...one, ...three]);
  116. }
  117. // console.log('年级111',tempList)
  118. return tempList;
  119. };
  120. const countDownRef = ref();
  121. const forms = reactive({
  122. isPageHide: false,
  123. currentClassText: '',
  124. supportList: [
  125. {
  126. title: '支持学校开展',
  127. val: true
  128. },
  129. {
  130. title: '不支持开展',
  131. val: false
  132. }
  133. ],
  134. willingList: [
  135. {
  136. title: '报名登记',
  137. val: true
  138. },
  139. {
  140. title: '不愿意参加',
  141. val: false
  142. }
  143. ],
  144. optionList: [
  145. {
  146. title: '传统自主练习(依托课堂所学知识与乐器技能,自行完成练习,无任何费用投入)',
  147. val: false
  148. },
  149. {
  150. title: 'Ai辅助练习(自主规划+Ai辅助,可以让练习更简单高效,解决学生不会练、家长无法辅导的问题。自行准备软件,品牌不限,一次性投入约300余元)',
  151. val: true
  152. }
  153. ],
  154. username: '',
  155. openId: null as any,
  156. participationFlag: null as any, // 课后练习方式
  157. supportFlag: null as any, // 是否支持
  158. currentGrade: null as any,
  159. currentClass: null as any,
  160. provinceCode: '',
  161. cityCode: '',
  162. districtCode: '',
  163. phone: '',
  164. prePhone: '',
  165. smsCode: '',
  166. selectArea: '', // 所选地区
  167. selectSchool: '', // 所选学校
  168. selectClass: '',
  169. countDownStatus: true,
  170. countDownTime: 1000 * 120, // 倒计时时间
  171. imgCodeStatus: false,
  172. successPopShow: false, // 提交结果弹窗
  173. schoolStatus: false,
  174. schoolPopupShow: false,
  175. schoolLoading: false,
  176. schoolPopupIndex: [] as any,
  177. schoolAreaList: [] as any,
  178. schoolAreaId: null, // 学校区域编号
  179. schoolInstrumentSetType: null as any,
  180. gradeList: [] as any,
  181. classList: [] as any,
  182. schoolName: '',
  183. gradeNumText: '',
  184. areaName: '',
  185. gradeStatus: false, // 年级状态
  186. classStatus: false, // 班级状态
  187. gradePopupShow: false,
  188. gradePopupIndex: [] as any, // 年级下拉索引
  189. classPopupShow: false,
  190. classPopupIndex: [] as any, // 班级下拉索引
  191. areaList: [] as any,
  192. showPicker: false,
  193. gradeAndClass: [gradeList, classList],
  194. gradeAndClassIndex: [] as any,
  195. gradeOptions: gradeList,
  196. classOptions: classList,
  197. gradeOptionIndex: [] as any,
  198. classOptionIndex: [] as any,
  199. submitLoading: false,
  200. id: null as any,
  201. code: null as any,
  202. areaPopupIndex: null as any,
  203. customSearchText: '' as any,
  204. tenantId: null as any, // 机构id
  205. customQuestionE: null as any, // 自定义的题目标题
  206. })
  207. onMounted(async () => {
  208. // 根据机构id获取省市区id
  209. forms.tenantId = route.query.tenantId
  210. if (sessionStorage.getItem('customQuestionE')) {
  211. forms.customQuestionE = sessionStorage.getItem('customQuestionE')
  212. }
  213. const { data } = await api_queryTennatArea(forms.tenantId)
  214. if (data && data.length) {
  215. forms.provinceCode = data[0].provinceCode
  216. forms.cityCode = data[0].cityCode
  217. forms.districtCode = data[0].regionCode
  218. /**
  219. * 2025.02.28,修改为不需要选区域,直接选学校,之前的逻辑如果areaName存在,则不需要选区域,后续可能会放开,又需要选区域,所以先随便给areaName赋值
  220. */
  221. forms.areaName = '学校名称'
  222. //getSchoolAreaList()
  223. }
  224. console.log(333,forms.provinceCode)
  225. queryDetail();
  226. window.scrollTo(0, 0);
  227. // getAreaList();
  228. });
  229. // 如果没有openId,跳转到第一个页面
  230. forms.openId = authCode.onWeChatCatchOpenId("GET");
  231. if (!forms.openId) {
  232. router.push({
  233. path: '/intention-questionnaire',
  234. query: {
  235. type: route.query.meetingType,
  236. id: route.query.tenantId,
  237. }
  238. });
  239. }
  240. const onPageShow = () => {
  241. console.log(forms.isPageHide, 'showInfo');
  242. if (forms.isPageHide) {
  243. window.location.reload();
  244. }
  245. };
  246. // 处理监听页面返回不刷新的问题
  247. window.addEventListener('pageshow', onPageShow);
  248. const onPageHide = () => {
  249. console.log(forms.isPageHide, 'showInfo');
  250. forms.isPageHide = true;
  251. };
  252. window.addEventListener('pagehide', onPageHide);
  253. const queryDetail = async () => {
  254. try {
  255. // 判断是否获取微信code码
  256. if (!forms.openId) return;
  257. const { data } = await request.get(
  258. '/edu-app/open/schoolMeetingQuestion/detail?openId=' + forms.openId
  259. );
  260. if (!data) return;
  261. // forms.provinceCode = data.provinceCode
  262. // forms.cityCode = data.cityCode
  263. // forms.districtCode = data.districtCode
  264. // console.log(12222,data,forms.provinceCode)
  265. // 回显省市区
  266. forms.areaPopupIndex = data.districtCode || data.cityCode || data.provinceCode
  267. forms.areaPopupIndex = forms.areaPopupIndex ? String(forms.areaPopupIndex) : null
  268. const primarySchool = ['一年级','二年级','三年级','四年级','五年级','六年级',], juniorSchool = ['六年级','七年级','八年级','九年级'];
  269. // if (primarySchool.includes(data.currentGrade) && (route.query.meetingType === 'primarySchoolNo' || route.query.meetingType === 'primarySchoolYes')) {
  270. // forms.currentClass = data.currentClass
  271. // forms.currentGrade = data.currentGrade
  272. // }
  273. // if (juniorSchool.includes(data.currentGrade) && (route.query.meetingType === 'juniorSchoolNo' || route.query.meetingType === 'juniorSchool')) {
  274. // forms.currentClass = data.currentClass
  275. // forms.currentGrade = data.currentGrade
  276. // }
  277. forms.currentClass = data.currentClass
  278. forms.currentGrade = data.currentGrade
  279. forms.phone = data.phone
  280. forms.prePhone = data.phone
  281. forms.username = data.username
  282. forms.schoolAreaId = data.schoolAreaId
  283. forms.schoolPopupIndex = data.schoolAreaId ? [data.schoolAreaId] : []
  284. forms.schoolName = data.schoolName
  285. forms.supportFlag = data.supportFlag
  286. forms.participationFlag = data.participationFlag
  287. forms.areaName = data.provinceName + ' ' + data.cityName + ' ' + (data.districtName || '')
  288. const gradeIdx = gradeList.find(item => item.text === data.currentGrade)?.value || 1
  289. // @ts-ignore
  290. const classIdx = classList.find(item => item.text === data.currentClass)?.value || 1
  291. // forms.gradeAndClassIndex = [gradeIdx, classIdx]
  292. forms.gradeOptionIndex = [gradeIdx]
  293. forms.classOptionIndex = [classIdx]
  294. getSchoolAreaList()
  295. } catch {
  296. //
  297. }
  298. }
  299. /** 手机号变更时清空验证码信息,用户信息 */
  300. const phoneChangeEmptyInfo = () => {
  301. };
  302. const onCodeSend = () => {
  303. forms.countDownStatus = false;
  304. nextTick(() => {
  305. countDownRef.value.start();
  306. });
  307. };
  308. const onSendCode = () => {
  309. // 发送验证码
  310. if (!checkPhone(forms.phone)) {
  311. return showToast('请输入正确的手机号码');
  312. }
  313. forms.imgCodeStatus = true;
  314. };
  315. const validatePhone = computed(() => {
  316. return checkPhone(forms.phone) ? true : false;
  317. });
  318. const onFinished = () => {
  319. forms.countDownStatus = true;
  320. countDownRef.value.reset();
  321. };
  322. const checkForm = (status = true) => {
  323. const regex = /^[\u4e00-\u9fa5]{2,14}$/;
  324. if (!forms.schoolAreaId) {
  325. showToast('请选择学校');
  326. return false;
  327. }
  328. if (!forms.username) {
  329. showToast('请输入姓名');
  330. return false;
  331. }
  332. if (!regex.test(forms.username)) {
  333. showToast('请输入正确的中文姓名');
  334. return false;
  335. }
  336. if (!forms.currentGrade) {
  337. showToast('请选择年级');
  338. return false;
  339. }
  340. if (!forms.currentClass) {
  341. showToast('请选择班级');
  342. return false;
  343. }
  344. // if (forms.supportFlag === null) {
  345. // showToast('请勾选是否支持学校数字化转型');
  346. // return false;
  347. // }
  348. if (forms.participationFlag === null) {
  349. showToast('请选择课后练习方式');
  350. return false;
  351. }
  352. // if (forms.participationFlag) {
  353. // if (!checkPhone(forms.phone)) {
  354. // status && showToast('请输入正确的手机号码');
  355. // return false;
  356. // } else if (!forms.smsCode) {
  357. // status && showToast('请输入验证码');
  358. // return false;
  359. // }
  360. // }
  361. if (!checkPhone(forms.phone)) {
  362. status && showToast('请输入正确的手机号码');
  363. return false;
  364. }
  365. if (!forms.smsCode) {
  366. status && showToast('请输入验证码');
  367. return false;
  368. }
  369. return true;
  370. };
  371. const submitFill = async () => {
  372. if (checkForm()) {
  373. try {
  374. forms.submitLoading = true;
  375. const { currentClass, districtCode, currentGrade, participationFlag,cityCode, openId,provinceCode,smsCode,phone,schoolAreaId,supportFlag,username,id, tenantId} = forms
  376. let params: any = {
  377. currentClass, districtCode, currentGrade, participationFlag,cityCode, openId,provinceCode,schoolAreaId,supportFlag: true,username, tenantId
  378. }
  379. if (id) {
  380. params.id = id
  381. }
  382. params.phone = phone
  383. params.smsCode = smsCode
  384. const res = await request.post('/edu-app/open/schoolMeetingQuestion/save', {
  385. data: params
  386. });
  387. if (res.code === 200) {
  388. forms.successPopShow = true;
  389. forms.prePhone = forms.phone
  390. }
  391. forms.submitLoading = false;
  392. forms.countDownStatus = true;
  393. } catch {
  394. //
  395. forms.submitLoading = false;
  396. forms.countDownStatus = true;
  397. }
  398. }
  399. }
  400. const formateArea = (area: any[]) => {
  401. const province_list: { [_: string]: string } = {};
  402. const city_list: { [_: string]: string } = {};
  403. const county_list: { [_: string]: string } = {};
  404. area.forEach((item: any) => {
  405. province_list[item.code] = item.name;
  406. });
  407. area.forEach((item: any) => {
  408. item.areas?.forEach((city: any) => {
  409. city_list[city.code] = city.name;
  410. });
  411. });
  412. area.forEach((item: any) => {
  413. item.areas?.forEach((city: any) => {
  414. city.areas?.forEach((county: any) => {
  415. county_list[county.code] = county.name;
  416. });
  417. });
  418. });
  419. return {
  420. province_list,
  421. city_list,
  422. county_list
  423. };
  424. };
  425. const getAreaList = () => {
  426. api_sysAreaQueryAllProvince().then(res => {
  427. if (res?.code === 200) {
  428. forms.areaList = formateArea(res.data);
  429. }
  430. });
  431. };
  432. const openAreaPop = () => {
  433. console.log(11111)
  434. // forms.schoolStatus = true
  435. // 如果没有选省市区,默认打开省市区弹窗
  436. if (!forms.areaName) {
  437. forms.showPicker = true
  438. } else {
  439. forms.schoolStatus = true
  440. getSchoolAreaList()
  441. }
  442. }
  443. // 高亮显示匹配的文字
  444. const highlightText = (text: string) => {
  445. if (!forms.customSearchText) return text;
  446. const regex = new RegExp(`(${forms.customSearchText})`, 'gi'); // 创建正则匹配用户输入
  447. const customText = text.replace(regex, '<span class="highLight">$1</span>'); // 将匹配部分包裹在 <span> 中
  448. // console.log(customText,999)
  449. return customText
  450. }
  451. const getSchoolAreaList = async (name?: string, isSearch?: boolean) => {
  452. forms.schoolLoading = true;
  453. try {
  454. const { data } = await request.post('/edu-app/open/schoolArea/list', {
  455. data: {
  456. name,
  457. testFlag: true,
  458. provinceCode: forms.provinceCode,
  459. cityCode: forms.cityCode,
  460. regionCode: forms.districtCode
  461. }
  462. });
  463. if (isSearch && data.length) {
  464. forms.schoolPopupIndex = data[0].id ? [data[0].id] : [];
  465. }
  466. forms.customSearchText = name || ''
  467. forms.schoolAreaList = data;
  468. } catch {
  469. //
  470. }
  471. forms.schoolLoading = false;
  472. };
  473. const switchParticipationFlag = (val: boolean) => {
  474. forms.participationFlag = val
  475. if (!forms.participationFlag) {
  476. forms.phone = ''
  477. forms.smsCode = ''
  478. forms.countDownStatus = true
  479. }
  480. if (forms.participationFlag) {
  481. forms.phone = forms.prePhone
  482. }
  483. }
  484. // 获取地区学校详情
  485. const getSchoolAreaDetail = async () => {
  486. try {
  487. const { data } = await request.get(
  488. '/edu-app/open/schoolArea/detail/' + forms.schoolAreaId
  489. );
  490. console.log(data, 'data');
  491. if (data.school) {
  492. const schoolInfo = data.school || {};
  493. const schoolInstrumentList = schoolInfo.schoolInstrumentList || [];
  494. forms.schoolInstrumentSetType = schoolInfo.instrumentSetType;
  495. if (schoolInfo.instrumentSetType === 'SCHOOL') {
  496. const instrumentCode = schoolInstrumentList[0]?.instrumentCode;
  497. forms.gradeList = getGradeList(
  498. schoolInfo.gradeYear,
  499. instrumentCode
  500. );
  501. forms.classList = classList;
  502. } else if (schoolInfo.instrumentSetType === 'GRADE') {
  503. forms.gradeList = [];
  504. schoolInstrumentList.forEach((item: any) => {
  505. forms.gradeList.push({
  506. text: GRADE_ENUM[item.gradeNum],
  507. value: item.gradeNum,
  508. instrumentId: item.instrumentId,
  509. instrumentCode: item.instrumentCode
  510. });
  511. });
  512. forms.gradeList.sort((a: any, b: any) => a.value - b.value);
  513. forms.classList = classList;
  514. } else if (schoolInfo.instrumentSetType === 'CLASS') {
  515. // 班级
  516. const tempGradeList: any[] = [];
  517. schoolInstrumentList.forEach((item: any) => {
  518. if (!tempGradeList.includes(item.gradeNum)) {
  519. tempGradeList.push(item.gradeNum);
  520. }
  521. });
  522. const lastGradeList: any[] = [];
  523. tempGradeList.forEach((temp: any) => {
  524. const list = {
  525. text: GRADE_ENUM[temp],
  526. value: temp,
  527. instrumentId: '',
  528. instrumentCode: '',
  529. instrumentName: '',
  530. classList: [] as any
  531. };
  532. schoolInstrumentList.forEach((item: any) => {
  533. if (temp === item.gradeNum) {
  534. list.instrumentId = item.instrumentId;
  535. list.instrumentCode = item.instrumentCode;
  536. list.instrumentName = item.instrumentName;
  537. list.classList.push({
  538. text: item.classNum + '班',
  539. value: item.classNum,
  540. instrumentCode: item.instrumentCode
  541. });
  542. }
  543. });
  544. // 排序班级
  545. list.classList.sort((a: any, b: any) => a.value - b.value);
  546. lastGradeList.push(list);
  547. });
  548. lastGradeList.sort((a: any, b: any) => a.value - b.value);
  549. forms.gradeList = lastGradeList;
  550. forms.classList = [];
  551. } else {
  552. forms.gradeList = getGradeList(schoolInfo.gradeYear);
  553. forms.classList = classList;
  554. }
  555. } else {
  556. forms.schoolInstrumentSetType = '';
  557. forms.gradeList = getGradeList();
  558. forms.classList = classList;
  559. }
  560. } catch {
  561. //
  562. }
  563. };
  564. // 监听状态
  565. watch(
  566. () => forms.showPicker,
  567. () => {
  568. if (forms.showPicker) {
  569. forms.areaPopupIndex = forms.districtCode || forms.cityCode || forms.provinceCode
  570. forms.areaPopupIndex = forms.areaPopupIndex ? String(forms.areaPopupIndex) : null
  571. }
  572. }
  573. )
  574. watch(
  575. () => forms.schoolStatus,
  576. () => {
  577. if (forms.schoolStatus) {
  578. forms.schoolPopupIndex = forms.schoolAreaId ? [forms.schoolAreaId] : [];
  579. }
  580. }
  581. )
  582. onUnmounted(() => {
  583. window.removeEventListener('pageshow', onPageShow);
  584. window.removeEventListener('pagehide', onPageHide);
  585. });
  586. return () => (
  587. <div class={styles['intention-page']}>
  588. <div class={styles.formBox}>
  589. <div class={styles.formItem}>
  590. <p style="font-size:15px;"><strong>1. 学校</strong></p>
  591. {
  592. forms.schoolName ?
  593. <div class={[styles.valDone, (forms.schoolStatus||forms.showPicker) && styles.openVal]} onClick={() => {
  594. forms.schoolStatus = true
  595. getSchoolAreaList()
  596. }}>
  597. {forms.schoolName && <span class={styles.vdSchool}>{forms.schoolName}</span>}
  598. {/* <span class={styles.vdArea}>{forms.areaName}</span> */}
  599. <i></i>
  600. </div> :
  601. <div class={[styles.valDot, styles.grayText, (forms.schoolStatus||forms.showPicker) && styles.openVal]} onClick={openAreaPop}>请选择学校<i></i></div>
  602. }
  603. <div></div>
  604. </div>
  605. <div class={styles.formItem}>
  606. <p style="font-size:15px;"><strong>2. 学生姓名</strong></p>
  607. <Field
  608. class={styles.valDot}
  609. clearable={false}
  610. inputAlign="left"
  611. placeholder="请输入学生姓名"
  612. autocomplete="off"
  613. maxlength={14}
  614. v-model={forms.username}>
  615. </Field>
  616. </div>
  617. <div class={styles.formItem}>
  618. <p style="font-size:15px;"><strong>3. 年级</strong></p>
  619. <div class={[styles.valDot, !forms.currentGrade && styles.grayText, forms.gradeStatus && styles.openVal]}
  620. onClick={()=> {
  621. const gradeIdx = gradeList.find(item => item.text === forms.currentGrade)?.value || 1
  622. forms.gradeOptionIndex = [gradeIdx]
  623. forms.gradeStatus = true
  624. }}>{forms.currentGrade ? forms.currentGrade : '请选择年级'}<i></i></div>
  625. </div>
  626. <div class={styles.formItem}>
  627. <p style="font-size:15px;"><strong>4. 班级</strong></p>
  628. <div class={[styles.valDot, !forms.currentClass && styles.grayText, forms.classStatus && styles.openVal]}
  629. onClick={()=> {
  630. const classIdx = classList.find((item: any) => item.text === forms.currentClass)?.value || 1
  631. forms.classOptionIndex = [classIdx]
  632. forms.classStatus = true
  633. }}>{forms.currentClass ? forms.currentClass : '请选择班级'}<i></i></div>
  634. </div>
  635. {/* <div class={styles.formItem}>
  636. <p style="font-size:15px;"><strong>5. 在您了解以上数字化转型事项后,您是否支持学校开展音乐(器乐)课堂数字化转型</strong></p>
  637. <div class={styles.selectItem}>
  638. {
  639. forms.supportList.map(item =>
  640. <div onClick={() => (forms.supportFlag = item.val)}>
  641. <i class={forms.supportFlag === item.val && styles.selectedIcon}></i>
  642. <span>{item.title}</span>
  643. </div>
  644. )
  645. }
  646. </div>
  647. </div> */}
  648. {/* <div class={styles.formItem}>
  649. {
  650. forms.customQuestionE ?
  651. <>
  652. <div v-html={forms.customQuestionE}></div>
  653. </> :
  654. <>
  655. {
  656. route.query.meetingType === 'primarySchoolNo' || route.query.meetingType === 'juniorSchoolNo' ?
  657. <p style="font-size:15px;"><strong>5. 您是否愿意学生参加数字化转型</strong><span style="font-size:15px;">(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好乐器和“器乐数字Ai”应用软件两项学习工具,市面上均有提供,大约300多元一年。学校不涉及任何收费行为。如不参加,学生按原有方式进行音乐课学习。)</span></p> :
  658. <p style="font-size:15px;"><strong>5. 您是否愿意学生参加数字化转型</strong><span style="font-size:15px;">(注:以学生及家长自愿参加为原则。如愿意参加,家长需自行为学生准备好“器乐数字Ai”应用软件,市面上均有提供,大约300多元一年,学校不涉及任何收费行为。如不参加,学生按原有方式进行器乐课程学习。)</span></p>
  659. }
  660. </>
  661. }
  662. <div class={styles.selectItem}>
  663. {
  664. forms.willingList.map(item =>
  665. <div onClick={() => switchParticipationFlag(item.val)}>
  666. <i class={forms.participationFlag === item.val && styles.selectedIcon}></i>
  667. <span>{item.title}</span>
  668. </div>
  669. )
  670. }
  671. </div>
  672. </div> */}
  673. <div class={styles.formItem}>
  674. <p style="font-size:15px;"><strong>5. 课后练习方式(二选一)</strong></p>
  675. <div class={[styles.selectItem, styles.specialSelect]}>
  676. {
  677. forms.optionList.map(item =>
  678. <div onClick={() => (forms.participationFlag = item.val)}>
  679. <i class={forms.participationFlag === item.val && styles.selectedIcon}></i>
  680. <span>{item.title}</span>
  681. </div>
  682. )
  683. }
  684. </div>
  685. </div>
  686. {
  687. <div class={styles.formItem}>
  688. <p style="font-size:15px;"><strong>6. 联系方式</strong></p>
  689. <Field
  690. class={styles.valDot}
  691. clearable={false}
  692. placeholder="请输入手机号码"
  693. type="digit"
  694. autocomplete="off"
  695. inputAlign="left"
  696. v-model={forms.phone}
  697. maxlength={11}
  698. onUpdate:modelValue={(val: any) => {
  699. phoneChangeEmptyInfo();
  700. }}>
  701. </Field>
  702. <Field
  703. class={[styles.valDot, styles.codeItem]}
  704. center
  705. clearable={false}
  706. inputAlign="left"
  707. placeholder="请输入验证码"
  708. autocomplete="off"
  709. type="number"
  710. v-model={forms.smsCode}
  711. maxlength={6}>
  712. {{
  713. button: () =>
  714. forms.countDownStatus ? (
  715. <span
  716. class={[
  717. styles.codeText,
  718. !validatePhone.value ? styles.codeTextDisabled : ''
  719. ]}
  720. onClick={onSendCode}>
  721. 获取验证码
  722. </span>
  723. ) : (
  724. <CountDown
  725. ref={(el: any) => (countDownRef.value = el)}
  726. auto-start={false}
  727. class={styles.countDown}
  728. time={forms.countDownTime}
  729. onFinish={onFinished}
  730. format="ss秒后重试"
  731. />
  732. )
  733. }}
  734. </Field>
  735. </div>
  736. }
  737. {
  738. forms.participationFlag !== null &&
  739. <img class={styles.bottomBtn} src={submitBtn}
  740. onClick={() => {
  741. if (forms.submitLoading) return;
  742. submitFill()
  743. }}
  744. />
  745. }
  746. </div>
  747. {/* 是否在微信中打开 */}
  748. <OWxTip />
  749. {forms.imgCodeStatus ? (
  750. <MImgCode
  751. v-model:value={forms.imgCodeStatus}
  752. phone={forms.phone}
  753. type="MEETING_QUESTION"
  754. onClose={() => {
  755. forms.imgCodeStatus = false;
  756. }}
  757. onSendCode={onCodeSend}
  758. />
  759. ) : null}
  760. {
  761. forms.successPopShow &&
  762. <div class={styles.successPop}>
  763. <div class={styles.successBox}>
  764. <img class={styles.sTitle} src={subSusIcon} />
  765. <p>感谢您的参与</p>
  766. <img class={styles.sDone} src={doneIcon} onClick={() => {
  767. forms.successPopShow = false
  768. }} />
  769. </div>
  770. </div>
  771. }
  772. <Popup
  773. zIndex={2010}
  774. v-model:show={forms.showPicker}
  775. position="bottom"
  776. round
  777. class={'popupBottomSearch'}>
  778. <Area
  779. optionHeight={46}
  780. areaList={forms.areaList}
  781. v-model={forms.areaPopupIndex}
  782. onCancel={() => {
  783. forms.showPicker = false
  784. // if (!forms.areaName) {
  785. // forms.schoolStatus = false
  786. // }
  787. }}
  788. onConfirm={({ selectedOptions }) => {
  789. forms.provinceCode = selectedOptions[0].value;
  790. forms.cityCode = selectedOptions[1].value;
  791. forms.districtCode = selectedOptions[2]?.value || null;
  792. forms.areaPopupIndex = forms.districtCode || forms.cityCode || forms.provinceCode
  793. forms.areaPopupIndex = forms.areaPopupIndex ? String(forms.areaPopupIndex) : null
  794. forms.areaName = selectedOptions
  795. .map((item: any) => item?.text)
  796. .join(' ');
  797. forms.showPicker = false;
  798. // if (!forms.areaName) {
  799. // forms.schoolStatus = false
  800. // }
  801. forms.schoolAreaId = null;
  802. forms.schoolName = '';
  803. forms.gradeNumText = '';
  804. forms.currentGrade = null;
  805. forms.currentClass = null;
  806. forms.currentClassText = '';
  807. // console.log('地址1')
  808. getSchoolAreaList();
  809. forms.schoolStatus = true
  810. }}
  811. />
  812. </Popup>
  813. {/* 互通学校 */}
  814. <Popup
  815. zIndex={2001}
  816. v-model:show={forms.schoolStatus}
  817. position="bottom"
  818. round
  819. safeAreaInsetBottom
  820. lazyRender={false}
  821. class={'popupBottomSearch'}
  822. onOpen={() => {
  823. forms.schoolPopupShow = true;
  824. }}
  825. onClosed={() => {
  826. forms.schoolPopupShow = false;
  827. }}>
  828. {forms.schoolPopupShow && (
  829. <div>
  830. <Picker
  831. class="cityPopBox"
  832. showToolbar
  833. v-model={forms.schoolPopupIndex}
  834. columns={forms.schoolAreaList}
  835. loading={forms.schoolLoading}
  836. columnsFieldNames={{
  837. text: 'name',
  838. value: 'id'
  839. }}
  840. onCancel={() => (forms.schoolStatus = false)}
  841. onConfirm={(val: any) => {
  842. const selectedOption = val.selectedOptions[0];
  843. forms.schoolAreaId = selectedOption.id || null;
  844. forms.schoolPopupIndex = forms.schoolAreaId ? [forms.schoolAreaId] : [];
  845. forms.schoolName = selectedOption.name;
  846. forms.schoolStatus = false;
  847. forms.currentGrade = null;
  848. forms.currentClass = null;
  849. // console.log('学校id',forms.schoolAreaId,selectedOption)
  850. // getSchoolAreaDetail();
  851. }}>
  852. {{
  853. 'columns-top': (
  854. <div class={styles.columnsTop}>
  855. {/* <Cell border={false} clickable={false} title={forms.areaName || '请选择省市区'} isLink onClick={() => {
  856. forms.showPicker = true;
  857. }} /> */}
  858. <MSearch
  859. placeholder="请输入学校名称"
  860. onSearch={(val: any) => {
  861. getSchoolAreaList(val, true);
  862. }}
  863. onSearchUpdate={(val: any) => {
  864. getSchoolAreaList(val, true);
  865. }}
  866. />
  867. </div>
  868. ),
  869. option: (item: any, index: number) => (
  870. <div class={styles.columnsContent} v-html={highlightText(item.name)} key={index}></div>
  871. ),
  872. }}
  873. </Picker>
  874. </div>
  875. )}
  876. </Popup>
  877. {/* 年级 */}
  878. <Popup
  879. v-model:show={forms.gradeStatus}
  880. position="bottom"
  881. round
  882. safeAreaInsetBottom
  883. lazyRender={false}
  884. class={'popupBottomSearch'}
  885. onOpen={() => {
  886. forms.gradePopupShow = true;
  887. }}
  888. onClosed={() => {
  889. forms.gradePopupShow = false;
  890. }}>
  891. {forms.gradePopupShow && (
  892. <Picker
  893. showToolbar
  894. v-model={forms.gradeOptionIndex}
  895. columns={forms.gradeOptions}
  896. onCancel={() => (forms.gradeStatus = false)}
  897. onConfirm={(val: any) => {
  898. console.log('选择1111',val)
  899. // forms.gradeAndClassIndex = [val.selectedOptions[0].value, val.selectedOptions[1].value]
  900. // forms.currentGrade = val.selectedOptions[0].text;
  901. // forms.currentClass = val.selectedOptions[1].text;
  902. forms.currentGrade = val.selectedOptions[0].text
  903. forms.gradeOptionIndex = [val.selectedOptions[0].value]
  904. forms.gradeStatus = false;
  905. }}
  906. />
  907. )}
  908. </Popup>
  909. {/* 班级 */}
  910. <Popup
  911. v-model:show={forms.classStatus}
  912. position="bottom"
  913. round
  914. safeAreaInsetBottom
  915. lazyRender={false}
  916. class={'popupBottomSearch'}
  917. onOpen={() => {
  918. forms.gradePopupShow = true;
  919. }}
  920. onClosed={() => {
  921. forms.gradePopupShow = false;
  922. }}>
  923. {forms.gradePopupShow && (
  924. <Picker
  925. showToolbar
  926. v-model={forms.classOptionIndex}
  927. columns={forms.classOptions}
  928. onCancel={() => (forms.classStatus = false)}
  929. onConfirm={(val: any) => {
  930. console.log('选择1111',val)
  931. forms.currentClass = val.selectedOptions[0].text
  932. forms.classOptionIndex = [val.selectedOptions[0].value]
  933. forms.classStatus = false;
  934. }}
  935. />
  936. )}
  937. </Popup>
  938. </div>
  939. );
  940. }
  941. });