| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <view class="box">
- <view class="tab bgfff dflex">
- <view :class="'li ' + (currentTab == 0 ? 'active' : '')" @tap="tab(0)">全部</view>
- <view :class="'li ' + (currentTab == 1 ? 'active' : '')" @tap="tab(1)">待预约</view>
- <view :class="'li ' + (currentTab == 4 ? 'active' : '')" @tap="tab(4)">待就诊</view>
- <view :class="'li ' + (currentTab == 7 ? 'active' : '')" @tap="tab(7)">已就诊</view>
- </view>
- <view v-if="pageList&&pageList.length>0">
- <view class="box-item" v-for="(item,index) in pageList" :key="index">
- <view v-for="(it,idx) in item.products" :key="idx" @tap="jumpUrl('/onlineregistration/detail/detail?id=' + item.id)">
- <view class="box-item-title">
- <text>{{item.merchantName}}</text>
- <view class="color-gray" v-if="it.history&&it.history.diagnosisNo">就诊序号 <text class="register-num">{{it.history.diagnosisNo}}</text></view>
- </view>
- <view class="box-item-contentbox">
- <view class="doctor-header">
- <image :src="it.history.headUrl?it.history.headUrl:'../static/onlineregistration/image/doctorPic.png'" mode="aspectFill"></image>
- </view>
- <view>
- <view class="box-item-content">
- <view class="box-item-content-item">
- <view class="item-name">预约医生</view>
- <view class="item-text">{{it.history.sysUidName}}</view>
- </view>
- </view>
- <view class="box-item-content">
- <view class="box-item-content-item">
- <view class="item-name">预约科室</view>
- <view class="item-text">{{it.history.departmentName}}</view>
- </view>
- </view>
- <view class="box-item-content">
- <view class="box-item-content-item">
- <view class="item-name">就诊时间段</view>
- <view class="item-text color-orange">{{captureTime(it.history.endTime,false)}} {{captureTime(it.history.startTime,true)}}~{{captureTime(it.history.endTime,true)}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="pay-info" v-if="item.money>0">
- <text><!-- 共1个挂号 -->预约费</text>
- <text class="color-orange">¥{{item.money}}</text>
- </view>
- <view class="box-item-footer">
- <view class="footer-status">
- {{item.state==4?'待就诊':item.state==8?'已取消':item.state==7?'已就诊':item.stateName}}
- </view>
- <view class="footer-btn">
- <!-- <view class="footer-btn-item">查看详情</view> -->
- <view class="footer-btn-item" v-if="item.state==1||item.state==4" @click="cancelOrder(item,index)">取消预约</view>
- <view class="footer-btn-item color-orange border-orange" @click="payOrder(item.id)" v-if="item.state==1">立即预约</view>
- </view>
- </view>
- </view>
- </view>
- <view class="nodata" v-if="ishow">
- <image :src="picUrlss+'empty_dd.png'"></image>
- <text>还没有预约哦</text>
- </view>
- </view>
- </template>
- <script>
- // mine/coupons/coupons.js
- const req = require("../../utils/request.js");
- const api = require("../../utils/api.js");
- const util = require("../../utils/util.js");
- const app = getApp();
- export default {
- data() {
- return {
- picUrlss: req.public.picUrls,
- currentTab:0,
- form: {
- page: 1,
- limit: 10
- },
- pageList: [],
- isLoad: true,
- ishow: false
- };
- },
- components: {},
- props: {},
- onLoad() {
- this.getList()
- },
- onShow: function() {
- },
- methods: {
- captureTime(time,isTime){
- return util.captureTime(time,isTime)
- },
- tab(index) {
- let that = this;
- if (that.currentTab === index) return false;
- that.currentTab = index
- this.isLoad = true
- this.form.page = 1
- this.getList()
- },
- getList(){
- if(!this.isLoad) return false;
- this.isLoad = false;
- let form = this.form
- form.orderType = '47'
- if(this.currentTab > 0){
- form.state = this.currentTab
- }else delete form.state
- req.getRequest('/api/order/list',form,data=>{
- if(data&&data.length>0){
- data.map(it=>{
- it.products.map(pit=>{
- pit.history = JSON.parse(pit.history);
- })
- return it;
- })
- }
- if(data&&data.length == this.form.limit) this.isLoad = true
- if(this.form.page > 1) data = this.pageList.concat(data);
- if (data.length == 0) this.ishow = true
- else this.ishow = false
- this.pageList = data;
- })
- },
- payOrder(id){
- req.payOrders(id,success=>{
- uni.navigateTo({
- url: '/onlineregistration/detail/detail?id='+id
- })
- },'registered')
- },
- cancelOrder(item,index){
- let that = this;
- req.msgConfirm('确认取消预约吗',suc=>{
- if(item.state == 1){
- req.postRequest('/api/order/cancel',{id:item.id},data=>{
- req.msg('预约已取消');
- that.pageList[index].state = 8
- that.pageList[index].stateName = '已取消'
- })
- }else{
- req.postRequest(api.orderRefund_whole,{orderId:item.id},data=>{
- req.msg('预约已取消');
- that.pageList[index].state = 30
- that.pageList[index].stateName = '售后待审核'
- })
- }
- })
- },
- jumpUrl(url) {
- uni.navigateTo({
- url: url
- })
- },
- }
- };
- </script>
- <style>
- @import './registrationlist.css';
- </style>
|