提交 5a38b5ec authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 08f19309
......@@ -30,7 +30,8 @@ export default {
return this.$route.query.code
},
orderNo() {
return this.$route.query.order_no
const orderNo = this.$route.query.order_no
return Array.isArray(orderNo) ? orderNo.pop() : orderNo
}
},
methods: {
......@@ -80,7 +81,11 @@ export default {
},
// 微信JSAPI支付
handleWxJSAPIPay(productId, num) {
this.openId ? this.createWxPayOrder(productId, num) : this.getOpenId(this.createWxPayOrder(productId, num))
this.openId
? this.createWxPayOrder(productId, num)
: this.getOpenId(() => {
this.createWxPayOrder(productId, num)
})
}
}
}
......@@ -26,6 +26,7 @@ export default {
components: { Pay },
data() {
return {
loaded: false,
ruleForm: {
personal_name: '',
class_name: '',
......@@ -111,7 +112,8 @@ export default {
})
},
getDetail() {
api.getAffair(this.pid).then(response => {
this.loaded = false
return api.getAffair(this.pid).then(response => {
const form = response.form
if (form.course_name_arr) {
form.course_id = form.course_name_arr.map(item => item.course_id)
......@@ -132,6 +134,7 @@ export default {
Object.assign(this.ruleForm, ruleForm)
// 设置接口返回的数据
this.detail = response
this.loaded = true
})
},
onSubmit(data) {
......@@ -141,7 +144,10 @@ export default {
this.isEdit ? this.handleUpdate(data) : this.handleAdd(data)
},
// 去支付
handlePay() {
async handlePay() {
if (!this.loaded) {
await this.getDetail()
}
const params = Object.assign({}, this.ruleForm, {
affair_id: this.channelId,
course_id: this.ruleForm.course_id.join(',')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论