提交 d5750763eaaaac8e6ec8c0a0b73559c29bd66ddf

作者 wangyu
1 个父辈 91eb4c68

优化后台参数消失引起的bug

... ... @@ -185,21 +185,25 @@ Page({
185 185 var btn_show = this.data.btn_show
186 186 if (that.data.cur_status == "continuing_education") {
187 187 var professionlist = newdata[0].profession_items
188   - for (var i = 0; i < professionlist.length > 0; i++) {
189   - if (professionlist[i].approval_date) {
190   - professionlist[i].approval_date = this.formatDate(professionlist[i].approval_date)
  188 + if (professionlist && professionlist.length>0){
  189 + for (var i = 0; i < professionlist.length > 0; i++) {
  190 + if (professionlist[i].approval_date) {
  191 + professionlist[i].approval_date = this.formatDate(professionlist[i].approval_date)
  192 + }
191 193 }
192 194 }
193 195 var titlelist = newdata[0].title_items
194   - for (var i = 0; i < titlelist.length > 0; i++) {
195   - if (titlelist[i].education_start) {
196   - titlelist[i].education_start = this.formatDate(titlelist[i].education_start).substring(0, 7)
197   - }
198   - if (titlelist[i].education_end) {
199   - titlelist[i].education_end = this.formatDate(titlelist[i].education_end).substring(0, 7)
  196 + if(titlelist&&titlelist.length>0){
  197 + for (var i = 0; i < titlelist.length > 0; i++) {
  198 + if (titlelist[i].education_start) {
  199 + titlelist[i].education_start = this.formatDate(titlelist[i].education_start).substring(0, 7)
  200 + }
  201 + if (titlelist[i].education_end) {
  202 + titlelist[i].education_end = this.formatDate(titlelist[i].education_end).substring(0, 7)
  203 + }
200 204 }
201 205 }
202   - btn_show = true
  206 + btn_show = true
203 207 // this.setData({
204 208 // issinglechildData: issinglechild_Data,
205 209 // shareMethodData: shareMethod_Data
... ...
注册登录 后发表评论