|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="payment-success">
|
|
|
- <van-nav-bar title="支付完成" @click-right="closePage">
|
|
|
+ <van-nav-bar title="支付完成" @click-right="autoSubmit(closePage)">
|
|
|
<template #right>
|
|
|
<van-icon name="close" size="18" /><span class="nav-bar-text">关闭</span>
|
|
|
</template>
|
|
@@ -99,10 +99,11 @@
|
|
|
type="warning"
|
|
|
round
|
|
|
style="width:120px;margin-left: 12px"
|
|
|
- @click="toHome"
|
|
|
+ @click="autoSubmit(toHome)"
|
|
|
>
|
|
|
回到首页
|
|
|
</van-button>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -147,7 +148,7 @@
|
|
|
plain
|
|
|
:disabled="disableSubmitComment"
|
|
|
style="width: 120px"
|
|
|
- @click="submitComment"
|
|
|
+ @click="submitComment(null)"
|
|
|
>
|
|
|
提交
|
|
|
</van-button>
|
|
@@ -183,6 +184,14 @@ function closePage() {
|
|
|
WeixinJSBridge.call('closeWindow')
|
|
|
}
|
|
|
|
|
|
+function autoSubmit(callback) {
|
|
|
+ if (createOrderRequest.orderType === 2 && !disableSubmitComment.value) {
|
|
|
+ submitComment(callback)
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const comment = reactive({
|
|
|
commentLevel: 5,
|
|
|
commentContent: '',
|
|
@@ -213,7 +222,7 @@ function checkMyOrder() {
|
|
|
}
|
|
|
|
|
|
const disableSubmitComment = ref(false)
|
|
|
-function submitComment() {
|
|
|
+function submitComment(callback) {
|
|
|
comment.doctorCode = createOrderRequest.doctorCode
|
|
|
comment.doctorName = createOrderRequest.doctorName
|
|
|
comment.hisOrdNum = createOrderRequest.hisOrdNum
|
|
@@ -221,10 +230,14 @@ function submitComment() {
|
|
|
comment.patientName = createOrderRequest.patientName
|
|
|
commitNewComment(comment).then(res => {
|
|
|
disableSubmitComment.value = true
|
|
|
- showDialog({
|
|
|
- type: 'success',
|
|
|
- message: '提交成功,感谢您的评价!',
|
|
|
- })
|
|
|
+ if (null === callback) {
|
|
|
+ showDialog({
|
|
|
+ type: 'success',
|
|
|
+ message: '提交成功,感谢您的评价!',
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
</script>
|