Feat;旅居订单评价
This commit is contained in:
@@ -66,3 +66,9 @@ export function sojoumOrderCheckDate(params) {
|
||||
login: true
|
||||
})
|
||||
}
|
||||
|
||||
export function sojoumOrderComment(params) {
|
||||
return request.post("/travel/travelGroupOrder/comment", params, {
|
||||
login: true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -341,6 +341,12 @@
|
||||
@click="goOrderDetails(order)"
|
||||
>去评价</view>
|
||||
</template>
|
||||
<template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 1">
|
||||
<view
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="goOrderDetails(order)"
|
||||
>去评价</view>
|
||||
</template>
|
||||
<template v-if="parseInt(order._status._type) === 4">
|
||||
<view class="bnt service" @click="goOrderDetails(order)">查看订单</view>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
<template>
|
||||
<view class="evaluate-con">
|
||||
<view
|
||||
v-if="orderCon.productInfo"
|
||||
v-if="isTravelGroup && travelOrderInfo && travelOrderInfo.travelGroupOrderInfo && travelOrderInfo.travelGroupOrderInfo.travelGroupProduct"
|
||||
class="goodsStyle acea-row row-between"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="travelOrderInfo.travelGroupOrderInfo.travelGroupProduct.mainImage" class="image"/>
|
||||
</view>
|
||||
<view class="text acea-row row-between">
|
||||
<view class="name line2">{{ travelOrderInfo.travelGroupOrderInfo.travelGroupProduct.name }}</view>
|
||||
<view class="money">
|
||||
<view>¥{{ travelOrderInfo.travelGroupOrderInfo.travelGroupProduct.price }}</view>
|
||||
<view class="num">x1</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-else-if="orderCon.productInfo"
|
||||
class="goodsStyle acea-row row-between"
|
||||
>
|
||||
<view class="pictrue">
|
||||
@@ -78,6 +93,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { postOrderComment, postOrderProduct } from '@/api/store'
|
||||
import { fetchSojoumOrderDetail, sojoumOrderComment } from '@/api/sojoumOrder'
|
||||
import { trim } from '@/utils'
|
||||
import { required } from '@/utils/validate'
|
||||
import { validatorDefaultCatch } from '@/utils/dialog'
|
||||
@@ -104,6 +120,8 @@ export default {
|
||||
productInfo: {}
|
||||
}
|
||||
},
|
||||
isTravelGroup: false,
|
||||
travelOrderInfo: null,
|
||||
scoreList: [
|
||||
{
|
||||
name: '商品质量',
|
||||
@@ -125,9 +143,19 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.unique = this.$yroute.query.id
|
||||
this.isTravelGroup = this.$yroute.query.isTravelGroup === '1'
|
||||
if (this.isTravelGroup) {
|
||||
this.getTravelOrderDetail()
|
||||
} else {
|
||||
this.getOrderProduct()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTravelOrderDetail() {
|
||||
fetchSojoumOrderDetail({ key: this.unique }).then(res => {
|
||||
this.travelOrderInfo = res.data
|
||||
})
|
||||
},
|
||||
getOrderProduct() {
|
||||
postOrderProduct(this.unique).then(res => {
|
||||
this.orderCon = res.data
|
||||
@@ -165,14 +193,26 @@ export default {
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e)
|
||||
}
|
||||
postOrderComment({
|
||||
const pics = this.picArr
|
||||
const video = this.videoArr[0] || ''
|
||||
const request = this.isTravelGroup
|
||||
? sojoumOrderComment({
|
||||
orderId: this.unique,
|
||||
comment: expect,
|
||||
pics,
|
||||
video,
|
||||
productScore: product_score,
|
||||
serviceScore: service_score
|
||||
})
|
||||
: postOrderComment({
|
||||
productScore: product_score,
|
||||
serviceScore: service_score,
|
||||
unique: this.unique,
|
||||
pics: this.picArr.join(','),
|
||||
comment: expect,
|
||||
video: this.videoArr.join(',')
|
||||
}).then(() => {
|
||||
})
|
||||
request.then(() => {
|
||||
uni.showToast({
|
||||
title: '评价成功',
|
||||
icon: 'success',
|
||||
|
||||
@@ -176,6 +176,9 @@
|
||||
<button class="btn v12-primary-border v12-primary-text modify-time" @click="modifyStayTime">修改入住时间</button>
|
||||
<button class="btn v12-primary-border v12-primary-text refund" @click="applyRefund">申请退款</button>
|
||||
</view>
|
||||
<view class="v12-align-center" v-if="orderInfo._status && ['3','4'].includes(orderInfo._status._type)">
|
||||
<button class="btn v12-primary-border v12-primary-text" @click="goEvaluate">立即评价</button>
|
||||
</view>
|
||||
<view class="v12-align-center" v-if="!orderInfo._status && ['1','2'].includes(orderInfo._status._type)">
|
||||
<button class="btn v12-dark-border v12-dark-text modify-time" @click="showPhoneDialog('phone')">联系商家</button>
|
||||
</view>
|
||||
@@ -385,6 +388,23 @@ export default {
|
||||
url: '/pkg_product/views/sojoumOrderRefund?id=' + this.key
|
||||
})
|
||||
},
|
||||
goEvaluate() {
|
||||
const orderId = this.orderInfo.orderId
|
||||
if (!orderId) {
|
||||
uni.showToast({
|
||||
title: '订单信息错误',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsEvaluate/index',
|
||||
query: {
|
||||
id: orderId,
|
||||
isTravelGroup: 1
|
||||
}
|
||||
})
|
||||
},
|
||||
// 显示电话弹窗
|
||||
showPhoneDialog(type) {
|
||||
if (!this.orderInfo.merPhone && type === 'phone') {
|
||||
|
||||
Reference in New Issue
Block a user