车牌号,订单

This commit is contained in:
DL
2024-01-02 19:31:49 +08:00
parent 2b29572ad5
commit 49c6c4db88
16 changed files with 323 additions and 243 deletions

View File

@@ -11,3 +11,13 @@ export const getMyCarAPI = () => request.get('car/user/center/getMyCar',{noAuth:
* 用户完整信息 /api/front/user/user/info
*/
export const getUserInfoAPI = () => request.get('user/user/info',{noAuth: true})
/**
* 获取用户手机号验证码 /api/front/user/phone/code
*/
export const getPhoneCodeAPI = (data) => request.post('user/phone/code',data)
/**
* 解绑 /api/front/car/user/center/unbind
*/
export const unbindCarAPI = (data) => request.post('car/user/center/unbind',data)

View File

@@ -9,3 +9,8 @@ export const getMineInfoAPI = () => request.get('user/info')
* 修改个人信息 /api/front/user/user/edit
*/
export const editUserAPI = (data) => request.post('user/user/edit',data)
/*
* 退出 /api/front/login/logout
*/
export const logoutAPI = () => request.get('login/logout')

View File

@@ -5,10 +5,6 @@ import request from "@/utils/request.js";
*/
export const getOrderListAPI = (params) => request.get('car/user/center/reservation/order/list',params,{noAuth: true})
// api/front/user/reservation/management/check/list
// export const getOrderListAPI = (params) => request.get('user/reservation/management/check/list',params,{noAuth: true})
/**
* 工单详情 /api/front/car/user/center/info
*/
@@ -25,8 +21,10 @@ export const cancelOrderAPI=(id)=>request.post(`car/user/center/cancel/reservati
*/
export const deleteOrderAPI=(id)=>request.post(`car/user/center/delete/reservation/order/${id}`,{noAuth:true})
/**
* 我的评价列表 /api/front/car/user/center/reply/list
*/
export const getReviewListAPI = (params) => request.get('car/user/center/reply/list',params,{noAuth: true})
/**
* 评价工单 /api/front/user/reservation/management/reply

View File

@@ -19,7 +19,6 @@ export const userBindAPI=(data)=>request.post('car/user/center/bind', data);
*/
export const dpListAPI = () => request.get('dp/company/listAll')
/**
* 用户实名添加 /api/front/certification/add
*/
@@ -28,4 +27,9 @@ export const certificationAPI=(data)=>request.post('certification/add', data);
/**
* 更具车牌号查询车辆详情 /api/front/car/user/center/getInfo
*/
export const getCarInfoAPI=(params)=>request.get('car/user/center/getInfo', params,{noAuth: true})
export const getCarInfoAPI=(params)=>request.get('car/user/center/getInfo', params,{noAuth: true})
/**
* 用户隐私协议 /api/front/agreement/userprivacyinfo
*/
export const userprivacyinfoAPI = () => request.get('agreement/userprivacyinfo')

View File

@@ -2,6 +2,7 @@ import Vue from 'vue'
import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import util from 'utils/util'
import './permission' // permission
import uView from '@/uni_modules/uview-ui'
import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin'
@@ -15,6 +16,7 @@ Vue.use(uView)
Vue.use(plugins)
Vue.config.productionTip = false
Vue.prototype.$util = util;
Vue.prototype.$store = store
Vue.prototype.$toast = toast
Vue.prototype.$confirm = showConfirm

View File

@@ -1,6 +1,6 @@
<template>
<view class="carinfo">
<view class="noneview" v-if="carInfo==null">
<view class="noneview" v-if="Object.keys(carInfo).length==0">
<view class="car_up">
<image class="up_img" src="@/static/images/images/car_car.png" mode=""></image>
<view class="up_txt">
@@ -11,12 +11,12 @@
<view class="car_btn" @click="toBindingPages"> 添加绑定 </view>
</view>
<!-- 判断是否有数据 公户车时才显示所属公司 私家车时才显示车主姓名 -->
<view class="showview">
<view class="showview" v-else>
<view class="contentview">
<view class="con_up"> 车辆信息 </view>
<view class="con_down">
<view class="down_l"> 姓名 </view>
<view class="down_r"> {{ userInfo.nikeName?userInfo.nikeName:'暂无'}} </view>
<view class="down_r"> {{ userInfo.nickname?userInfo.nickname:'暂无'}} </view>
</view>
<view class="con_down">
<view class="down_l"> 车型 </view>
@@ -74,9 +74,10 @@
methods:{
async getMyCar(){
const car= await getMyCarAPI()
console.log(car,'car');
console.log(car,'car-info');
this.carInfo=car.data
const user= await getUserInfoAPI()
console.log(user,'user-info');
this.userInfo=user.data
},
toBindingPages(){

View File

@@ -41,17 +41,17 @@
</view>
</view>
<view class="footview" v-if="userInfo.phone">
<view class="foot_up"> 已向您绑定的手机号
<view class="foot_up" v-if="isShow"> 已向您绑定的手机号
<text class="fu_txt">
{{userInfo.phone.toString().replace(/^(1[3-9][0-9])\d{4}(\d{4}$)/, '$1****$2') }}
</text> 发送验证码
</view>
<view class="foot_code">
<view class="u-demo-block__content" style="margin-top: 15px;">
<u-input placeholder="请输入验证码" border="none">
<u-input placeholder="请输入验证码" border="none" v-model="carData.captcha">
<template slot="suffix">
<u-code ref="uCode" @change="codeChange" seconds="10" changeText="X秒重新获取"></u-code>
<!-- <u-button @tap="getCode" :text="tips" type="success" size="mini"></u-button> -->
<u-code ref="uCode" @change="codeChange" seconds="60" changeText="X s" endText='重新获取验证码' @end="end"></u-code>
<!-- <u-button @tap="getCode">{{tips}}</u-button> -->
<view class="codebtn" @tap="getCode"> {{tips}} </view>
</template>
</u-input>
@@ -65,15 +65,19 @@
</template>
<script>
import { getMyCarAPI ,getUserInfoAPI } from '@/api/car'
import { getMyCarAPI ,getUserInfoAPI , unbindCarAPI , getPhoneCodeAPI } from '@/api/car'
export default {
data() {
return {
tips: '',
value: '',
codenum:null,
carInfo:{},
userInfo:{},
isShow:false,
carData:{
captcha: "",
phone: ""
},
timer:null
}
},
onShow() {
@@ -82,11 +86,12 @@
methods: {
async getMyCar(){
const car= await getMyCarAPI()
console.log(car,'car');
console.log(car,'car-unbind');
this.carInfo=car.data
const user= await getUserInfoAPI()
console.log(user,'userrrrrrrrrr');
console.log(user,'user-unbind');
this.userInfo=user.data
this.carData.phone=user.data.phone
},
// 手机号脱敏
// phoneHide(phone) {
@@ -96,38 +101,48 @@
// },
toUnbindPages() {
console.log('去解绑');
uni.navigateTo({
url: '/pages/car/unbindResult'
})
// console.log(this.carData,'去解绑');
if(this.carData.captcha){
unbindCarAPI(this.carData)
.then((res) => {
// console.log(res,'then-res-unbindCarAPI');
this.$toast(res.data)
uni.navigateTo({
url: '/pages/car/unbindResult'
})
})
.catch((err) => {
// console.log(err,'err-unbindCarAPI');
this.$toast(err)
});
}else{
this.$toast('请输入验证码')
}
},
codeChange(text) {
this.tips = text;
console.log(text,'texttttttttt');
console.log( text,'texttttttttt')
},
getCode() {
this.isShow=true
if (this.$refs.uCode.canGetCode) {
// 模拟请求验证码
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
// getPhoneCodeAPI()
this.timer=setTimeout(() => {
uni.hideLoading();
// 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送');
// 通知验证码组件内部开始倒计时
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
change(e) {
console.log('change', e);
end() {
clearTimeout(this.timer)
}
}
}
</script>

View File

@@ -40,7 +40,7 @@
<u-col span="6" textAlign='right'>
<!-- 判断 -->
<view class="redtxt"> {{item.id}} </view>
<!-- <view class="redtxt"> {{item.id}} </view> -->
<view class="redtxt" v-if="item.auditStatus===0 && item.isFinish===false"> 待受理 </view>
<view class="redtxt" v-if="item.auditStatus===1 && item.isFinish===false"> 已确认 </view>
<view class="redtxt" v-if="item.auditStatus===2 && item.isFinish===false"> 已驳回 </view>

View File

@@ -4,56 +4,58 @@
<!-- <view class="componview">
<image class="com_img" src="@/static/images/images/order_component.png" mode=""></image>
</view> -->
<view class="review_down">
<view class="review_down" v-for="item in reviewList" :key="item.id">
<view class="up_up">
工作人员服务态度很好维修的很仔细休息室很干净
</view>
<view class="up_centre">
<view class="up_cen_l"> 星桔EV(祥园路店) </view>
<view class="up_cen_r"> 常规保养 </view>
</view>
<view class="up_down">
<view class="up_down_l">
<u-rate :count="count" :value="value" active-color="#F68D1F" inactive-color="#E4E4E4" readonly :allowHalf='true'></u-rate>
<view class="l_score"> {{value}} </view>
</view>
<view class="up_down_r"> 2023-11-8 12:23:25 </view>
</view>
</view>
<view class="review_down">
<view class="up_up">
工作人员服务态度很好维修的很仔细休息室很干净维修的很仔细
<!-- 工作人员服务态度很好维修的很仔细休息室很干净维修的很仔细 -->
{{ item.comment }}
</view>
<!-- 判断是否有图 -->
<view class="review_img">
<view class="review_img" v-for="pic in item.pics" :key="pic">
<image class="re_img" :src="pic"></image>
<!-- <image class="re_img" src="@/static/images/images/order_two.png" mode=""></image>
<image class="re_img" src="@/static/images/images/order_one.png" mode=""></image>
<image class="re_img" src="@/static/images/images/order_two.png" mode=""></image>
<image class="re_img" src="@/static/images/images/order_one.png" mode=""></image>
<image class="re_img" src="@/static/images/images/order_two.png" mode=""></image>
<image class="re_img" src="@/static/images/images/order_two.png" mode=""></image> -->
</view>
<view class="up_centre">
<view class="up_cen_l"> 星桔EV(祥园路店) </view>
<view class="up_cen_r"> 常规保养 </view>
<view class="up_cen_l"> {{item.merName?item.merName:'暂无'}} </view>
<view class="up_cen_r">
{{ item.repairType==1?'常规保养':item.repairType==2?'故障维修'
:item.repairType==3?'事故维修':item.repairType==4?'退车':'暂无' }}
</view>
</view>
<view class="up_down">
<view class="up_down_l">
<u-rate :count="count" :value="value2" active-color="#F68D1F" inactive-color="#E4E4E4" readonly :allowHalf='true'></u-rate>
<u-rate :count="count" :value="item.star" active-color="#F68D1F" inactive-color="#E4E4E4" readonly :allowHalf='true'></u-rate>
<!-- <image class="re_img" src="@/static/images/images/order_greystar.png" mode=""></image> -->
<view class="l_score"> {{value2}} </view>
<view class="l_score"> {{ item.star }} </view>
</view>
<view class="up_down_r"> 2023-11-8 12:23:25 </view>
<view class="up_down_r"> {{ item.createTime ? item.createTime : '暂无' }} </view>
</view>
</view>
</view>
</template>
<script>
import { getReviewListAPI } from '@/api/order'
export default{
data(){
return{
count: 5,
value: 4.0,
value2: 4.5
reviewData:{
limit:20,
page:1,
},
reviewList:[]
}
},
onShow() {
this.getReviewList()
},
methods:{
async getReviewList(){
const review= await getReviewListAPI(this.reviewData)
console.log(review,'reviewList');
this.reviewList=review.data.list
}
}
}

View File

@@ -9,7 +9,7 @@
<view class="up_centre">
<view class="up_centre_l">
<text class="pingjia">评价 </text>
<u-rate :count="count" v-model="pushData.star" active-color="#F68D1F" inactive-color="#E4E4E4" :allowHalf='true'></u-rate>
<u-rate :count="5" v-model="pushData.star" active-color="#F68D1F" inactive-color="#E4E4E4" :allowHalf='true'></u-rate>
<view class="l_score" v-if="pushData.star"> {{pushData.star}} </view>
</view>
</view>
@@ -19,17 +19,16 @@
<view class="up_down">
<!-- <u-upload
:fileList="fileList"
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
name="3"
name="1"
multiple
:maxCount="10"
:previewFullImage="true"
uploadText='上传照片'
></u-upload> -->
<image-upload v-model="imageUrls" :uploadIcon='uploadIcon' :clearIcon='clearIcon'/>
<imageUpload v-model="value" :uploadIcon='uploadIcon' :clearIcon='clearIcon'/>
</view>
</view>
<view class="line_view"></view>
@@ -52,13 +51,10 @@
import imageUpload from '@/components/image-upload/image-upload.vue'
import { pushReviewAPI } from '@/api/order'
export default{
components: { 'image-upload':imageUpload },
components: { imageUpload },
data(){
return{
count:5,
fileList: [
{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg'},
],
fileList: [],
uploadIcon:'../../static/images/images/order_upLoadbg.png',
clearIcon:'../../static/images/images/order_close.png',
@@ -69,13 +65,13 @@
pics: [],
star: null
},
imageUrls:'',
value:'',
}
},
watch: {
imageUrls: {
value: {
handler(nV) {
// console.log(nV,'imageUrls')
// console.log(nV,'value')
this.pushData.pics.push(nV)
// console.log(this.pushData,'this.pushData');
},
@@ -87,6 +83,52 @@
this.orderObj=wx.getStorageSync('Obj')
},
methods:{
// 删
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 增
async afterRead(event) {
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data)
}, 1000)
}
});
})
},
// -----------------------------------------------
async reviewSubmit(){
// console.log(this.pushData,'pushData');
this.pushData.id=this.orderObj.id
@@ -157,6 +199,14 @@
.text_area{
margin-bottom: 56rpx;
}
.up_down{
width: 170rpx;
height: 170rpx;
.upload-bg{
width: 168rpx;
height: 168rpx;
}
}
}
.line_view{
height: 0rpx;

View File

@@ -53,7 +53,7 @@
</template>
<script>
import { getMineInfoAPI,editUserAPI } from '@/api/mine'
import { getMineInfoAPI , editUserAPI , logoutAPI } from '@/api/mine'
export default {
data() {
return {
@@ -88,9 +88,14 @@
this.formData=res.data
},
submit() {
uni.switchTab({
url: '/pages/home/index'
});
logoutAPI()
.then((res) => {
uni.switchTab({
url: '/pages/home/index'
});
}).catch((err)=>{
this.$toast(err)
})
},
clickname(){
this.isEditing = true;

View File

@@ -2,8 +2,10 @@
<view class="useragree">
<view class="title"> 用户协议</view>
<view class="content">
<rich-text :nodes="htmlContent" :decode='true'/>
<view class="h1title"> 1.一级标题 </view>
<view class="">
<!-- <view class="">
<view class="h2title"> 1.1 二级标题内容 </view>
<view class="contxt">
正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容
@@ -20,9 +22,9 @@
<view class="contxt">
正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容
</view>
</view>
</view> -->
</view>
<view class="content">
<!-- <view class="content">
<view class="h1title"> 2.一级标题 </view>
<view class="">
<view class="h2title"> 2.1 二级标题内容 </view>
@@ -42,19 +44,27 @@
正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容
</view>
</view>
</view>
</view> -->
</view>
</template>
<script>
import { userprivacyinfoAPI } from '@/api/user'
export default{
data(){
return{
htmlContent:''
}
},
onShow() {
this.userprivacyinfo()
},
methods:{
async userprivacyinfo(){
const res=await userprivacyinfoAPI()
this.htmlContent=res.data
console.log(res.data);
}
}
}
</script>

View File

@@ -13,20 +13,21 @@
</view>
<view class="contentview">
<u-cell-group :border="false">
<u-cell title="姓名" :value="formObj.realName?formObj.realName:'暂无'"></u-cell>
<u-cell title="姓名" :value="userInfo.nickname?userInfo.nickname:'暂无'"></u-cell>
<u-cell title="车型" :value="formObj.modelName?formObj.modelName:'暂无'"></u-cell>
<u-cell title="行驶证">
<!-- <u-icon slot="icon" size="26" name="file-text"></u-icon> -->
<view slot="right-icon">
<view class="conimg"><u-image :showLoading="true" :src="formObj.driveLicense" width="112rpx" height="112rpx"></u-image>
<view class="conimg">
<u-image :showLoading="true" :src="formObj.driveLicense" width="112rpx" height="112rpx"></u-image>
</view>
</view>
</u-cell>
<u-cell title="车牌号" :value="formObj.carNo?formObj.carNo:'暂无'"></u-cell>
<u-cell title="解绑日期" :value="formObj.unbindTime?formObj.unbindTime:'暂无'"></u-cell>
<u-cell title="车辆类型" :value="formObj.type==1?'预约出租客运':formObj.type==2?'非营运':formObj.type==3?'租赁':'暂无'"></u-cell>
<u-cell title="所属公司" :value="formObj.company?formObj.company:'暂无'"></u-cell>
<u-cell title="车主姓名" :value="formObj.ownerName?formObj.ownerName:'暂无'"></u-cell>
<u-cell title="所属公司" v-if="formObj.category==1" :value="formObj.company?formObj.company:'暂无'"></u-cell>
<u-cell title="车主姓名" v-if="formObj.category==2" :value="formObj.ownerName?formObj.ownerName:'暂无'"></u-cell>
<u-cell title="使用性质" :value="formObj.category==1?'公户车':formObj.category==2?'私家车':'暂无'"></u-cell>
</u-cell-group>
</view>
@@ -38,25 +39,35 @@
</template>
<script>
import { getMyCarAPI,getUserInfoAPI } from '@/api/car'
export default {
data() {
return {
// src: '../../static/user/user_car.png'
src: 'https://cdn.uviewui.com/uview/album/1.jpg',
formObj:{}
formObj:{},
userInfo:{}
}
},
created() {
this.getcarInfo()
onShow() {
// this.getcarInfo()
this.getMyCar()
},
methods: {
getcarInfo(){
// console.log(wx.getStorageSync('carInfo'));
// this.formObj=wx.getStorageSync('carInfo')
wx.getStorage({key:'carInfo',success:(res)=> {
this.formObj=res.data
}})
async getMyCar(){
const car= await getMyCarAPI()
console.log(car,'car-info');
this.formObj=car.data
const user= await getUserInfoAPI()
console.log(user,'user-info');
this.userInfo=user.data
},
// getcarInfo(){
// wx.getStorage({key:'carInfo',success:(res)=> {
// this.formObj=res.data
// console.log(res.data);
// }})
// },
toHomePage() {
uni.switchTab({
url: '/pages/home/index'

View File

@@ -35,10 +35,8 @@
<view class="content_foot">
<label>上传网约车资格证选填</label>
<view class="upload-box">
<!-- <u-upload @afterRead="afterRead" @delete="deletePic" :maxCount="10" :previewFullImage="true"
uploadText='上传照片'></u-upload> -->
<!-- <image-upload v-model="userInfo.qualificationImage" :uploadIcon='uploadIcon' :clearIcon='clearIcon' /> -->
<image-upload v-model="imageUrls" :uploadIcon='uploadIcon' :clearIcon='clearIcon'/>
<imageUpload v-model="imageUrls" :uploadIcon='uploadIcon' :clearIcon='clearIcon'/>
</view>
<!-- <u-button class="custom-style" @click="submit" shape="circle">提交</u-button> -->
</view>
@@ -50,12 +48,10 @@
import {certificationAPI} from '@/api/user'
import imageUpload from '@/components/image-upload/image-upload.vue'
export default {
components: { 'image-upload':imageUpload },
components: { imageUpload },
data() {
return {
isShow: true,
images: '',
showSex: false,
userInfo: {
id:null,
realName: '',
@@ -90,12 +86,6 @@
},
uploadIcon: '../../static/images/images/user_upload.png',
clearIcon: '../../static/images/images/user_clear.png',
customStyle: {
width: '702rpx',
height: '96rpx',
background: '#84D2CF',
opacity: '1'
},
imageUrls:'',
}
},

View File

@@ -10,23 +10,23 @@
<view class="form-box">
<u-form labelPosition="left" :model="formData" ref="uForm" label-width='190rpx'>
<u-form-item label="车牌号码" border-bottom='true'>
<!-- <u-code-input v-model="codeValue"></u-code-input> -->
<!-- <u-input v-model="formData.carNo" border="none" inputAlign='right'></u-input> -->
<view class="fcar_letter">
<view class="f_car_num" @click="keyboardShow=true">
<view class="fcn_l"> {{area}} </view>
<view class="fcn_l"> {{ formData.carNo.charAt(0) }} </view>
<view class="fcn_r">
<image class="fcn_r_img" src="@/static/images/images/user_down.png" mode=""></image>
</view>
</view>
<view class="letter_number">
<view class="ln_one" @click="keyboardShow1=true"> {{area1}} </view>
<view class="ln_point"> {{drop}} </view>
<view class="ln_one" @click="keyboardShow2=true"> {{area2}} </view>
<view class="ln_one" @click="keyboardShow3=true"> {{area3}} </view>
<view class="ln_one" @click="keyboardShow4=true"> {{area4}} </view>
<view class="ln_one" @click="keyboardShow5=true"> {{area5}} </view>
<view class="ln_one" @click="keyboardShow6=true"> {{area6}} </view>
<!-- <u-code-input v-model="area1" :maxlength="6" :size='30' :space='8'></u-code-input> -->
<view class="ln_one"> {{ formData.carNo.charAt(1) }} </view>
<view class="ln_point"> {{ formData.carNo.charAt(2) }} </view>
<view class="ln_one"> {{ formData.carNo.charAt(3) }} </view>
<view class="ln_one"> {{ formData.carNo.charAt(4) }} </view>
<view class="ln_one"> {{ formData.carNo.charAt(5) }} </view>
<view class="ln_one"> {{ formData.carNo.charAt(6) }} </view>
<view class="ln_one"> {{ formData.carNo.charAt(7) }} </view>
</view>
</view>
</u-form-item>
@@ -64,7 +64,8 @@
</u-form-item>
<u-form-item label="上传行驶证" border-bottom='true'>
<view class="lr">
<u-image width="80" height="80" :src="carInfo.driveLicense"></u-image>
<u-image v-if="carInfo.driveLicense" width="60" height="60" :src="carInfo.driveLicense"></u-image>
<image v-else style="width: 112rpx; height: 112rpx;" src="../../static/images/images/user_travel.png" mode=""></image>
</view>
</u-form-item>
<u-form-item label="解绑日期" border-bottom='true'>
@@ -97,27 +98,11 @@
</view>
<u-button @click="submit" :color='isFormDataEmpty ?"#84D2CF":"#13AFA8"' shape="circle">提交</u-button>
<!-- 车牌号 -->
<u-keyboard mode="car" @change="keyboardChange" @confirm='keyboardConfirmBtn' @cancel="keyboardShow=false" :show="keyboardShow"
:showCancel='false' :showConfirm='false'
></u-keyboard>
<u-keyboard mode="car" @change="keyboardChange1" @confirm='keyboardConfirmBtn1' @cancel="keyboardShow1=false" :show="keyboardShow1"
:showCancel='false' :showConfirm='false'
></u-keyboard>
<u-keyboard mode="car" @change="keyboardChange2" @confirm='keyboardConfirmBtn2' @cancel="keyboardShow2=false" :show="keyboardShow2"
:showCancel='false' :showConfirm='false'
></u-keyboard>
<u-keyboard mode="car" @change="keyboardChange3" @confirm='keyboardConfirmBtn3' @cancel="keyboardShow3=false" :show="keyboardShow3"
:showCancel='false' :showConfirm='false'
></u-keyboard>
<u-keyboard mode="car" @change="keyboardChange4" @confirm='keyboardConfirmBtn4' @cancel="keyboardShow4=false" :show="keyboardShow4"
:showCancel='false' :showConfirm='false'
></u-keyboard>
<u-keyboard mode="car" @change="keyboardChange5" @confirm='keyboardConfirmBtn5' @cancel="keyboardShow5=false" :show="keyboardShow5"
:showCancel='false' :showConfirm='false'
></u-keyboard>
<u-keyboard mode="car" @change="keyboardChange6" @confirm='keyboardConfirmBtn6' @cancel="keyboardShow6=false" :show="keyboardShow6"
:showCancel='false' :showConfirm='false'
<u-keyboard mode="car" @change="keyboardChange" @confirm='keyboardConfirmBtn'
:show="keyboardShow" @backspace="backspace" safeAreaInsetBottom autoChange @cancel="cancel" @close="carClose"
></u-keyboard>
<!-- :showCancel='false' :showConfirm='false' -->
<!-- 日期 -->
<!-- <u-datetime-picker ref="datetimePicker" :show="datetimeShow" v-model="datetimeValue" mode="date" title='请选择'
:formatter="formatter" @change="datetimeChange" @confirm='datetimeConfirmBtn'
@@ -145,35 +130,11 @@
data() {
return {
top_bgImg: '../../../static/images/images/user_bgr.png',
imageUrls: '',
uploadIcon: '../../static/images/images/user_travel.png',
codeValue: '',
keyboardValue: '',
imageUrls: '',
keyboardShow: false,
keyboardShow1: false,
keyboardShow2: false,
keyboardShow3: false,
keyboardShow4: false,
keyboardShow5: false,
keyboardShow6: false,
area:'',
area1:'',
area2:'',
area3:'',
area4:'',
area5:'',
area6:'',
drop:'·',
letter:{
one:'',
two:'',
three:'',
four:'',
five:'',
six:'',
seven:'',
},
datetimeShow: false,
datetimeValue: Number(new Date()),
alltime:'',
@@ -204,9 +165,7 @@
{id:3,label:'租赁'},
]
],
uploadFileList: [],
isShow: true,
images: '',
formData: {
carNo: "",
category: null,
@@ -216,7 +175,6 @@
type: null,
unbindTime: ""
},
carNo:'',
carInfo:{},
rules: {
'formData.ownerName': {
@@ -273,7 +231,18 @@
onShow() {
this.getdpList()
},
watch:{
// formData:{
// handler(val){
// console.log(val.carNo,'valllllllllllll');
// const a=val.carNo.charAt(val.carNo.length-1)
// console.log(a,'最后一个');
// },
// deep:true
// }
},
methods: {
// 获取 dp 公司
async getdpList(){
const dp=await dpListAPI()
// console.log(dp,'dpppppp');
@@ -308,70 +277,70 @@
wx.setStorage({key:'carInfo',data:this.carInfo})
},
// 按键被点击
keyboardChange(val) {
console.log(val,'keyboardChange');
this.area = val
this.carNo = val
cancel() {
this.carClose()
},
carClose() {
this.keyboardShow = false
},
keyboardChange1(val) {
this.area1=val
this.carNo = this.carNo+val+this.drop
this.keyboardShow1 = false
},keyboardChange2(val) {
this.area2=val
this.carNo += val
this.keyboardShow2 = false
},keyboardChange3(val) {
this.area3=val
this.carNo += val
this.keyboardShow3 = false
},keyboardChange4(val) {
this.area4=val
this.carNo += val
this.keyboardShow4 = false
},keyboardChange5(val) {
this.area5=val
this.carNo += val
this.keyboardShow5 = false
},async keyboardChange6(val) {
this.area6=val
this.formData.carNo = this.carNo+val
this.keyboardShow6 = false
console.log(this.formData,'this.formData');
const carIn=await getCarInfoAPI({carNo:this.formData.carNo})
this.carInfo=carIn.data
console.log(carIn,' this.carInfo');
// 点击确认
keyboardConfirmBtn() {
// console.log(this.formData,'this.formData');
// console.log(this.formData.carNo,'this.formData');
getCarInfoAPI({carNo: this.formData.carNo}).then(res => {
// console.log(res);
if(res.data) this.carInfo=res.data
else this.$u.toast('车辆信息不存在')
}).finally(() => {
this.keyboardShow = false
this.$store.dispatch('CarNo', this.formData.carNo)
})
},
// 键盘确认
// keyboardConfirmBtn() {
// this.carNo = this.area
// this.keyboardShow = false
// },keyboardConfirmBtn1() {
// this.carNo += this.area1
// this.keyboardShow1 = false
// },keyboardConfirmBtn2() {
// this.carNo += this.area2
// this.keyboardShow2 = false
// },keyboardConfirmBtn3() {
// this.carNo += this.area3
// this.keyboardShow3 = false
// },keyboardConfirmBtn4() {
// this.carNo += this.area4
// this.keyboardShow4 = false
// },keyboardConfirmBtn5() {
// this.carNo += this.area5
// this.keyboardShow5 = false
// },keyboardConfirmBtn6() {
// this.formData.carNo = this.carNo+this.area6
// this.keyboardShow6 = false
// },
// 退格键被点击
// backspace() {
// if (this.keyboardValue.length) this.keyboardValue = this.keyboardValue.substr(0, this.keyboardValue
// .length - 1)
// },
// 退格
backspace() {
if(this.formData.carNo) this.formData.carNo = this.formData.carNo.substring(0, this.formData.carNo.length-1)
},
// 车牌格式 按键被点击
keyboardChange(e) {
// console.log(e,'keyboardChange-eeeeeee');
let a = this.checkType(e);
// console.log(a,'aaaaaaaaaaaa');
if(a == 1) {
if(this.formData.carNo) {
this.formData.carNo = this.replaceStr(this.formData.carNo, 0, e)
} else {
this.formData.carNo = e
}
} else {
if(this.formData.carNo.length == 2) {
this.formData.carNo += ('·' + e)
} else {
this.formData.carNo += e
}
}
},
// 根据下标替换字符串
replaceStr (str, index, char) {
// console.log(str, index, char,'----str, index, char----');
const strAry = str.split('');
strAry[index] = char;
return strAry.join('');
},
checkType(str) {
// console.log(str,'type----str');
if(/^[\u4e00-\u9fa5]+$/.test(str)) {
// 中文
return 1
} else if (/^[0-9]+$/.test(str)) {
// 数字
return 2
} else if (/^[a-zA-Z]+$/.test(str)){
// 字母
return 3
}
},
// 日期
formatter(type, datetimeValue) {
if (type === 'year') {

View File

@@ -6,22 +6,26 @@ const tools = {
checkIds: uni.getStorageSync('vuex_checkIds') || [],
orderIds: uni.getStorageSync('vuex_orderIds') || [],
citySave: '',
homenum:null
homenum:null,
carNo:''
},
mutations: {
SET_CHECKIDS: (state, id) => {
if(id) {
state.checkIds.push(id)
uni.setStorageSync('vuex_checkIds', state.checkIds)
} else {
state.checkIds = []
uni.setStorageSync('vuex_checkIds', [])
}
if(id) {
state.checkIds.push(id)
uni.setStorageSync('vuex_checkIds', state.checkIds)
} else {
state.checkIds = []
uni.setStorageSync('vuex_checkIds', [])
}
},
SET_CITY: (state, city) => {
state.citySave = city
},
SET_CARNO: (state, carNo) => {
state.carNo = carNo
},
SET_HOMENUM: (state, num) => {
state.homenum = num
},
@@ -48,6 +52,10 @@ const tools = {
SetCity({ commit }, city) {
console.log('vuex', city);
commit('SET_CITY', city)
},
CarNo({ commit }, carNo) {
console.log('vuex', carNo);
commit('SET_CARNO', carNo)
},
HomeNum({ commit }, num) {
console.log('vuex', num);