提交 e08a2ae697961d3159e399623db2a6bcf4622aa3

作者 wangyu
1 个父辈 0d81d1d4

优化

@@ -22,13 +22,20 @@ Page({ @@ -22,13 +22,20 @@ Page({
22 cardtype: "", 22 cardtype: "",
23 nation: "", 23 nation: "",
24 birthday_datelong: -1, 24 birthday_datelong: -1,
  25 + choosed_date: ""//上一个页面选择的年份
25 }, 26 },
26 27
27 /** 28 /**
28 * Lifecycle function--Called when page load 29 * Lifecycle function--Called when page load
29 */ 30 */
30 onLoad: function(options) { 31 onLoad: function(options) {
  32 + var pages = getCurrentPages()
  33 + var frontPage = pages[pages.length - 2]
  34 + console.log("front", frontPage.data)
31 console.log("onLoad", options) 35 console.log("onLoad", options)
  36 + this.setData({
  37 + choosed_date: frontPage.data.choosed_date,
  38 + })
32 if (options.id) { 39 if (options.id) {
33 this.setData({ 40 this.setData({
34 legal_entity_id: options.id, 41 legal_entity_id: options.id,
@@ -191,6 +198,7 @@ Page({ @@ -191,6 +198,7 @@ Page({
191 wx.request({ 198 wx.request({
192 url: baseUrl + 'persontax/v1/co-supporters', 199 url: baseUrl + 'persontax/v1/co-supporters',
193 data: { 200 data: {
  201 + 'years': that.data.choosed_date+"",
194 "id": that.data.supporter_id, 202 "id": that.data.supporter_id,
195 "legal_entity_id": that.data.legal_entity_id, 203 "legal_entity_id": that.data.legal_entity_id,
196 "co_supporter": formdata.name, 204 "co_supporter": formdata.name,
@@ -537,7 +537,8 @@ Page({ @@ -537,7 +537,8 @@ Page({
537 // }, 537 // },
538 edu_lable: "school", 538 edu_lable: "school",
539 oldersupport_lable: "", 539 oldersupport_lable: "",
540 - img_path: "/images/upload_img.png" 540 + img_path: "/images/upload_img.png",
  541 + choosed_date: ""//上一个页面选择的年份
541 }, 542 },
542 543
543 /** 544 /**
@@ -636,6 +637,7 @@ Page({ @@ -636,6 +637,7 @@ Page({
636 } 637 }
637 638
638 this.setData({ 639 this.setData({
  640 + choosed_date: frontPage.data.choosed_date,
639 title: title, 641 title: title,
640 cur_index: nameKey, 642 cur_index: nameKey,
641 house_type: house_type, 643 house_type: house_type,
@@ -1975,6 +1977,7 @@ Page({ @@ -1975,6 +1977,7 @@ Page({
1975 } 1977 }
1976 newdata.legal_entity_id = this.legal_entity_id 1978 newdata.legal_entity_id = this.legal_entity_id
1977 newdata.legal_entity = this.legal_entity 1979 newdata.legal_entity = this.legal_entity
  1980 + newdata.years = this.data.choosed_date+""
1978 if (this.isEdit) { 1981 if (this.isEdit) {
1979 newdata.id = this.edit_id 1982 newdata.id = this.edit_id
1980 } 1983 }
@@ -41,7 +41,8 @@ Page({ @@ -41,7 +41,8 @@ Page({
41 sureid: false, 41 sureid: false,
42 disable_change: '', 42 disable_change: '',
43 status: "", 43 status: "",
44 - extra_message: '' 44 + extra_message: '',
  45 + choosed_date: ""//上一个页面选择的年份
45 }, 46 },
46 ], 47 ],
47 }, 48 },
@@ -50,10 +51,14 @@ Page({ @@ -50,10 +51,14 @@ Page({
50 * Lifecycle function--Called when page load 51 * Lifecycle function--Called when page load
51 */ 52 */
52 onLoad: function(options) { 53 onLoad: function(options) {
  54 + var pages = getCurrentPages()
  55 + var frontPage = pages[pages.length - 2]
  56 + console.log("front", frontPage.data)
53 console.log("onLoad", options) 57 console.log("onLoad", options)
54 this.setData({ 58 this.setData({
55 legal_entity_id: options.legal_entity_id, 59 legal_entity_id: options.legal_entity_id,
56 legal_entity: options.legal_entity, 60 legal_entity: options.legal_entity,
  61 + choosed_date: frontPage.data.choosed_date,
57 type: options.type, 62 type: options.type,
58 selectdata: options.select_data ? JSON.parse(options.select_data) : {} 63 selectdata: options.select_data ? JSON.parse(options.select_data) : {}
59 }) 64 })
@@ -222,6 +227,7 @@ Page({ @@ -222,6 +227,7 @@ Page({
222 wx.request({ 227 wx.request({
223 url: baseUrl + 'persontax/v1/additional-settings', 228 url: baseUrl + 'persontax/v1/additional-settings',
224 data: { 229 data: {
  230 + "years": that.data.choosed_date+"",
225 "legal_entity_id": this.data.legal_entity_id, 231 "legal_entity_id": this.data.legal_entity_id,
226 "legal_entity": this.data.legal_entity, 232 "legal_entity": this.data.legal_entity,
227 "options": array 233 "options": array
@@ -14,6 +14,7 @@ Page({ @@ -14,6 +14,7 @@ Page({
14 additionlist: [], 14 additionlist: [],
15 complete_item:[], 15 complete_item:[],
16 choosed_date: '', 16 choosed_date: '',
  17 + addition_data_last_year:false,//上一年是否有数据
17 has_showModal:false,//当前页面是否展示过modal 18 has_showModal:false,//当前页面是否展示过modal
18 show_modal:false, 19 show_modal:false,
19 tip_detail:"尊敬的用户您好!2020年度的专项附加扣除申报已经启动,请您及时确认填报信息,确保专项附加扣除能正常享受扣除。", 20 tip_detail:"尊敬的用户您好!2020年度的专项附加扣除申报已经启动,请您及时确认填报信息,确保专项附加扣除能正常享受扣除。",
@@ -121,6 +122,7 @@ Page({ @@ -121,6 +122,7 @@ Page({
121 if (res && res.data) { 122 if (res && res.data) {
122 console.log("show_modal", !res.data.new_addition_status) 123 console.log("show_modal", !res.data.new_addition_status)
123 that.setData({ 124 that.setData({
  125 + addition_data_last_year: res.data.last_addition_status,
124 show_modal: !that.data.has_showModal&&!res.data.new_addition_status, 126 show_modal: !that.data.has_showModal&&!res.data.new_addition_status,
125 complete_item: res.data.complete_item, 127 complete_item: res.data.complete_item,
126 additionlist: that.handleData(res.data.items) 128 additionlist: that.handleData(res.data.items)
@@ -133,10 +133,7 @@ @@ -133,10 +133,7 @@
133 </view> --> 133 </view> -->
134 134
135 </view> 135 </view>
136 - <view wx:if="{{hascompleted&&additionlist.length<1&&choosed_date!=2020}}" style='background:#fff;'>  
137 - <image style='width:55%;height:254rpx;margin:400rpx 166rpx 0 166rpx;' src='/images/noreduce_img.png'></image>  
138 - </view>  
139 - <view wx:if="{{hascompleted&&additionlist.length<1&&choosed_date==2020}}" style='background:#fef6e9;padding:40rpx 30rpx;display:flex;'> 136 + <view wx:if="{{hascompleted&&additionlist.length<1&&choosed_date==2020&&addition_data_last_year}}" style='background:#fef6e9;padding:40rpx 30rpx;display:flex;'>
140 <view style="margin-right:20rpx;margin-top:10rpx"> 137 <view style="margin-right:20rpx;margin-top:10rpx">
141 <image style='width:40rpx;height:40rpx;' src='/images/warn_yellow.png'></image> 138 <image style='width:40rpx;height:40rpx;' src='/images/warn_yellow.png'></image>
142 </view> 139 </view>
@@ -147,4 +144,7 @@ @@ -147,4 +144,7 @@
147 </view> 144 </view>
148 145
149 </view> 146 </view>
  147 + <view wx:elif="{{hascompleted&&additionlist.length<1}}" style='background:#fff;'>
  148 + <image style='width:55%;height:254rpx;margin:400rpx 166rpx 0 166rpx;' src='/images/noreduce_img.png'></image>
  149 + </view>
150 </view> 150 </view>
注册登录 后发表评论