|
@@ -29,6 +29,7 @@ import request from '@/helpers/request'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { goWechatAuth, setLogout } from '@/state'
|
|
|
import ODialog from '@/components/o-dialog'
|
|
|
+import InspectModal from './modal/inspect-modal'
|
|
|
|
|
|
// 乐团交付,乐团停止或关闭,有新的交付团;则不允许报名
|
|
|
const classList: any = []
|
|
@@ -41,9 +42,13 @@ export default defineComponent({
|
|
|
setup() {
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
+
|
|
|
+ // 获取是否已经看过训练工具图片
|
|
|
+ const readToolImg = localStorage.getItem('read-tool-image')
|
|
|
const state = reactive({
|
|
|
code: '' as any, // 微信授权code码
|
|
|
detail: {} as any, // 学员详情
|
|
|
+ toolImgStatus: readToolImg ? true : false,
|
|
|
currentGrade: [
|
|
|
{ text: '一年级', value: 1 },
|
|
|
{ text: '二年级', value: 2 },
|
|
@@ -57,10 +62,12 @@ export default defineComponent({
|
|
|
], // 年级数组列表
|
|
|
classList: classList,
|
|
|
subjectList: [] as any, // 声部列表
|
|
|
+ instrumentsInspectionDescribe: '', // 配置信息
|
|
|
+ inspectPopupStatus: false, // 查看说明
|
|
|
gradeStatus: false,
|
|
|
classStatus: false,
|
|
|
subjectStatus: false,
|
|
|
- registerInfo: {}, // 乐团信息
|
|
|
+ registerInfo: {} as any, // 乐团信息
|
|
|
goodsInfo: {} as any, // 商品
|
|
|
textBookInfo: {} as any, // 教材
|
|
|
inspectInfo: {} as any, // 乐器检查
|
|
@@ -71,7 +78,6 @@ export default defineComponent({
|
|
|
details: [] as any, //
|
|
|
pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
|
|
|
nameReg: /^[\u4E00-\u9FA5]+$/,
|
|
|
- subjectChangeStatus: false, // 更换声部时
|
|
|
paymentType: '',
|
|
|
musicPaymentType: '', // 乐团中对应支付方式
|
|
|
dialogStatus: false,
|
|
@@ -80,7 +86,8 @@ export default defineComponent({
|
|
|
orderInfo: {
|
|
|
needPrice: 0,
|
|
|
originalPrice: 0
|
|
|
- }
|
|
|
+ },
|
|
|
+ submitStatus: false
|
|
|
})
|
|
|
const forms = reactive({
|
|
|
username: null,
|
|
@@ -93,7 +100,9 @@ export default defineComponent({
|
|
|
registerSubjectTxt: null, // 所在声部
|
|
|
parentName: null,
|
|
|
groupBuyType: '' as any,
|
|
|
- phone: null as any
|
|
|
+ phone: null as any,
|
|
|
+ learningTools: null,
|
|
|
+ instrumentsBrand: null
|
|
|
})
|
|
|
|
|
|
// 获取乐团报名信息
|
|
@@ -109,6 +118,7 @@ export default defineComponent({
|
|
|
const subjects: any = state.subjectList.find(
|
|
|
(item: any) => item.value == detail.registerSubjectId
|
|
|
)
|
|
|
+ state.instrumentsInspectionDescribe = subjects.instrumentsInspectionDescribe
|
|
|
forms.username = detail.username
|
|
|
forms.sex = detail.sex ? 1 : 0
|
|
|
forms.currentGrade = detail.currentGrade
|
|
@@ -119,6 +129,14 @@ export default defineComponent({
|
|
|
forms.registerSubjectTxt = subjects ? subjects.text : ''
|
|
|
forms.parentName = detail.parentName
|
|
|
forms.phone = detail.phone
|
|
|
+ forms.instrumentsBrand = detail.instrumentsBrand
|
|
|
+ forms.learningTools = detail.learningTools
|
|
|
+
|
|
|
+ if (detail.registerSubjectId) {
|
|
|
+ // 更新商品信息
|
|
|
+ await registerGoods()
|
|
|
+ }
|
|
|
+ forms.groupBuyType = detail.groupBuyType || 'GROUP_BUY'
|
|
|
} catch (e) {
|
|
|
//
|
|
|
console.log(e)
|
|
@@ -166,8 +184,7 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 乐团报名
|
|
|
- const onSubmit = async () => {
|
|
|
+ const onRegisterUser = async () => {
|
|
|
try {
|
|
|
const params: any = {
|
|
|
orchestraId: route.query.id,
|
|
@@ -187,81 +204,97 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ if (forms.groupBuyType === 'SELF') {
|
|
|
+ router.push({
|
|
|
+ path: '/preGoodsSuccess'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 乐团报名
|
|
|
+ const onSubmit = async () => {
|
|
|
+ try {
|
|
|
+ if (forms.groupBuyType === 'SELF') {
|
|
|
+ state.submitStatus = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 判断是否购买乐器
|
|
|
- if (forms.groupBuyType === 'GROUP_BUY') {
|
|
|
- // 重新计算金额
|
|
|
- calcPrice()
|
|
|
- const params: any = [] // 支付参数
|
|
|
+ // 乐器报名前先注册用户
|
|
|
+ await onRegisterUser()
|
|
|
+ // 重新计算金额
|
|
|
+ calcPrice()
|
|
|
+ const params: any = [] // 支付参数
|
|
|
+
|
|
|
+ // 学练工具
|
|
|
+ const vipYear = state.vipYearInfo
|
|
|
+ params.push({
|
|
|
+ goodsId: vipYear.goodsId,
|
|
|
+ goodsNum: 1,
|
|
|
+ goodsType: vipYear.goodsType,
|
|
|
+ paymentCashAmount: vipYear.currentPrice, // 现金支付金额
|
|
|
+ paymentCouponAmount: 0 // 优惠券金额
|
|
|
+ })
|
|
|
|
|
|
- // 学练工具
|
|
|
- const vipYear = state.vipYearInfo
|
|
|
- params.push({
|
|
|
- goodsId: vipYear.goodsId,
|
|
|
- goodsNum: 1,
|
|
|
- goodsType: vipYear.goodsType,
|
|
|
- paymentCashAmount: vipYear.currentPrice, // 现金支付金额
|
|
|
- paymentCouponAmount: 0 // 优惠券金额
|
|
|
- })
|
|
|
+ // 商品
|
|
|
+ const goodsInfo = state.goodsInfo
|
|
|
+ params.push({
|
|
|
+ goodsId: goodsInfo.goodsId,
|
|
|
+ goodsNum: 1,
|
|
|
+ goodsType: goodsInfo.goodsType,
|
|
|
+ paymentCashAmount: goodsInfo.currentPrice, // 现金支付金额
|
|
|
+ paymentCouponAmount: 0 // 优惠券金额
|
|
|
+ })
|
|
|
|
|
|
- // 商品
|
|
|
- const goodsInfo = state.goodsInfo
|
|
|
- params.push({
|
|
|
- goodsId: goodsInfo.goodsId,
|
|
|
- goodsNum: 1,
|
|
|
- goodsType: goodsInfo.goodsType,
|
|
|
- paymentCashAmount: goodsInfo.currentPrice, // 现金支付金额
|
|
|
- paymentCouponAmount: 0 // 优惠券金额
|
|
|
- })
|
|
|
+ // 教材
|
|
|
+ const textBookInfo = state.textBookInfo
|
|
|
+ params.push({
|
|
|
+ goodsId: textBookInfo.goodsId,
|
|
|
+ goodsNum: 1,
|
|
|
+ goodsType: textBookInfo.goodsType,
|
|
|
+ paymentCashAmount: textBookInfo.currentPrice, // 现金支付金额
|
|
|
+ paymentCouponAmount: 0 // 优惠券金额
|
|
|
+ })
|
|
|
|
|
|
- // 教材
|
|
|
- const textBookInfo = state.textBookInfo
|
|
|
+ // 检查
|
|
|
+ if (state.inspectStatus) {
|
|
|
+ const inspectInfo = state.inspectInfo
|
|
|
params.push({
|
|
|
- goodsId: textBookInfo.goodsId,
|
|
|
+ goodsId: inspectInfo.goodsId,
|
|
|
goodsNum: 1,
|
|
|
- goodsType: textBookInfo.goodsType,
|
|
|
- paymentCashAmount: textBookInfo.currentPrice, // 现金支付金额
|
|
|
+ goodsType: inspectInfo.goodsType,
|
|
|
+ paymentCashAmount: inspectInfo.currentPrice, // 现金支付金额
|
|
|
paymentCouponAmount: 0 // 优惠券金额
|
|
|
})
|
|
|
+ }
|
|
|
|
|
|
- // 检查
|
|
|
- if (state.inspectStatus) {
|
|
|
- const inspectInfo = state.inspectInfo
|
|
|
- params.push({
|
|
|
- goodsId: inspectInfo.goodsId,
|
|
|
- goodsNum: 1,
|
|
|
- goodsType: inspectInfo.goodsType,
|
|
|
- paymentCashAmount: inspectInfo.currentPrice, // 现金支付金额
|
|
|
- paymentCouponAmount: 0 // 优惠券金额
|
|
|
- })
|
|
|
+ // 创建订单
|
|
|
+ const { data } = await request.post('/api-student/userPaymentOrder/executeOrder', {
|
|
|
+ hideLoading: false,
|
|
|
+ data: {
|
|
|
+ paymentType: state.musicPaymentType || state.paymentType,
|
|
|
+ bizId: route.query.id, // 乐团编号
|
|
|
+ orderType: 'ORCHESTRA',
|
|
|
+ paymentCashAmount: state.orderInfo.needPrice || 0,
|
|
|
+ paymentCouponAmount: 0,
|
|
|
+ goodsInfos: params,
|
|
|
+ orderName: '乐团报名缴费',
|
|
|
+ orderDesc: '乐团报名缴费'
|
|
|
}
|
|
|
+ })
|
|
|
|
|
|
- // 创建订单
|
|
|
- const { data } = await request.post('/api-student/userPaymentOrder/executeOrder', {
|
|
|
- hideLoading: false,
|
|
|
- data: {
|
|
|
- paymentType: state.musicPaymentType || state.paymentType,
|
|
|
- bizId: route.query.id, // 乐团编号
|
|
|
- orderType: 'ORCHESTRA',
|
|
|
- paymentCashAmount: state.orderInfo.needPrice || 0,
|
|
|
- paymentCouponAmount: 0,
|
|
|
- goodsInfos: params,
|
|
|
- orderName: '乐团报名缴费',
|
|
|
- orderDesc: '乐团报名缴费'
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- console.log(data)
|
|
|
- router.push({
|
|
|
- path: '/orderDetail',
|
|
|
- query: {
|
|
|
- pm: 1, // h5乐团报名
|
|
|
- config: JSON.stringify({ ...data.paymentConfig, paymentType: data.paymentType }),
|
|
|
- orderNo: data.orderNo
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- //
|
|
|
- }
|
|
|
+ console.log(data)
|
|
|
+ router.push({
|
|
|
+ path: '/orderDetail',
|
|
|
+ query: {
|
|
|
+ pm: 1, // h5乐团报名
|
|
|
+ config: JSON.stringify({ ...data.paymentConfig, paymentType: data.paymentType }),
|
|
|
+ orderNo: data.orderNo
|
|
|
+ }
|
|
|
+ })
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -339,6 +372,7 @@ export default defineComponent({
|
|
|
if (item.goodsType === 'INSTRUMENTS') {
|
|
|
const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
|
|
|
state.goodsInfo = { ...item, goodsUrl: img }
|
|
|
+ state.instrumentsInspectionDescribe = item.instrumentsInspectionDescribe
|
|
|
} else if (item.goodsType === 'TEXTBOOK') {
|
|
|
const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
|
|
|
state.textBookInfo = { ...item, goodsUrl: img }
|
|
@@ -530,18 +564,6 @@ export default defineComponent({
|
|
|
showToast('暂无报名声部')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- // 切换订单时判断是否有支付中和已支付的订单,并且已注册过
|
|
|
- // 判断学员所在乐团状态,如果在读则不允许更换声部(只能退团重新报名)
|
|
|
- // 退团重新报名也不能更新声部
|
|
|
- // if (
|
|
|
- // props.registerInfo?.registerStatus === 'LEARNING' ||
|
|
|
- // (props.registerInfo?.registerStatus === 'OUTOF_ORCHESTRA' &&
|
|
|
- // props.registerInfo?.orderNumber > 0)
|
|
|
- // ) {
|
|
|
- // state.subjectChangeStatus = true
|
|
|
- // return
|
|
|
- // }
|
|
|
state.subjectStatus = true
|
|
|
}}
|
|
|
rules={[{ required: true, message: '请选择声部' }]}
|
|
@@ -706,16 +728,34 @@ export default defineComponent({
|
|
|
|
|
|
<Cell>
|
|
|
{{
|
|
|
- icon: () => <img src={iconBao} class={styles.iconBao} />,
|
|
|
+ icon: () => (
|
|
|
+ <img
|
|
|
+ src={iconBao}
|
|
|
+ class={styles.iconBao}
|
|
|
+ onClick={() => {
|
|
|
+ if (state.instrumentsInspectionDescribe) state.inspectPopupStatus = true
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ ),
|
|
|
value: () => (
|
|
|
<div class={styles.baoContainer}>
|
|
|
<div class={styles.baoTitle}>下校检查乐器 1-2次/学期</div>
|
|
|
<div class={styles.baoPrice}>
|
|
|
- <p>
|
|
|
+ <p
|
|
|
+ onClick={() => {
|
|
|
+ state.inspectStatus = !state.inspectStatus
|
|
|
+ calcPrice()
|
|
|
+ }}
|
|
|
+ >
|
|
|
<span class={styles.prefix}>¥</span> {state.inspectInfo.currentPrice}
|
|
|
<span class={styles.suffix}>/年</span>
|
|
|
</p>
|
|
|
- <Checkbox v-model={state.inspectStatus}></Checkbox>
|
|
|
+ <Checkbox
|
|
|
+ v-model={state.inspectStatus}
|
|
|
+ onClick={() => {
|
|
|
+ calcPrice()
|
|
|
+ }}
|
|
|
+ ></Checkbox>
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
@@ -753,26 +793,28 @@ export default defineComponent({
|
|
|
<CellGroup class={[styles.applyCellGroup, styles.self]} border={false}>
|
|
|
<div class={styles.toolImg}>
|
|
|
<Image
|
|
|
- src={'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/1696816717584.png'}
|
|
|
+ src={state.registerInfo?.instrumentPriceImg}
|
|
|
onClick={() => {
|
|
|
- showImagePreview([
|
|
|
- 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/1696816717584.png'
|
|
|
- ])
|
|
|
+ showImagePreview([state.registerInfo?.instrumentPriceImg])
|
|
|
+ localStorage.setItem('read-tool-image', '1')
|
|
|
+ state.toolImgStatus = true
|
|
|
}}
|
|
|
/>
|
|
|
|
|
|
- <div class={styles.toolImgOverflow}>
|
|
|
- <Button
|
|
|
- onClick={() => {
|
|
|
- showImagePreview([
|
|
|
- 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/1696816717584.png'
|
|
|
- ])
|
|
|
- }}
|
|
|
- >
|
|
|
- 点击查看《乐团训练工具标准配置表》
|
|
|
- </Button>
|
|
|
- <img src={iconHead} class={styles.iconHead} />
|
|
|
- </div>
|
|
|
+ {!state.toolImgStatus && (
|
|
|
+ <div class={styles.toolImgOverflow}>
|
|
|
+ <Button
|
|
|
+ onClick={() => {
|
|
|
+ showImagePreview([state.registerInfo?.instrumentPriceImg])
|
|
|
+ localStorage.setItem('read-tool-image', '1')
|
|
|
+ state.toolImgStatus = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 点击查看《乐团训练工具标准配置表》
|
|
|
+ </Button>
|
|
|
+ <img src={iconHead} class={styles.iconHead} />
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
<Field
|
|
|
required
|
|
@@ -780,7 +822,7 @@ export default defineComponent({
|
|
|
labelAlign="top"
|
|
|
border={false}
|
|
|
placeholder="请填写您计划配置的乐器品牌"
|
|
|
- v-model={forms.parentName}
|
|
|
+ v-model={forms.instrumentsBrand}
|
|
|
maxlength={30}
|
|
|
class={styles.toolInput}
|
|
|
rules={[{ required: true, message: '请填写您计划配置的乐器品牌' }]}
|
|
@@ -792,7 +834,7 @@ export default defineComponent({
|
|
|
border={false}
|
|
|
class={styles.toolInput}
|
|
|
placeholder="请填写您计划配置的AI学练工具品牌"
|
|
|
- v-model={forms.phone}
|
|
|
+ v-model={forms.learningTools}
|
|
|
maxlength={30}
|
|
|
rules={[{ required: true, message: '请填写您计划配置的AI学练工具品牌' }]}
|
|
|
/>
|
|
@@ -864,16 +906,40 @@ export default defineComponent({
|
|
|
const selectedOption = val.selectedOptions[0]
|
|
|
forms.registerSubjectId = selectedOption.value
|
|
|
forms.registerSubjectTxt = selectedOption.text
|
|
|
+ console.log(selectedOption, 'selected')
|
|
|
state.subjectStatus = false
|
|
|
|
|
|
// 更新商品信息
|
|
|
await registerGoods()
|
|
|
-
|
|
|
forms.groupBuyType = 'GROUP_BUY'
|
|
|
}}
|
|
|
/>
|
|
|
</Popup>
|
|
|
|
|
|
+ {/* 声部 */}
|
|
|
+ <Popup v-model:show={state.inspectPopupStatus} round closeable class={styles.inspectPopup}>
|
|
|
+ <InspectModal describe={state.instrumentsInspectionDescribe} />
|
|
|
+ </Popup>
|
|
|
+
|
|
|
+ {/* 确认信息 */}
|
|
|
+ <ODialog
|
|
|
+ title="确认信息"
|
|
|
+ v-model:show={state.submitStatus}
|
|
|
+ message={
|
|
|
+ '<p style="text-align: left;">请确认您准备的乐器和AI学练工具符合<span style="color: #F67146;font-weight: bold;">《乐团训练工具标准配置表》</span></p>'
|
|
|
+ }
|
|
|
+ allowHtml
|
|
|
+ confirmButtonText="确认"
|
|
|
+ cancelButtonText="返回"
|
|
|
+ showCancelButton
|
|
|
+ onConfirm={() => {
|
|
|
+ onRegisterUser()
|
|
|
+ }}
|
|
|
+ onCancel={async () => {
|
|
|
+ state.submitStatus = false
|
|
|
+ }}
|
|
|
+ />
|
|
|
+
|
|
|
<ODialog
|
|
|
title="提示"
|
|
|
v-model:show={state.dialogStatus}
|
|
@@ -883,7 +949,6 @@ export default defineComponent({
|
|
|
showCancelButton
|
|
|
onConfirm={() => {
|
|
|
const paymentConfig = state.dialogConfig.paymentConfig
|
|
|
-
|
|
|
router.push({
|
|
|
path: '/orderDetail',
|
|
|
query: {
|