NurseStationApp/pages/orderDetails/orderDetails.vue
2023-03-20 14:49:18 +08:00

234 lines
8.1 KiB
Vue

<template>
<view class="app">
<view class="time" style="" v-if="order.orderStatus=='WAIT_PAY'">
剩余付款时间:
<u-count-down style='' :timestamp="timestamp">
</u-count-down>
</view>
<view class="OrderStatus" v-if="order.orderStatus=='REFUNDED'||order.orderStatus=='CANCEL'">
订单已关闭
</view>
<view class="content">
<view class="name">
店铺名称
<image src="../../static/huijiantou.png" mode=""></image>
</view>
<view class="details">
<view class="detailslist">
<image :src="baseurl+order.attributePitureUrl" mode=""></image>
<view class="model">
<view class="top">
<span v-if="order.orderType =='HEALTH_CONSULTATION'">健康咨询</span>
<span v-else>{{order.goodsName}}</span>
<span v-if="order.orderType=='DIRECT_BUY'">¥{{order.goodsPrice}}</span>
</view>
<view class="bottom" v-if="order.orderType !='HEALTH_CONSULTATION'">
<span class="box">型号:{{order.goodsAttributeName}}</span>
<span class="box">X{{order.goodsCount}}</span>
</view>
<view class="bottom" v-if="order.orderType !='HEALTH_CONSULTATION'&&order.discountPrice>0">
<span class="box" style='width:40%'>优惠金额:</span>
<span class="box">-¥{{order.discountPrice}}</span>
</view>
<view class="refund"
v-if="order.orderStatus != 'WAIT_PAY'&& order.orderStatus!='CANCEL'&&order.orderStatus!='WAIT_REFUND'&&order.orderStatus!='REFUNDED'&&order.orderStatus!='RETURNED_GOODS'&&order.orderStatus!='WAIT_RETURNED_GOODS'">
<text @tap='gorefundType' v-if="order.orderType=='INTEGRAL_EXCHANGE'">取消兑换</text>
<text @tap='gorefundType' v-if="order.orderType=='DIRECT_BUY'">申请退款</text>
<text @tap='gorefundType'
v-if="order.orderType=='HEALTH_CONSULTATION'&&order.orderStatus=='WAIT_RECEIVED_GOODS'">取消咨询</text>
</view>
<view class="refund" style="border: 1rpx solid #969394;" v-if="order.orderStatus=='WAIT_REFUND'"
@tap='goAftersalesdetails(order)'>
退款中
</view>
<view class="refund" style="border: 1rpx solid #969394;" v-if="order.orderStatus=='REFUNDED'">
退款成功
</view>
<view class="refund" style="border: 1rpx solid #969394;"
v-if="order.orderStatus=='WAIT_RETURNED_GOODS'">
待退货
</view>
<view class="refund" style="border: 1rpx solid #969394;" v-if="order.orderStatus=='CANCEL'">
已取消
</view>
</view>
</view>
<view class="payinfo">
<text class="pay">实付款</text>
<text class="price"
v-if="order.orderType=='DIRECT_BUY'||order.orderType =='HEALTH_CONSULTATION'">¥{{order.totalPrice}}</text>
<text class="price"
v-if="order.orderType=='INTEGRAL_EXCHANGE'">{{order.integralExchangeSill}}积分</text>
</view>
</view>
</view>
<view class="info">
<span>收货人:<text>{{order.receiver}}</text></span>
<span>联系电话:<text>{{order.phone}}</text></span>
<span v-if="order.orderType =='HEALTH_CONSULTATION'">咨询医生:<text>{{order.hospitalPersonName}}</text></span>
<span v-if="order.orderType =='HEALTH_CONSULTATION'">咨询时间:<text>{{order.healthAppointDate}}</text></span>
<span v-if="order.orderType !='HEALTH_CONSULTATION'">收货地址:<text>{{order.receiveAddress}}</text></span>
<span>订单编号:<text>{{order.goOrderNo}}</text></span>
<span>下单时间:<text>{{order.orderTime}}</text></span>
<span
v-if="order.orderStatus=='REFUNDED'&&order.orderType=='DIRECT_BUY'">退款时间:<text>{{order.updateTime}}</text></span>
<span
v-if="order.orderStatus=='REFUNDED'&&order.orderType=='INTEGRAL_EXCHANGE'">退款时间:<text>{{order.appleTime}}</text></span>
</view>
<view class="buy" v-if="order.orderStatus == 'WAIT_PAY'">
<view class="pay">
去支付
</view>
</view>
<view class="buy" v-if="order.orderStatus == 'EVALUATED'" @tap='golookrate'>
<view class="pay" style="background-color: #4C7BC9;">
查看评价
</view>
</view>
<view class="buy" v-if="order.orderStatus == 'RECEIVED_GOODS'" @tap='rate'>
<view class="pay" style="background-color: #60c5f1;">
去评价
</view>
</view>
<view class="buy" v-if="order.orderStatus == 'WAIT_RECEIVED_GOODS'&&order.orderType !='HEALTH_CONSULTATION'">
<view class="logistics" style="" @tap='gologistics'>查看物流
</view>
<view class="pay" style="background-color: #4C7BC9;" @tap='Receipt'>
确认收货
</view>
</view>
<view class="buy" v-if="order.orderStatus == 'WAIT_RECEIVED_GOODS'&&order.orderType =='HEALTH_CONSULTATION'">
<view class="pay" style="background-color: #4C7BC9;" @tap='Receipt'>
咨询完成
</view>
</view>
<view class="frame">
<u-popup v-model="show" mode="bottom" length="45%" border-radius="30" :closeable='true'>
<view class="payment">
<span v-if="order.orderType =='HEALTH_CONSULTATION'">确认咨询完成了吗</span>
<span v-else>确认收到货了吗</span>
</view>
<view class="chat">
<view class="image" style="height:182rpx">
<image :src="baseurl+order.attributePitureUrl" mode=""
v-if="order.orderType !='HEALTH_CONSULTATION'"></image>
<view class="blackground" v-if="order.orderType !='HEALTH_CONSULTATION'">共1件</view>
</view>
<view class="word" v-if="order.orderType =='HEALTH_CONSULTATION'">为了保证您的售后权益,请确认健康咨询无误后再确认完成
</view>
<view class="word" v-else>为了保证您的售后权益,请收到商品确认无误后再确认收货</view>
</view>
<view class="submits" @tap='Receipts'>确定</view>
</u-popup>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
goodsOrder
} from '@/api/CommodityOrder/index.js'
import baseurl from '@/api/baseurl.js'
import {
appletGoodsOrderPay
} from '@/api/confirmOrder/index.js'
import {
confirmReceipt
} from '@/api/CommodityOrder/index.js'
export default {
data() {
return {
show: false,
baseurl: '',
order: {},
patientId: '',
orderStatus: '',
pageSize: 10,
pageNum: 1,
timestamp: 0, //倒计时
goodsOrderId: null,
}
},
methods: { //收货
Receipts() {
confirmReceipt(this.order.goOrderNo).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '完成订单成功',
type: 'success',
duration: '1000'
})
this.show = false
uni.setStorageSync("Refresh", 'Refresh')
this.goodsOrderinfo()
setTimeout(e => {
uni.navigateTo({
url: `/pages/goodsorderRate/goodsorderRate?item=${JSON.stringify(this.order)}&delta=${4}`
})
}, 1000)
} else {
this.$refs.uToast.show({
title: '完成订单失败',
type: 'error',
duration: '1000'
})
this.show = false
}
})
},
//收货
Receipt() {
this.show = true
},
//查看评价
golookrate() {
uni.navigateTo({
url: `/pages/lookrate/lookrate?item=${JSON.stringify(this.order)}`
})
},
//评价
rate() {
uni.navigateTo({
url: `/pages/goodsorderRate/goodsorderRate?item=${JSON.stringify(this.order)}&delta=${4}`
})
},
//退款页面
gorefundType() {
uni.navigateTo({
url: `/pages/refundType/refundType?order=${JSON.stringify(this.order)}`
})
},
goodsOrderinfo(goodsOrderId) {
goodsOrder(this.patientId, this.orderStatus, goodsOrderId, this.pageSize, this.pageNum).then(res => {
this.order = res.rows[0]
var time = new Date(this.order.orderTime).getTime() / 1000 + (60 * 60 * 24)
var times = new Date().getTime() / 1000
this.timestamp = time - times
})
},
//跳转售后详情
goAftersalesdetails(item) {
uni.navigateTo({
url: `/pages/Aftersalesdetails/Aftersalesdetails?goodsOrderId=${item.goodsOrderId}`
})
},
},
onShow() {
this.goodsOrderinfo(this.goodsOrderId)
},
onLoad(options) {
this.baseurl = baseurl
this.goodsOrderId = options.goodsOrderId
let that = this
const value = uni.getStorageSync('patientId');
if (value) {
that.patientId = value
}
}
}
</script>
<style lang="scss">
@import "./orderDetails.scss";
</style>