正在显示
3 个修改的文件
包含
30 行增加
和
30 行删除
| @@ -9,12 +9,12 @@ Page({ | @@ -9,12 +9,12 @@ Page({ | ||
| 9 | */ | 9 | */ |
| 10 | data: { | 10 | data: { |
| 11 | legal_entity_id: "", | 11 | legal_entity_id: "", |
| 12 | - supporter_id:"", | 12 | + supporter_id: "", |
| 13 | name: "", | 13 | name: "", |
| 14 | nation: "", | 14 | nation: "", |
| 15 | id_card_no: "", | 15 | id_card_no: "", |
| 16 | - birthday:"", | ||
| 17 | - datas:"", | 16 | + birthday: "", |
| 17 | + datas: "", | ||
| 18 | birthday_datelong: -1, | 18 | birthday_datelong: -1, |
| 19 | }, | 19 | }, |
| 20 | 20 | ||
| @@ -23,20 +23,20 @@ Page({ | @@ -23,20 +23,20 @@ Page({ | ||
| 23 | */ | 23 | */ |
| 24 | onLoad: function(options) { | 24 | onLoad: function(options) { |
| 25 | console.log("onLoad", options) | 25 | console.log("onLoad", options) |
| 26 | - if (options.id){ | 26 | + if (options.id) { |
| 27 | this.setData({ | 27 | this.setData({ |
| 28 | legal_entity_id: options.id, | 28 | legal_entity_id: options.id, |
| 29 | }) | 29 | }) |
| 30 | } | 30 | } |
| 31 | - | ||
| 32 | - if (options.datas && JSON.parse(options.datas)){ | ||
| 33 | - var curdata = JSON.parse(options.datas) | 31 | + |
| 32 | + if (options.datas && JSON.parse(options.datas)) { | ||
| 33 | + var curdata = JSON.parse(options.datas) | ||
| 34 | this.setData({ | 34 | this.setData({ |
| 35 | datas: curdata, | 35 | datas: curdata, |
| 36 | supporter_id: curdata.id, | 36 | supporter_id: curdata.id, |
| 37 | name: curdata.co_supporter, | 37 | name: curdata.co_supporter, |
| 38 | id_card_no: curdata.id_card_no, | 38 | id_card_no: curdata.id_card_no, |
| 39 | - birthday: curdata.birthday ? this.formatDate(curdata.birthday ):"", | 39 | + birthday: curdata.birthday ? this.formatDate(curdata.birthday) : "", |
| 40 | birthday_datelong: Date.parse(new Date(curdata.birthday)) / 1000 | 40 | birthday_datelong: Date.parse(new Date(curdata.birthday)) / 1000 |
| 41 | }) | 41 | }) |
| 42 | } | 42 | } |
| @@ -109,7 +109,7 @@ Page({ | @@ -109,7 +109,7 @@ Page({ | ||
| 109 | this.showToast("证件号码有误") | 109 | this.showToast("证件号码有误") |
| 110 | return; | 110 | return; |
| 111 | } | 111 | } |
| 112 | - if (this.data.birthday.length < 1 ){ | 112 | + if (this.data.birthday.length < 1) { |
| 113 | this.showToast("请选择出生日期") | 113 | this.showToast("请选择出生日期") |
| 114 | return; | 114 | return; |
| 115 | } | 115 | } |
| @@ -143,23 +143,23 @@ Page({ | @@ -143,23 +143,23 @@ Page({ | ||
| 143 | wx.navigateBack({ | 143 | wx.navigateBack({ |
| 144 | delta: 1 | 144 | delta: 1 |
| 145 | }) | 145 | }) |
| 146 | - }else{ | 146 | + } else { |
| 147 | that.showToast(res.data.message) | 147 | that.showToast(res.data.message) |
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | }, | 150 | }, |
| 151 | - fail:function(res){ | 151 | + fail: function(res) { |
| 152 | console.log("fail", res) | 152 | console.log("fail", res) |
| 153 | that.showToast(res.data.message) | 153 | that.showToast(res.data.message) |
| 154 | } | 154 | } |
| 155 | }) | 155 | }) |
| 156 | }, | 156 | }, |
| 157 | 157 | ||
| 158 | - bindDateChange:function(e){ | 158 | + bindDateChange: function(e) { |
| 159 | console.log('picker发送选择改变,携带值为', e) | 159 | console.log('picker发送选择改变,携带值为', e) |
| 160 | this.setData({ | 160 | this.setData({ |
| 161 | birthday: e.detail.value, | 161 | birthday: e.detail.value, |
| 162 | - birthday_datelong : Date.parse(new Date(e.detail.value)) / 1000 | 162 | + birthday_datelong: Date.parse(new Date(e.detail.value)) / 1000 |
| 163 | }) | 163 | }) |
| 164 | }, | 164 | }, |
| 165 | 165 | ||
| @@ -172,8 +172,8 @@ Page({ | @@ -172,8 +172,8 @@ Page({ | ||
| 172 | } | 172 | } |
| 173 | }, | 173 | }, |
| 174 | 174 | ||
| 175 | - bindinput:function(e){ | ||
| 176 | - console.log("bindinput",e.detail.value) | 175 | + bindinput: function(e) { |
| 176 | + console.log("bindinput", e.detail.value) | ||
| 177 | var idCardNo = e.detail.value | 177 | var idCardNo = e.detail.value |
| 178 | if (idCardNo.length == 18) { | 178 | if (idCardNo.length == 18) { |
| 179 | if (!format.isIDCardNum(idCardNo)) { | 179 | if (!format.isIDCardNum(idCardNo)) { |
| @@ -398,29 +398,29 @@ Page({ | @@ -398,29 +398,29 @@ Page({ | ||
| 398 | method: "POST", | 398 | method: "POST", |
| 399 | success: function(res) { | 399 | success: function(res) { |
| 400 | console.log("success", res) | 400 | console.log("success", res) |
| 401 | - if (res.statusCode==200){ | 401 | + if (res.statusCode == 200) { |
| 402 | that.getAdditionInfo() | 402 | that.getAdditionInfo() |
| 403 | - }else { | 403 | + } else { |
| 404 | wx.showToast({ | 404 | wx.showToast({ |
| 405 | title: res.data.message, | 405 | title: res.data.message, |
| 406 | icon: "none" | 406 | icon: "none" |
| 407 | }) | 407 | }) |
| 408 | } | 408 | } |
| 409 | - | 409 | + |
| 410 | }, | 410 | }, |
| 411 | - fail:function(res){ | ||
| 412 | - console.log("fail",res) | ||
| 413 | - wx.showToast({ | ||
| 414 | - title: res.data.message, | ||
| 415 | - icon:"none" | ||
| 416 | - }) | 411 | + fail: function(res) { |
| 412 | + console.log("fail", res) | ||
| 413 | + wx.showToast({ | ||
| 414 | + title: res.data.message, | ||
| 415 | + icon: "none" | ||
| 416 | + }) | ||
| 417 | } | 417 | } |
| 418 | }) | 418 | }) |
| 419 | }, | 419 | }, |
| 420 | 420 | ||
| 421 | goedit: function(e) { //编辑 | 421 | goedit: function(e) { //编辑 |
| 422 | console.log("goedit", e) | 422 | console.log("goedit", e) |
| 423 | - var oridata = this.data.origindata?this.data.origindata.items:[] | 423 | + var oridata = this.data.origindata ? this.data.origindata.items : [] |
| 424 | var new_info | 424 | var new_info |
| 425 | if (this.data.cur_status == "continuing_education") { | 425 | if (this.data.cur_status == "continuing_education") { |
| 426 | if (e.currentTarget.id.indexOf('title') != -1) { | 426 | if (e.currentTarget.id.indexOf('title') != -1) { |
| @@ -532,14 +532,14 @@ Page({ | @@ -532,14 +532,14 @@ Page({ | ||
| 532 | console.log('succ', res) | 532 | console.log('succ', res) |
| 533 | if (res.statusCode == 200) { | 533 | if (res.statusCode == 200) { |
| 534 | that.handleData(res.data); | 534 | that.handleData(res.data); |
| 535 | - }else{ | 535 | + } else { |
| 536 | wx.showToast({ | 536 | wx.showToast({ |
| 537 | title: res.data.message, | 537 | title: res.data.message, |
| 538 | icon: "none" | 538 | icon: "none" |
| 539 | }) | 539 | }) |
| 540 | } | 540 | } |
| 541 | }, | 541 | }, |
| 542 | - fail: function (res) { | 542 | + fail: function(res) { |
| 543 | console.log("fail", res) | 543 | console.log("fail", res) |
| 544 | wx.showToast({ | 544 | wx.showToast({ |
| 545 | title: res.data.message, | 545 | title: res.data.message, |
请
注册
或
登录
后发表评论