<template>
|
<view class="container">
|
<view class="">
|
<view class="" v-if="!orderId">
|
<view class="center center-second">
|
<view class="title">就诊人信息</view>
|
<u-cell-group>
|
<u-cell title="就诊人" :value="dataList.name" :border="false" />
|
<!-- <u-cell title="就诊人证件" :value="listData.xh" :border="false" /> -->
|
</u-cell-group>
|
</view>
|
|
<view class="center">
|
<view class="title">预约信息</view>
|
<u-cell-group>
|
<u-cell title="预约套餐" :value="dataList.tjPackage.pacName" :border="false" />
|
<u-cell title="预约时间" :value="dataList.reservationTime" :border="false" />
|
<u-cell title="套餐金额" :value="dataList.tjPackage.price" :border="false" />
|
</u-cell-group>
|
</view>
|
<scroll-view class="content" scroll-y>
|
<!-- 套餐项目 -->
|
<view class="card1">
|
<view class="card1_header">体检项目</view>
|
|
<view class="Package" :is-shadow="false" v-for="(item,index) in orderList" :key="index">
|
<view class="Package1">
|
<view class="small">
|
|
</view>
|
<view class="card1_Package">
|
{{item.proName}}
|
</view>
|
<view class="card1_char">
|
{{item.proPrice}}元
|
</view>
|
</view>
|
|
|
</view>
|
</view>
|
</scroll-view>
|
<view class="footer">
|
<view class="button" @tap="reservation">取消预约</view>
|
<view class="button1" @tap="payTime">修改时间</view>
|
</view>
|
</view>
|
|
|
<view class="" v-if="orderId">
|
<view class="center">
|
<view class="title">订单信息</view>
|
<u-cell-group>
|
<u-cell title="订单编号" :value="orderInfo.orderSn" :border="false" />
|
<u-cell title="下单时间" :value="orderInfo.createTime" :border="false" />
|
<u-cell title="预约时间" :value="orderInfo.reservationTime" :border="false" />
|
<u-cell title="实付金额" :value="orderInfo.actualPrice" :border="false" />
|
</u-cell-group>
|
</view>
|
<scroll-view class="content" scroll-y>
|
<!-- 套餐项目 -->
|
<view class="card1">
|
<view class="card1_header">体检项目</view>
|
|
<view class="Package" :is-shadow="false" v-for="(item,index) in orderList" :key="index">
|
<view class="Package1">
|
<view class="small">
|
|
</view>
|
<view class="card1_Package">
|
{{item.goodsName}}
|
</view>
|
<view class="card1_char">
|
{{item.price}}元
|
</view>
|
</view>
|
|
|
</view>
|
</view>
|
</scroll-view>
|
<view class="footer">
|
<view class="button" @tap="cancelOrder" v-if="orderInfo.orderStatus == 101">取消订单</view>
|
<view class="button1" @tap="payOrder" v-if="orderInfo.orderStatus == 101">去付款</view>
|
<view class="button2" @tap="confirmOrder" v-if="orderInfo.orderStatus == 202">取消申请售后</view>
|
<view class="button2" @tap="deleteOrder" v-if="orderInfo.orderStatus == 203">删除订单</view>
|
<view class="button2" @tap="deleteOrder" v-if="orderInfo.orderStatus == 102 ">删除订单</view>
|
<view class="button" @tap="refundOrder" v-if="orderInfo.orderStatus == 201">申请退款</view>
|
<view class="button1" @tap="payTime" v-if="orderInfo.orderStatus == 201">修改时间</view>
|
<view class="button" @tap="payTime" v-if="orderInfo.orderStatus == 101">修改时间</view>
|
</view>
|
</view>
|
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import {
|
getList,
|
prepay,
|
refund,
|
deleteordel,
|
cancel,
|
agreeToRefund,
|
agreesubmit,
|
agreecancel,
|
deletereservation,
|
detailByOrderId,
|
updateReservationTime,
|
getReservationByIdCard
|
} from "@/api/system/cart";
|
export default {
|
data() {
|
return {
|
orderId: 0,
|
orderInfo: {
|
|
},
|
orderGoods: [],
|
expressInfo: {
|
Traces: []
|
},
|
idcard: 0,
|
id: "",
|
flag: false,
|
orderList: [{
|
goodsName: "身高",
|
price: 24
|
},
|
{
|
goodsName: "身高",
|
price: 24
|
},
|
{
|
goodsName: "身高",
|
price: 24
|
},
|
{
|
goodsName: "身高",
|
price: 24
|
},
|
],
|
dataList: {},
|
handleOption: {
|
cancel: '',
|
pay: '',
|
confirm: '',
|
delete: '',
|
refund: '',
|
aftersale: '',
|
comment: '',
|
rebuy: ''
|
},
|
reservationList: [],
|
iitem: {
|
AcceptStation: '',
|
AcceptTime: ''
|
}
|
};
|
},
|
onLoad: function(options) {
|
// console.log(options)
|
// 页面初始化 options为页面跳转所带来的参数
|
// if (options.id) {
|
// this.orderId = options.id
|
// this.getList(this.orderId)
|
// this.getOrderDetail();
|
// } else if (options.idcard) {
|
// this.idcard = options.idcard
|
// console.log(this.idcard)
|
// this.search()
|
// }
|
|
|
},
|
onReady: function() {
|
// 页面渲染完成
|
},
|
onShow: function() {
|
// 页面显示
|
},
|
onHide: function() {
|
// 页面隐藏
|
},
|
onUnload: function() {
|
// 页面关闭
|
},
|
methods: {
|
search() {
|
getReservationByIdCard(this.idcard).then((response) => {
|
// this.reservationList = response.data;
|
// this.reservationList.forEach(item => {
|
// this.dataList = item
|
// })
|
|
this.dataList = response.data;
|
if (this.dataList) {
|
this.orderList = this.dataList.tjPackage.tjProjectList
|
}
|
|
});
|
},
|
|
getList() {
|
detailByOrderId(this.orderId).then(res => {
|
this.orderList = res.data
|
})
|
},
|
expandDetail: function() {
|
let that = this;
|
this.setData({
|
flag: !that.flag
|
});
|
},
|
|
getOrderDetail: function() {
|
let that = this
|
getList().then((res) => {
|
if (res.code == 200) {
|
that.orderGoods = res.data
|
that.orderGoods.forEach(item => {
|
// if (item.orderStatus == 101) {
|
// item.orderStatus = "待付款"
|
// } else if (item.orderStatus == 201) {
|
// item.orderStatus = "待核销"
|
// } else if (item.orderStatus == 301) {
|
// item.orderStatus = "已支付"
|
// }
|
if (item.id == that.orderId) {
|
that.orderInfo = item
|
}
|
})
|
if (that.orderInfo) {
|
getReservationByIdCard(that.orderInfo.idCard).then((response) => {
|
this.reservationList = response.data;
|
this.id = this.reservationList.id
|
});
|
}
|
}
|
})
|
},
|
|
payTime() {
|
if (this.dataList.pacId) {
|
let data = this.dataList;
|
uni.navigateTo({
|
url: `/pagesA/date/date?pacId=${data.tjPackage.pacId}&id=${data.id}`
|
})
|
} else {
|
let data = this.orderInfo;
|
let id = this.id
|
uni.navigateTo({
|
url: `/pagesA/date/date?pacId=${data.pacId}&id=${id}`
|
})
|
}
|
|
},
|
|
reservation() {
|
let data = {
|
idCard: this.dataList.idCard,
|
pacId: this.dataList.tjPackage.pacId,
|
name: this.dataList.name,
|
reservationTime: this.dataList.reservationTime
|
}
|
deletereservation(data).then(res => {
|
if (res.code == 200) {
|
this.$modal.showToast("已取消预约");
|
uni.switchTab({
|
url: '/pages/mine/index'
|
});
|
}
|
|
})
|
},
|
// “去付款”按钮点击效果
|
payOrder: function() {
|
let that = this;
|
let data = {
|
orderId: that.orderId
|
}
|
prepay(data).then((res) => {
|
if (res.code === 200) {
|
const payParam = res.data;
|
console.log('支付过程开始');
|
uni.requestPayment({
|
timeStamp: payParam.timeStamp,
|
nonceStr: payParam.nonceStr,
|
package: payParam.packageValue,
|
signType: payParam.signType,
|
paySign: payParam.paySign,
|
success: function(res) {
|
console.log('支付过程成功');
|
uni.redirectTo({
|
// url: '/pages/payResult/payResult?status=1&orderId=' +
|
// orderId
|
url: '/pagesB/mine/myReservation/myReservation'
|
});
|
},
|
fail: function(res) {
|
console.log('支付过程失败');
|
that.$modal.showToast('支付失败');
|
},
|
complete: function(res) {
|
console.log('支付过程结束');
|
}
|
});
|
} else {
|
util.showErrorToast(res.msg);
|
}
|
});
|
},
|
|
// “取消订单”点击效果
|
cancelOrder: function() {
|
let that = this;
|
let orderInfo = that.orderInfo;
|
uni.showModal({
|
title: '',
|
content: '确定要取消此订单?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
orderId: orderInfo.id
|
}
|
cancel(data).then(function(res) {
|
if (res.code == 200) {
|
let data = {
|
idCard: orderInfo.idCard,
|
pacId: orderInfo.mallOrderGoodsList[0].goodsId,
|
name: orderInfo.consignee,
|
reservationTime: orderInfo.reservationTime,
|
id: that.id
|
}
|
deletereservation(data).then(res => {
|
uni.showToast({
|
title: '取消订单成功'
|
});
|
uni.redirectTo({
|
url: '../myReservation/myReservation?status=0'
|
});
|
})
|
|
} else {
|
that.$modal.showToast(res.errmsg);
|
}
|
});
|
}
|
}
|
});
|
},
|
|
// “取消订单并退款”点击效果
|
refundOrder: function() {
|
let that = this;
|
let orderInfo = that.orderInfo;
|
uni.showModal({
|
title: '',
|
content: '确定要申请此订单?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
orderId: orderInfo.id,
|
userId: orderInfo.userId,
|
amount: orderInfo.actualPrice,
|
status: 0
|
}
|
// refund
|
agreesubmit(data).then(function(res) {
|
if (res.code === 200) {
|
|
uni.showToast({
|
title: '申请订单已提交'
|
});
|
uni.redirectTo({
|
url: '../myReservation/myReservation?status=0'
|
});
|
} else {
|
that.$modal.showToast(res.errmsg);
|
}
|
});
|
}
|
},
|
})
|
},
|
|
// “删除”点击效果
|
deleteOrder: function() {
|
let that = this;
|
let orderInfo = that.orderInfo;
|
uni.showModal({
|
title: '',
|
content: '确定要删除此订单?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
orderId: orderInfo.id
|
}
|
deleteordel(data).then(function(res) {
|
if (res.code === 200) {
|
uni.showToast({
|
title: '删除订单成功'
|
});
|
uni.redirectTo({
|
url: '../myReservation/myReservation?status=0'
|
});
|
} else {
|
that.$modal.showToast(res.errmsg);
|
}
|
});
|
}
|
}
|
});
|
},
|
|
// “确认收货”点击效果
|
confirmOrder: function() {
|
let that = this;
|
let orderInfo = that.orderInfo;
|
uni.showModal({
|
title: '',
|
content: '确认取消售后?',
|
success: function(res) {
|
if (res.confirm) {
|
let id = orderInfo.id
|
agreecancel(id).then(function(res) {
|
if (res.code === 200) {
|
uni.showToast({
|
title: '取消售后成功!'
|
});
|
uni.redirectTo({
|
url: '../myReservation/myReservation?status=0'
|
});
|
} else {
|
util.showErrorToast(res.errmsg);
|
}
|
});
|
}
|
}
|
});
|
},
|
|
// “申请售后”点击效果
|
aftersaleOrder: function() {
|
// if (this.orderInfo.aftersaleStatus === 0) {
|
// util.redirect('/pages/ucenter/aftersale/aftersale?id=' + this.orderId);
|
// } else {
|
// util.redirect('/pages/ucenter/aftersaleDetail/aftersaleDetail?id=' + this.orderId);
|
// }
|
// let data = {
|
// actualPrice:0.01,
|
// id:this.orderInfo.id,
|
// orderPrice:0.01,
|
// refundAmount:0.01,
|
// refundType:1,
|
// }
|
// agreeToRefund(data).then(res={
|
|
// })
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
.content {
|
flex: 1;
|
overflow: auto;
|
padding-bottom: 68rpx;
|
}
|
|
// 套餐内项目
|
.card1 {
|
// margin: 10px 0;
|
padding: 15px;
|
background-color: #fff;
|
|
|
}
|
|
.card1_header {
|
width: 702rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
padding-left: 30rpx;
|
background: linear-gradient(90deg, #FFF5F5 0%, #FFE4F1 100%);
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
color: #A20048;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
}
|
|
.Package {
|
margin-top: 26rpx;
|
}
|
|
.Package1 {
|
width: 642rpx;
|
height: 80rpx;
|
display: flex;
|
background: #F4F5F8;
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
margin-left: 28rpx;
|
}
|
|
.card1_Package {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #373E58;
|
line-height: 80rpx;
|
font-style: normal;
|
text-transform: none;
|
padding-left: 30rpx;
|
width: 512rpx;
|
}
|
|
.small {
|
width: 6rpx;
|
height: 32rpx;
|
background: #FD6397;
|
border-radius: 0rpx 8rpx 8rpx 0rpx;
|
margin-top: 25rpx;
|
}
|
|
.card1_char {
|
// width: 612rpx;
|
line-height: 80rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #65686A;
|
text-align: right;
|
font-style: normal;
|
text-transform: none;
|
// margin: 24rpx 0;
|
// margin-left: 58rpx;
|
}
|
|
.container {
|
width: 750rpx;
|
height: 1624rpx;
|
background: #FBFDFF;
|
margin: 0;
|
padding: 0;
|
|
.top {
|
width: 738rpx;
|
height: 160rpx;
|
margin: 0 auto;
|
|
.top_one,
|
.text {
|
margin-left: 72rpx;
|
line-height: 50rpx;
|
}
|
|
.top_one {
|
padding-top: 30rpx;
|
font-weight: bold;
|
font-size: 36rpx;
|
color: #FFFFFF;
|
}
|
|
.text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #E9F7FE;
|
}
|
|
}
|
|
.top_info {
|
width: 702rpx;
|
height: 148rpx;
|
background: linear-gradient(90deg, #FFFFFF 0%, #FCFFFE 100%);
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 12rpx;
|
margin: 0 auto;
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
margin: 20rpx;
|
|
|
.images {
|
width: 90rpx;
|
height: 90rpx;
|
}
|
|
.jianjie {
|
line-height: 50rpx;
|
|
.name {
|
font-weight: bold;
|
font-size: 32rpx;
|
color: #464F72;
|
}
|
|
.text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #9496A2;
|
}
|
}
|
|
.last_text {
|
display: flex;
|
align-items: center;
|
|
.last {
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #419FFD;
|
}
|
}
|
}
|
|
|
.center {
|
width: 702rpx;
|
height: 280rpx;
|
background: linear-gradient(90deg, #FFFFFF 0%, #FCFFFE 100%);
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 12rpx;
|
margin: 16rpx auto;
|
|
.title {
|
// width: 112rpx;
|
// height: 28rpx;
|
width: 100%;
|
margin-bottom: 20rpx;
|
font-weight: bold;
|
font-size: 28rpx;
|
color: #E60165;
|
margin-left: 31rpx;
|
padding-top: 29rpx;
|
}
|
|
.u-line {
|
width: 95% !important;
|
margin-left: 24rpx !important;
|
}
|
|
|
.u-cell-group {
|
border-radius: 16rpx;
|
border: none;
|
}
|
}
|
|
.center-second {
|
height: 160rpx;
|
}
|
|
.center-third {
|
height: 288rpx;
|
|
.u-cell-group .u-cell:last-child .u-cell__value {
|
color: #F5981F;
|
}
|
}
|
|
|
|
}
|
|
.footer {
|
// position: fixed;
|
// width: 750rpx;
|
// height: 98rpx;
|
// background: #FFFFFF;
|
// box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
// border-radius: 0rpx;
|
// display: flex;
|
// align-items: center;
|
// justify-content: flex-end;
|
// z-index: 1000;
|
position: fixed;
|
/* 固定定位 */
|
bottom: 0;
|
/* 贴紧底部 */
|
left: 0;
|
/* 横向铺满 */
|
right: 0;
|
display: flex;
|
/* 启用Flex布局 */
|
justify-content: space-around;
|
/* 按钮等间距分布 */
|
align-items: center;
|
padding: 20rpx;
|
background: #fff;
|
/* 背景色 */
|
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
|
/* 顶部阴影分隔线 */
|
z-index: 999;
|
/* 确保按钮在顶层 */
|
}
|
|
.button {
|
width: 216rpx;
|
height: 76rpx;
|
background: #FE368E;
|
font-weight: 400;
|
font-size: 31rpx;
|
color: #FFFFFF;
|
text-align: center;
|
line-height: 2.5;
|
border-radius: 12rpx;
|
}
|
|
.button2{
|
text-align: center;
|
line-height: 2.5;
|
flex: 1;
|
/* 等宽按钮 */
|
margin: 0 30rpx;
|
/* 按钮间距 */
|
background: #FE368E;
|
color: white;
|
border-radius: 50rpx;
|
border-radius: 12rpx;
|
}
|
|
.button1 {
|
width: 216rpx;
|
height: 76rpx;
|
background: #E30165;
|
font-weight: 400;
|
font-size: 31rpx;
|
color: #FFFFFF;
|
text-align: center;
|
line-height: 2.5;
|
border-radius: 12rpx;
|
}
|
|
|
|
.u-cell__title {
|
font-size: 26rpx;
|
color: #9496A2;
|
line-height: 64rpx;
|
}
|
|
.u-cell__body {
|
padding: 10rpx 30rpx !important;
|
}
|
|
.u-cell__value {
|
font-size: 26rpx;
|
color: #464F72;
|
}
|
</style>
|