2024-06-05 19:14:51 +08:00
|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="timeView">
|
2024-08-28 16:51:26 +08:00
|
|
|
<view class="timeView-top">
|
|
|
|
<span class="dx_title">是否接单 <!-- <text class="switchTxt">{{switchTxt=='true'?'接单':'不接单'}}</text> --></span>
|
2024-09-02 11:22:06 +08:00
|
|
|
<switch :checked='isTrue' style="transform:scale(0.7)" color="#029d88" @change="switch1Change"/>
|
2024-08-28 16:51:26 +08:00
|
|
|
</view>
|
|
|
|
<view class="selectTimt">
|
|
|
|
<view class="dx_title">选择接单时问</view>
|
|
|
|
<view class="selectTimt-bottom">
|
2024-08-30 16:27:19 +08:00
|
|
|
<hTimePicker class="selectTimt-time" dayNum='0' sTime="0" cTime="23" interval="30" @changeTime="bindTimeChange">
|
|
|
|
<view slot="pCon" class="changeTime">
|
|
|
|
<view class="selectTimt-time-title">开始时间</view>
|
|
|
|
<view class="uni-input">{{starTime}}</view>
|
|
|
|
</view>
|
|
|
|
</hTimePicker>
|
|
|
|
<hTimePickerEnd class="selectTimt-time" dayNum='0' sTime="0" cTime="23" interval="30" @changeTime="bindTimeChangeEndTime">
|
|
|
|
<view slot="pCon" class="changeTime">
|
|
|
|
<view class="selectTimt-time-title">结束时间</view>
|
|
|
|
<view class="uni-input">
|
|
|
|
<span style="margin-right: 5px;">次日</span>
|
|
|
|
<span>{{endTime}}</span>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</hTimePickerEnd>
|
2024-08-28 16:51:26 +08:00
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
2024-08-30 16:27:19 +08:00
|
|
|
<view class="container-top">
|
|
|
|
<span>设置不可接单时间</span>
|
|
|
|
<span>(只能设置近3天的时间)</span>
|
|
|
|
</view>
|
|
|
|
<scroll-view class="scroll-view_H b-t b-b" scroll-x>
|
|
|
|
<block v-for="(item,index) in dateArr" :key="index">
|
|
|
|
<div class="flex-box" @click="selectDateEvent(index,item)" :class="{ borderb: index==dateActive}">
|
|
|
|
<view class="date-box" :style="{color:index==dateActive?selectedTabColor:'#333'}">
|
|
|
|
<text class="fontw">{{item.week}}</text>
|
|
|
|
<text>{{item.date}}</text>
|
|
|
|
</view>
|
|
|
|
</div>
|
|
|
|
</block>
|
|
|
|
</scroll-view>
|
|
|
|
<view class="time-box">
|
|
|
|
<view class="item" v-for="(item,index) in today" :key="index" @click="selectTime(index,item)">
|
|
|
|
<view class="item-box" :class="[item.isSelected==false?'disable':'active']">
|
|
|
|
<text>{{item.artificerTime}}</text>
|
|
|
|
<text class="all">{{item.title}}</text>
|
2024-06-05 19:14:51 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
2024-09-02 11:22:06 +08:00
|
|
|
<view class="sub" @click="sub()">保存选择</view>
|
|
|
|
<!-- <view class="push-button">
|
|
|
|
<view class="detail-btn" @click="sub()">
|
|
|
|
保存选择
|
|
|
|
</view>
|
|
|
|
</view> -->
|
2024-06-05 19:14:51 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-08-30 16:27:19 +08:00
|
|
|
import hTimePicker from "@/components/h-timePicker/h-timePicker.vue";
|
|
|
|
import hTimePickerEnd from "@/components/h-timePicker/h-timePickerEnd.vue";
|
2024-08-28 16:51:26 +08:00
|
|
|
import {
|
2024-08-30 16:27:19 +08:00
|
|
|
tomorrow,
|
|
|
|
dayAfterTomorrow,
|
2024-08-28 16:51:26 +08:00
|
|
|
initData,
|
2024-08-30 16:27:19 +08:00
|
|
|
initTime,
|
|
|
|
timeStamp,
|
2024-08-30 17:04:20 +08:00
|
|
|
currentTime,
|
|
|
|
dayAfterTomorrowD
|
2024-08-28 16:51:26 +08:00
|
|
|
} from '../../utils/date.js'
|
2024-08-27 10:03:13 +08:00
|
|
|
import times from '@/components/pretty-times/pretty-times.vue'
|
2024-06-05 19:14:51 +08:00
|
|
|
export default {
|
|
|
|
components: {
|
2024-08-30 16:27:19 +08:00
|
|
|
times,
|
|
|
|
hTimePicker,
|
|
|
|
hTimePickerEnd
|
2024-06-05 19:14:51 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2024-08-30 16:27:19 +08:00
|
|
|
today: [
|
|
|
|
{
|
|
|
|
artificerTime: '00:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
|
|
|
|
}, {
|
|
|
|
artificerTime: '00:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '01:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '01:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '02:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '02:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '03:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '03:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '04:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '04:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '05:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '05:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '06:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '06:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '07:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '07:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '08:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '08:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '09:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '09:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '10:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '10:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '11:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '11:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '12:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '12:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '13:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '13:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '14:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '14:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '15:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '15:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '16:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '16:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '17:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '17:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '18:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '18:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '19:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '19:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '20:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '20:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '21:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '21:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '22:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '22:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '23:00',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}, {
|
|
|
|
artificerTime: '23:30',
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
}
|
|
|
|
],
|
|
|
|
checkbox1: [],
|
|
|
|
selectedTabColor:'rgb(40, 186, 146)',
|
|
|
|
dateActive: 0, //选中的日期索引
|
|
|
|
dateArr: [], //日期数据
|
|
|
|
multiSelector: '',
|
|
|
|
isTrue: true,
|
|
|
|
starTime:'00:00',
|
2024-08-28 16:51:26 +08:00
|
|
|
endTime: '00:00',
|
2024-08-27 10:03:13 +08:00
|
|
|
appointTime:[],
|
2024-08-28 16:51:26 +08:00
|
|
|
disableTimeSlot:[],
|
2024-06-05 19:14:51 +08:00
|
|
|
newmsList: [],
|
|
|
|
msList: [],
|
|
|
|
startTime: '',
|
|
|
|
yearsDate: '',
|
2024-08-28 16:51:26 +08:00
|
|
|
switchTxt:'',
|
|
|
|
timeCurrent:'',
|
2024-08-30 16:27:19 +08:00
|
|
|
tomorrowTime:'',
|
|
|
|
selected:[],
|
|
|
|
timeData:[],
|
|
|
|
timeList:''
|
2024-06-05 19:14:51 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad() {
|
2024-08-30 16:27:19 +08:00
|
|
|
|
2024-08-28 16:51:26 +08:00
|
|
|
if(this.timeCurrent==''){
|
|
|
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
|
|
|
}
|
2024-08-30 16:27:19 +08:00
|
|
|
// this.tomorrowTime=currentTime().date+' '+currentTime().times;
|
|
|
|
this.timeList=currentTime().date;
|
|
|
|
this.getMsTime(currentTime().date);
|
|
|
|
this.initOnload();
|
|
|
|
this.getTimeMs(currentTime().myDate)
|
2024-06-05 19:14:51 +08:00
|
|
|
},
|
|
|
|
methods: {
|
2024-08-30 16:27:19 +08:00
|
|
|
isToday(date){
|
|
|
|
const today = new Date();
|
|
|
|
return date.getDate() === today.getDate() // 比较日期
|
|
|
|
&& date.getMonth() === today.getMonth() // 比较月份
|
|
|
|
&& date.getFullYear() === today.getFullYear(); // 比较年份
|
|
|
|
},
|
|
|
|
getTimeMs(someDate){
|
|
|
|
// const someDate = new Date(); // 假设你有一个日期对象
|
|
|
|
var data=[];
|
|
|
|
if (this.isToday(someDate)) {
|
|
|
|
var time=currentTime().times
|
|
|
|
for(var i=0;i<this.today.length;i++){
|
|
|
|
if(time<=this.today[i].artificerTime){
|
|
|
|
data.push({
|
|
|
|
artificerTime: this.today[i].artificerTime,
|
|
|
|
isSelected: true,
|
|
|
|
disable:true,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
data.push({
|
|
|
|
artificerTime: this.today[i].artificerTime,
|
|
|
|
isSelected: false,
|
|
|
|
disable:false,
|
|
|
|
title:'不可预约',
|
|
|
|
createTime:currentTime().date
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.today=data
|
|
|
|
} else {
|
|
|
|
for(var i=0;i<this.today.length;i++){
|
|
|
|
data.push({
|
|
|
|
artificerTime: this.today[i].artificerTime,
|
|
|
|
isSelected: true,
|
|
|
|
disable:true,
|
|
|
|
title:'可预约',
|
|
|
|
createTime:this.timeList
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.today=data;
|
|
|
|
console.log("这个日期不是今天");
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
selectTime(index,item){
|
|
|
|
var data = [];
|
|
|
|
if(item.disable==true){
|
|
|
|
if(item.isSelected==true){
|
|
|
|
item.isSelected=false;
|
|
|
|
item.title='不可预约';
|
|
|
|
|
|
|
|
}else{
|
|
|
|
item.isSelected=true;
|
|
|
|
item.title='可预约';
|
|
|
|
}
|
|
|
|
var index = this.selected.indexOf(item);
|
|
|
|
if(item.huixian==false){//回显的时候反选
|
|
|
|
item.huixian=true
|
|
|
|
this.selected.splice(index, 1);
|
|
|
|
}else{
|
|
|
|
if (index === -1) {
|
|
|
|
this.selected.push(item);
|
|
|
|
} else {
|
|
|
|
this.selected.splice(index, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.timeData=this.selected;
|
|
|
|
console.log("this.timeData",this.timeData)
|
|
|
|
}else{
|
|
|
|
console.log("时间过了")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 日期选择事件
|
|
|
|
selectDateEvent(index, item) {
|
|
|
|
const today = new Date();
|
|
|
|
this.dateActive = index
|
2024-08-30 17:04:20 +08:00
|
|
|
this.selectDate = item.week
|
2024-08-30 16:27:19 +08:00
|
|
|
if(item.week=='明天'){
|
|
|
|
this.selected=[];
|
|
|
|
this.timeList=tomorrow().tomorrow;
|
|
|
|
this.getTimeMs(tomorrow().todayT)
|
|
|
|
}else if(item.week=='后天'){
|
|
|
|
this.selected=[];
|
|
|
|
this.timeList=dayAfterTomorrow().dayAfterTomorrow;
|
|
|
|
this.getTimeMs(dayAfterTomorrow().todayD)
|
|
|
|
}else{
|
|
|
|
this.selected=[];
|
|
|
|
this.timeList=currentTime().date;
|
|
|
|
this.getTimeMs(today)
|
|
|
|
}
|
|
|
|
this.initOnload()
|
|
|
|
this.getMsTime(this.timeList)
|
|
|
|
},
|
|
|
|
initOnload() {
|
|
|
|
var danqian=initData() // 日期栏初始化
|
|
|
|
// this.dateArr = initData() // 日期栏初始化
|
|
|
|
let newObj = [];
|
|
|
|
for (let i = 0; i < 3; i++) {
|
|
|
|
let key = danqian[i];
|
|
|
|
if (key.week == '今天') {
|
|
|
|
key.week = "今天"
|
|
|
|
} else if (key.week == "明天") {
|
|
|
|
key.week = "明天"
|
|
|
|
|
|
|
|
} else if (key.week == '后天') {
|
|
|
|
key.week = "后天";
|
|
|
|
|
|
|
|
}
|
|
|
|
newObj.push(key)
|
|
|
|
}
|
|
|
|
this.dateArr = newObj
|
|
|
|
|
|
|
|
},
|
2024-08-28 16:51:26 +08:00
|
|
|
bindTimeChange: function(e) {// 当天接单开始时间
|
2024-08-30 16:27:19 +08:00
|
|
|
this.starTime = e;
|
2024-08-28 16:51:26 +08:00
|
|
|
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
2024-08-27 10:03:13 +08:00
|
|
|
},
|
2024-08-28 16:51:26 +08:00
|
|
|
bindTimeChangeEndTime(e){//次日接单结束时间
|
2024-08-30 16:27:19 +08:00
|
|
|
this.endTime = e;
|
2024-08-28 16:51:26 +08:00
|
|
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
|
|
|
},
|
|
|
|
switch1Change: function (e) {
|
|
|
|
this.switchTxt=e.detail.value
|
|
|
|
var time=''
|
|
|
|
if(this.switchTxt==true){
|
|
|
|
time='1'
|
|
|
|
}else{
|
|
|
|
time='2'
|
2024-06-05 19:14:51 +08:00
|
|
|
}
|
2024-08-28 16:51:26 +08:00
|
|
|
this.sfJdan(time)
|
|
|
|
|
|
|
|
},
|
|
|
|
sfJdan(time){//是否接单
|
|
|
|
var data={
|
|
|
|
flag:time,
|
2024-08-30 16:27:19 +08:00
|
|
|
artificerId:uni.getStorageSync('artificerId')
|
2024-08-28 16:51:26 +08:00
|
|
|
}
|
|
|
|
this.$Request.postT('/app/artificerTime/setArtificerAccept',data).then(res => {
|
|
|
|
if (res.code == 0) {
|
|
|
|
this.$queue.showToast('设置成功!')
|
2024-08-30 16:27:19 +08:00
|
|
|
this.getMsTime(this.timeList)
|
2024-08-28 16:51:26 +08:00
|
|
|
} else {
|
|
|
|
this.$queue.showToast(res.msg);
|
2024-06-05 19:14:51 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
2024-08-28 16:51:26 +08:00
|
|
|
getTime(time){
|
|
|
|
this.msList=time;
|
|
|
|
},
|
|
|
|
sub() {
|
|
|
|
this.saveMangShi();
|
|
|
|
// if (this.msList.length == 0) {
|
|
|
|
// if(this.yearsDate === ''){
|
|
|
|
// this.$queue.showToast('请先添加待选时间!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// uni.showModal({
|
|
|
|
// title: '温馨提示',
|
|
|
|
// content: '是否将待选区的时间设置为忙时?',
|
|
|
|
// showCancel: true,
|
|
|
|
// cancelText: '取消',
|
|
|
|
// confirmText: '确认',
|
|
|
|
// success: res => {
|
|
|
|
// if (res.confirm) {
|
|
|
|
// this.saveMangShi();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
},
|
2024-06-05 19:14:51 +08:00
|
|
|
//删除规格
|
|
|
|
bindupdata(index1, item) {
|
|
|
|
let over = false;
|
|
|
|
for (var i = 0; i < this.newmsList.length; i++) {
|
|
|
|
if (this.newmsList[i].artificerTime === item) {
|
|
|
|
if (this.newmsList[i].classify == 1) {
|
|
|
|
over = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!over) {
|
|
|
|
this.msList.splice(index1, 1)
|
|
|
|
} else {
|
2024-08-30 16:27:19 +08:00
|
|
|
ithis.$queue.showToast('当前时间已被用户下单,禁止删除!')
|
2024-06-05 19:14:51 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
saveMangShi() {
|
2024-08-30 16:27:19 +08:00
|
|
|
var time=[];
|
|
|
|
for(var i=0;i<this.timeData.length;i++){
|
|
|
|
time.push(
|
|
|
|
this.timeData[i].createTime+' '+this.timeData[i].artificerTime
|
|
|
|
)
|
|
|
|
}
|
2024-08-28 16:51:26 +08:00
|
|
|
var data={
|
|
|
|
idleTime:this.tomorrowTime+','+this.timeCurrent,
|
2024-08-30 16:27:19 +08:00
|
|
|
busyTime:time.toString(),
|
|
|
|
artificerId:uni.getStorageSync('artificerId')
|
2024-08-28 16:51:26 +08:00
|
|
|
}
|
2024-08-30 17:04:20 +08:00
|
|
|
if(this.selectDate=='明天'){
|
|
|
|
data.idleTime=(this.timeList+' '+this.starTime)+','+(dayAfterTomorrow().dayAfterTomorrow+' '+this.endTime);
|
|
|
|
}else if(this.selectDate=='后天'){
|
|
|
|
data.idleTime=(this.timeList+' '+this.starTime)+','+(dayAfterTomorrowD().dayAfterTomorrowD+' '+this.endTime);
|
|
|
|
}
|
2024-08-28 16:51:26 +08:00
|
|
|
this.$Request.postT('/app/artificerTime/setArtificerTime',data).then(res => {
|
2024-06-05 19:14:51 +08:00
|
|
|
if (res.code == 0) {
|
|
|
|
this.$queue.showToast('设置成功!')
|
2024-08-30 16:27:19 +08:00
|
|
|
this.getMsTime(this.timeList)
|
2024-06-05 19:14:51 +08:00
|
|
|
} else {
|
|
|
|
this.$queue.showToast(res.msg);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getMsTime(artificerDate) {
|
2024-08-30 16:27:19 +08:00
|
|
|
// this.yearsDate = artificerDate;
|
|
|
|
this.$Request.getT('/app/artificerTime/selectArtificerTimeByArtificerId?artificerId=' + uni.getStorageSync('artificerId') + '&artificerDate=' + artificerDate).then(res => {
|
|
|
|
if (res.code == 0) {
|
2024-08-30 16:33:02 +08:00
|
|
|
if(res.data!=''){
|
|
|
|
var data=[];
|
|
|
|
for(var i=0;i<res.data.length;i++){
|
|
|
|
data.push({
|
|
|
|
artificerTime: res.data[i].artificerTime,
|
|
|
|
isSelected: false,
|
|
|
|
disable:true,
|
|
|
|
title:'不可预约',
|
|
|
|
createTime:res.data[i].artificerDate,
|
|
|
|
})
|
2024-08-30 16:27:19 +08:00
|
|
|
}
|
2024-08-30 16:33:02 +08:00
|
|
|
this.today.forEach(item1 => {
|
|
|
|
let item2 = data.find(item => item.artificerTime == item1.artificerTime);
|
|
|
|
if(item2){
|
|
|
|
item1.isSelected=false;
|
|
|
|
item1.title='不可预约';
|
|
|
|
item1.huixian=false;
|
|
|
|
}else{
|
|
|
|
item1.isSelected=true
|
|
|
|
item1.title='可预约'
|
|
|
|
item1.huixian=true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-30 16:27:19 +08:00
|
|
|
var jintian=currentTime().date;//今天
|
|
|
|
var mingtian=tomorrow().tomorrow;//明天
|
|
|
|
var houtian=dayAfterTomorrow().dayAfterTomorrow;//后天
|
|
|
|
if (res.acceptOrders == 1) {
|
|
|
|
this.isTrue = true
|
|
|
|
} else if (res.acceptOrders == 2) {
|
|
|
|
this.isTrue = false
|
|
|
|
}
|
|
|
|
if(res.startTime){
|
|
|
|
this.starTime=res.startTime.slice(11,16);
|
|
|
|
this.tomorrowTime=jintian+' '+this.starTime;
|
|
|
|
}else{
|
|
|
|
// 获取当前时间
|
|
|
|
const now = new Date();
|
|
|
|
// 格式化时间为时分
|
|
|
|
const hours = now.getHours();
|
|
|
|
const minutes = now.getMinutes();
|
|
|
|
// 将分钟划分为半小时
|
|
|
|
let halfHour = false;
|
|
|
|
if (minutes >= 30) {
|
|
|
|
halfHour = true;
|
|
|
|
}
|
|
|
|
// 格式化输出
|
|
|
|
this.starTime = `${hours.toString().padStart(2, '0')}:${halfHour ? '30' : '00'}`;
|
|
|
|
this.tomorrowTime=jintian+' '+this.starTime;
|
|
|
|
}
|
|
|
|
this.endTime=res.endTime.slice(11,16);
|
|
|
|
}else {
|
|
|
|
this.isTrue = false
|
|
|
|
}
|
2024-06-05 19:14:51 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2024-08-28 16:51:26 +08:00
|
|
|
<style lang="scss" scoped>
|
2024-08-30 16:27:19 +08:00
|
|
|
.container-top span:nth-child(1){
|
|
|
|
font-size: 14px;
|
|
|
|
font-weight: bold;
|
|
|
|
margin-right: 5px;
|
2024-09-02 11:22:06 +08:00
|
|
|
margin-left: 20rpx;
|
2024-08-30 16:27:19 +08:00
|
|
|
}
|
|
|
|
.container-top span:nth-child(2){
|
|
|
|
font-size: 13px;
|
|
|
|
color: #ccc;
|
|
|
|
}
|
|
|
|
.container-top{
|
|
|
|
width:100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
background: #fff;
|
|
|
|
padding-top: 10px;
|
|
|
|
padding-left: 5px;
|
|
|
|
}
|
|
|
|
.active{
|
|
|
|
border: 1px solid #28ba92;
|
|
|
|
font-weight: bold;
|
|
|
|
color: rgb(40, 186, 146);
|
|
|
|
}
|
|
|
|
.disable{
|
|
|
|
border: 1px solid #EEEEEE;
|
|
|
|
background: #F1F3F6 !important;
|
|
|
|
color: #999;
|
|
|
|
}
|
|
|
|
/deep/.checkbox__inner{
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.all{
|
|
|
|
white-space: nowrap;
|
|
|
|
font-size: 10px;
|
|
|
|
padding-top: 5px;
|
|
|
|
}
|
|
|
|
.item-box{
|
|
|
|
width: 100%;
|
|
|
|
height: 50px;
|
|
|
|
padding: 0 21px;
|
|
|
|
background: #fff;
|
|
|
|
font-size: 13px;
|
|
|
|
border-radius: 4px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.item{
|
|
|
|
width: 25%;
|
|
|
|
padding: 0 4px;
|
2024-09-02 11:22:06 +08:00
|
|
|
margin: 6px 0;
|
2024-08-30 16:27:19 +08:00
|
|
|
}
|
|
|
|
.time-box{
|
|
|
|
width:100%;
|
|
|
|
padding: 13px 5px 12px;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
|
|
|
.flex-box .date-box{
|
|
|
|
border: none;
|
|
|
|
display: flex;
|
|
|
|
height: 50px;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-around;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #818181;
|
|
|
|
}
|
|
|
|
.flex-box{
|
|
|
|
display: inline-block;
|
|
|
|
height: 60px;
|
2024-09-02 11:22:06 +08:00
|
|
|
width: 33%;
|
2024-08-30 16:27:19 +08:00
|
|
|
margin: 0 3px 0 3px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
/deep/.uni-scroll-view-content{
|
|
|
|
display:flex;
|
|
|
|
}
|
|
|
|
/deep/.scroll-view_H{
|
|
|
|
width: 100%;
|
|
|
|
white-space: nowrap;
|
|
|
|
height: 75px;
|
|
|
|
background-color: #fff;
|
|
|
|
position: relative;
|
|
|
|
padding-top: 10px;
|
|
|
|
}
|
|
|
|
.borderb {
|
|
|
|
border-bottom: 2px solid rgb(40, 186, 146);
|
|
|
|
}
|
2024-08-28 16:51:26 +08:00
|
|
|
.selectTimt-time-title{
|
|
|
|
text-align: center;
|
|
|
|
margin-bottom: 5px;
|
|
|
|
}
|
|
|
|
/deep/.uni-input{
|
|
|
|
text-align: center;
|
|
|
|
color: #28BA92;
|
|
|
|
}
|
|
|
|
.selectTimt-time{
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.selectTimt-bottom{
|
|
|
|
margin-top:10px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-around;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.selectTimt{
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
width: 100%;
|
|
|
|
padding: 10px 5px;
|
|
|
|
background: #fff;
|
|
|
|
margin: 10px auto;
|
|
|
|
}
|
|
|
|
.dx_title{
|
|
|
|
font-size: 14px;
|
|
|
|
font-weight: bold;
|
2024-09-02 11:22:06 +08:00
|
|
|
margin-left:20rpx;
|
2024-08-28 16:51:26 +08:00
|
|
|
}
|
|
|
|
.switchTxt{
|
|
|
|
font-size: 13px;
|
|
|
|
font-weight: 400;
|
|
|
|
margin-left: 5px;
|
|
|
|
color: #28BA92;
|
|
|
|
}
|
|
|
|
.timeView-top{
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 100%;
|
|
|
|
padding: 10px 5px;
|
|
|
|
background: #fff;
|
|
|
|
margin: 10px auto;
|
|
|
|
}
|
2024-06-05 19:14:51 +08:00
|
|
|
page {
|
|
|
|
background: #f7f7f7;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dx_view {
|
|
|
|
background: #FFFFFF;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
padding: 20rpx 20rpx 40rpx;
|
|
|
|
width: 710rpx;
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
|
|
|
.dx_title {
|
|
|
|
font-size: 30rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.timeView {
|
|
|
|
display: flex;
|
|
|
|
width: 750rpx;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
.timeview_item {
|
|
|
|
background: #F7F7F7;
|
|
|
|
border-radius: 15rpx;
|
|
|
|
width: 120rpx;
|
|
|
|
height: 140rpx;
|
|
|
|
text-align: center;
|
|
|
|
padding-top: 14rpx;
|
|
|
|
margin: 20rpx 20rpx 20rpx 6rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.timeview_acitem {
|
|
|
|
width: 120rpx;
|
|
|
|
height: 140rpx;
|
|
|
|
text-align: center;
|
|
|
|
background: #E8F9EF;
|
|
|
|
border: 1px solid #00B88F;
|
|
|
|
color: #00B88F;
|
|
|
|
border-radius: 15rpx;
|
|
|
|
padding-top: 14rpx;
|
|
|
|
margin: 20rpx 20rpx 20rpx 6rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item_text {
|
|
|
|
width: 120rpx;
|
|
|
|
font-size: 22rpx;
|
|
|
|
font-family: PingFang SC;
|
|
|
|
font-weight: 500;
|
|
|
|
margin-top: 6rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
border: 1upx solid #CCCCCC;
|
|
|
|
border-radius: 28px;
|
|
|
|
padding: 15rpx 30rpx;
|
|
|
|
margin-right: 25rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btns {
|
|
|
|
border: 1upx dashed #333333;
|
|
|
|
border-radius: 28px;
|
|
|
|
padding: 10rpx 30rpx;
|
|
|
|
margin-right: 25rpx;
|
|
|
|
}
|
|
|
|
|
2024-08-30 16:27:19 +08:00
|
|
|
|
2024-06-05 19:14:51 +08:00
|
|
|
|
|
|
|
.topView {
|
|
|
|
width: 750rpx;
|
|
|
|
height: 180rpx;
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
|
|
|
.topview_item {
|
|
|
|
width: 160rpx;
|
|
|
|
height: 120rpx;
|
|
|
|
text-align: center;
|
|
|
|
padding-top: 14rpx;
|
|
|
|
margin: 0rpx 10rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.topview_acitem {
|
|
|
|
width: 160rpx;
|
|
|
|
height: 120rpx;
|
|
|
|
text-align: center;
|
|
|
|
background: #E8F9EF;
|
|
|
|
border: 1px solid #00B88F;
|
|
|
|
color: #00B88F;
|
|
|
|
border-radius: 20rpx;
|
|
|
|
padding-top: 14rpx;
|
|
|
|
margin: 0rpx 10rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item_text {
|
|
|
|
width: 160rpx;
|
|
|
|
font-size: 20rpx;
|
|
|
|
font-family: PingFang SC;
|
|
|
|
font-weight: bold;
|
|
|
|
margin-top: 6rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.sub {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
width: 696rpx;
|
|
|
|
height: 80rpx;
|
|
|
|
line-height: 80rpx;
|
|
|
|
border-radius: 50rpx;
|
2024-09-02 11:22:06 +08:00
|
|
|
margin: 20rpx auto 20rpx auto;
|
2024-06-05 19:14:51 +08:00
|
|
|
color: #FFFFFF;
|
|
|
|
font-size: 30rpx;
|
2024-06-28 11:08:20 +08:00
|
|
|
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
2024-06-05 19:14:51 +08:00
|
|
|
}
|
2024-09-02 11:22:06 +08:00
|
|
|
.push-button{
|
|
|
|
width: 100%;
|
|
|
|
height: 48px;
|
|
|
|
position: fixed;
|
|
|
|
bottom: 0px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0 auto;
|
|
|
|
}
|
|
|
|
.detail-btn{
|
|
|
|
display: inline-block;
|
|
|
|
width: 92%;
|
|
|
|
text-align: center;
|
|
|
|
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
|
|
|
height: 40px;
|
|
|
|
border-radius: 28px;
|
|
|
|
color: #ffffff;
|
|
|
|
line-height: 40px;
|
|
|
|
margin-top: 4px;
|
|
|
|
font-size: 34rpx;
|
|
|
|
}
|
2024-06-05 19:14:51 +08:00
|
|
|
</style>
|