2022-11-25 10:58:46 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="app" v-if="order">
|
|
|
|
|
|
<view class="time" style="" v-if="order.orderStatus=='WAIT_PAY'">
|
|
|
|
|
|
剩余付款时间:
|
|
|
|
|
|
<u-count-down style='' :timestamp="timestamp">
|
|
|
|
|
|
</u-count-down>
|
|
|
|
|
|
</view>
|
2023-01-12 16:16:36 +08:00
|
|
|
|
<view class="OrderStatus" v-if="order.orderStatus=='REFUNDED'||order.orderStatus=='CANCEL'">
|
2022-12-06 10:08:19 +08:00
|
|
|
|
订单已关闭
|
|
|
|
|
|
</view>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
<!-- <custom-nav nav='To' Url="/pages/CommodityOrder/CommodityOrder" title='商品订单'></custom-nav> -->
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
|
<view class="name">
|
|
|
|
|
|
店铺名称
|
2023-02-24 14:35:29 +08:00
|
|
|
|
<image src="../../static/huijiantou.png" mode=""></image>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<view class="details">
|
|
|
|
|
|
<view class="detailslist">
|
|
|
|
|
|
<image :src="baseurl+order.attributePitureUrl" mode=""></image>
|
|
|
|
|
|
<view class="model">
|
|
|
|
|
|
<view class="top">
|
2023-03-10 16:27:59 +08:00
|
|
|
|
<span v-if="order.orderType =='HEALTH_CONSULTATION'">健康咨询</span>
|
|
|
|
|
|
<span v-else>{{order.goodsName}}</span>
|
|
|
|
|
|
<span
|
|
|
|
|
|
v-if="order.goodsPrice&&order.orderType !='HEALTH_CONSULTATION'">¥{{order.goodsPrice}}</span>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
</view>
|
2023-03-10 16:27:59 +08:00
|
|
|
|
<view class="bottom" v-if="order.orderType !='HEALTH_CONSULTATION'">
|
2022-11-25 10:58:46 +08:00
|
|
|
|
<span class="box">型号:{{order.goodsAttributeName}}</span>
|
|
|
|
|
|
<span class="box">X{{order.goodsCount}}</span>
|
|
|
|
|
|
</view>
|
2023-03-03 13:31:01 +08:00
|
|
|
|
<view class="bottom" v-if="order.discountPrice>0">
|
|
|
|
|
|
<span class="box" style='width:40%'>优惠金额:</span>
|
|
|
|
|
|
<span class="box">-¥{{order.discountPrice}}</span>
|
|
|
|
|
|
</view>
|
2023-03-10 16:27:59 +08:00
|
|
|
|
<view class="refund"
|
2022-11-25 10:58:46 +08:00
|
|
|
|
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'">
|
2023-03-10 16:27:59 +08:00
|
|
|
|
<text @tap='gorefundType'
|
|
|
|
|
|
v-if="order.orderType=='DIRECT_BUY'||order.orderType=='HEALTH_CONSULTATION'">申请退款</text>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
</view>
|
2023-04-27 14:19:41 +08:00
|
|
|
|
<view class="refund" style="border: 1rpx solid #969394;" v-if="order.orderStatus=='WAIT_REFUND'"
|
|
|
|
|
|
@tap='goAftersalesdetails(order)'>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
退款中
|
|
|
|
|
|
</view>
|
2023-04-27 14:19:41 +08:00
|
|
|
|
<view class="refund" style="border: 1rpx solid #969394;" v-if="order.orderStatus=='REFUNDED'">
|
2022-11-25 10:58:46 +08:00
|
|
|
|
退款成功
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- <view class="refund" v-if="order.orderStatus=='RETURNED_GOODS'">
|
2023-04-27 14:19:41 +08:00
|
|
|
|
退货中
|
2022-11-25 10:58:46 +08:00
|
|
|
|
</view> -->
|
2023-04-27 14:19:41 +08:00
|
|
|
|
<view class="refund" style="border: 1rpx solid #969394;"
|
|
|
|
|
|
v-if="order.orderStatus=='WAIT_RETURNED_GOODS'">
|
2022-11-25 10:58:46 +08:00
|
|
|
|
待退货
|
|
|
|
|
|
</view>
|
2023-04-27 14:19:41 +08:00
|
|
|
|
<view class="refund" style="border: 1rpx solid #969394;" v-if="order.orderStatus=='CANCEL'">
|
2022-11-25 10:58:46 +08:00
|
|
|
|
已取消
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="payinfo">
|
|
|
|
|
|
<text class="pay">实付款</text>
|
|
|
|
|
|
<text class="price">¥{{order.totalPrice}}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2023-04-27 14:19:41 +08:00
|
|
|
|
<view class="info">
|
2022-11-25 10:58:46 +08:00
|
|
|
|
<span>收货人:<text>{{order.receiver}}</text></span>
|
|
|
|
|
|
<span>联系电话:<text>{{order.phone}}</text></span>
|
2023-03-10 16:27:59 +08:00
|
|
|
|
<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>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
<span>订单编号:<text>{{order.goOrderNo}}</text></span>
|
|
|
|
|
|
<!-- <span>获得积分:<text>30点积分</text></span> -->
|
|
|
|
|
|
<span>下单时间:<text>{{order.orderTime}}</text></span>
|
|
|
|
|
|
<span v-if="order.orderStatus=='REFUNDED'">退款时间:<text>{{order.updateTime}}</text></span>
|
|
|
|
|
|
<!-- <span>成交时间:<text>2022-10-28 11:31:26</text></span> -->
|
|
|
|
|
|
</view>
|
2023-01-12 16:16:36 +08:00
|
|
|
|
<view class="buy" v-if="order.orderStatus == 'WAIT_PAY'" @tap='pay'>
|
2022-11-25 10:58:46 +08:00
|
|
|
|
<view class="pay">
|
|
|
|
|
|
去支付
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<u-toast ref="uToast" />
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
appletGoodsOrderPay
|
|
|
|
|
|
} from '@/api/confirmOrder/index.js'
|
2023-04-27 14:19:41 +08:00
|
|
|
|
import {
|
|
|
|
|
|
handCloseOrder
|
|
|
|
|
|
} from '@/api/ServiceDetails/ServiceDetails.js'
|
2022-11-25 10:58:46 +08:00
|
|
|
|
import {
|
|
|
|
|
|
goodsOrder
|
|
|
|
|
|
} from '@/api/CommodityOrder/index.js'
|
|
|
|
|
|
import baseurl from '@/api/baseurl.js'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
baseurl: '',
|
|
|
|
|
|
order: null,
|
|
|
|
|
|
patientId: '',
|
|
|
|
|
|
openid: null,
|
|
|
|
|
|
orderStatus: '',
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
timestamp: 0,
|
2023-01-12 16:16:36 +08:00
|
|
|
|
goodsOrderId: null,
|
2023-04-27 14:19:41 +08:00
|
|
|
|
timecount: undefined,
|
|
|
|
|
|
Timers: null,
|
2022-11-25 10:58:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-04-27 14:19:41 +08:00
|
|
|
|
onUnload() {
|
|
|
|
|
|
clearInterval(this.Timers); //清除该函数
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: { //监听
|
|
|
|
|
|
timecount() {
|
|
|
|
|
|
if (this.timecount <= 0) {
|
|
|
|
|
|
clearInterval(this.Timers); //清除该函数
|
|
|
|
|
|
handCloseOrder().then(res => {
|
|
|
|
|
|
this.order.orderStatus = 'CANCEL'
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2022-11-25 10:58:46 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
//支付
|
|
|
|
|
|
pay() {
|
|
|
|
|
|
var that = this
|
|
|
|
|
|
let paydata = this.order
|
|
|
|
|
|
paydata.openid = this.openid
|
|
|
|
|
|
paydata.payType = "WECHAT_PAY"
|
|
|
|
|
|
paydata.paymentPrice = this.order.totalPrice
|
|
|
|
|
|
paydata.orderChannel = 'WECHAT_APPLET'
|
|
|
|
|
|
paydata.orderNo = this.order.goOrderNo
|
|
|
|
|
|
appletGoodsOrderPay(paydata).then(response => {
|
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
|
uni.requestPayment({
|
|
|
|
|
|
timeStamp: response.data.timeStamp,
|
|
|
|
|
|
nonceStr: response.data.nonceStr,
|
|
|
|
|
|
package: response.data.prepayId,
|
|
|
|
|
|
signType: response.data.signType,
|
|
|
|
|
|
paySign: response.data.paySign,
|
|
|
|
|
|
success: function(res) {
|
|
|
|
|
|
that.$refs.uToast.show({
|
|
|
|
|
|
title: '支付成功',
|
|
|
|
|
|
type: 'success',
|
2023-01-12 16:16:36 +08:00
|
|
|
|
duration: 1500,
|
2022-11-25 10:58:46 +08:00
|
|
|
|
url: `/pages/paysuccess/paysuccess?delta=${3}`
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
fail: function(err) {
|
|
|
|
|
|
that.$refs.uToast.show({
|
|
|
|
|
|
title: '取消支付',
|
|
|
|
|
|
type: 'error',
|
2023-01-12 16:16:36 +08:00
|
|
|
|
duration: 1500,
|
2022-11-25 10:58:46 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
that.$refs.uToast.show({
|
|
|
|
|
|
title: response.msg,
|
|
|
|
|
|
type: 'error',
|
2023-01-12 16:16:36 +08:00
|
|
|
|
duration: 2000
|
2022-11-25 10:58:46 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
//退款页面
|
|
|
|
|
|
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]
|
2023-01-12 16:16:36 +08:00
|
|
|
|
var ordertimes = this.order.orderTime.replaceAll(/\-/gi, "/")
|
2023-04-27 14:19:41 +08:00
|
|
|
|
var time = new Date(ordertimes).getTime() / 1000 + (60 * 60 * 2)
|
2022-11-25 10:58:46 +08:00
|
|
|
|
var times = new Date().getTime() / 1000
|
|
|
|
|
|
this.timestamp = time - times
|
2023-04-27 14:19:41 +08:00
|
|
|
|
this.timecount = this.timeStamp
|
|
|
|
|
|
this.timecount = 10
|
2022-11-25 10:58:46 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
//跳转售后详情
|
|
|
|
|
|
goAftersalesdetails(item) {
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: `/pages/Aftersalesdetails/Aftersalesdetails?goodsOrderId=${item.goodsOrderId}`
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
|
this.baseurl = baseurl
|
2022-12-28 08:50:08 +08:00
|
|
|
|
this.goodsOrderId = options.goodsOrderId
|
2022-11-25 10:58:46 +08:00
|
|
|
|
let that = this
|
2023-03-09 16:07:29 +08:00
|
|
|
|
const value = uni.getStorageSync('patientId');
|
|
|
|
|
|
if (value) {
|
|
|
|
|
|
that.patientId = value
|
|
|
|
|
|
}
|
|
|
|
|
|
const value2 = uni.getStorageSync('openid');
|
|
|
|
|
|
if (value2) {
|
|
|
|
|
|
that.openid = value2
|
|
|
|
|
|
} else {}
|
2022-11-25 10:58:46 +08:00
|
|
|
|
},
|
2022-12-28 08:50:08 +08:00
|
|
|
|
onShow() {
|
|
|
|
|
|
this.goodsOrderinfo(this.goodsOrderId)
|
2023-04-27 14:19:41 +08:00
|
|
|
|
this.Timers = setInterval(() => {
|
|
|
|
|
|
this.timecount--;
|
|
|
|
|
|
}, 1000)
|
2022-12-28 08:50:08 +08:00
|
|
|
|
},
|
2022-11-25 10:58:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
@import '../orderDetails/orderDetails.scss'
|
|
|
|
|
|
</style>
|