|
@@ -12,19 +12,21 @@ import {
|
|
|
} from 'vant';
|
|
|
import { computed, defineComponent, onMounted, reactive } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
-import iconGift from './images/icon-gift.png';
|
|
|
-import shopEmpty from './images/shop-empty.png';
|
|
|
-import iconDateMember from './images/icon-date-member.png';
|
|
|
import MSticky from '@/components/m-sticky';
|
|
|
import MVideo from '@/components/m-video';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
-import RegisterModal from './register-modal';
|
|
|
import { useStudentRegisterStore } from '@/store/modules/student-register-store';
|
|
|
import request from '@/helpers/request';
|
|
|
import { browser, moneyFormat } from '@/helpers/utils';
|
|
|
import deepClone from '@/helpers/deep-clone';
|
|
|
import OWxTip from '@/components/m-wx-tip';
|
|
|
import MDialog from '@/components/m-dialog';
|
|
|
+import f1 from './images/new/f-1.png';
|
|
|
+import f2 from './images/new/f-2.png';
|
|
|
+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 giftTip from './images/new/gift-tip.png';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'student-register',
|
|
@@ -43,6 +45,7 @@ export default defineComponent({
|
|
|
gradeYear: '', // 学制
|
|
|
bugGoods: false, // 是否购买AI
|
|
|
registerType: '', // 报名类型
|
|
|
+ detailVip: {} as any,
|
|
|
giftVipDay: 0, // 赠送天数
|
|
|
submitLoading: false,
|
|
|
showMore: true,
|
|
@@ -63,6 +66,7 @@ export default defineComponent({
|
|
|
studentRegisterStore.setVip(data.details || []);
|
|
|
forms.details = deepClone(data.details || []);
|
|
|
if (forms.details.length > 0) {
|
|
|
+ forms.detailVip = forms.details[0];
|
|
|
forms.giftVipDay = forms.details[0].membershipDays;
|
|
|
}
|
|
|
forms.bugGoods = data.bugGoods;
|
|
@@ -91,11 +95,11 @@ export default defineComponent({
|
|
|
originAmount += Number(vip.originalPrice);
|
|
|
});
|
|
|
|
|
|
- const goodsList: any[] = studentRegisterStore.getGoods;
|
|
|
- goodsList.forEach((good: any) => {
|
|
|
- amount += Number(good.price) * good.quantity;
|
|
|
- originAmount += Number(good.originalPrice) * good.quantity;
|
|
|
- });
|
|
|
+ // const goodsList: any[] = studentRegisterStore.getGoods;
|
|
|
+ // goodsList.forEach((good: any) => {
|
|
|
+ // amount += Number(good.price) * good.quantity;
|
|
|
+ // originAmount += Number(good.originalPrice) * good.quantity;
|
|
|
+ // });
|
|
|
return {
|
|
|
amount,
|
|
|
originAmount
|
|
@@ -103,14 +107,14 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
// 删除商品
|
|
|
- const onGoodsRemove = (item: any) => {
|
|
|
- showConfirmDialog({
|
|
|
- message: '是否删除该商品',
|
|
|
- confirmButtonColor: '#FF8633'
|
|
|
- }).then(() => {
|
|
|
- studentRegisterStore.deleteGoods(item.productSkuId);
|
|
|
- });
|
|
|
- };
|
|
|
+ // const onGoodsRemove = (item: any) => {
|
|
|
+ // showConfirmDialog({
|
|
|
+ // message: '是否删除该商品',
|
|
|
+ // confirmButtonColor: '#FF8633'
|
|
|
+ // }).then(() => {
|
|
|
+ // studentRegisterStore.deleteGoods(item.productSkuId);
|
|
|
+ // });
|
|
|
+ // };
|
|
|
|
|
|
// 登记成功之后购买
|
|
|
const onRegisterSubmit = async () => {
|
|
@@ -167,259 +171,118 @@ export default defineComponent({
|
|
|
|
|
|
return () => (
|
|
|
<div class={styles['student-register']}>
|
|
|
- <div class={styles.studentSection} style={{ marginTop: '18px' }}>
|
|
|
- <div class={styles.titleTool}></div>
|
|
|
- {forms.details.map((item: any) => (
|
|
|
- <CellGroup
|
|
|
- class={styles.goodsSection}
|
|
|
- onClick={() => {
|
|
|
- if (studentRegisterStore.selectedVip(item.goodsId)) {
|
|
|
- studentRegisterStore.deleteVip(item.goodsId);
|
|
|
- } else {
|
|
|
- studentRegisterStore.setVip([item]);
|
|
|
- }
|
|
|
- }}>
|
|
|
- <Cell border={false} class={styles.goodsCell}>
|
|
|
- {{
|
|
|
- icon: () => <Image class={styles.img} src={item.goodsUrl} />,
|
|
|
- title: () => (
|
|
|
- <div class={styles.section}>
|
|
|
- <div class={styles.sectionContent}>
|
|
|
- <h2>
|
|
|
- <img
|
|
|
- src={iconDateMember}
|
|
|
- class={styles.iconDateMember}
|
|
|
- />
|
|
|
- </h2>
|
|
|
+ <div class={styles.studentRegisterContainer}>
|
|
|
+ <div class={styles.studentSection}>
|
|
|
+ <div class={styles.title1}></div>
|
|
|
|
|
|
- <p
|
|
|
- class={[
|
|
|
- styles.model,
|
|
|
- forms.showMore ? styles.more : ''
|
|
|
- ]}>
|
|
|
- {item.description}
|
|
|
- </p>
|
|
|
- {item.description &&
|
|
|
- item.description.length >= 36 &&
|
|
|
- forms.showMore ? (
|
|
|
- <span
|
|
|
- class={styles.moreBtn}
|
|
|
- onClick={(e: MouseEvent) => {
|
|
|
- e.stopPropagation();
|
|
|
- forms.showMore = false;
|
|
|
- }}>
|
|
|
- 查看更多
|
|
|
- <Icon name="arrow-down" color="#aaa" />
|
|
|
- </span>
|
|
|
- ) : (
|
|
|
- ''
|
|
|
- )}
|
|
|
+ <p class={styles.content}>
|
|
|
+ 提供在乐器学练中的AI智能学练工具、数字化乐谱与课件,解决学生不会练习、家长无法辅导的乐器学练痛点,学生可实现自主学练,家长即时全面了解学练情况。
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class={[styles.studentSection, styles.truns]}>
|
|
|
+ <div class={styles.trunList}>
|
|
|
+ <div class={styles.trunItem}>
|
|
|
+ <img src={f1} />
|
|
|
+ <p>
|
|
|
+ 随身云教练
|
|
|
+ <br />
|
|
|
+ 无需请老师
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class={styles.trunItem}>
|
|
|
+ <img src={f2} />
|
|
|
+ <p>
|
|
|
+ 简单易操作
|
|
|
+ <br />
|
|
|
+ 学生都会练
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class={styles.trunItem}>
|
|
|
+ <img src={f3} />
|
|
|
+ <p>
|
|
|
+ 练习可测评
|
|
|
+ <br />
|
|
|
+ 家长可省心
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- {/* <div class={styles.sbtnGroup}>
|
|
|
- <span
|
|
|
- class={styles.btnDetail}
|
|
|
- onClick={(e: MouseEvent) => {
|
|
|
- e.stopPropagation();
|
|
|
- router.push('/student-digital-tools');
|
|
|
- }}>
|
|
|
- 查看详情
|
|
|
- </span>
|
|
|
- <span
|
|
|
- class={styles.btnVideo}
|
|
|
- onClick={(e: MouseEvent) => {
|
|
|
- e.stopPropagation();
|
|
|
- forms.popupShow = true;
|
|
|
- }}>
|
|
|
- 介绍视频
|
|
|
- </span>
|
|
|
- </div> */}
|
|
|
- </div>
|
|
|
+ <div class={styles.tipInfo}>
|
|
|
+ <img src={iconTip2} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <i
|
|
|
- class={
|
|
|
- studentRegisterStore.selectedVip(item.goodsId)
|
|
|
- ? styles.selected
|
|
|
- : styles.noSelected
|
|
|
- }></i>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Cell>
|
|
|
- <Cell border={false} class={styles.priceCell}>
|
|
|
- {{
|
|
|
- title: () => (
|
|
|
- <div class={styles.sPriceGroup}>
|
|
|
- <div class={styles.tg}>
|
|
|
- 团购价:
|
|
|
- <span>
|
|
|
- <i>¥ </i>
|
|
|
- {moneyFormat(item.currentPrice)}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- {item.currentPrice < item.originalPrice && (
|
|
|
- <del>¥{moneyFormat(item.originalPrice)}</del>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Cell>
|
|
|
- {item.membershipDays > 0 && (
|
|
|
- <Cell border={false} class={styles.giftCell}>
|
|
|
- {{
|
|
|
- title: () => (
|
|
|
- <div class={styles.gift}>
|
|
|
- <img src={iconGift} class={styles.iconGift} />
|
|
|
- 现在购买赠送 <span>{item.membershipDays || 0}</span>
|
|
|
- 天有效期
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Cell>
|
|
|
- )}
|
|
|
- </CellGroup>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
+ <div class={styles.videoGroup}>
|
|
|
+ <MVideo
|
|
|
+ class={styles.videoB}
|
|
|
+ src={'https://oss.dayaedu.com/daya/202105/SWmqmvW.mp4'}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
|
|
|
- {forms.bugGoods && (
|
|
|
- <>
|
|
|
- <div class={styles.studentSection}>
|
|
|
- <div class={styles.titleBuy}></div>
|
|
|
- {studentRegisterStore.getGoods &&
|
|
|
- studentRegisterStore.getGoods.length <= 0 ? (
|
|
|
- <div class={styles.goodsEmpty}>
|
|
|
- <img src={shopEmpty} class={styles.shopImg} />
|
|
|
- <div class={styles.goodsContainer}>
|
|
|
- <h2>
|
|
|
- 为你的<span>音乐之旅</span>做好准备
|
|
|
- </h2>
|
|
|
- <p class={styles.tips}>快去选购乐器吧~</p>
|
|
|
- <Button
|
|
|
- class={styles.goSelect}
|
|
|
- type="primary"
|
|
|
- onClick={() => {
|
|
|
- router.push('/goods-list');
|
|
|
- }}>
|
|
|
- 进入商城选购
|
|
|
- <Icon name="arrow" />
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
- studentRegisterStore.getGoods.map((goods: any) => (
|
|
|
- <CellGroup class={styles.goodsSection}>
|
|
|
- <Cell border={false} class={styles.goodsCell}>
|
|
|
- {{
|
|
|
- icon: () => (
|
|
|
- <Image class={styles.img} src={goods.pic} />
|
|
|
- ),
|
|
|
- title: () => (
|
|
|
- <div class={styles.section}>
|
|
|
- <div class={styles.sectionContent}>
|
|
|
- <h2>
|
|
|
- {goods.name}
|
|
|
- <Tag class={styles.brandName}>
|
|
|
- {goods.brandName}
|
|
|
- </Tag>
|
|
|
- </h2>
|
|
|
- <p class={[styles.model]}>
|
|
|
- 规格:{goods.spDataJson}
|
|
|
- </p>
|
|
|
- <p class={[styles.model]}>{goods.productSn}</p>
|
|
|
+ <div class={styles.studentSection}>
|
|
|
+ <div class={styles.title2}></div>
|
|
|
|
|
|
- <Stepper
|
|
|
- min={1}
|
|
|
- max={99}
|
|
|
- v-model={goods.quantity}
|
|
|
- disableInput
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <div class={styles.functionGroup}>
|
|
|
+ <img src={functionBg} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <i
|
|
|
- class={styles.delete}
|
|
|
- onClick={() => onGoodsRemove(goods)}></i>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Cell>
|
|
|
- <Cell border={false} class={styles.priceCell}>
|
|
|
- {{
|
|
|
- title: () => (
|
|
|
- <div class={styles.sPriceGroup}>
|
|
|
- <div class={styles.tg}>
|
|
|
- 团购价:
|
|
|
- <span>
|
|
|
- <i>¥ </i>
|
|
|
- {moneyFormat(goods.price)}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- {goods.price < goods.originalPrice && (
|
|
|
- <del>¥{moneyFormat(goods.originalPrice)}</del>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Cell>
|
|
|
- </CellGroup>
|
|
|
- ))
|
|
|
- )}
|
|
|
+ {forms.giftVipDay > 0 && (
|
|
|
+ <div class={[styles.studentSection, styles.memberGroup]}>
|
|
|
+ <p>
|
|
|
+ 现在购买赠送会员有效期<span>{forms.giftVipDay || 0}</span>天
|
|
|
+ </p>
|
|
|
</div>
|
|
|
- {studentRegisterStore.getGoods &&
|
|
|
- studentRegisterStore.getGoods.length > 0 && (
|
|
|
+ )}
|
|
|
+
|
|
|
+ <MSticky position="bottom">
|
|
|
+ <div class={styles.paymentContainer}>
|
|
|
+ <div class={styles.payemntPrice}>
|
|
|
+ <img src={giftTip} class={styles.giftTip} />
|
|
|
+ <div>
|
|
|
+ <span class={styles.needPrice}>
|
|
|
+ <i style="font-style: normal">¥ </i>
|
|
|
+ <span>{moneyFormat(calcPrice.value.amount)}</span>
|
|
|
+ <i style="font-style: normal">/年</i>
|
|
|
+ </span>
|
|
|
+ {calcPrice.value.originAmount > calcPrice.value.amount ? (
|
|
|
+ <del class={styles.allPrice}>
|
|
|
+ ¥ {moneyFormat(calcPrice.value.originAmount)}
|
|
|
+ </del>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class={styles.paymentBtn}
|
|
|
+ onClick={() => {
|
|
|
+ // const vipList = studentRegisterStore.getVip;
|
|
|
+ // const goodsList = studentRegisterStore.getGoods;
|
|
|
+ // if (vipList.length <= 0 && goodsList.length <= 0) {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // showToast('请选择需要购买的商品');
|
|
|
+ // }, 100);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ onRegisterSubmit();
|
|
|
+ }}>
|
|
|
<Button
|
|
|
- class={styles.addButton}
|
|
|
- block
|
|
|
- onClick={() => {
|
|
|
- router.push('/goods-list');
|
|
|
- }}>
|
|
|
- <Icon name="add-o" />
|
|
|
- 进入商城选购
|
|
|
+ round
|
|
|
+ disabled={forms.submitLoading}
|
|
|
+ loading={forms.submitLoading}>
|
|
|
+ 下一步
|
|
|
</Button>
|
|
|
- )}
|
|
|
- </>
|
|
|
- )}
|
|
|
-
|
|
|
- <MSticky position="bottom">
|
|
|
- <div class={styles.paymentContainer}>
|
|
|
- <div class={styles.payemntPrice}>
|
|
|
- <span class={styles.needPrice}>
|
|
|
- <i style="font-style: normal">¥ </i>
|
|
|
- <span>{moneyFormat(calcPrice.value.amount)}</span>
|
|
|
- </span>
|
|
|
- {calcPrice.value.originAmount > calcPrice.value.amount ? (
|
|
|
- <del class={styles.allPrice}>
|
|
|
- ¥ {moneyFormat(calcPrice.value.originAmount)}
|
|
|
- </del>
|
|
|
- ) : (
|
|
|
- ''
|
|
|
- )}
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={styles.paymentBtn}
|
|
|
- onClick={() => {
|
|
|
- const vipList = studentRegisterStore.getVip;
|
|
|
- const goodsList = studentRegisterStore.getGoods;
|
|
|
- if (vipList.length <= 0 && goodsList.length <= 0) {
|
|
|
- setTimeout(() => {
|
|
|
- showToast('请选择需要购买的商品');
|
|
|
- }, 100);
|
|
|
- return;
|
|
|
- }
|
|
|
- onRegisterSubmit();
|
|
|
- }}>
|
|
|
- <Button
|
|
|
- disabled={forms.submitLoading}
|
|
|
- loading={forms.submitLoading}>
|
|
|
- 确认购买
|
|
|
- </Button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </MSticky>
|
|
|
+ </MSticky>
|
|
|
+ </div>
|
|
|
|
|
|
- <Popup v-model:show={forms.popupShow} class={styles.videoPopup}>
|
|
|
+ {/* <Popup v-model:show={forms.popupShow} class={styles.videoPopup}>
|
|
|
{forms.popupShow && (
|
|
|
<MVideo src={'https://oss.dayaedu.com/daya/202105/SWmqmvW.mp4'} />
|
|
|
)}
|
|
|
- </Popup>
|
|
|
+ </Popup> */}
|
|
|
|
|
|
{/* 是否在微信中打开 */}
|
|
|
<OWxTip
|