Feat;旅居订单评价
This commit is contained in:
@@ -66,3 +66,9 @@ export function sojoumOrderCheckDate(params) {
|
|||||||
login: true
|
login: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sojoumOrderComment(params) {
|
||||||
|
return request.post("/travel/travelGroupOrder/comment", params, {
|
||||||
|
login: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -341,6 +341,12 @@
|
|||||||
@click="goOrderDetails(order)"
|
@click="goOrderDetails(order)"
|
||||||
>去评价</view>
|
>去评价</view>
|
||||||
</template>
|
</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">
|
<template v-if="parseInt(order._status._type) === 4">
|
||||||
<view class="bnt service" @click="goOrderDetails(order)">查看订单</view>
|
<view class="bnt service" @click="goOrderDetails(order)">查看订单</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="evaluate-con">
|
<view class="evaluate-con">
|
||||||
<view
|
<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"
|
class="goodsStyle acea-row row-between"
|
||||||
>
|
>
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
@@ -78,6 +93,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { postOrderComment, postOrderProduct } from '@/api/store'
|
import { postOrderComment, postOrderProduct } from '@/api/store'
|
||||||
|
import { fetchSojoumOrderDetail, sojoumOrderComment } from '@/api/sojoumOrder'
|
||||||
import { trim } from '@/utils'
|
import { trim } from '@/utils'
|
||||||
import { required } from '@/utils/validate'
|
import { required } from '@/utils/validate'
|
||||||
import { validatorDefaultCatch } from '@/utils/dialog'
|
import { validatorDefaultCatch } from '@/utils/dialog'
|
||||||
@@ -104,6 +120,8 @@ export default {
|
|||||||
productInfo: {}
|
productInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isTravelGroup: false,
|
||||||
|
travelOrderInfo: null,
|
||||||
scoreList: [
|
scoreList: [
|
||||||
{
|
{
|
||||||
name: '商品质量',
|
name: '商品质量',
|
||||||
@@ -125,9 +143,19 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.unique = this.$yroute.query.id
|
this.unique = this.$yroute.query.id
|
||||||
this.getOrderProduct()
|
this.isTravelGroup = this.$yroute.query.isTravelGroup === '1'
|
||||||
|
if (this.isTravelGroup) {
|
||||||
|
this.getTravelOrderDetail()
|
||||||
|
} else {
|
||||||
|
this.getOrderProduct()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getTravelOrderDetail() {
|
||||||
|
fetchSojoumOrderDetail({ key: this.unique }).then(res => {
|
||||||
|
this.travelOrderInfo = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
getOrderProduct() {
|
getOrderProduct() {
|
||||||
postOrderProduct(this.unique).then(res => {
|
postOrderProduct(this.unique).then(res => {
|
||||||
this.orderCon = res.data
|
this.orderCon = res.data
|
||||||
@@ -165,14 +193,26 @@ export default {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
return validatorDefaultCatch(e)
|
return validatorDefaultCatch(e)
|
||||||
}
|
}
|
||||||
postOrderComment({
|
const pics = this.picArr
|
||||||
productScore: product_score,
|
const video = this.videoArr[0] || ''
|
||||||
serviceScore: service_score,
|
const request = this.isTravelGroup
|
||||||
unique: this.unique,
|
? sojoumOrderComment({
|
||||||
pics: this.picArr.join(','),
|
orderId: this.unique,
|
||||||
comment: expect,
|
comment: expect,
|
||||||
video: this.videoArr.join(',')
|
pics,
|
||||||
}).then(() => {
|
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(',')
|
||||||
|
})
|
||||||
|
request.then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '评价成功',
|
title: '评价成功',
|
||||||
icon: 'success',
|
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 modify-time" @click="modifyStayTime">修改入住时间</button>
|
||||||
<button class="btn v12-primary-border v12-primary-text refund" @click="applyRefund">申请退款</button>
|
<button class="btn v12-primary-border v12-primary-text refund" @click="applyRefund">申请退款</button>
|
||||||
</view>
|
</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)">
|
<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>
|
<button class="btn v12-dark-border v12-dark-text modify-time" @click="showPhoneDialog('phone')">联系商家</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -385,6 +388,23 @@ export default {
|
|||||||
url: '/pkg_product/views/sojoumOrderRefund?id=' + this.key
|
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) {
|
showPhoneDialog(type) {
|
||||||
if (!this.orderInfo.merPhone && type === 'phone') {
|
if (!this.orderInfo.merPhone && type === 'phone') {
|
||||||
@@ -647,4 +667,4 @@ export default {
|
|||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user