|
@@ -48,6 +48,10 @@ import MDialog from '@/components/m-dialog';
|
|
|
// import f3 from './images/new/f-3.png';
|
|
|
// import iconTip2 from './images/new/icon-tip2.png';
|
|
|
// import functionBg from './images/new/function-bg.png';
|
|
|
+import tuangou from './images/new/tuangou.png';
|
|
|
+import icon3 from './images/new/icon-3.png';
|
|
|
+import icon5 from './images/new/icon-5.png';
|
|
|
+import icon6 from './images/new/icon-6.png';
|
|
|
import giftTip from './images/new/icon-4.png';
|
|
|
import iconGift from './images/new/icon-gift.png';
|
|
|
import dayjs from 'dayjs';
|
|
@@ -122,6 +126,7 @@ export default defineComponent({
|
|
|
details: [] as any[],
|
|
|
// schoolType: '', // 学校类型
|
|
|
gradeYear: '', // 学制
|
|
|
+ schoolInstrumentSetType: null as any,
|
|
|
// bugGoods: false, // 是否购买AI
|
|
|
registerType: '', // 报名类型
|
|
|
detailVip: {} as any,
|
|
@@ -154,7 +159,10 @@ export default defineComponent({
|
|
|
saveId: null as any,
|
|
|
openId: null as any,
|
|
|
code: null as any,
|
|
|
- intervalFnRef: null as any // 页面订时器
|
|
|
+ intervalFnRef: null as any, // 页面订时器
|
|
|
+ registerExpireTime: null as any, // 结束时间
|
|
|
+ activeOverTime: 0, // 活动结束时间
|
|
|
+ activeOverStatus: true // 活动是否结束 默认已结束
|
|
|
});
|
|
|
|
|
|
const state = reactive({
|
|
@@ -202,6 +210,17 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ const overCountDown = useCountDown({
|
|
|
+ time: forms.activeOverTime,
|
|
|
+ onFinish() {
|
|
|
+ if (forms.submitLoading) return;
|
|
|
+ forms.showTips = true;
|
|
|
+ forms.showMessage = '团购时间已截止,感谢您的参与';
|
|
|
+ forms.showButton = false;
|
|
|
+ forms.activeOverStatus = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
const onCodeSend = () => {
|
|
|
forms.countDownStatus = false;
|
|
|
nextTick(() => {
|
|
@@ -241,17 +260,35 @@ export default defineComponent({
|
|
|
// 默认选中商品
|
|
|
studentRegisterStore.setVip(data.details || []);
|
|
|
forms.details = deepClone(data.details || []);
|
|
|
+
|
|
|
+ forms.registerExpireTime = data.registerExpireTime; // '2024-03-26 21:10:52'; //
|
|
|
+ if (forms.registerExpireTime) {
|
|
|
+ if (dayjs(new Date()).isBefore(forms.registerExpireTime)) {
|
|
|
+ // 活动没有结束
|
|
|
+ forms.activeOverStatus = false;
|
|
|
+ // 默认返回毫秒
|
|
|
+ forms.activeOverTime = dayjs(forms.registerExpireTime).diff(
|
|
|
+ dayjs(new Date())
|
|
|
+ );
|
|
|
+ overCountDown.reset(forms.activeOverTime);
|
|
|
+ overCountDown.start();
|
|
|
+ } else {
|
|
|
+ forms.showTips = true;
|
|
|
+ forms.showMessage = '团购时间已截止,感谢您的参与';
|
|
|
+ forms.showButton = false;
|
|
|
+ forms.activeOverStatus = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (forms.details.length > 0) {
|
|
|
forms.detailVip = forms.details[0];
|
|
|
// forms.giftVipDay = forms.details[0].membershipDays;
|
|
|
}
|
|
|
forms.giftVipDay = data.giftVipDay || 0;
|
|
|
forms.gradeYear = data.gradeYear;
|
|
|
+ forms.schoolInstrumentSetType = data.schoolInstrumentSetType;
|
|
|
forms.registerType = data.registerType;
|
|
|
studentInfo.extra.registerType = data.registerType;
|
|
|
-
|
|
|
const schoolInstrumentList = data.schoolInstrumentList || [];
|
|
|
-
|
|
|
if (data.schoolInstrumentSetType === 'SCHOOL') {
|
|
|
forms.gradeList = getGradeList(data.gradeYear);
|
|
|
forms.classList = classList;
|
|
@@ -278,21 +315,30 @@ export default defineComponent({
|
|
|
const list = {
|
|
|
text: GRADE_ENUM[temp],
|
|
|
value: temp,
|
|
|
- children: [] as any
|
|
|
+ instrumentId: '',
|
|
|
+ instrumentName: '',
|
|
|
+ classList: [] as any
|
|
|
};
|
|
|
schoolInstrumentList.forEach((item: any) => {
|
|
|
- if (item === item.gradeNum) {
|
|
|
- list.children.push({
|
|
|
+ if (temp === item.gradeNum) {
|
|
|
+ list.instrumentId = item.instrumentId;
|
|
|
+ list.instrumentName = item.instrumentName;
|
|
|
+ list.classList.push({
|
|
|
text: item.classNum + '班',
|
|
|
value: item.classNum
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ // 排序班级
|
|
|
+ list.classList.sort((a: any, b: any) => a.value - b.value);
|
|
|
|
|
|
lastGradeList.push(list);
|
|
|
});
|
|
|
forms.gradeList = lastGradeList;
|
|
|
forms.classList = [];
|
|
|
+ } else {
|
|
|
+ forms.gradeList = getGradeList(data.gradeYear);
|
|
|
+ forms.classList = classList;
|
|
|
}
|
|
|
if (browser().weixin) {
|
|
|
// if (
|
|
@@ -361,7 +407,10 @@ export default defineComponent({
|
|
|
const onSubmit = async () => {
|
|
|
forms.submitLoading = true;
|
|
|
try {
|
|
|
- if (checkForm()) return;
|
|
|
+ if (checkForm()) {
|
|
|
+ forms.submitLoading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
const { extra, ...res } = studentInfo;
|
|
|
const result = await request.post('/edu-app/userlogin', {
|
|
|
requestType: 'form',
|
|
@@ -490,7 +539,6 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- // if (!studentInfo.extra.gender) {
|
|
|
studentInfo.extra.gender =
|
|
|
studentInfo.extra.gender !== data.gender
|
|
|
? data.gender
|
|
@@ -761,7 +809,7 @@ export default defineComponent({
|
|
|
* @param schoolId 学校编号
|
|
|
*/
|
|
|
const updateStat = async (
|
|
|
- pageBrowseTime = 10,
|
|
|
+ pageBrowseTime = 5,
|
|
|
joinType?: string,
|
|
|
userId?: string,
|
|
|
schoolId?: string
|
|
@@ -822,6 +870,14 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ const formatTimerTo = (num: number): string => {
|
|
|
+ if (num > 9) {
|
|
|
+ return num + '';
|
|
|
+ } else {
|
|
|
+ return '0' + num;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
try {
|
|
|
getRegisterGoods();
|
|
@@ -860,6 +916,33 @@ export default defineComponent({
|
|
|
return () => (
|
|
|
<div class={styles['student-register']}>
|
|
|
<div class={styles.studentRegisterContainer}>
|
|
|
+ {!forms.activeOverStatus && (
|
|
|
+ <div class={styles.countdownSection}>
|
|
|
+ <div class={styles.timer}>
|
|
|
+ <img src={icon3} class={styles.timerTitle} />
|
|
|
+ <div class={styles.timerAll}>
|
|
|
+ <span>{formatTimerTo(overCountDown.current.value.days)}</span>
|
|
|
+ 天
|
|
|
+ <span>
|
|
|
+ {formatTimerTo(overCountDown.current.value.hours)}
|
|
|
+ </span>
|
|
|
+ 时
|
|
|
+ <span>
|
|
|
+ {formatTimerTo(overCountDown.current.value.minutes)}
|
|
|
+ </span>
|
|
|
+ 分
|
|
|
+ <span>
|
|
|
+ {formatTimerTo(overCountDown.current.value.seconds)}
|
|
|
+ </span>
|
|
|
+ 秒
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class={styles.timerTip}>
|
|
|
+ 请在规定时间内报名,超过截止时间,将无法使用个人账号
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
<div
|
|
|
class={[styles.studentSection, styles.studentSectionForm]}
|
|
|
// style={{ display: 'none' }}
|
|
@@ -1011,7 +1094,16 @@ export default defineComponent({
|
|
|
readonly
|
|
|
clickable={false}
|
|
|
modelValue={forms.currentClassText}
|
|
|
- onClick={() => (forms.classStatus = true)}
|
|
|
+ onClick={() => {
|
|
|
+ if (
|
|
|
+ forms.schoolInstrumentSetType === 'CLASS' &&
|
|
|
+ forms.classList.length <= 0
|
|
|
+ ) {
|
|
|
+ showToast('请先选择年级');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ forms.classStatus = true;
|
|
|
+ }}
|
|
|
/>
|
|
|
{forms.giftVipDay > 0 ? (
|
|
|
<div class={styles.memberNumer}>
|
|
@@ -1058,23 +1150,30 @@ export default defineComponent({
|
|
|
<i class={styles.iconArrow}></i>
|
|
|
<Cell border={false} class={styles.goodsCell}>
|
|
|
{{
|
|
|
- icon: () => (
|
|
|
- <Image class={styles.img} src={forms.detailVip.goodsUrl} />
|
|
|
- ),
|
|
|
+ icon: () => <Image class={styles.img} src={tuangou} />,
|
|
|
title: () => (
|
|
|
<div class={styles.section}>
|
|
|
<div class={styles.sectionContent}>
|
|
|
<h2>
|
|
|
- {forms.detailVip.goodsName}
|
|
|
+ {/* {forms.detailVip.goodsName} */}
|
|
|
+ <img src={icon5} class={styles.goodsName} />
|
|
|
<Tag class={styles.brandName}>
|
|
|
- {forms.detailVip.brandName}
|
|
|
+ {/* {forms.detailVip.brandName} */}
|
|
|
+ 12个月
|
|
|
</Tag>
|
|
|
</h2>
|
|
|
<p class={[styles.model]}>
|
|
|
{/* 解决学生不会练、不知练的对错、家长无法辅导、无需再额外请老师 */}
|
|
|
- {forms.detailVip.description}
|
|
|
+ {/* {forms.detailVip.description} */}
|
|
|
+ <p>
|
|
|
+ <i></i>解决学生不会练、不知练的对错
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <i></i>家长无法辅导、无需再额外请老师
|
|
|
+ </p>
|
|
|
</p>
|
|
|
- <span class={styles.sendInstrument}>赠送课堂乐器</span>
|
|
|
+ {/* <span class={styles.sendInstrument}>赠送课堂乐器</span> */}
|
|
|
+ <img src={icon6} class={styles.sendInstrument} />
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
@@ -1209,6 +1308,13 @@ export default defineComponent({
|
|
|
studentInfo.extra.currentGradeNum = selectedOption.value;
|
|
|
forms.gradeNumText = selectedOption.text;
|
|
|
forms.gradeStatus = false;
|
|
|
+ if (forms.schoolInstrumentSetType === 'CLASS') {
|
|
|
+ forms.classList = selectedOption.classList;
|
|
|
+ }
|
|
|
+ if (['CLASS', 'GRADE'].includes(forms.schoolInstrumentSetType)) {
|
|
|
+ forms.currentClassText = '';
|
|
|
+ studentInfo.extra.currentClass = '';
|
|
|
+ }
|
|
|
}}
|
|
|
/>
|
|
|
</Popup>
|
|
@@ -1253,17 +1359,6 @@ export default defineComponent({
|
|
|
primaryColor="#FF8057"
|
|
|
confirmButtonText="继续支付"
|
|
|
onConfirm={async () => {
|
|
|
- // const paymentConfig = forms.dialogConfig.paymentConfig;
|
|
|
- // router.push({
|
|
|
- // path: '/order-detail',
|
|
|
- // query: {
|
|
|
- // pm: 1, // h5乐团报名
|
|
|
- // config: JSON.stringify(paymentConfig.paymentConfig),
|
|
|
- // orderNo: paymentConfig.orderNo
|
|
|
- // }
|
|
|
- // });
|
|
|
- // console.log(forms.dialogConfig, 'dialogConfig');
|
|
|
-
|
|
|
countDown.pause();
|
|
|
const paymentConfig = forms.dialogConfig.paymentConfig;
|
|
|
state.config = paymentConfig?.paymentConfig;
|