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

bug fixes

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