xinelu-applet-ui/pagesB/consulted/consulted.vue

276 lines
8.2 KiB
Vue
Raw Normal View History

2023-09-27 16:20:09 +08:00
<template>
<view class="app">
2023-11-01 10:00:47 +08:00
<u-navbar :is-back="false" :background="background" class="u-navbar">
<image src="@/static/pagesB/fanhui.png" mode="" @tap="goprevious"></image>
<view class="title" v-if="list.orderStatus=='WAIT_PAY'">待付款</view>
<view class="title" v-if="list.orderStatus=='WAIT_REFUND'">退款中</view>
<view class="title" v-if="list.orderStatus=='CANCEL'">已取消</view>
2023-11-01 17:33:57 +08:00
<view class="title" v-if="list.orderStatus=='WAIT_RECEIVED_GOODS'">待接单</view>
<!-- <view class="title" v-if="list.orderStatus=='WAIT_RECEIVED_GOODS'&&list.orderType !='HEALTH_CONSULTATION'">
待收货</view> -->
<!-- <view class="title" v-if="list.orderStatus=='WAIT_RECEIVED_GOODS'&&list.orderType =='HEALTH_CONSULTATION'">
待咨询</view> -->
<view class="title" v-if="list.orderStatus=='COMPLETED'">待评价</view>
<view class="title" v-if="list.orderStatus=='RECEIVED_GOODS'">待服务</view>
<view class="title" v-if="list.orderStatus=='EVALUATED'">已评价</view>
2023-11-01 10:00:47 +08:00
<view class="title" v-if="list.orderStatus=='PAY'">待发货</view>
<view class="title" v-if="list.orderStatus=='REFUNDED'">已退款</view>
<view class="title" v-if="list.orderStatus=='WAIT_RETURNED_GOODS'">待退货</view>
<view class="title" v-if="list.orderStatus=='RETURNED_GOODS'">退款成功</view>
</u-navbar>
2023-11-01 17:33:57 +08:00
<view class="time" style="" v-if="list.orderStatus=='WAIT_PAY'">
<!-- v-if="list.orderStatus!='WAIT_PAY' -->
剩余付款时间
<u-count-down style='' :timestamp="timestamp">
</u-count-down>
</view>
<view class="OrderStatus" v-if="list.orderStatus=='REFUNDED'||list.orderStatus=='CANCEL'">
订单已关闭
</view>
2023-09-27 16:20:09 +08:00
<view class="content">
<view class="service">
<image src="/static/pagesB/persone.png" mode=""></image>
<span>医生服务</span>
</view>
<view class="orderitem">
<view class="details">
<image src="../../static/headsculpture.png" mode=""></image>
<view class="ppointment">
<view class="doctorname">
2023-11-01 10:00:47 +08:00
<span>{{list.hospitalPersonName}}</span>
2023-09-27 16:20:09 +08:00
</view>
<view class="reservation">
<span>齐鲁医院</span>
2023-11-01 10:00:47 +08:00
<span v-if="list.academicTitle=='DEPUTY_CHIEF_PHYSICIAN'">副主任医师</span>
<span v-if="list.academicTitle=='CHIEF_PHYSICIAN'">主任医师</span>
<span v-if="list.academicTitle=='ATTENDING_DOCTOR'">主治医师</span>
<span v-if="list.academicTitle=='PHYSICIAN'">医师</span>
<span v-if="list.academicTitle=='HEALER'">医士</span>
<span v-if="list.academicTitle=='RESIDENT_PHYSICIAN'">住院医师</span>
2023-09-27 16:20:09 +08:00
</view>
2023-11-01 17:33:57 +08:00
2023-09-27 16:20:09 +08:00
</view>
</view>
</view>
<view class="doctordetails">
<view class="doctorphone">
医生电话
</view>
2023-11-01 10:00:47 +08:00
<view class="phone" v-if="list.personPhone">
·{{list.personPhone}}
2023-09-27 16:20:09 +08:00
</view>
</view>
<view class="doctordetails">
<view class="doctorphone">
预约时间
</view>
2023-11-01 10:00:47 +08:00
<view class="phone" v-if="list.healthAppointDate">
{{list.healthAppointDate}}
2023-09-27 16:20:09 +08:00
</view>
</view>
<view class="doctordetailstwo">
<view class="doctorphonetwo">
咨询内容
</view>
2023-11-01 10:00:47 +08:00
<view class="phonetwo advicetwo" v-if="list.healthConsultationContent">
·{{list.healthConsultationContent}}
2023-09-27 16:20:09 +08:00
</view>
</view>
<view class="amount">
2023-11-01 10:00:47 +08:00
<span>预约金额</span><span>{{list.totalPrice}}</span>
2023-09-27 16:20:09 +08:00
</view>
<view class="doctordetailstwo">
<view class="doctorphonetwo">
备注
</view>
2023-11-01 10:00:47 +08:00
<view class="phonetwo advicetwo" v-if="list.remark">
·{{list.remark}}
2023-09-27 16:20:09 +08:00
</view>
</view>
</view>
<view class="bottom">
<span>更多</span>
2023-11-01 17:33:57 +08:00
<span @tap="cancle"
2023-11-02 11:40:28 +08:00
v-if="list.orderStatus!='WAIT_PAY'&&list.orderStatus!='EVALUATED'&&list.orderStatus!='WAIT_REFUND'&&list.orderStatus!='COMPLETED'&&list.orderStatus!='RECEIVED_GOODS'&&list.orderStatus!='REFUNDED'">取消订单</span>
2023-11-02 16:54:17 +08:00
2023-11-02 11:40:28 +08:00
<!-- <span@tap="evaluate" v-if="list.orderStatus=='COMPLETED'">服务评价</span> -->
2023-09-27 16:20:09 +08:00
</view>
2023-11-02 15:27:36 +08:00
<view class="buy" v-if="order.orderStatus == 'WAIT_PAY'" @tap='pay'>
<view class="pay">
去支付
</view>
</view>
2023-11-01 17:33:57 +08:00
<!-- <u-popup v-model="evaluateshow" mode="bottom" length="45%" border-radius="30" :closeable='true'>
2023-09-27 16:20:09 +08:00
<view class="evaluate">
服务评价
</view>
<view class="star">
2023-11-01 17:33:57 +08:00
<u-rate size="70" active-color="#F4EA2A" v-model="countvalue" inactive-color="#b2b2b2" gutter="20"></u-rate>
2023-09-27 16:20:09 +08:00
<span>非常差//满意/非常满意</span>
</view>
<view class="submits">
2023-11-01 10:00:47 +08:00
提交
2023-09-27 16:20:09 +08:00
</view>
2023-11-01 17:33:57 +08:00
</u-popup> -->
2023-09-27 16:20:09 +08:00
2023-11-02 15:27:36 +08:00
<u-toast ref="uToast" />
2023-09-27 16:20:09 +08:00
</view>
</template>
<script>
2023-11-01 10:00:47 +08:00
import {
confirmReceipt,
ssgoodsOrder,
} from '@/api/pagesB/CommodityOrder/index.js'
import baseurl from '@/api/baseurl.js'
2023-11-02 15:27:36 +08:00
import {
appletGoodsOrderPay
} from '@/api/pagesB/confirmOrder/index.js'
2023-09-27 16:20:09 +08:00
export default {
data() {
return {
2023-11-01 17:33:57 +08:00
timestamp: 0,
countvalue: 0,
2023-11-01 10:00:47 +08:00
list: [],
2023-09-27 16:20:09 +08:00
// 评价弹框
2023-11-01 10:00:47 +08:00
background: {
backgroundColor: '#26A888',
},
evaluateshow: false,
orderTypeList: {
goodsOrderId: null,
patientId: '',
openid: null,
orderType: 'HEALTH_CONSULTATION',
2023-11-02 16:54:17 +08:00
orderStatus: '',
2023-11-01 10:00:47 +08:00
// orderTypeList: [
// 'INTEGRAL_EXCHANGE',
// 'DIRECT_BUY',
// ],
// orderStatus: '',
pageSize: 15,
pageNum: 1,
goodsName: '',
},
2023-11-02 16:54:17 +08:00
order: [],
2023-09-27 16:20:09 +08:00
}
},
2023-11-01 10:00:47 +08:00
onLoad(options) {
2023-11-02 14:44:32 +08:00
// if(options.item){
2023-11-01 10:00:47 +08:00
this.list = JSON.parse(options.item)
2023-11-02 16:54:17 +08:00
// console.log(this.list, '555')
this.orderTypeList.orderStatus = this.list.orderStatus
2023-11-02 14:44:32 +08:00
this.orderTypeList.goodsOrderId = this.list.goodsOrderId
2023-11-02 16:54:17 +08:00
// console.log(this.orderTypeList.orderStatus, '25256')
// else if(options.goodsOrderId){
// this.orderTypeList.goodsOrderId = options.goodsOrderId
// let that = this
2023-11-02 14:44:32 +08:00
2023-11-02 16:54:17 +08:00
// }
this.orderTypeList.patientId = uni.getStorageSync('patientId');
this.orderTypeList.openid = uni.getStorageSync('openid');
// if (value && value2) {
// that.orderTypeList.patientId = value
// that.orderTypeList.openid = value2
// }
this.goodsOrderinfo()
// console.log(this.list, '99')
this.baseurl = baseurl
2023-11-02 14:44:32 +08:00
2023-11-01 10:00:47 +08:00
},
2023-11-02 16:54:17 +08:00
methods: {
goprevious() {
uni.navigateBack({
delta: 1
})
},
//支付
pay() {
var that = this
let paydata = this.list
paydata.openid = this.orderTypeList.openid
paydata.payType = "WECHAT_PAY"
paydata.paymentPrice = this.list.totalPrice
paydata.orderChannel = 'WECHAT_APPLET'
paydata.orderNo = this.list.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) {
uni.setStorageSync("Refresh", 'Refresh')
that.goodsOrderinfo()
that.$refs.uToast.show({
title: '支付成功',
type: 'success',
duration: 1500,
url: `/pagesB/paysuccess/paysuccess?delta=${2}`
})
},
fail: function(err) {
that.$refs.uToast.show({
title: '取消支付',
type: 'error',
duration: 1500
})
}
});
} else {
that.$refs.uToast.show({
title: response.msg,
type: 'error',
duration: 1500
})
}
})
},
goodsOrderinfo() {
// console.log(this.list.orderStatus, '444')
ssgoodsOrder(this.orderTypeList).then(
res => {
this.order = res.rows[0]
var ordertimes = this.order.orderTime.replaceAll(/\-/gi, "/")
var time = new Date(ordertimes).getTime() / 1000 + (60 * 60 * 2)
var times = new Date().getTime() / 1000
this.timestamp = time - times
console.log(this.timestamp, '8585')
if (this.timestamp >= 0) {
this.timecount = this.timestamp
this.Timers = setInterval(() => {
this.timecount--;
}, 1000)
2023-11-02 15:27:36 +08:00
}
})
2023-11-02 16:54:17 +08:00
},
// 取消订单
cancle() {
var list = this.list
uni.navigateTo({
url: `/pagesB/refundType/refundType?list=${JSON.stringify(this.list)}`
2023-09-27 16:20:09 +08:00
})
2023-11-02 16:54:17 +08:00
},
// 服务评价
evaluate() {
this.evaluateshow = true;
2023-11-01 10:00:47 +08:00
2023-11-02 16:54:17 +08:00
},
2023-09-27 16:20:09 +08:00
2023-11-02 16:54:17 +08:00
}
2023-09-27 16:20:09 +08:00
}
</script>
<style lang="scss">
@import './consulted.scss'
2023-11-01 17:33:57 +08:00
</style>