|
@@ -107,54 +107,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="createOrderRequest.orderType === 2" class="comment-wrapper">
|
|
|
- <div class="comment-bar-title">
|
|
|
- <div class="comment-bar-title_icon">
|
|
|
- <van-icon name="comment" />
|
|
|
- </div>
|
|
|
- <div class="comment-bar-title_text">
|
|
|
- 服务评价
|
|
|
- </div>
|
|
|
- <div class="comment-bar-title_subtext">
|
|
|
- 请为本次医生服务进行评价
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="comment-content-box">
|
|
|
- <div>
|
|
|
- <span style="color: #333333; font-size: 14px">评分:</span>
|
|
|
- <van-rate
|
|
|
- v-model="comment.commentLevel"
|
|
|
- :size="20"
|
|
|
- color="#ffd21e"
|
|
|
- void-icon="star"
|
|
|
- void-color="#eee"
|
|
|
- />
|
|
|
- <span style="margin-left: 12px; font-size: 12px; color: rgb(255,0,0)">({{rateLevelExplain}})</span>
|
|
|
- </div>
|
|
|
- <van-field
|
|
|
- v-model="comment.commentContent"
|
|
|
- rows="3"
|
|
|
- autosize
|
|
|
- type="textarea"
|
|
|
- placeholder="您对医生的服务还有哪些建议或意见"
|
|
|
- style="border: 1px solid lightgray; border-radius: 5px; margin-top: 12px"
|
|
|
- />
|
|
|
- <div class="comment-submit-box">
|
|
|
- <van-button
|
|
|
- size="small"
|
|
|
- type="danger"
|
|
|
- round
|
|
|
- plain
|
|
|
- :disabled="disableSubmitComment"
|
|
|
- style="width: 120px"
|
|
|
- @click="submitComment(null)"
|
|
|
- >
|
|
|
- 提交
|
|
|
- </van-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <DoctorGrade
|
|
|
+ ref="doctorGrade"
|
|
|
+ v-show="createOrderRequest.orderType === 2"
|
|
|
+ :order="createOrderRequest"
|
|
|
+ />
|
|
|
|
|
|
<van-popup v-model:show="showOrderDetail" position="top" :style="{ height: '100%' }">
|
|
|
<wx-order-detail @close="showOrderDetail = false" />
|
|
@@ -165,12 +122,12 @@
|
|
|
<script setup>
|
|
|
import {useRouter} from "vue-router";
|
|
|
import store from "@/store";
|
|
|
-import {computed, reactive, ref} from "vue";
|
|
|
-import {commitNewComment} from "@/api/comment";
|
|
|
-import {showDialog} from "vant";
|
|
|
+import {ref} from "vue";
|
|
|
import WxOrderDetail from '@/components/wx-order-detail/index.vue'
|
|
|
+import DoctorGrade from '@/components/doctor-grade/index.vue'
|
|
|
|
|
|
const router = useRouter()
|
|
|
+const doctorGrade = ref(null)
|
|
|
const createOrderRequest = store.getters.getCreateOrderRequest
|
|
|
if (createOrderRequest.orderType !== 6 && !createOrderRequest.patientId) {
|
|
|
router.push('/404')
|
|
@@ -185,61 +142,17 @@ function closePage() {
|
|
|
}
|
|
|
|
|
|
function autoSubmit(callback) {
|
|
|
- if (createOrderRequest.orderType === 2 && !disableSubmitComment.value) {
|
|
|
- submitComment(callback)
|
|
|
+ if (createOrderRequest.orderType === 2) {
|
|
|
+ doctorGrade.value.submitComment(callback)
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const comment = reactive({
|
|
|
- commentLevel: 5,
|
|
|
- commentContent: '',
|
|
|
- doctorName: '',
|
|
|
- hisOrdNum: '',
|
|
|
- patientName: '',
|
|
|
- patientId: ''
|
|
|
-})
|
|
|
-
|
|
|
-const rateLevelExplain = computed(() => {
|
|
|
- switch (comment.commentLevel) {
|
|
|
- case 5:
|
|
|
- return '非常满意'
|
|
|
- case 4:
|
|
|
- return '满意'
|
|
|
- case 3:
|
|
|
- return '一般'
|
|
|
- case 2:
|
|
|
- return '不满意'
|
|
|
- case 1:
|
|
|
- return '非常不满意'
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
const showOrderDetail = ref(false)
|
|
|
function checkMyOrder() {
|
|
|
showOrderDetail.value = true
|
|
|
}
|
|
|
-
|
|
|
-const disableSubmitComment = ref(false)
|
|
|
-function submitComment(callback) {
|
|
|
- comment.doctorCode = createOrderRequest.doctorCode
|
|
|
- comment.doctorName = createOrderRequest.doctorName
|
|
|
- comment.hisOrdNum = createOrderRequest.hisOrdNum
|
|
|
- comment.patientId = createOrderRequest.patientId
|
|
|
- comment.patientName = createOrderRequest.patientName
|
|
|
- commitNewComment(comment).then(res => {
|
|
|
- disableSubmitComment.value = true
|
|
|
- if (null === callback) {
|
|
|
- showDialog({
|
|
|
- type: 'success',
|
|
|
- message: '提交成功,感谢您的评价!',
|
|
|
- })
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -305,43 +218,5 @@ function submitComment(callback) {
|
|
|
.money-color {
|
|
|
color: orangered;
|
|
|
}
|
|
|
- .comment-wrapper {
|
|
|
- background-image: linear-gradient(#fca46d, #fcd5b3);
|
|
|
- margin: 24px 12px;
|
|
|
- border-radius: 10px;
|
|
|
- padding-bottom: 12px;
|
|
|
- }
|
|
|
- .comment-bar-title {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding: 4px 0 2px 16px;
|
|
|
- }
|
|
|
- .comment-bar-title_icon {
|
|
|
- color: #dc2424;
|
|
|
- font-size: 18px;
|
|
|
- margin-top: 3px;
|
|
|
- }
|
|
|
- .comment-bar-title_text {
|
|
|
- color: #dc2424;
|
|
|
- margin-left: 6px;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 30px;
|
|
|
- }
|
|
|
- .comment-bar-title_subtext {
|
|
|
- margin-left: 8px;
|
|
|
- font-size: 12px;
|
|
|
- color: white;
|
|
|
- line-height: 30px;
|
|
|
- }
|
|
|
- .comment-content-box {
|
|
|
- background-color: white;
|
|
|
- margin: 0 12px;
|
|
|
- padding: 12px;
|
|
|
- }
|
|
|
- .comment-submit-box {
|
|
|
- width: 100%;
|
|
|
- margin-top: 12px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|