|
@@ -9,7 +9,7 @@
|
|
|
:background="{background: '#008CFF' }"></u-navbar>
|
|
|
<view class="car-info u-flex">
|
|
|
<view class="car-info-img" @click="getPic">
|
|
|
- <u-image src="/static/img/default-car.png" width="100%" height="100%"></u-image>
|
|
|
+ <u-image :src="carImg" mode="aspectFit" width="100%" height="100%"></u-image>
|
|
|
</view>
|
|
|
<view class="car-info-text u-flex-1">
|
|
|
<view class="text-item position-wrap">
|
|
@@ -17,7 +17,7 @@
|
|
|
</view>
|
|
|
<view class="text-item u-flex u-flex u-row-between">
|
|
|
<view class="">车辆类型</view>
|
|
|
- <view class="" @click="carTypeShow = true">{{carType|filterCarType}}</view>
|
|
|
+ <view class="" @click="carTypeShow = true">{{vehicleType|filterCarType}}</view>
|
|
|
</view>
|
|
|
<view class="text-item u-flex u-flex u-row-between">
|
|
|
<view class="">余额:<span class="balance">{{balance||'暂无'}}</span></view>
|
|
@@ -33,12 +33,16 @@
|
|
|
<u-button type="primary" @click="handleParkInInfo">确认</u-button>
|
|
|
</view>
|
|
|
<view class="other-info-item">
|
|
|
- <u-input style="width: 100%;" v-model="deposit" height="80" type="text" placeholder="输入进场押金" />
|
|
|
+ <u-input style="width: 100%;" v-model="depositAmount" height="80" type="text" placeholder="输入进场押金" />
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
<view class="upload-wrap">
|
|
|
- <u-upload :action="upload" :file-list="fileList" upload-text="拍照取证" ></u-upload>
|
|
|
+ <u-upload
|
|
|
+ ref="uUpload"
|
|
|
+ :action="uploadAction"
|
|
|
+ :show-progress="false"
|
|
|
+ upload-text="拍照取证" ></u-upload>
|
|
|
</view>
|
|
|
|
|
|
|
|
@@ -49,15 +53,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <u-select v-model="carTypeShow" :default-value="[carType]" :list="carTypeList" @confirm="carTypeConfirm"></u-select>
|
|
|
+ <u-select v-model="carTypeShow" :default-value="[vehicleType]" :list="carTypeList" @confirm="carTypeConfirm"></u-select>
|
|
|
<u-toast ref="uToast" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { config } from '@/common/config.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ carImg:'/static/img/default-car.png',
|
|
|
+ uploadAction:config.baseUrl+'/file/qiniu/upload',
|
|
|
spaceId:'',
|
|
|
spaceName:'',
|
|
|
carTypeShow:false,
|
|
@@ -69,15 +76,15 @@
|
|
|
,{label: '非机动车',value:4}
|
|
|
,{label: '其他',value:5}
|
|
|
],
|
|
|
- carType:0,
|
|
|
- vehicleType:null,
|
|
|
+ vehicleType:0,
|
|
|
currentTime: new Date(), // 获取当前时间
|
|
|
vehicleNo:null,
|
|
|
vehicleColor:null,
|
|
|
vehicleImage:null,
|
|
|
- deposit:null,
|
|
|
+ memberId:null,
|
|
|
+ depositAmount:null,
|
|
|
balance:null,
|
|
|
- fileList:[]
|
|
|
+ images:[]
|
|
|
}
|
|
|
},
|
|
|
onLoad(page) {
|
|
@@ -110,29 +117,42 @@
|
|
|
this.vehicleType = e[0].value;
|
|
|
},
|
|
|
submit(){
|
|
|
+ let files = [];
|
|
|
+ let that = this;
|
|
|
+ // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
|
|
|
+ files = this.$refs.uUpload.lists.filter(val => {
|
|
|
+ return val.progress == 100;
|
|
|
+ });
|
|
|
+ // 如果不需要进行太多的处理,直接如下即可
|
|
|
+ // files = this.$refs.uUpload.lists;
|
|
|
+ files.forEach(function(element) {
|
|
|
+ that.images.push(element.response.data.url);
|
|
|
+ });
|
|
|
let param ={
|
|
|
spaceId:this.spaceId,
|
|
|
vehicleNo:this.vehicleNo,
|
|
|
vehicleColor:this.vehicleColor,
|
|
|
vehicleImage:this.vehicleImage,
|
|
|
vehicleType:this.vehicleType,
|
|
|
- deposit:this.deposit
|
|
|
+ memberId:this.memberId,
|
|
|
+ depositAmount:this.depositAmount,
|
|
|
+ images:this.images
|
|
|
};
|
|
|
- this.$u.api.parkInConfirm(param)
|
|
|
+ this.$u.api.entrance(param)
|
|
|
.then(res=>{
|
|
|
this.$refs.uToast.show({
|
|
|
title: res.msg,
|
|
|
type: 'success',
|
|
|
- url:'pages/getout/getout'
|
|
|
+ // url:'pages/getout/getout'
|
|
|
});
|
|
|
- console.log('parkInConfirm',res)
|
|
|
+ console.log('entrance',res)
|
|
|
}).catch(err=>{
|
|
|
this.$refs.uToast.show({
|
|
|
title: err.msg,
|
|
|
type: 'error',
|
|
|
// url:'pages/parking/parking'
|
|
|
});
|
|
|
- console.log('parkInConfirm ',err)
|
|
|
+ console.log('entrance ',err)
|
|
|
});
|
|
|
},
|
|
|
handleParkInInfo(){
|
|
@@ -147,8 +167,8 @@
|
|
|
type: 'success',
|
|
|
// url:'pages/getout/getout'
|
|
|
});
|
|
|
- this.vehicleType = res.data.vehicleType??"0";
|
|
|
- this.balance = res.data.balance;
|
|
|
+ this.vehicleType = res?.data?.vehicleType??"0";
|
|
|
+ this.balance = res?.data?.balance;
|
|
|
console.log('parkInInfo',res);
|
|
|
console.log('this.vehicleType',this.vehicleType)
|
|
|
}).catch(err=>{
|
|
@@ -167,7 +187,8 @@
|
|
|
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['camera'], //
|
|
|
success: function (res) {
|
|
|
- // console.log('img',res)
|
|
|
+ console.log('img',res)
|
|
|
+ that.carImg = res.tempFilePaths[0];
|
|
|
uni.showLoading({});
|
|
|
const tempFilePaths = res.tempFilePaths;
|
|
|
// 若多选,需循环调用uni.uploadFile ,因微信小程序只支持单文件上传
|
|
@@ -187,14 +208,14 @@
|
|
|
console.log(resobj);
|
|
|
that.vehicleNo = resobj.data.vehicleNo;
|
|
|
that.vehicleClor = resobj.data.vehicleClor;
|
|
|
+ that.vehicleImage = resobj.data.url;
|
|
|
}else{
|
|
|
that.$refs.uToast.show({
|
|
|
title: resobj.msg,
|
|
|
type: 'error'
|
|
|
});
|
|
|
- }
|
|
|
-
|
|
|
- console.log(res);
|
|
|
+ };
|
|
|
+ console.log('resobj',resobj);
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
that.$refs.uToast.show({
|
|
@@ -206,9 +227,6 @@
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- },
|
|
|
- upload(){
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|