<template>
|
<view class="box">
|
<image class="bg-image" src="/static/images/tabbar/loginbg.png" mode="scaleToFill"></image>
|
<!-- <uni-forms ref="form" :modelValue="formData" :rules="rules">
|
<uni-forms-item required name="idcard">
|
<uni-easyinput v-model="formData.idcard" placeholder="点击输入身份证号" maxlength='18'/>
|
</uni-forms-item>
|
</uni-forms> -->
|
<view v-if="disapley == 0">
|
<uni-search-bar placeholder="点击输入身份证号" @confirm="search(idcard)" v-model="idcard" />
|
|
<!-- 卡片 -->
|
<!-- <view class="padding-l" v-if="reservationList!=null" v-for="(item,index) in reservationList" :key="index" @click="tiaozhuan(item.idCard)"> -->
|
<view class="order" v-if="reservationList!=null" @click="tiaozhuan(reservationList.idCard)">
|
|
<view class="top">
|
<view class="top_one">
|
<view>{{ reservationList.name }}</view>
|
<text>{{reservationList.sex ? "女" :"男" }}</text>
|
</view>
|
<view class="top_two" v-if="reservationList.isExpire == 2">待体检</view>
|
<view class="top_two" v-if="reservationList.isExpire == 1">已过期</view>
|
</view>
|
<view style="border-top: 1rpx solid #EBEEF2; width: 95%; margin: 0 auto;"></view>
|
<u-cell-group>
|
<u-cell title="套餐名" :value="reservationList.tjPackage.pacName" :border="false" />
|
<u-cell title="预约时间" :value="reservationList.reservationTime" :border="false" />
|
</u-cell-group>
|
|
</view>
|
</view>
|
|
<view v-else>
|
<view class="orders-switch" style="padding: 20rpx 0;">
|
<view :class="'item ' + (showType == 0 ? 'active' : '')" @tap="switchTab" data-index="0">
|
<view class="txt">全部</view>
|
</view>
|
<view :class="'item ' + (showType == 1 ? 'active' : '')" @tap="switchTab" data-index="1">
|
<view class="txt">待就诊</view>
|
</view>
|
<view :class="'item ' + (showType == 2? 'active' : '')" @tap="switchTab" data-index="2">
|
<view class="txt">已完成</view>
|
</view>
|
<view :class="'item ' + (showType == 3 ? 'active' : '')" @tap="switchTab" data-index="3">
|
<view class="txt">已取消</view>
|
</view>
|
|
|
<!-- <view :class="'item ' + (showType == 4 ? 'active' : '')" @tap="switchTab" data-index="4">
|
<view class="txt">待评价</view>
|
</view> -->
|
</view>
|
|
<view class="no-order" v-if="orderList.length <= 0">
|
<view class="c">
|
<text>还没有任何订单呢</text>
|
</view>
|
</view>
|
|
<view class="orders">
|
<navigator :url="'../orderDetail/orderDetail?id=' + item.id" class="order" open-type="redirect"
|
v-for="(item, index) in orderList" :key="index">
|
<view class="top">
|
<view class="top_one">
|
<view>{{ item.consignee }}</view>
|
</view>
|
<view class="top_two">{{item.orderStatus}}</view>
|
</view>
|
<view style="border-top: 1rpx solid #EBEEF2; width: 95%; margin: 0 auto;"></view>
|
<u-cell-group>
|
<u-cell title="套餐名字" :value="item.pacName" :border="false" />
|
<u-cell title="预约时间" :value="item.reservationTime" :border="false" />
|
<u-cell title="订单编号" :value="item.orderSn" :border="false" />
|
<u-cell title="实付金额" :value="item.actualPrice" :border="false" />
|
</u-cell-group>
|
</navigator>
|
</view>
|
</view>
|
|
<div class="warm" v-if="orderList.length <= 0">
|
<text>温馨提示:如有其他问题,请联系客服:4000-0000-000</text>
|
</div>
|
</view>
|
|
</template>
|
|
<script>
|
import {
|
getList,
|
getIsPay,
|
getreservation,
|
getReservationByIdCard
|
} from "@/api/system/cart";
|
export default {
|
name: 'App',
|
data() {
|
return {
|
idcard: '',
|
reservationList: {
|
|
name: "秦女士",
|
sex: "女",
|
isExpire: 2,
|
reservationTime: "2025-04-29",
|
tjPackage: {
|
pacName: "健康体检"
|
},
|
|
|
},
|
orderList: [{
|
orderSn: "123456",
|
orderStatus: "已完成",
|
consignee: "秦女士",
|
pacName: "健康体检",
|
reservationTime: "2025-04-29",
|
actualPrice: "280"
|
}, {
|
orderSn: "123456",
|
orderStatus: "已完成",
|
consignee: "秦女士",
|
pacName: "健康体检",
|
reservationTime: "2025-04-29",
|
actualPrice: "280"
|
}, ],
|
showType: 0,
|
page: 1,
|
limit: 10,
|
totalPages: 1,
|
disapley: 0,
|
gitem: {
|
picUrl: '',
|
goodsName: '',
|
number: ''
|
}
|
}
|
},
|
onLoad: function(options) {
|
this.showType = options.status
|
this.getList()
|
|
},
|
methods: {
|
getList() {
|
let that = this
|
getIsPay().then((res) => {
|
if (res.msg == "true") {
|
that.disapley = 1
|
that.getOrderList()
|
} else {
|
that.disapley = 0
|
that.gettjList()
|
}
|
})
|
},
|
gettjList() {
|
// getreservation().then(res => {
|
// if(res.data){
|
// this.reservationList = res.data;
|
// }else{
|
// this.reservationList = null
|
// this.$modal.msgError("暂无预约信息")
|
// }
|
// })
|
},
|
getOrderList() {
|
let that = this
|
getList(that.showType).then((res) => {
|
if (res.code == 200) {
|
that.orderList = res.data
|
that.orderList.forEach(item => {
|
if (item.orderStatus == 101) {
|
item.orderStatus = "待付款"
|
} else if (item.orderStatus == 201) {
|
item.orderStatus = "已支付"
|
} else if (item.orderStatus == 301) {
|
item.orderStatus = "已完成"
|
} else if (item.orderStatus == 102) {
|
item.orderStatus = "已取消"
|
} else if (item.orderStatus == 203) {
|
item.orderStatus = "已退款"
|
} else if (item.orderStatus == 202) {
|
item.orderStatus = "已申请售后"
|
}
|
})
|
}
|
})
|
},
|
|
tiaozhuan(idCard) {
|
console.log(idCard)
|
uni.navigateTo({
|
url: '../orderDetail/orderDetail?idcard=' + idCard
|
});
|
},
|
/** 查询历史预约 传身份证号*/
|
search(idcard) {
|
idcard = this.idcard;
|
getReservationByIdCard(idcard).then((response) => {
|
// console.log('12212121接口得到', response.data)
|
if (response.data) {
|
this.reservationList = response.data;
|
} else {
|
this.$modal.msgError("暂无预约信息")
|
}
|
|
});
|
},
|
switchTab: function(event) {
|
this.showType = event.currentTarget.dataset.index;
|
this.getOrderList();
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import './order.css';
|
|
.box {
|
width: 100%;
|
min-height: 1240rpx;
|
// background: linear-gradient(180deg, #fd8b4d, #f4f8f7, #f7f7f7 60%, );
|
}
|
|
.bg-image {
|
position: absolute;
|
top: 0;
|
left: 0;
|
width: 100vw;
|
height: 100vh;
|
z-index: -1;
|
left: 50%;
|
transform: translateX(-50%);
|
object-fit: cover;
|
}
|
|
.card {
|
|
//margin-top: 10px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.card_sty {
|
width: 670rpx;
|
height: 200rpx;
|
border-radius: 8px 8px 8px 8px;
|
background-color: #fff;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 30px;
|
}
|
|
.card_left {
|
width: 120rpx;
|
height: 103rpx;
|
border-right: 1px solid #ccc;
|
display: flex;
|
align-items: center;
|
flex-direction: column;
|
}
|
|
.card_left_txt {
|
font-size: 16px;
|
}
|
|
.card_left_txt2 {
|
font-size: 14px;
|
color: #838383;
|
}
|
|
.card_right {
|
display: flex;
|
}
|
|
.card_right1 {
|
margin-top: 20px;
|
margin-left: 10px;
|
width: 450rpx;
|
height: 103rpx;
|
display: flex;
|
flex-direction: column;
|
|
}
|
|
.card_right_txt1 {
|
font-size: 14px;
|
}
|
|
.card_right_txt2 {
|
font-size: 14px;
|
}
|
|
.card_right_txt3 {
|
font-size: 14px;
|
}
|
|
.card_right2 {
|
margin-left: 10px;
|
width: 50rpx;
|
height: 200rpx;
|
font-size: 14px;
|
color: #fff;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
border-radius: 0px 8px 8px 0px;
|
background-color: #fd8b4d;
|
}
|
|
.card_right_txt4 {
|
margin-top: 6px;
|
font-size: 14px;
|
color: #fff;
|
}
|
|
.warm {
|
width: 100%;
|
color: LightSlateGray;
|
position: absolute;
|
left: 5%;
|
bottom: 2%;
|
}
|
</style>
|