|
@@ -17,7 +17,7 @@ import iconTips from '@common/images/icon_tips.png'
|
|
import Payment from './payment'
|
|
import Payment from './payment'
|
|
import ColHeader from '@/components/col-header'
|
|
import ColHeader from '@/components/col-header'
|
|
import { state } from '@/state'
|
|
import { state } from '@/state'
|
|
-import { orderStatus } from './orderStatus'
|
|
|
|
|
|
+import { orderInfos, orderStatus } from './orderStatus'
|
|
import OrderVideo from './order-video'
|
|
import OrderVideo from './order-video'
|
|
import OrderLive from './order-live'
|
|
import OrderLive from './order-live'
|
|
import OrderPractice from './order-practice'
|
|
import OrderPractice from './order-practice'
|
|
@@ -33,7 +33,7 @@ export default defineComponent({
|
|
data() {
|
|
data() {
|
|
const query = this.$route.query
|
|
const query = this.$route.query
|
|
return {
|
|
return {
|
|
- loading: false, // 是否加载中
|
|
|
|
|
|
+ loading: false, // 是否加载中,为了处理0元订单()
|
|
orderType: query.orderType,
|
|
orderType: query.orderType,
|
|
recomUserId: query.recomUserId, // 推荐人id
|
|
recomUserId: query.recomUserId, // 推荐人id
|
|
id: query.id,
|
|
id: query.id,
|
|
@@ -56,64 +56,64 @@ export default defineComponent({
|
|
// 商品列表
|
|
// 商品列表
|
|
const orderObject = orderStatus.orderObject
|
|
const orderObject = orderStatus.orderObject
|
|
return orderObject.orderList || []
|
|
return orderObject.orderList || []
|
|
- },
|
|
|
|
- orderInfos() {
|
|
|
|
- // 商品列表
|
|
|
|
- const orderList = orderStatus.orderObject.orderList || []
|
|
|
|
- return orderList.map((item: any) => {
|
|
|
|
- const params = {
|
|
|
|
- goodType: item.orderType,
|
|
|
|
- goodName: item.goodsName,
|
|
|
|
- recomUserId: item.recomUserId, // 推荐人id
|
|
|
|
- bizContent: {}
|
|
|
|
- }
|
|
|
|
- if (item.orderType === 'VIDEO') {
|
|
|
|
- params.bizContent = {
|
|
|
|
- videoLessonGroupId: item.courseGroupId,
|
|
|
|
- payMoney: item.coursePrice || 0
|
|
|
|
- }
|
|
|
|
- } else if (item.orderType === 'LIVE') {
|
|
|
|
- params.bizContent = {
|
|
|
|
- groupId: item.courseGroupId
|
|
|
|
- }
|
|
|
|
- } else if (item.orderType === 'PRACTICE') {
|
|
|
|
- const tempTime = item.classTime || []
|
|
|
|
- const classCourse: any = []
|
|
|
|
- tempTime.forEach((time: any) => {
|
|
|
|
- classCourse.push({
|
|
|
|
- classDate: time.classDate,
|
|
|
|
- startTime: time.startTime,
|
|
|
|
- endTime: time.endTime
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- params.bizContent = {
|
|
|
|
- courseGroupName: item.courseGroupName,
|
|
|
|
- courseIntroduce: item.courseIntroduce,
|
|
|
|
- subjectId: item.subjectId,
|
|
|
|
- singleCourseMinutes: item.singleCourseMinutes,
|
|
|
|
- courseNum: item.courseNum,
|
|
|
|
- coursePrice: item.coursePrice,
|
|
|
|
- teacherId: item.teacherId,
|
|
|
|
- classTime: classCourse
|
|
|
|
- }
|
|
|
|
- } else if (item.orderType === 'VIP') {
|
|
|
|
- params.bizContent = item.id
|
|
|
|
- } else if (item.orderType === 'MUSIC') {
|
|
|
|
- params.bizContent = {
|
|
|
|
- musicSheetId: item.id,
|
|
|
|
- actualPrice: item.actualPrice || 0,
|
|
|
|
- clientType: state.platformType
|
|
|
|
- }
|
|
|
|
- } else if (item.orderType === 'PINAO_ROOM') {
|
|
|
|
- params.bizContent = item.id
|
|
|
|
- } else if (item.orderType === 'ACTI_REGIST') {
|
|
|
|
- params.bizContent = {
|
|
|
|
- activityId: item.activityId
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return params
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
|
|
+ // orderInfos() {
|
|
|
|
+ // // 商品列表
|
|
|
|
+ // const orderList = orderStatus.orderObject.orderList || []
|
|
|
|
+ // return orderList.map((item: any) => {
|
|
|
|
+ // const params = {
|
|
|
|
+ // goodType: item.orderType,
|
|
|
|
+ // goodName: item.goodsName,
|
|
|
|
+ // recomUserId: item.recomUserId, // 推荐人id
|
|
|
|
+ // bizContent: {}
|
|
|
|
+ // }
|
|
|
|
+ // if (item.orderType === 'VIDEO') {
|
|
|
|
+ // params.bizContent = {
|
|
|
|
+ // videoLessonGroupId: item.courseGroupId,
|
|
|
|
+ // payMoney: item.coursePrice || 0
|
|
|
|
+ // }
|
|
|
|
+ // } else if (item.orderType === 'LIVE') {
|
|
|
|
+ // params.bizContent = {
|
|
|
|
+ // groupId: item.courseGroupId
|
|
|
|
+ // }
|
|
|
|
+ // } else if (item.orderType === 'PRACTICE') {
|
|
|
|
+ // const tempTime = item.classTime || []
|
|
|
|
+ // const classCourse: any = []
|
|
|
|
+ // tempTime.forEach((time: any) => {
|
|
|
|
+ // classCourse.push({
|
|
|
|
+ // classDate: time.classDate,
|
|
|
|
+ // startTime: time.startTime,
|
|
|
|
+ // endTime: time.endTime
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ // params.bizContent = {
|
|
|
|
+ // courseGroupName: item.courseGroupName,
|
|
|
|
+ // courseIntroduce: item.courseIntroduce,
|
|
|
|
+ // subjectId: item.subjectId,
|
|
|
|
+ // singleCourseMinutes: item.singleCourseMinutes,
|
|
|
|
+ // courseNum: item.courseNum,
|
|
|
|
+ // coursePrice: item.coursePrice,
|
|
|
|
+ // teacherId: item.teacherId,
|
|
|
|
+ // classTime: classCourse
|
|
|
|
+ // }
|
|
|
|
+ // } else if (item.orderType === 'VIP') {
|
|
|
|
+ // params.bizContent = item.id
|
|
|
|
+ // } else if (item.orderType === 'MUSIC') {
|
|
|
|
+ // params.bizContent = {
|
|
|
|
+ // musicSheetId: item.id,
|
|
|
|
+ // actualPrice: item.actualPrice || 0,
|
|
|
|
+ // clientType: state.platformType
|
|
|
|
+ // }
|
|
|
|
+ // } else if (item.orderType === 'PINAO_ROOM') {
|
|
|
|
+ // params.bizContent = item.id
|
|
|
|
+ // } else if (item.orderType === 'ACTI_REGIST') {
|
|
|
|
+ // params.bizContent = {
|
|
|
|
+ // activityId: item.activityId
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // return params
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
async mounted() {
|
|
async mounted() {
|
|
// 判断是否是曲目购买(只有智能陪练才会有入口),其它地方不会有入口
|
|
// 判断是否是曲目购买(只有智能陪练才会有入口),其它地方不会有入口
|
|
@@ -194,11 +194,11 @@ export default defineComponent({
|
|
orderType: orderObject.orderType,
|
|
orderType: orderObject.orderType,
|
|
actualPrice: orderObject.actualPrice || 0,
|
|
actualPrice: orderObject.actualPrice || 0,
|
|
recomUserId: orderObject.recomUserId,
|
|
recomUserId: orderObject.recomUserId,
|
|
- orderInfos: [...this.orderInfos]
|
|
|
|
|
|
+ orderInfos: [...orderInfos()]
|
|
}
|
|
}
|
|
})
|
|
})
|
|
const result = res.data || {}
|
|
const result = res.data || {}
|
|
-
|
|
|
|
|
|
+ // 支付成功
|
|
if (result.status == 'PAID') {
|
|
if (result.status == 'PAID') {
|
|
this.$router.replace({
|
|
this.$router.replace({
|
|
path: '/tradeDetail',
|
|
path: '/tradeDetail',
|
|
@@ -208,9 +208,10 @@ export default defineComponent({
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 拉起支付方式
|
|
orderStatus.orderObject.orderNo = result.orderNo
|
|
orderStatus.orderObject.orderNo = result.orderNo
|
|
orderStatus.orderObject.actualPrice = result.actualPrice
|
|
orderStatus.orderObject.actualPrice = result.actualPrice
|
|
-
|
|
|
|
this.paymentStatus = true
|
|
this.paymentStatus = true
|
|
} catch {
|
|
} catch {
|
|
this.loading = false
|
|
this.loading = false
|