提交 f459afd8004303958e934c8903b0d1c71eb4748d

作者 wangyu
1 个父辈 3135d1a8

修改添加页面传值bug

... ... @@ -24,7 +24,7 @@ Page({
24 24 console.log("options", options);
25 25 this.setData({
26 26 cur_status: options.status,
27   - datas: JSON.parse(options.data)
  27 + datas: JSON.parse(options.datas)
28 28 })
29 29 wx.setNavigationBarTitle({
30 30 title: that.data.additiontitle[options.status],
... ...
... ... @@ -68,7 +68,7 @@ Page({
68 68 canceltext: "添加家庭成员并申报",
69 69 confirmtext: "确定为该选择的人申报",
70 70 },
71   - selected_reduceindex:0,
  71 + selected_reduceindex: 0,
72 72 selected_addindex: 0
73 73 },
74 74
... ... @@ -124,7 +124,7 @@ Page({
124 124 })
125 125 },
126 126
127   - goaddSupporter:function(){
  127 + goaddSupporter: function() {
128 128 wx.navigateTo({
129 129 url: '../adddupporters/adddupporters',
130 130 })
... ... @@ -145,10 +145,11 @@ Page({
145 145 // },
146 146
147 147 showdetail: function(e) {
148   - console.log("showdetail", e)
  148 + console.log("showdetail", JSON.stringify(this.data.additionInfo[e.currentTarget.id]))
149 149 if (this.data.additionInfo && this.data.additionInfo.length > 0) {
150 150 wx.navigateTo({
151   - url: '../additiondetail/additiondetail?datas=' + JSON.stringify(this.data.additionInfo[e.currentTarget.id]) + "&status=" + this.data.cur_status,
  151 + url: '../additiondetail/additiondetail?datas=' +
  152 + JSON.stringify(this.data.additionInfo[e.currentTarget.id]) + "&status=" + this.data.cur_status,
152 153 })
153 154 }
154 155 },
... ... @@ -166,10 +167,10 @@ Page({
166 167 'content-type': 'application/json',
167 168 "Authorization": Authorization
168 169 },
169   - success: function (res) {
  170 + success: function(res) {
170 171 if (res && res.data) {
171 172 console.log("res", res)
172   -
  173 +
173 174 }
174 175 }
175 176 })
... ... @@ -185,11 +186,12 @@ Page({
185 186 },
186 187
187 188 goadd: function(e) { //添加
  189 + console.log("goadd", e)
188 190 var that = this
189   - var modalinfo
  191 + var modalinfo, senddata
190 192 if (this.data.cur_status == 'continuing_education' || this.data.cur_status == 'house_fund') {
191 193 wx.navigateTo({
192   - url: '../addextrainfo/addextrainfo?status=' + this.data.cur_status ,
  194 + url: '../addextrainfo/addextrainfo?datas=' + '' + '&status=' + this.data.cur_status + '&reducetype=' + this.data.reducetypeData[this.data.selected_reduceindex],
193 195 })
194 196 } else {
195 197 if (this.data.cur_status == 'children_education') { //modalData
... ... @@ -199,10 +201,11 @@ Page({
199 201 } else if (this.data.cur_status == 'medical_fund') {
200 202 modalinfo = this.data.medical_modalData
201 203 }
  204 + senddata = JSON.stringify(modalinfo.datas[e.currentTarget.id])
202 205 console.log("modalinfo", modalinfo)
203 206 if (modalinfo.datas.length < 2) {
204 207 wx.navigateTo({
205   - url: '../addextrainfo/addextrainfo?status=' + this.data.cur_status + '&datas=' + JSON.stringify(this.data.additionInfo[e.currentTarget.id]),
  208 + url: '../addextrainfo/addextrainfo?status=' + this.data.cur_status + '&datas=' + senddata + '&reducetype=' + this.data.reducetypeData[this.data.selected_reduceindex],
206 209 })
207 210 } else {
208 211 this.showAddtionmodal(modalinfo)
... ... @@ -259,16 +262,16 @@ Page({
259 262 var medicalmodal = this.data.medical_modalData
260 263 for (var i = 0; i < data.items.length; i++) {
261 264 if (data.items[i].family_ties == '子' || data.items[i].family_ties == '女') {
262   - childRelativelist.push(data.items[i].name)
  265 + childRelativelist.push(data.items[i])
263 266 } else if (data.items[i].family_ties != '祖父母' && data.items[i].family_ties != '外祖父母') {
264   - medicalRelativelist.push(data.items[i].name)
  267 + medicalRelativelist.push(data.items[i])
265 268 } else if (data.items[i].family_ties == '祖父母' || data.items[i].family_ties == '外祖父母') {
266   - olderRelativelist.push(data.items[i].name)
  269 + olderRelativelist.push(data.items[i])
267 270 }
268 271 }
269   - childmodal.data = childRelativelist
270   - oldermodal.data = olderRelativelist
271   - medicalmodal.data = medicalRelativelist
  272 + childmodal.datas = childRelativelist
  273 + oldermodal.datas = olderRelativelist
  274 + medicalmodal.datas = medicalRelativelist
272 275 this.setData({
273 276 children_modalData: childmodal,
274 277 support_older_modalData: oldermodal,
... ... @@ -329,13 +332,12 @@ Page({
329 332 this.setData({
330 333 showModal_addtype: false
331 334 })
332   - if (this.data.cur_status == 'children_education') {
333   -
334   - } else if (this.data.cur_status == 'support_duty') {
335   -
336   - } else if (this.data.cur_status == 'medical_fund') {
337   -
338   - }
  335 + var senddata = JSON.stringify(this.data.modalData.datas[this.data.selected_addindex])
  336 + console.log("senddata", senddata)
  337 + wx.navigateTo({
  338 + url: '../addextrainfo/addextrainfo?status=' + this.data.cur_status + '&datas=' + senddata + '&reducetype=' + this.data.reducetypeData[this.data.selected_reduceindex],
  339 + })
  340 +
339 341 },
340 342
341 343 goselect: function(e) {
... ...
... ... @@ -543,7 +543,7 @@
543 543 </view>
544 544 </view>
545 545 <view style='background:#FFF;padding:30rpx'>
546   - <view style='line-height:84rpx;text-align:center;font-size:34rpx;color:#fff;background:#357AEB;' bindtap='goadd'>
  546 + <view style='line-height:84rpx;text-align:center;font-size:34rpx;color:#fff;background:#357AEB;' id='{{index}}' bindtap='goadd'>
547 547 添加
548 548 </view>
549 549 </view>
... ... @@ -592,13 +592,13 @@
592 592 <text class='text_modal_title'>{{modalData.title}}</text>
593 593 <view class='divide_line_f5f5f5'></view>
594 594 <view style='width:100%;display:flex;flex-direction:column;align-items:center;'>
595   - <block wx:for="{{modalData.data}}" wx:for-index="idx">
  595 + <block wx:for="{{modalData.datas}}" wx:for-index="idx">
596 596 <view wx:if="{{idx==selected_addindex}}">
597   - <text class='text_item_blue float_left'>{{item}}</text>
  597 + <text class='text_item_blue float_left'>{{item.name}}</text>
598 598 <image class='icon_choosed' src="/images/icon_chat_choosed.png"></image>
599 599 </view>
600   - <view wx:else bindtap='goselect' id='idx'>
601   - <text class='text_item_black float_left'>{{item}}</text>
  600 + <view wx:else bindtap='goselect' id='{{idx}}'>
  601 + <text class='text_item_black float_left'>{{item.name}}</text>
602 602 </view>
603 603 <view class='divide_line_f5f5f5'></view>
604 604 </block>
... ...
注册登录 后发表评论