...
|
...
|
@@ -15,6 +15,7 @@ Page({ |
|
|
city:'',
|
|
|
phone_number:'',
|
|
|
phone_number_params:'',
|
|
|
wx_num:'',
|
|
|
introduce:'',
|
|
|
is_change:false,
|
|
|
is_choose_phone:false
|
...
|
...
|
@@ -123,6 +124,24 @@ Page({ |
|
|
this.setData({is_change:true});
|
|
|
}
|
|
|
},
|
|
|
//输入微信号
|
|
|
inputWx(e) {
|
|
|
this.setData({
|
|
|
wx_num: e.detail.value,
|
|
|
is_choose_wx: true
|
|
|
});
|
|
|
if(e.detail.value === '') {
|
|
|
this.setData({is_change:false});
|
|
|
}
|
|
|
if((this.data.is_choose_wx&&this.data.wx_num !== '') &&
|
|
|
this.data.user.country !== null &&
|
|
|
this.data.user.tel !== null &&
|
|
|
this.data.user.introduce !== null
|
|
|
){
|
|
|
console.log(2);
|
|
|
this.setData({is_change:true});
|
|
|
}
|
|
|
},
|
|
|
//简介
|
|
|
inputContent(e) {
|
|
|
var textcontent = e.detail.value;
|
...
|
...
|
@@ -148,7 +167,8 @@ Page({ |
|
|
if((this.data.is_choose_introduce&&this.data.introduce !== '') &&
|
|
|
this.data.user.city !== null &&
|
|
|
this.data.user.tel !== null &&
|
|
|
this.data.user.country !== null
|
|
|
this.data.user.country !== null &&
|
|
|
this.data.user.wx !== null
|
|
|
){
|
|
|
console.log(2);
|
|
|
this.setData({is_change:true});
|
...
|
...
|
@@ -156,7 +176,8 @@ Page({ |
|
|
if((this.data.is_choose_country&&this.data.country !== '')&&
|
|
|
(this.data.is_choose_city&&this.data.city !== '') &&
|
|
|
(this.data.user.tel!==null&&this.data.user.tel !== '') &&
|
|
|
(this.data.is_choose_introduce&&this.data.introduce !== '')
|
|
|
(this.data.is_choose_introduce&&this.data.introduce !== '') &&
|
|
|
(this.data.is_choose_wx&&this.data.wx_num !== '')
|
|
|
) {
|
|
|
console.log(1);
|
|
|
this.setData({is_change:true});
|
...
|
...
|
@@ -174,6 +195,8 @@ Page({ |
|
|
wx.showToast({title:'请获取手机号',icon:'none'})
|
|
|
}else if(this.data.is_wrong_phone){
|
|
|
wx.showToast({title:'手机号格式错误',icon:'none'})
|
|
|
}else if(this.data.wx_num === '' && this.data.user.wx === null) {
|
|
|
wx.showToast({title:'请填写微信号',icon:'none'})
|
|
|
}else if(this.data.introduce === '' && this.data.user.introduce === null) {
|
|
|
wx.showToast({title:'请填写简介',icon:'none'})
|
|
|
}else {
|
...
|
...
|
@@ -186,6 +209,7 @@ Page({ |
|
|
city:this.data.is_choose_city?this.data.city:this.data.user.city,
|
|
|
// tel:(this.data.is_choose_phone&&this.data.phone_number !== '')?this.data.phone_number:this.data.user.tel,
|
|
|
tel:this.data.user.tel,
|
|
|
wx: this.data.is_choose_wx?this.data.wx_num:this.data.user.wx,
|
|
|
introduce:this.data.is_choose_introduce?this.data.introduce:this.data.user.introduce
|
|
|
};
|
|
|
app.post(url, params, {}).then((res) => {
|
...
|
...
|
@@ -214,7 +238,8 @@ Page({ |
|
|
if(this.data.user.country === null ||
|
|
|
this.data.user.city === null ||
|
|
|
this.data.user.tel === null ||
|
|
|
this.data.user.introduce === null
|
|
|
this.data.user.introduce === null ||
|
|
|
this.data.user.wx === null
|
|
|
) {
|
|
|
this.setData({is_change:false});//完成按钮不能点
|
|
|
}else {
|
...
|
...
|
|