|
@@ -1,7 +1,39 @@
|
|
<template>
|
|
<template>
|
|
<view class="content">
|
|
<view class="content">
|
|
<view class='content1'>
|
|
<view class='content1'>
|
|
-
|
|
|
|
|
|
+ <view style='padding:5px 0 10px;border-bottom:1px solid #eee;' class="flex width100">
|
|
|
|
+ <view style='width:100px;font-size:14px;'>姓名</view>
|
|
|
|
+ <view class="flex">
|
|
|
|
+ <u--input @input='nameinput' placeholder="输入姓名" inputAlign='left' border="none" v-model="dataDetails.name">
|
|
|
|
+ </u--input>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view style='padding:10px 0 5px;border-bottom:1px solid #eee;' class="flex width100">
|
|
|
|
+ <view style='width:100px;font-size:14px;'>联系电话</view>
|
|
|
|
+ <view class="flex">
|
|
|
|
+ <u--input disabledColor='#fff' disabled placeholder="输入联系电话" inputAlign='left' border="none"
|
|
|
|
+ v-model="dataDetails.phone">
|
|
|
|
+ </u--input>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex row" style='padding:10px 0 5px;border-bottom:1px solid #eee;'>
|
|
|
|
+ <view style='width:100px;font-size:14px;'>性别</view>
|
|
|
|
+ <u-radio-group v-model="dataDetails.sex" placement="row">
|
|
|
|
+ <u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
|
|
|
|
+ :label="item.name" :name="item.name" @change="radioChange">
|
|
|
|
+ </u-radio>
|
|
|
|
+ </u-radio-group>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex row row-ch" style='padding:10px 0 5px;'>
|
|
|
|
+ <view style='width:100px;font-size:14px;'>称呼</view>
|
|
|
|
+ <u--input placeholder="输入姓氏" class="ch-style" inputAlign='left' border="none"
|
|
|
|
+ v-model="dataDetails.call">
|
|
|
|
+ </u--input>
|
|
|
|
+ <view class="flex align-center" v-if="dataDetails.sex=='男'">先生</view>
|
|
|
|
+ <view class="flex align-center" v-else>女士</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="content2 content-other">
|
|
<view class="title">上传身份证人像面</view>
|
|
<view class="title">上传身份证人像面</view>
|
|
<view @click.stop="uploadImg(1,index)" class="picture picture1" v-if="!dataDetails.cardAddressUrl">
|
|
<view @click.stop="uploadImg(1,index)" class="picture picture1" v-if="!dataDetails.cardAddressUrl">
|
|
<image class="xj-image" src="@/static/mine/ic_shanchuan@2x.png"></image>
|
|
<image class="xj-image" src="@/static/mine/ic_shanchuan@2x.png"></image>
|
|
@@ -31,44 +63,10 @@
|
|
|
|
|
|
<image class="" :src="dataDetails.cardBackAddressUrl" mode="aspectFit"></image>
|
|
<image class="" :src="dataDetails.cardBackAddressUrl" mode="aspectFit"></image>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="content2 content-other">
|
|
|
|
- <view style='padding:5px 0 10px;border-bottom:1px solid #eee;' class="flex width100">
|
|
|
|
- <view style='width:100px;font-size:14px;'>姓名</view>
|
|
|
|
- <view class="flex">
|
|
|
|
- <u--input @input='nameinput' placeholder="输入姓名" inputAlign='left' border="none"
|
|
|
|
- v-model="dataDetails.name">
|
|
|
|
- </u--input>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view style='padding:10px 0 5px;border-bottom:1px solid #eee;' class="flex width100">
|
|
|
|
- <view style='width:100px;font-size:14px;'>联系电话</view>
|
|
|
|
- <view class="flex">
|
|
|
|
- <u--input disabledColor='#fff' disabled placeholder="输入联系电话" inputAlign='left' border="none"
|
|
|
|
- v-model="dataDetails.phone">
|
|
|
|
- </u--input>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="flex row" style='padding:10px 0 5px;border-bottom:1px solid #eee;'>
|
|
|
|
- <view style='width:100px;font-size:14px;'>性别</view>
|
|
|
|
- <u-radio-group v-model="dataDetails.sex" placement="row">
|
|
|
|
- <u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
|
|
|
|
- :label="item.name" :name="item.name" @change="radioChange">
|
|
|
|
- </u-radio>
|
|
|
|
- </u-radio-group>
|
|
|
|
- </view>
|
|
|
|
- <view class="flex row row-ch" style='padding:10px 0 5px;'>
|
|
|
|
- <view style='width:100px;font-size:14px;'>称呼</view>
|
|
|
|
- <u--input placeholder="输入姓氏" class="ch-style" inputAlign='left' border="none"
|
|
|
|
- v-model="dataDetails.call">
|
|
|
|
- </u--input>
|
|
|
|
- <view class="flex align-center">{{sexText}}</view>
|
|
|
|
- </view>
|
|
|
|
|
|
|
|
<view class="flex row">
|
|
<view class="flex row">
|
|
<view class="left-text">身份证号</view>
|
|
<view class="left-text">身份证号</view>
|
|
- <u--input :disabled='dataDetails.id' placeholder="请输入身份证号" inputAlign='left' border="none"
|
|
|
|
- v-model="dataDetails.cardNumber">
|
|
|
|
|
|
+ <u--input :disabled='dataDetails.id' placeholder="请输入身份证号" inputAlign='left' border="none" v-model="dataDetails.cardNumber">
|
|
</u--input>
|
|
</u--input>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -112,7 +110,6 @@
|
|
@select="imgTypeSelect" @cancel='isShowimgType=false' :closeOnClickOverlay="true" :closeOnClickAction="true"
|
|
@select="imgTypeSelect" @cancel='isShowimgType=false' :closeOnClickOverlay="true" :closeOnClickAction="true"
|
|
@close="isShowimgType=false">
|
|
@close="isShowimgType=false">
|
|
</u-action-sheet>
|
|
</u-action-sheet>
|
|
- <u-toast ref="uToast"></u-toast>
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -139,7 +136,6 @@
|
|
disabled: false
|
|
disabled: false
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- sexText: "先生",
|
|
|
|
uploadType: '',
|
|
uploadType: '',
|
|
isShowimgType: false,
|
|
isShowimgType: false,
|
|
dataDetails: {
|
|
dataDetails: {
|
|
@@ -150,8 +146,7 @@
|
|
cardAddressUrl: '',
|
|
cardAddressUrl: '',
|
|
cardBackAddressUrl: '',
|
|
cardBackAddressUrl: '',
|
|
cardValidityDate: '',
|
|
cardValidityDate: '',
|
|
- driverSex: '男',
|
|
|
|
- sex: ''
|
|
|
|
|
|
+ driverSex: '男'
|
|
},
|
|
},
|
|
checked: false,
|
|
checked: false,
|
|
isShowcardValidity: false,
|
|
isShowcardValidity: false,
|
|
@@ -172,17 +167,13 @@
|
|
...mapState(['hasLogin', 'userInfo']),
|
|
...mapState(['hasLogin', 'userInfo']),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- nameinput() {
|
|
|
|
- this.dataDetails.call = this.dataDetails.name[0]
|
|
|
|
|
|
+ nameinput(){
|
|
|
|
+ this.dataDetails.call=this.dataDetails.name[0]
|
|
},
|
|
},
|
|
// 性别切换
|
|
// 性别切换
|
|
radioChange(n) {
|
|
radioChange(n) {
|
|
|
|
+ console.log('radioChange', n);
|
|
this.dataDetails.sex = n
|
|
this.dataDetails.sex = n
|
|
- if (n == "男") {
|
|
|
|
- this.sexText = "先生"
|
|
|
|
- } else {
|
|
|
|
- this.sexText = "女士"
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
consent() {
|
|
consent() {
|
|
this.checked = !this.checked
|
|
this.checked = !this.checked
|
|
@@ -192,6 +183,8 @@
|
|
},
|
|
},
|
|
//设置图片
|
|
//设置图片
|
|
setImage(e) {
|
|
setImage(e) {
|
|
|
|
+ //
|
|
|
|
+ console.log(e);
|
|
//显示在页面
|
|
//显示在页面
|
|
//this.imagesrc = e.path;
|
|
//this.imagesrc = e.path;
|
|
if (e.dotype == 'idphoto') {
|
|
if (e.dotype == 'idphoto') {
|
|
@@ -206,7 +199,7 @@
|
|
savePhoto(path) {
|
|
savePhoto(path) {
|
|
//
|
|
//
|
|
this.imagesrc = path;
|
|
this.imagesrc = path;
|
|
- uploadImage('image', path, 'appData/',
|
|
|
|
|
|
+ uploadImage(path, 'appData/',
|
|
result => {
|
|
result => {
|
|
// 上传成功
|
|
// 上传成功
|
|
console.log('图片地址', result)
|
|
console.log('图片地址', result)
|
|
@@ -245,6 +238,7 @@
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
confirmValidityPeriod(e) {
|
|
confirmValidityPeriod(e) {
|
|
|
|
+ console.log('confirm', e)
|
|
if (e.value[0] == '长期') {
|
|
if (e.value[0] == '长期') {
|
|
this.dataDetails.cardValidityDate = e.value[0]
|
|
this.dataDetails.cardValidityDate = e.value[0]
|
|
} else {
|
|
} else {
|
|
@@ -255,8 +249,10 @@
|
|
},
|
|
},
|
|
uploadImg(type, index) {
|
|
uploadImg(type, index) {
|
|
this.uploadType = type
|
|
this.uploadType = type
|
|
- this.isShowimgType = true
|
|
|
|
this.index = index
|
|
this.index = index
|
|
|
|
+ this.imgTypeSelect()
|
|
|
|
+ // this.isShowimgType = true
|
|
|
|
+
|
|
},
|
|
},
|
|
validate() {
|
|
validate() {
|
|
if (uni.$u.test.isEmpty(this.dataDetails.name)) {
|
|
if (uni.$u.test.isEmpty(this.dataDetails.name)) {
|
|
@@ -266,14 +262,14 @@
|
|
})
|
|
})
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
- if (this.dataDetails.name.length < 2 || this.dataDetails.name.length > 10) {
|
|
|
|
|
|
+ if (this.dataDetails.name.length<2||this.dataDetails.name.length<10) {
|
|
this.$refs.uToast.show({
|
|
this.$refs.uToast.show({
|
|
type: 'error',
|
|
type: 'error',
|
|
message: "姓名输入错误!",
|
|
message: "姓名输入错误!",
|
|
})
|
|
})
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
- if (this.dataDetails.call.length > 4) {
|
|
|
|
|
|
+ if (this.dataDetails.call.length<4) {
|
|
this.$refs.uToast.show({
|
|
this.$refs.uToast.show({
|
|
type: 'error',
|
|
type: 'error',
|
|
message: "称呼输入错误!",
|
|
message: "称呼输入错误!",
|
|
@@ -287,13 +283,20 @@
|
|
})
|
|
})
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
- if (this.dataDetails.cardNumber.length < 18) {
|
|
|
|
|
|
+ if (this.dataDetails.call.length<18) {
|
|
this.$refs.uToast.show({
|
|
this.$refs.uToast.show({
|
|
type: 'error',
|
|
type: 'error',
|
|
message: "身份证号输入错误!",
|
|
message: "身份证号输入错误!",
|
|
})
|
|
})
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
+ if(!this.checked){
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: "请勾选细则!",
|
|
|
|
+ })
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
if (this.validate()) return
|
|
if (this.validate()) return
|
|
@@ -305,10 +308,7 @@
|
|
this.$request.baseRequest('post', '/cargoOwnerInfo/api/editCargoOwner', _this.dataDetails).then(res => {
|
|
this.$request.baseRequest('post', '/cargoOwnerInfo/api/editCargoOwner', _this.dataDetails).then(res => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
uni.$u.toast('提交成功')
|
|
uni.$u.toast('提交成功')
|
|
- // uni.$u.route('/pages/mine/cargoowner/cargoowner')
|
|
|
|
- uni.navigateBack({
|
|
|
|
- delta: 1
|
|
|
|
- })
|
|
|
|
|
|
+ uni.$u.route('/pages/mine/cargoowner/cargoowner')
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
@@ -325,7 +325,8 @@
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
count: 1,
|
|
count: 1,
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- uploadImage('image', res.tempFilePaths[0], 'appData/',
|
|
|
|
|
|
+ console.log(JSON.stringify(res.tempFilePaths));
|
|
|
|
+ uploadImage(res.tempFilePaths[0], 'appData/',
|
|
result => {
|
|
result => {
|
|
// 上传成功
|
|
// 上传成功
|
|
console.log('图片地址', result)
|
|
console.log('图片地址', result)
|
|
@@ -338,17 +339,17 @@
|
|
|
|
|
|
imgTypeSelect(val) {
|
|
imgTypeSelect(val) {
|
|
let that = this
|
|
let that = this
|
|
- if (val.name == '相册') {
|
|
|
|
|
|
+ console.log(val)
|
|
|
|
+ console.log(this.uploadType)
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
count: 1,
|
|
count: 1,
|
|
- sourceType: this.$helper.chooseImage.sourceType,
|
|
|
|
success: function(res) {
|
|
success: function(res) {
|
|
console.log(JSON.stringify(res.tempFilePaths));
|
|
console.log(JSON.stringify(res.tempFilePaths));
|
|
- uploadImage('image', res.tempFilePaths[0], 'appData/',
|
|
|
|
|
|
+ uploadImage(res.tempFilePaths[0], 'appData/',
|
|
result => {
|
|
result => {
|
|
// 上传成功回调函数
|
|
// 上传成功回调函数
|
|
console.log('图片地址', result)
|
|
console.log('图片地址', result)
|
|
-
|
|
|
|
|
|
+
|
|
switch (that.uploadType) {
|
|
switch (that.uploadType) {
|
|
// 身份正面
|
|
// 身份正面
|
|
case 1:
|
|
case 1:
|
|
@@ -359,16 +360,6 @@
|
|
personImg: result,
|
|
personImg: result,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
that.dataDetails.cardNumber = res.data.recPersonNo
|
|
that.dataDetails.cardNumber = res.data.recPersonNo
|
|
- //性别设置默认
|
|
|
|
- let i = res.data.recPersonNo.substr(16, 1)
|
|
|
|
- if (i % 2 == 0) {
|
|
|
|
- that.dataDetails.sex = "女"
|
|
|
|
- that.sexText = "女士"
|
|
|
|
- } else {
|
|
|
|
- that.dataDetails.sex = "男"
|
|
|
|
- that.sexText = "先生"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (!that.dataDetails.name) {
|
|
if (!that.dataDetails.name) {
|
|
that.dataDetails.name = res.data.recPerson
|
|
that.dataDetails.name = res.data.recPerson
|
|
}
|
|
}
|
|
@@ -388,19 +379,15 @@
|
|
)
|
|
)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
- } else {
|
|
|
|
- switch (this.uploadType) {
|
|
|
|
- case 1:
|
|
|
|
- uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=idcardface');
|
|
|
|
- console.log('身份正面')
|
|
|
|
- break
|
|
|
|
- case 2:
|
|
|
|
- uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=badge');
|
|
|
|
- console.log('身份反面')
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // switch (this.uploadType) {
|
|
|
|
+ // case 1:
|
|
|
|
+ // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=idcardface');
|
|
|
|
+ // console.log('身份正面')
|
|
|
|
+ // break
|
|
|
|
+ // case 2:
|
|
|
|
+ // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=badge');
|
|
|
|
+ // console.log('身份反面')
|
|
|
|
+ // break
|
|
|
|
|
|
},
|
|
},
|
|
//身份证正面
|
|
//身份证正面
|
|
@@ -439,19 +426,15 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
- /deep/.content {
|
|
|
|
- margin-bottom: 160px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
// .preview-card-img {
|
|
// .preview-card-img {
|
|
// /deep/uni-image>div, uni-image>img {
|
|
// /deep/uni-image>div, uni-image>img {
|
|
// transform: scale(1.5) rotate(-90deg);
|
|
// transform: scale(1.5) rotate(-90deg);
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
- /deep/.uni-input-input:disabled {
|
|
|
|
- background: #fff;
|
|
|
|
|
|
+ /deep/.uni-input-input:disabled{
|
|
|
|
+ background:#fff;
|
|
}
|
|
}
|
|
-
|
|
|
|
.picture {
|
|
.picture {
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
background: #F5F6FA;
|
|
background: #F5F6FA;
|
|
@@ -470,7 +453,6 @@
|
|
margin: 20rpx;
|
|
margin: 20rpx;
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
-
|
|
|
|
.row-ch {
|
|
.row-ch {
|
|
padding-right: 180rpx;
|
|
padding-right: 180rpx;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
@@ -517,28 +499,40 @@
|
|
height: 80rpx;
|
|
height: 80rpx;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .picture {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 440rpx;
|
|
|
|
+ position: relative;
|
|
|
|
+ .text {
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ .picture1 {
|
|
|
|
+ background: url(../../../static/mine/zm.png);
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ }
|
|
|
|
|
|
- .picture {
|
|
|
|
- width: 100%;
|
|
|
|
- height: 440rpx;
|
|
|
|
- position: relative;
|
|
|
|
|
|
+ .picture2 {
|
|
|
|
+ background: url(../../../static/mine/gh.png);
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ }
|
|
|
|
|
|
- .text {
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
|
+ .picture3 {
|
|
|
|
+ background: url(../../../static/mine/yhkzm.png);
|
|
|
|
+ background-size: 100% 100%;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- .xj-image {
|
|
|
|
- width: 100rpx;
|
|
|
|
- height: 100rpx;
|
|
|
|
- }
|
|
|
|
|
|
+ .xj-image {
|
|
|
|
+ width: 100rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ }
|
|
|
|
|
|
- .title {
|
|
|
|
- color: #999999;
|
|
|
|
- margin: 20rpx 0;
|
|
|
|
- font-size: 14px;
|
|
|
|
|
|
+ .title {
|
|
|
|
+ color: #999999;
|
|
|
|
+ margin: 20rpx 0;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.u-input {
|
|
.u-input {
|
|
@@ -584,23 +578,7 @@
|
|
height: 80rpx;
|
|
height: 80rpx;
|
|
z-index: 9;
|
|
z-index: 9;
|
|
}
|
|
}
|
|
-
|
|
|
|
- .bz {
|
|
|
|
|
|
+ .bz{
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
}
|
|
}
|
|
-
|
|
|
|
- .picture1 {
|
|
|
|
- background: url(../../../static/mine/zm.png);
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .picture2 {
|
|
|
|
- background: url(../../../static/mine/gh.png);
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .picture3 {
|
|
|
|
- background: url(../../../static/mine/yhkzm.png);
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
- }
|
|
|
|
</style>
|
|
</style>
|