提交 ed2373254310d65fd6a2211a1decacc9acca7001

作者 wangyu
1 个父辈 fbd3de4c

优化编辑功能数据转换

... ... @@ -16,6 +16,7 @@ Page({
16 16 person_total_amount: 0,
17 17 remaining_amount: 0,
18 18 input_disable: false,
  19 + origindata: {},
19 20 declareStatus: {
20 21 "to_declare": "待申报",
21 22 "declaring": "申报中",
... ... @@ -304,6 +305,7 @@ Page({
304 305 reduce_amount: data.month_deduction_amount ? data.month_deduction_amount : 0,
305 306 input_disable: true,
306 307
  308 + origindata: data,
307 309 handle_finished: true,
308 310 person_total_amount: data.person_total_amount ? data.person_total_amount : 0,
309 311 remaining_amount: data.remaining_amount ? data.remaining_amount : 0,
... ... @@ -311,8 +313,9 @@ Page({
311 313 })
312 314 console.log("newdata", newdata)
313 315 wx.hideLoading()
314   - }else{
  316 + } else {
315 317 this.setData({
  318 + origindata: data,
316 319 additionInfo: newdata
317 320 })
318 321 }
... ... @@ -320,7 +323,7 @@ Page({
320 323
321 324 goaddSupporter: function() {
322 325 wx.navigateTo({
323   - url: '../adddupporters/adddupporters?id='+this.data.legal_entity_id,
  326 + url: '../adddupporters/adddupporters?id=' + this.data.legal_entity_id,
324 327 })
325 328
326 329 },
... ... @@ -397,33 +400,32 @@ Page({
397 400
398 401 goedit: function(e) { //编辑
399 402 console.log("goedit", e)
  403 + var oridata = this.data.origindata.items
400 404 var new_info
401 405 if (this.data.cur_status == "continuing_education") {
402 406 if (e.currentTarget.id.indexOf('title') != -1) {
403   - new_info = this.data.additionInfo[0].title_items[e.currentTarget.id.replace('title', '')]
  407 + new_info = oridata[0].title_items[e.currentTarget.id.replace('title', '')]
404 408 }
405 409 if (e.currentTarget.id.indexOf('profession') != -1) {
406   - new_info = this.data.additionInfo[0].profession_items[e.currentTarget.id.replace('profession', '')]
  410 + new_info = oridata[0].profession_items[e.currentTarget.id.replace('profession', '')]
407 411 }
408 412 } else if (this.data.cur_status == "support_duty") {
409 413 if (e.currentTarget.id.indexOf('support_duty') != -1) {
410   - new_info = this.data.additionInfo[0].support_duties[e.currentTarget.id.replace('support_duty', '')]
  414 + new_info = oridata[0].support_duties[e.currentTarget.id.replace('support_duty', '')]
411 415 }
412 416 if (e.currentTarget.id.indexOf('co_supporter') != -1) {
413   - new_info = this.data.additionInfo[0].co_supporters[e.currentTarget.id.replace('co_supporter', '')]
  417 + new_info = oridata[0].co_supporters[e.currentTarget.id.replace('co_supporter', '')]
414 418 wx.navigateTo({
415   - url: '../adddupporters/adddupporters?datas=' + JSON.stringify(new_info) + '&status=' + this.data.cur_status + "&id="+this.data.legal_entity_id ,
  419 + url: '../adddupporters/adddupporters?datas=' + JSON.stringify(new_info) + '&status=' + this.data.cur_status + "&id=" + this.data.legal_entity_id,
416 420 })
417 421 return;
418 422 }
419 423 } else {
420   - new_info = this.data.additionInfo[e.currentTarget.id]
421   - }
422   - if (this.data.additionInfo && this.data.additionInfo.length > 0) {
423   - wx.navigateTo({
424   - url: '../addextrainfo/addextrainfo?datas=' + JSON.stringify(new_info) + '&status=' + this.data.cur_status + '&reducetype=' + this.data.reducetypeData[this.data.selected_reduceindex] + '&isedit=true',
425   - })
  424 + new_info = oridata[e.currentTarget.id]
426 425 }
  426 + wx.navigateTo({
  427 + url: '../addextrainfo/addextrainfo?datas=' + JSON.stringify(new_info) + '&status=' + this.data.cur_status + '&reducetype=' + this.data.reducetypeData[this.data.selected_reduceindex] + '&isedit=true',
  428 + })
427 429 },
428 430
429 431 goadd: function(e) { //添加
... ...
... ... @@ -110,14 +110,14 @@ Page({
110 110 chatlist: that.data.chatlist
111 111 })
112 112 console.log("chatlist", that.data.chatlist)
113   - wx.pageScrollTo({
114   - scrollTop: 20000,
115   - duration: 300
116   - })
  113 + // wx.pageScrollTo({
  114 + // scrollTop: 999999,
  115 + // duration: 300
  116 + // })
117 117 // that.getChatinfo()
118   - // setTimeout(function(){
119   - // that.bottom()
120   - // },400);
  118 + setTimeout(function(){
  119 + that.bottom()
  120 + },400);
121 121
122 122 }
123 123 }
... ... @@ -237,7 +237,8 @@ Page({
237 237 wx.createSelectorQuery().select('#flag').boundingClientRect(function (rect) {
238 238 // 使页面滚动到底部
239 239 wx.pageScrollTo({
240   - scrollTop: rect.bottom
  240 + scrollTop: rect.height+99999,
  241 + duration:100
241 242 })
242 243 }).exec()
243 244 },
... ...
注册登录 后发表评论