|
@@ -67,12 +67,47 @@
|
|
|
<u-select v-model="carColorShow" :default-value="[2]" :list="carColorList" @confirm="carColorConfirm"></u-select>
|
|
|
<u-toast ref="uToast" />
|
|
|
<u-keyboard ref="uKeyboard" mode="car" @change="keyboardChange" @backspace="backspace" v-model="keyboardshow"></u-keyboard>
|
|
|
+ <u-popup class="popup-confirmTime" v-model="timeshow" :mask-close-able="false" mode="center" border-radius="20" width="90%" style="z-index: 99;">
|
|
|
+ <view class="popup-title">入场时间确认:</view>
|
|
|
+ <view class="popup-content">请在地磁时间和当前时间里选择一个来做为入场时间:</view>
|
|
|
+ <view class="popup-confirm u-flex">
|
|
|
+ <u-radio-group v-model="timevalue" @change="radioGroupChange" :wrap="true">
|
|
|
+ <u-radio
|
|
|
+ @change="radioChange"
|
|
|
+ v-for="(item, index) in timeList" :key="index"
|
|
|
+ :name="item.time"
|
|
|
+ :disabled="item.disabled"
|
|
|
+ >
|
|
|
+ <view class="popup-intime">
|
|
|
+ <view class="popup-intime-top" > {{item.name}}</view>
|
|
|
+ <!-- <view class="popup-intime-bottom" v-if="item.time !=0">{{item.time}}</view> -->
|
|
|
+ <picker class="openTime" mode="time" :value="time" start="09:01" end="21:01" @change="bindTimeChange">
|
|
|
+ <view class="popup-intime-bottom" v-if="index==1">{{item.time}}</view>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="pop-right"><u-button class="upset" size="mini" @click="upset()" v-if="index==0">修正</u-button></view> -->
|
|
|
+ </u-radio>
|
|
|
+ </u-radio-group>
|
|
|
+ </view>
|
|
|
+ <view class="button-wrap">
|
|
|
+ <u-button class="btn1" @click="timesubmit">确认</u-button>
|
|
|
+ <u-button class="btn2" @click="cancel">取消</u-button>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <!-- <u-popup class="timeopen" v-model="visible" mode="center" border-radius="20" width="90%"height="50%">
|
|
|
+ <picker class="openTime" mode="time" :value="time" start="09:01" end="21:01" @change="bindTimeChange">
|
|
|
+ <view class="uni-input">{{time}}</view>
|
|
|
+ </picker>
|
|
|
+ </u-popup> -->
|
|
|
+
|
|
|
+ <!-- <select-timer :visible="visible"></select-timer> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { config } from '@/common/config.js';
|
|
|
import { mydata } from '@/common/data.js';
|
|
|
+ import selectTimer from '../../components/select-timer/select-timer.vue';
|
|
|
console.log('mydata',mydata.carColorList)
|
|
|
//#ifdef APP-PLUS
|
|
|
import speak from '@/utils/speaks.js';
|
|
@@ -81,8 +116,13 @@
|
|
|
let ocr = uni.requireNativePlugin("OcrPlug");
|
|
|
//#endif
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ selectTimer
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ time: '12:01',
|
|
|
+ visible:false,
|
|
|
carImg:'',
|
|
|
uploadAction:config.baseUrl+'/file/tencent/upload',
|
|
|
spaceId:'',
|
|
@@ -101,6 +141,26 @@
|
|
|
balance:null,
|
|
|
images:[],
|
|
|
keyboardshow:false,
|
|
|
+ timeshow:false,
|
|
|
+ timevalue:'',
|
|
|
+ timechangeList:[],
|
|
|
+ timeList:[
|
|
|
+ {
|
|
|
+ name:'地磁时间',
|
|
|
+ disabled: false,
|
|
|
+ time:''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'当前时间',
|
|
|
+ disabled: false,
|
|
|
+ time:''
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ inTime:'',
|
|
|
+ confirmTime:'',
|
|
|
+ time:'',
|
|
|
+ placeStatus:'',
|
|
|
+ finialtime:''
|
|
|
}
|
|
|
},
|
|
|
onLoad(page) {
|
|
@@ -110,12 +170,67 @@
|
|
|
this.spaceName = page.spaceName;
|
|
|
this.roadNo = page.roadNo;
|
|
|
this.carImg = page.carImg;
|
|
|
- this.vehicleNo = page.vehicleNo
|
|
|
+ this.vehicleNo = page.vehicleNo;
|
|
|
+ this.inTime = page.inTime;
|
|
|
+ this.placeStatus=page.placeStatus;
|
|
|
},
|
|
|
onShow() {
|
|
|
-
|
|
|
+ this.timeList[1].time = this.getTimer();
|
|
|
+ // this.timeList[1].time=this.currentTime.getFullYear()+ '-' +(this.currentTime.getMonth()+1)+ '-' +this.currentTime.getDate()+ ' ' +this.finialtime+ ':'+"00";
|
|
|
+ setInterval( () => {
|
|
|
+ this.timeList[0].time = this.inTime;
|
|
|
+
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
methods:{
|
|
|
+ upset(){
|
|
|
+ this.visible=true;
|
|
|
+ },
|
|
|
+ bindTimeChange(e) {
|
|
|
+ this.finialtime = e.target.value;
|
|
|
+ console.log(this.finialtime)
|
|
|
+ this.timeList[1].time=this.getYMD()+ ' ' +this.finialtime+ ':'+"00";
|
|
|
+ console.log(this.timeList[0].time)
|
|
|
+ this.confirmTime=this.timeList[1].time
|
|
|
+ },
|
|
|
+ cancel(){
|
|
|
+ this.timeshow=false;
|
|
|
+ },
|
|
|
+ submit(){
|
|
|
+ this.time = this.confirmTime;
|
|
|
+ console.log(this.time)
|
|
|
+ this.timeshow=true;
|
|
|
+ },
|
|
|
+ radioGroupChange(){
|
|
|
+
|
|
|
+ },
|
|
|
+ getYMD(){
|
|
|
+ var time = new Date();
|
|
|
+ var y = time.getFullYear();
|
|
|
+ var mon = time.getMonth() + 1;
|
|
|
+ mon = mon <10 ? '0' + mon : mon;
|
|
|
+ var d = time.getDate();
|
|
|
+ d = d <10 ? '0' + d : d;
|
|
|
+ return y + '-' + mon + '-' + d ;
|
|
|
+ },
|
|
|
+ getTimer(){
|
|
|
+ var time = new Date();
|
|
|
+ var y = time.getFullYear();
|
|
|
+ var mon = time.getMonth() + 1;
|
|
|
+ mon = mon <10 ? '0' + mon : mon;
|
|
|
+ var d = time.getDate();
|
|
|
+ d = d <10 ? '0' + d : d;
|
|
|
+ var h = time.getHours();
|
|
|
+ h = h < 10 ? '0' + h : h;
|
|
|
+ var m = time.getMinutes();
|
|
|
+ m = m < 10 ? '0' + m : m;
|
|
|
+ var s = time.getSeconds();
|
|
|
+ s = s < 10 ? '0' + s : s;
|
|
|
+ return y + '-' + mon + '-' + d + ' ' + h + ':' + m + ':' + s;
|
|
|
+ },
|
|
|
+ radioChange(e) {
|
|
|
+ this.confirmTime = e;
|
|
|
+ },
|
|
|
customBack(){
|
|
|
this.$u.route({
|
|
|
// type:'switchTab',
|
|
@@ -138,7 +253,9 @@
|
|
|
console.log('e',e)
|
|
|
this.vehicleColor = e[0].value;
|
|
|
},
|
|
|
- submit(){
|
|
|
+ timesubmit(){
|
|
|
+ this.time = this.confirmTime;
|
|
|
+ console.log(this.time)
|
|
|
let files = [];
|
|
|
let that = this;
|
|
|
// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
|
|
@@ -158,9 +275,32 @@
|
|
|
vehicleType:this.vehicleType,
|
|
|
memberId:this.memberId,
|
|
|
depositAmount:this.depositAmount,
|
|
|
- images:this.images
|
|
|
+ images:this.images,
|
|
|
+ inTime:this.time
|
|
|
};
|
|
|
- this.$u.api.entrance(param)
|
|
|
+ if(this.placeStatus==1&&(this.vehicleNo=='')){
|
|
|
+ this.$u.api.parkInConfirm(param)//有车但是车牌为空
|
|
|
+ .then(res=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: res.msg,
|
|
|
+ type: 'success',
|
|
|
+ url:'pages/getout/getout'
|
|
|
+ });
|
|
|
+ //#ifdef APP-PLUS
|
|
|
+ device.print(res.data.print);
|
|
|
+ speak(res.data.speak);
|
|
|
+ //#endif
|
|
|
+ console.log('parkInConfirm',res)
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ // url:'pages/parking/parking'
|
|
|
+ });
|
|
|
+ console.log('parkInConfirm ',err)
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$u.api.entrance(param)//车位空闲调
|
|
|
.then(res=>{
|
|
|
this.$refs.uToast.show({
|
|
|
title: res.msg,
|
|
@@ -180,6 +320,8 @@
|
|
|
});
|
|
|
console.log('entrance ',err)
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
handleParkInInfo(){
|
|
|
let param ={
|