Browse Source

BUG修改 个人资料姓名 样式修改 吹哨内容过多

master
chenteng 5 years ago
parent
commit
bc89495336
  1. 37
      pages/topics/talents/index.js
  2. 4
      pages/topics/talents/index.wxml
  3. 3
      pages/topics/talents/index.wxss
  4. 40
      pages/user/myInfo/index.js
  5. 2
      pages/user/myInfo/index.wxml

37
pages/topics/talents/index.js

@ -89,11 +89,18 @@ Component({
})
},
bindTextAreaInput(e) {
this.setData({
messageDetail: e.detail.value
})
if(this.data.messageDetail.length <= 200){
this.setData({
messageDetail: e.detail.value
})
}else{
wx.showToast({
title: '超过字数',
icon: 'none',
duration: 2000,
})
}
},
uplaodFile(files) {
console.log('upload files', files)
// 文件上传的函数,返回一个promise
@ -144,6 +151,21 @@ Component({
})
return
}
if (this.data.messageDetail.length >200){
let th = this
wx.showModal({
title: '提示',
content: '问题超过字数,请重新输入',
showCancel:false,
success: function (res) {
console.log(res);
setTimeout(function(){th.setData({
messageDetail: ''
})},500)
},
})
return
}
//判断是否选择街道
if (this.data.streetID === ''){
wx.showModal({
@ -165,7 +187,7 @@ Component({
},()=>{
wx.showModal({
title: '提交成功',
content: '问题已收到,我们会尽快给您答复的!',
content: '问题已收到!',
cancelText:'知道了',
confirmText:'查看进度',
success (res) {
@ -192,8 +214,9 @@ Component({
})
}
})
this.setData({
streetsIndex: 0,
})
}
},

4
pages/topics/talents/index.wxml

@ -6,10 +6,10 @@
<view class="question-image">
<!-- 文本框 -->
<view class="item">
<textarea class="textArea" maxlength="1000" value="{{messageDetail}}" bindinput="bindTextAreaInput" placeholder="请描述您的问题" />
<textarea class="textArea" maxlength="210" value="{{messageDetail}}" bindinput="bindTextAreaInput" placeholder="请描述您的问题(200字内)" />
</view>
<!-- 添加图片 -->
<view>
<view style="z-index:10">
<mp-uploader ext-class="myUploader" delete="true" binddelete="deleteFile" upload="{{uplaodFile}}" files="{{files}}" select="{{selectFile}}" max-count="9" title=""></mp-uploader>
</view>
</view>

3
pages/topics/talents/index.wxss

@ -35,6 +35,7 @@
bottom: 0;
left: 0;
right: 0;
background-color: white;
}
.submitBtn{
/* width: 100%; */
@ -73,7 +74,7 @@
/* 以下为新增 */
.question-image{
padding:20px 0px;
padding:5px 0px 20px 0px;
}
.select-view{
display: flex;

40
pages/user/myInfo/index.js

@ -31,6 +31,7 @@ Page({
show: false,
tempData:String,
realData:String,
temp:String,
type:String,
value:String,
},
@ -45,11 +46,30 @@ Page({
this.setData({
realData:this.data.tempData
})
//判断名字长度,限制名字长度10个字之内,姓名不能为空
if(this.data.type === 'userName'){
this.setData({
nickName:this.data.realData
})
console.log("username");
console.dir(this.data.realData);
console.log(this.data.realData.length);
if(this.data.realData.length > 10){
wx.showToast({
title: '姓名长度应小于10',
icon: 'none',
duration: 2000,
})
}else if(this.data.realData.length == 0){
wx.showToast({
title: '姓名不能为空',
icon: 'none',
duration: 2000,
})
}else{
console.log("nickName修改了");
console.log(this.data.nickName);
this.setData({
nickName:this.data.realData
})
}
}
if(this.data.type === 'userAge'){
this.setData({
@ -87,13 +107,16 @@ Page({
})
}
this.setData({
value:''
value:'',
realData:'',
tempData:''
})
},
tempData: function(e){
this.setData({
tempData:e.detail.value
tempData:e.detail.value,
// value:''
})
},
@ -224,7 +247,9 @@ Page({
})
},
submit(){
// console.log("submit");
console.log("submit");
// console.log(this.data.nickName.length);
// console.log(this.data.nickName);
// console.log(this.data);
userModel.updateUserInfo(this.data, res => {
if(res.code === 200){
@ -256,5 +281,6 @@ Page({
})
}
})
}
})

2
pages/user/myInfo/index.wxml

@ -47,7 +47,7 @@
title="年龄"
ext-class="cell-item">
<!-- <view slot="footer" class="msg_footer" >{{phone}}</view> -->
<input slot="footer" style="text-align:right;" class="footer_input_phone" maxlength="45" value="{{age}}" disabled placeholder="请输入"></input>
<input slot="footer" style="text-align:right;" class="footer_input_phone" maxlength="10" value="{{age}}" disabled placeholder="请输入"></input>
</mp-cell>
<!-- 下面是选择框 -->
<mp-cell link="true"

Loading…
Cancel
Save