|
@@ -27,6 +27,7 @@ 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';
|
|
|
+import shopEmpty from './images/shop-empty.png';
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
export default defineComponent({
|
|
@@ -44,7 +45,14 @@ export default defineComponent({
|
|
|
details: [] as any[],
|
|
|
schoolType: '', // 学校类型
|
|
|
gradeYear: '', // 学制
|
|
|
- bugGoods: false, // 是否购买AI
|
|
|
+ // bugGoods: false, // 是否购买AI
|
|
|
+ // @ApiModelProperty("购买课堂乐器 新 自选乐器 SELECT_INSTRUMENT 不购买乐器 NOT_BUY_INSTRUMENT 赠送乐器 GIVE_INSTRUMENT")
|
|
|
+ // private EBuyGoodsType buyGoodsType;
|
|
|
+
|
|
|
+ // @ApiModelProperty("学生信息收集 REGISTER 注册收集 LOGIN 登陆收集")
|
|
|
+ // private EStudentInfoType studentInfoType;
|
|
|
+ buyGoodsType: null, // 报名乐器设置
|
|
|
+ studentInfoType: null, // 学生信息收集
|
|
|
registerType: '', // 报名类型
|
|
|
detailVip: {} as any,
|
|
|
giftVipDay: 0, // 赠送天数
|
|
@@ -70,20 +78,22 @@ export default defineComponent({
|
|
|
forms.detailVip = forms.details[0];
|
|
|
forms.giftVipDay = forms.details[0].membershipDays;
|
|
|
}
|
|
|
- forms.bugGoods = data.bugGoods;
|
|
|
+ // forms.bugGoods = data.bugGoods;
|
|
|
+ forms.buyGoodsType = data.buyGoodsType;
|
|
|
+ forms.studentInfoType = data.studentInfoType;
|
|
|
forms.schoolType = data.schoolType;
|
|
|
forms.gradeYear = data.gradeYear;
|
|
|
forms.registerType = data.registerType;
|
|
|
if (browser().weixin) {
|
|
|
- if (
|
|
|
- data.schoolStatus === 0 &&
|
|
|
- forms.schoolId == '1770035687490105346'
|
|
|
- ) {
|
|
|
- forms.showTips = true;
|
|
|
- forms.showMessage = '团购时间已截止,感谢您的参与';
|
|
|
- forms.showButton = false;
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (
|
|
|
+ // data.schoolStatus === 0 &&
|
|
|
+ // forms.schoolId == '1770035687490105346'
|
|
|
+ // ) {
|
|
|
+ // forms.showTips = true;
|
|
|
+ // forms.showMessage = '团购时间已截止,感谢您的参与';
|
|
|
+ // forms.showButton = false;
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
if (data.registerType !== 'BUG_GOODS' || data.schoolStatus === 0) {
|
|
|
forms.showTips = true;
|
|
|
forms.showMessage = '二维码已经失效,详情请咨询学校老师';
|
|
@@ -106,11 +116,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
|
|
@@ -118,14 +128,14 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
// 删除商品
|
|
|
- // const onGoodsRemove = (item: any) => {
|
|
|
- // showConfirmDialog({
|
|
|
- // message: '是否删除该商品',
|
|
|
- // confirmButtonColor: '#FF8633'
|
|
|
- // }).then(() => {
|
|
|
- // studentRegisterStore.deleteGoods(item.productSkuId);
|
|
|
- // });
|
|
|
- // };
|
|
|
+ const onGoodsRemove = (item: any) => {
|
|
|
+ showConfirmDialog({
|
|
|
+ message: '是否删除该商品',
|
|
|
+ confirmButtonColor: '#19A1FE'
|
|
|
+ }).then(() => {
|
|
|
+ studentRegisterStore.deleteGoods(item.productSkuId);
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
// 登记成功之后购买
|
|
|
const onRegisterSubmit = async () => {
|
|
@@ -217,11 +227,13 @@ export default defineComponent({
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ </div>
|
|
|
+ {/* 赠送乐器 */}
|
|
|
+ {forms.buyGoodsType === 'GIVE_INSTRUMENT' && (
|
|
|
<div class={styles.tipInfo}>
|
|
|
<img src={iconTip2} />
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
|
|
|
{/* <div class={styles.videoGroup}>
|
|
|
<MVideo
|
|
@@ -246,10 +258,117 @@ export default defineComponent({
|
|
|
</div>
|
|
|
)}
|
|
|
|
|
|
+ {forms.buyGoodsType === 'SELECT_INSTRUMENT' && (
|
|
|
+ <>
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.studentSection,
|
|
|
+ styles.studentInstrumentSection
|
|
|
+ ]}>
|
|
|
+ <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');
|
|
|
+ }}>
|
|
|
+ {/* 进入商城选购 */}
|
|
|
+ <span>去选购</span>
|
|
|
+ <Icon name="arrow" />
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ studentRegisterStore.getGoods.map((goods: any) => (
|
|
|
+ <CellGroup class={styles.goodsSection} border={false}>
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <Stepper
|
|
|
+ min={1}
|
|
|
+ max={99}
|
|
|
+ v-model={goods.quantity}
|
|
|
+ disableInput
|
|
|
+ />
|
|
|
+ </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>
|
|
|
+ ))
|
|
|
+ )}
|
|
|
+ {studentRegisterStore.getGoods &&
|
|
|
+ studentRegisterStore.getGoods.length > 0 && (
|
|
|
+ <Button
|
|
|
+ class={styles.addButton}
|
|
|
+ block
|
|
|
+ onClick={() => {
|
|
|
+ router.push('/goods-list');
|
|
|
+ }}>
|
|
|
+ <Icon name="add-o" />
|
|
|
+ 添加购买
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+
|
|
|
<MSticky position="bottom">
|
|
|
<div class={styles.paymentContainer}>
|
|
|
<div class={styles.payemntPrice}>
|
|
|
- <img src={giftTip} class={styles.giftTip} />
|
|
|
+ {/* 赠送乐器 */}
|
|
|
+ {forms.buyGoodsType === 'GIVE_INSTRUMENT' && (
|
|
|
+ <img src={giftTip} class={styles.giftTip} />
|
|
|
+ )}
|
|
|
+
|
|
|
<div>
|
|
|
<span class={styles.needPrice}>
|
|
|
<i style="font-style: normal">¥ </i>
|
|
@@ -282,7 +401,8 @@ export default defineComponent({
|
|
|
round
|
|
|
disabled={forms.submitLoading}
|
|
|
loading={forms.submitLoading}>
|
|
|
- 下一步
|
|
|
+ {forms.studentInfoType === 'REGISTER' ? '下一步' : ''}
|
|
|
+ {forms.studentInfoType === 'LOGIN' ? '确认购买' : ''}
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -296,13 +416,13 @@ export default defineComponent({
|
|
|
</Popup> */}
|
|
|
|
|
|
{/* 是否在微信中打开 */}
|
|
|
- <OWxTip
|
|
|
+ {/* <OWxTip
|
|
|
show={forms.showTips}
|
|
|
message={forms.showMessage}
|
|
|
showButton={forms.showButton}
|
|
|
buttonText="刷新"
|
|
|
onConfirm={() => window.location.reload()}
|
|
|
- />
|
|
|
+ /> */}
|
|
|
</div>
|
|
|
);
|
|
|
}
|