提交 ce305d9fa95c636fe1db447cfe7d2fd6244d0700

作者 pangy
1 个父辈 b629e2a5

微信系统bug。form表单丢数据

... ... @@ -237,7 +237,12 @@ Page({
237 237 mobile: e.detail.value
238 238 })
239 239 },
240   -
  240 + nameInput: function (e) {
  241 + console.log('bindinputname', e)
  242 + this.setData({
  243 + name: e.detail.value
  244 + })
  245 + },
241 246 // =============其他数据选中处理==============
242 247
243 248 getIdInfo: function(e) {
... ... @@ -269,10 +274,11 @@ Page({
269 274 this.showtoast('证照号码有误');
270 275 return
271 276 }
272   - if (formdata.name.length < 1) {
  277 + var name = formdata.person_name.length ? formdata.person_name : this.data.name
  278 + if (name.length < 1 ) {
273 279 this.showtoast('姓名未填写');
274 280 return
275   - } else if (!regname.test(formdata.name)) {
  281 + } else if (!regname.test(name)) {
276 282 this.showtoast('请输入正确姓名');
277 283 return
278 284 }
... ... @@ -302,6 +308,7 @@ Page({
302 308 goCommit: function(data) {
303 309 var that = this
304 310 var formdata = data
  311 + var name = formdata.person_name.length ? formdata.person_name : this.data.name
305 312 console.log("form_data", formdata);
306 313 var Authorization = app.globalData.Authorization;
307 314 var url = baseUrl + 'persontax/v1/personal-taxes', method = "POST"
... ... @@ -320,7 +327,7 @@ Page({
320 327 "family_ties": that.data.relativeData.selected,
321 328 "id_card_type": '居民身份证',//that.data.cardtypeData.selected,
322 329 "id_card_no": formdata.id_card_no ? formdata.id_card_no : that.data.card_number,
323   - "name": formdata.name,
  330 + "name": name,
324 331 "gender": that.data.genderData.selected,
325 332 "mobile": formdata.mobile,
326 333 //"age": formdata.age ? formdata.age : '',//不传
... ...
... ... @@ -35,7 +35,7 @@
35 35 <view class='item_body'>
36 36 <text class='red_star_right_10'>*</text>
37 37 <text class='text_777_30 float_left' style='line-height: 90rpx'>姓名</text>
38   - <input class='input_wrap float_right' placeholder='请填写姓名' name='name' value='{{name}}' placeholder-class='text_777_30' maxlength='15' disabled='{{isDisable}}'></input>
  38 + <input class='input_wrap float_right' placeholder='请填写姓名' name='person_name' value='{{name}}' placeholder-class='text_777_30' maxlength='15' disabled='{{isDisable}}' bindinput='nameInput'></input>
39 39 </view>
40 40 <view class="divide_line_30"></view>
41 41
... ...
注册登录 后发表评论