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

bug fixes

上级 98e1d248
...@@ -7,6 +7,7 @@ export default { ...@@ -7,6 +7,7 @@ export default {
components: { VForm }, components: { VForm },
data() { data() {
return { return {
loaded: false,
detail: {}, detail: {},
// 学期列表 // 学期列表
semesterList: [ semesterList: [
...@@ -86,9 +87,11 @@ export default { ...@@ -86,9 +87,11 @@ export default {
}, },
// 获取详情 // 获取详情
getDetail() { getDetail() {
api.getAffair(this.pid).then(response => { this.loaded = false
return api.getAffair(this.pid).then(response => {
this.detail = response this.detail = response
this.ruleForm = response.form this.ruleForm = response.form
this.loaded = true
}) })
}, },
// 提交 // 提交
......
...@@ -12,13 +12,7 @@ ...@@ -12,13 +12,7 @@
</div> </div>
<van-dialog v-model="payVisible" title="支付" :showConfirmButton="false" :closeOnClickOverlay="true"> <van-dialog v-model="payVisible" title="支付" :showConfirmButton="false" :closeOnClickOverlay="true">
<van-icon name="close" class="dialog-close" @click="payVisible = false" /> <van-icon name="close" class="dialog-close" @click="payVisible = false" />
<pay <pay :payment="ruleForm.payment" :productId="productId" @success="handlePaySuccess" v-if="payVisible"></pay>
:payment="ruleForm.payment"
:productId="productId"
:num="ruleForm.number"
@success="handlePaySuccess"
v-if="payVisible"
></pay>
</van-dialog> </van-dialog>
</div> </div>
</template> </template>
...@@ -138,9 +132,12 @@ export default { ...@@ -138,9 +132,12 @@ export default {
} }
}, },
// 去支付 // 去支付
handlePay() { async handlePay() {
if (!this.loaded) {
await this.getDetail()
}
if (this.isWechat && this.ruleForm.payment === '2') { if (this.isWechat && this.ruleForm.payment === '2') {
this.handleWxJSAPIPay(this.productId, this.ruleForm.number) this.handleWxJSAPIPay(this.productId)
} else { } else {
this.payVisible = true this.payVisible = true
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论