|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <!-- 个人资料 -->
|
|
|
|
|
|
+ <!-- 个人资料 -->
|
|
<view>
|
|
<view>
|
|
<form @submit="formSubmit">
|
|
<form @submit="formSubmit">
|
|
<view class='personal-data' :style="colorStyle">
|
|
<view class='personal-data' :style="colorStyle">
|
|
@@ -44,7 +44,8 @@
|
|
</view>
|
|
</view>
|
|
<view class='item acea-row row-between-wrapper'>
|
|
<view class='item acea-row row-between-wrapper'>
|
|
<view>昵称</view>
|
|
<view>昵称</view>
|
|
- <view class='input'><input type='nickname' name='nickname' :value='userInfo.nickname' maxlength="16"></input>
|
|
|
|
|
|
+ <view class='input'><input type='nickname' name='nickname' :value='userInfo.nickname'
|
|
|
|
+ maxlength="16"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class='item acea-row row-between-wrapper'>
|
|
<view class='item acea-row row-between-wrapper'>
|
|
@@ -65,19 +66,24 @@
|
|
<text class='iconfont icon-suozi'></text>
|
|
<text class='iconfont icon-suozi'></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class='item acea-row row-between-wrapper' v-for="(item,index) in userInfo.register_extend_info" :key="index">
|
|
|
|
- <view class="acea-row row-middle">{{item.info}}<text v-if="item.required==1" class="asterisk iconfont icon-xinghao"></text></view>
|
|
|
|
|
|
+ <view class='item acea-row row-between-wrapper'
|
|
|
|
+ v-for="(item,index) in userInfo.register_extend_info" :key="index">
|
|
|
|
+ <view class="acea-row row-middle">{{item.info}}<text v-if="item.required==1"
|
|
|
|
+ class="asterisk iconfont icon-xinghao"></text></view>
|
|
<!-- text -->
|
|
<!-- text -->
|
|
<view class='input' v-if="item.format == 'text'">
|
|
<view class='input' v-if="item.format == 'text'">
|
|
- <input type='text' v-model="item.value" :placeholder="item.tip" placeholder-class="placeholder"></input>
|
|
|
|
|
|
+ <input type='text' v-model="item.value" :placeholder="item.tip"
|
|
|
|
+ placeholder-class="placeholder"></input>
|
|
</view>
|
|
</view>
|
|
<!-- number -->
|
|
<!-- number -->
|
|
<view class='input' v-if="item.format == 'num'">
|
|
<view class='input' v-if="item.format == 'num'">
|
|
- <input type='number' v-model="item.value" :placeholder="item.tip" placeholder-class="placeholder"></input>
|
|
|
|
|
|
+ <input type='number' v-model="item.value" :placeholder="item.tip"
|
|
|
|
+ placeholder-class="placeholder"></input>
|
|
</view>
|
|
</view>
|
|
<!-- email -->
|
|
<!-- email -->
|
|
<view class='input' v-if="item.format == 'mail'">
|
|
<view class='input' v-if="item.format == 'mail'">
|
|
- <input type='text' v-model="item.value" :placeholder="item.tip" placeholder-class="placeholder"></input>
|
|
|
|
|
|
+ <input type='text' v-model="item.value" :placeholder="item.tip"
|
|
|
|
+ placeholder-class="placeholder"></input>
|
|
</view>
|
|
</view>
|
|
<!-- data -->
|
|
<!-- data -->
|
|
<view class="input acea-row row-middle row-right" v-if="item.format=='date'">
|
|
<view class="input acea-row row-middle row-right" v-if="item.format=='date'">
|
|
@@ -91,11 +97,13 @@
|
|
</view>
|
|
</view>
|
|
<!-- id -->
|
|
<!-- id -->
|
|
<view class='input' v-if="item.format == 'id'">
|
|
<view class='input' v-if="item.format == 'id'">
|
|
- <input type='idcard' v-model="item.value" :placeholder="item.tip" placeholder-class="placeholder"></input>
|
|
|
|
|
|
+ <input type='idcard' v-model="item.value" :placeholder="item.tip"
|
|
|
|
+ placeholder-class="placeholder"></input>
|
|
</view>
|
|
</view>
|
|
<!-- phone -->
|
|
<!-- phone -->
|
|
<view class='input' v-if="item.format == 'phone'">
|
|
<view class='input' v-if="item.format == 'phone'">
|
|
- <input type='tel' v-model="item.value" :placeholder="item.tip" placeholder-class="placeholder"></input>
|
|
|
|
|
|
+ <input type='tel' v-model="item.value" :placeholder="item.tip"
|
|
|
|
+ placeholder-class="placeholder"></input>
|
|
</view>
|
|
</view>
|
|
<!-- radio -->
|
|
<!-- radio -->
|
|
<view class="input" v-if="item.format=='radio'">
|
|
<view class="input" v-if="item.format=='radio'">
|
|
@@ -103,17 +111,18 @@
|
|
<label class="label" v-for="(j ,jindex) in item.singlearr" :key="jindex">
|
|
<label class="label" v-for="(j ,jindex) in item.singlearr" :key="jindex">
|
|
<!-- <radio :value="j" :checked="item.value == j" /> -->
|
|
<!-- <radio :value="j" :checked="item.value == j" /> -->
|
|
<!-- #ifndef MP -->
|
|
<!-- #ifndef MP -->
|
|
- <radio :value="jindex.toString()" :checked='item.value == jindex'/>
|
|
|
|
|
|
+ <radio :value="jindex.toString()" :checked='item.value == jindex' />
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
<!-- #ifdef MP -->
|
|
<!-- #ifdef MP -->
|
|
- <radio :value="jindex" :checked='item.value == jindex'/>
|
|
|
|
|
|
+ <radio :value="jindex" :checked='item.value == jindex' />
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
{{j}}
|
|
{{j}}
|
|
</label>
|
|
</label>
|
|
</radio-group>
|
|
</radio-group>
|
|
</view>
|
|
</view>
|
|
<!-- address -->
|
|
<!-- address -->
|
|
- <view class="input acea-row row-middle row-right" @click="addressList" v-if="item.format=='address'">
|
|
|
|
|
|
+ <view class="input acea-row row-middle row-right" @click="addressList"
|
|
|
|
+ v-if="item.format=='address'">
|
|
<!-- <picker mode="multiSelector" @change="bindRegionChange($event,index)"
|
|
<!-- <picker mode="multiSelector" @change="bindRegionChange($event,index)"
|
|
@columnchange="bindMultiPickerColumnChange" :value="valueRegion"
|
|
@columnchange="bindMultiPickerColumnChange" :value="valueRegion"
|
|
:range="multiArray">
|
|
:range="multiArray">
|
|
@@ -122,7 +131,8 @@
|
|
</view>
|
|
</view>
|
|
</picker>
|
|
</picker>
|
|
<text class='iconfont icon-xiangyou'></text> -->
|
|
<text class='iconfont icon-xiangyou'></text> -->
|
|
- <input type='text' v-model="item.value" :placeholder="item.tip" placeholder-class="placeholder"></input>
|
|
|
|
|
|
+ <input type='text' v-model="item.value" :placeholder="item.tip"
|
|
|
|
+ placeholder-class="placeholder"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -206,11 +216,11 @@
|
|
uni.removeStorageSync('form_type_cart');
|
|
uni.removeStorageSync('form_type_cart');
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getIsLogin(){
|
|
|
|
|
|
+ getIsLogin() {
|
|
toLogin()
|
|
toLogin()
|
|
},
|
|
},
|
|
// 省市区地址处理逻辑;
|
|
// 省市区地址处理逻辑;
|
|
- addressList(){
|
|
|
|
|
|
+ addressList() {
|
|
this.getCityList();
|
|
this.getCityList();
|
|
},
|
|
},
|
|
// 获取地址数据
|
|
// 获取地址数据
|
|
@@ -242,7 +252,7 @@
|
|
this.multiArray = [province, city, area]
|
|
this.multiArray = [province, city, area]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- bindRegionChange(e,index) {
|
|
|
|
|
|
+ bindRegionChange(e, index) {
|
|
let multiIndex = this.multiIndex,
|
|
let multiIndex = this.multiIndex,
|
|
province = this.district[multiIndex[0]] || {
|
|
province = this.district[multiIndex[0]] || {
|
|
c: []
|
|
c: []
|
|
@@ -252,7 +262,7 @@
|
|
},
|
|
},
|
|
multiArray = this.multiArray,
|
|
multiArray = this.multiArray,
|
|
value = e.detail.value;
|
|
value = e.detail.value;
|
|
-
|
|
|
|
|
|
+
|
|
this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
|
|
this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
|
|
this.userInfo.register_extend_info[index].value = city.v;
|
|
this.userInfo.register_extend_info[index].value = city.v;
|
|
this.userInfo.register_extend_info[index].province = this.region[0];
|
|
this.userInfo.register_extend_info[index].province = this.region[0];
|
|
@@ -302,7 +312,7 @@
|
|
// #endif
|
|
// #endif
|
|
this.multiIndex = multiIndex
|
|
this.multiIndex = multiIndex
|
|
},
|
|
},
|
|
- radioChange(e, index){
|
|
|
|
|
|
+ radioChange(e, index) {
|
|
this.userInfo.register_extend_info[index].value = e.detail.value
|
|
this.userInfo.register_extend_info[index].value = e.detail.value
|
|
},
|
|
},
|
|
bindDateChange: function(e, index) {
|
|
bindDateChange: function(e, index) {
|
|
@@ -394,23 +404,23 @@
|
|
getUserInfo: function() {
|
|
getUserInfo: function() {
|
|
let that = this;
|
|
let that = this;
|
|
getUserInfo().then(res => {
|
|
getUserInfo().then(res => {
|
|
- res.data.register_extend_info.forEach(item=>{
|
|
|
|
- if(item.format == 'radio'){
|
|
|
|
|
|
+ res.data.register_extend_info.forEach(item => {
|
|
|
|
+ if (item.format == 'radio') {
|
|
item.value = '0'
|
|
item.value = '0'
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
item.value = ''
|
|
item.value = ''
|
|
- if(item.format == 'address'){
|
|
|
|
|
|
+ if (item.format == 'address') {
|
|
item.province = "";
|
|
item.province = "";
|
|
item.city = "";
|
|
item.city = "";
|
|
item.district = "";
|
|
item.district = "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- res.data.register_extend_info.forEach(item=>{
|
|
|
|
- res.data.extend_info.forEach(j=>{
|
|
|
|
- if(item.info === j.info){
|
|
|
|
|
|
+ res.data.register_extend_info.forEach(item => {
|
|
|
|
+ res.data.extend_info.forEach(j => {
|
|
|
|
+ if (item.info === j.info) {
|
|
item.value = j.value
|
|
item.value = j.value
|
|
- if(item.format == 'address'){
|
|
|
|
|
|
+ if (item.format == 'address') {
|
|
let region = [j.province, j.city, j.district];
|
|
let region = [j.province, j.city, j.district];
|
|
that.$set(that, 'region', region);
|
|
that.$set(that, 'region', region);
|
|
}
|
|
}
|
|
@@ -440,7 +450,24 @@
|
|
*/
|
|
*/
|
|
uploadpic: function() {
|
|
uploadpic: function() {
|
|
let that = this;
|
|
let that = this;
|
|
- this.canvasStatus = true
|
|
|
|
|
|
+ // #ifdef APP
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: "权限申请",
|
|
|
|
+ content: "是否允许访问相机及存储空间用于上传头像?",
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ that.commitImg();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // #endif
|
|
|
|
+ // #ifndef APP
|
|
|
|
+ that.commitImg();
|
|
|
|
+ // #endif
|
|
|
|
+ },
|
|
|
|
+ commitImg() {
|
|
|
|
+ let that = this;
|
|
|
|
+ that.canvasStatus = true
|
|
that.$util.uploadImageChange('upload/image', (res) => {
|
|
that.$util.uploadImageChange('upload/image', (res) => {
|
|
let userInfo = that.switchUserInfo[that.userIndex];
|
|
let userInfo = that.switchUserInfo[that.userIndex];
|
|
// if (userInfo !== undefined) {
|
|
// if (userInfo !== undefined) {
|
|
@@ -448,13 +475,14 @@
|
|
// }
|
|
// }
|
|
that.switchUserInfo[that.userIndex] = userInfo;
|
|
that.switchUserInfo[that.userIndex] = userInfo;
|
|
that.$set(that, 'switchUserInfo', that.switchUserInfo);
|
|
that.$set(that, 'switchUserInfo', that.switchUserInfo);
|
|
- this.canvasStatus = false
|
|
|
|
|
|
+ that.canvasStatus = false
|
|
}, (res) => {
|
|
}, (res) => {
|
|
- this.canvasStatus = false
|
|
|
|
|
|
+ that.canvasStatus = false
|
|
}, (res) => {
|
|
}, (res) => {
|
|
- this.canvasWidth = res.w
|
|
|
|
- this.canvasHeight = res.h
|
|
|
|
|
|
+ that.canvasWidth = res.w
|
|
|
|
+ that.canvasHeight = res.h
|
|
});
|
|
});
|
|
|
|
+
|
|
},
|
|
},
|
|
// 微信头像获取
|
|
// 微信头像获取
|
|
onChooseAvatar(e) {
|
|
onChooseAvatar(e) {
|
|
@@ -489,7 +517,7 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(data.format === 'text'){
|
|
|
|
|
|
+ if (data.format === 'text') {
|
|
if (!data.value.trim()) {
|
|
if (!data.value.trim()) {
|
|
return that.$util.Tips({
|
|
return that.$util.Tips({
|
|
title: `${data.tip}`
|
|
title: `${data.tip}`
|
|
@@ -539,7 +567,9 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (!/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/i.test(data.value)) {
|
|
|
|
|
|
+ if (!
|
|
|
|
+ /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/i
|
|
|
|
+ .test(data.value)) {
|
|
return that.$util.Tips({
|
|
return that.$util.Tips({
|
|
title: '请填写正确的身份证号码'
|
|
title: '请填写正确的身份证号码'
|
|
});
|
|
});
|
|
@@ -564,23 +594,28 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
- .personal-data{
|
|
|
|
|
|
+ .personal-data {
|
|
padding-bottom: 50rpx;
|
|
padding-bottom: 50rpx;
|
|
}
|
|
}
|
|
- .dater{
|
|
|
|
|
|
+
|
|
|
|
+ .dater {
|
|
width: 400rpx;
|
|
width: 400rpx;
|
|
}
|
|
}
|
|
- .grab{
|
|
|
|
|
|
+
|
|
|
|
+ .grab {
|
|
color: #ccc !important;
|
|
color: #ccc !important;
|
|
}
|
|
}
|
|
- .asterisk{
|
|
|
|
|
|
+
|
|
|
|
+ .asterisk {
|
|
color: red;
|
|
color: red;
|
|
font-size: 20rpx;
|
|
font-size: 20rpx;
|
|
margin-left: 6rpx;
|
|
margin-left: 6rpx;
|
|
}
|
|
}
|
|
- .placeholder{
|
|
|
|
|
|
+
|
|
|
|
+ .placeholder {
|
|
color: #ccc;
|
|
color: #ccc;
|
|
}
|
|
}
|
|
|
|
+
|
|
.cartcolor {
|
|
.cartcolor {
|
|
color: var(--view-theme);
|
|
color: var(--view-theme);
|
|
border: 1px solid var(--view-theme);
|
|
border: 1px solid var(--view-theme);
|
|
@@ -691,7 +726,8 @@
|
|
margin-left: 30rpx;
|
|
margin-left: 30rpx;
|
|
font-size: 32rpx;
|
|
font-size: 32rpx;
|
|
color: #282828;
|
|
color: #282828;
|
|
- .label{
|
|
|
|
|
|
+
|
|
|
|
+ .label {
|
|
margin-right: 30rpx;
|
|
margin-right: 30rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -720,10 +756,12 @@
|
|
width: 460rpx;
|
|
width: 460rpx;
|
|
text-align: right;
|
|
text-align: right;
|
|
color: #868686;
|
|
color: #868686;
|
|
- input{
|
|
|
|
|
|
+
|
|
|
|
+ input {
|
|
text-align: right;
|
|
text-align: right;
|
|
}
|
|
}
|
|
- .picker{
|
|
|
|
|
|
+
|
|
|
|
+ .picker {
|
|
width: 400rpx;
|
|
width: 400rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -768,4 +806,4 @@
|
|
border: 1px solid #eee;
|
|
border: 1px solid #eee;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|