提交 1cfb28d9269b1a43cf906bc4b6f49b0cac5ea6da

作者 wangyu
1 个父辈 93a57607

修改 查看并调整相关功能

... ... @@ -234,7 +234,7 @@ Page({
234 234 if (res && res.data) {
235 235 console.log("res", res)
236 236 wx.redirectTo({
237   - url: '../godetail/godetail?datas=' + JSON.stringify(res.data.item)
  237 + url: '../godetail/godetail?datas=' + JSON.stringify(res.data)
238 238 })
239 239 }
240 240 }
... ...
... ... @@ -8,36 +8,76 @@ Page({
8 8 * Page initial data
9 9 */
10 10 data: {
  11 + additiontitle: {
  12 + "children_education": "子女教育",
  13 + "continuing_education": "继续教育",
  14 + "support_duty": "赡养老人",
  15 + "medical_fund": "大病医疗",
  16 + "house_fund_rent": "住房",
  17 + "house_fund_loan": "住房",
  18 + "house_fund": "住房"
  19 + },
  20 + reducetype: {
  21 + "": "月",
  22 + "month": "月",
  23 + "year": "年"
  24 + },
11 25 additiondata: {}
12 26 },
13 27
14 28 /**
15 29 * Lifecycle function--Called when page load
16 30 */
17   - onLoad: function (options) {
18   - console.log("onLoad", options.datas)
19   - this.setData({
20   - additiondata: JSON.parse(options.datas)
21   - })
  31 + onLoad: function(options) {
  32 + console.log("onLoad", options)
  33 + if (options.datas) {
  34 + this.setData({
  35 + additiondata: this.handleData(JSON.parse(options.datas))
  36 + })
  37 + }
22 38 },
23 39
24 40 /**
25 41 * Lifecycle function--Called when page is initially rendered
26 42 */
27   - onReady: function () {
  43 + onReady: function() {
28 44
29 45 },
30 46
31 47 /**
32 48 * Lifecycle function--Called when page show
33 49 */
34   - onShow: function () {
  50 + onShow: function() {
  51 +
  52 + },
35 53
  54 + handleData: function(data) {
  55 + if (data.addition_items && data.addition_items.length>0){
  56 + for (var j = 0; j < data.addition_items.length; j++) {
  57 + var midItem = data.addition_items[j]
  58 + if (midItem.addition_category == 'continuing_education') {
  59 + var majors = [],
  60 + professions = []
  61 + for (var k = 0; k < midItem.detail_items.length; k++) {
  62 + var smallItem = midItem.detail_items[k]
  63 + if (smallItem.continue_education_type == 'major') {
  64 + majors.push(smallItem)
  65 + } else if (smallItem.continue_education_type == 'nomajor') {
  66 + professions.push(smallItem)
  67 + }
  68 + }
  69 + data.addition_items[j].majors = majors
  70 + data.addition_items[j].professions = professions
  71 + break;
  72 + }
  73 + }
  74 + }
  75 + return data
36 76 },
37 77
38   - lookandadd:function(e){
  78 + lookandadd: function(e) {
39 79 console.log("lookandadd", e);
40   - if (this.data.additiondata.options && this.data.additiondata.options.length>0){
  80 + if (this.data.additiondata.options && this.data.additiondata.options.length > 0) {
41 81 var newstatus = this.data.additiondata.options[e.currentTarget.id]
42 82 // if (newstatus == 'house_fund_rent' || newstatus == 'house_fund_loan'){
43 83 // newstatus = "house_fund"
... ... @@ -48,38 +88,48 @@ Page({
48 88 }
49 89 },
50 90
  91 + lookandadd02: function (e) {
  92 + console.log("lookandadd02", e);
  93 + if (this.data.additiondata.addition_items && this.data.additiondata.addition_items.length > 0) {
  94 + var newstatus = this.data.additiondata.addition_items[e.currentTarget.id].addition_category
  95 + wx.navigateTo({
  96 + url: '../lookandupdate/lookandupdate?status=' + newstatus + "&legal_entity_id=" + this.data.additiondata.legal_entity_id + "&legal_entity=" + this.data.additiondata.legal_entity,
  97 + })
  98 + }
  99 + },
  100 +
51 101 /**
52 102 * Lifecycle function--Called when page hide
53 103 */
54   - onHide: function () {
  104 + onHide: function() {
55 105
56 106 },
57 107
58 108 /**
59 109 * Lifecycle function--Called when page unload
60 110 */
61   - onUnload: function () {
  111 + onUnload: function() {
62 112
63 113 },
64 114
65 115 /**
66 116 * Page event handler function--Called when user drop down
67 117 */
68   - onPullDownRefresh: function () {
  118 + onPullDownRefresh: function() {
69 119
70 120 },
71 121
72 122 /**
73 123 * Called when page reach bottom
74 124 */
75   - onReachBottom: function () {
  125 + onReachBottom: function() {
76 126
77 127 },
78 128
79 129 /**
80 130 * Called when user click on the top right corner to share
81 131 */
82   - onShareAppMessage: function () {
  132 + onShareAppMessage: function() {
83 133
84 134 }
85 135 })
\ No newline at end of file
... ...
... ... @@ -3,12 +3,12 @@
3 3 <view class='text_gray_30' style='padding:30rpx'>您在“{{additiondata.legal_entity}}”申报的专项附加扣除项已添加完成,请完善各项的具体申报内容。</view>
4 4
5 5 <view wx:if="{{additiondata.options&&additiondata.options.length>0}}">
6   - <block wx:for="{{additiondata.options}}" wx:key="" wx:for-item="item" wx:for-index="idx" >
7   - <view wx:if="{{item=='children_education'}}" style='margin:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd' id='{{idx}}'>
  6 + <block wx:for="{{additiondata.options}}" wx:key="" wx:for-item="item" wx:for-index="idx">
  7 + <view wx:if="{{item=='children_education'}}" style='margin:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd' id='{{idx}}'>
8 8 <view style='height:40rpx'>
9 9 <text class='text_333_32 float_left'>子女教育</text>
10 10 <image class='arrow_img_wrap float_right' src="/images/arrow_right.png"></image>
11   - <text class='text_999_28' style='float:right' >查看</text>
  11 + <text class='text_999_28' style='float:right'>查看</text>
12 12 </view>
13 13 <view style='width:100%;padding:20rpx 20rpx;display:flex;flex-direction:row '>
14 14 <view class='float_left' style='flex:1'>
... ... @@ -17,7 +17,7 @@
17 17 </view>
18 18 <view class='float_right' style='flex:1'>
19 19 <text class='text_999_24 '>可扣除金额</text>
20   - <text class='text_orange_28 ' style='margin-left:20rpx'>¥{{additiondata.children_total_amount}}/月</text>
  20 + <text class='text_orange_28 ' style='margin-left:20rpx'>¥0/月</text>
21 21 </view>
22 22 </view>
23 23 </view>
... ... @@ -66,7 +66,7 @@
66 66 </view>
67 67 </view> -->
68 68 </view>
69   - <view wx:if="{{item=='medical_fund'}}" style='padding:30rpx 40rpx;display:flex;flex-direction:column' bindtap='lookandadd' id='{{idx}}'>
  69 + <view wx:if="{{item=='medical_fund'}}" style='padding:30rpx 40rpx;display:flex;flex-direction:column' bindtap='lookandadd' id='{{idx}}'>
70 70 <view style='height:40rpx'>
71 71 <text class='text_333_32 float_left'>大病医疗</text>
72 72 <image class='arrow_img_wrap float_right' src="/images/arrow_right.png"></image>
... ... @@ -83,11 +83,11 @@
83 83 </view>
84 84 </view>
85 85 </view>
86   - <view wx:if="{{item=='support_duty'}}" style='padding:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd' id='{{idx}}'>
  86 + <view wx:if="{{item=='support_duty'}}" style='padding:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd' id='{{idx}}'>
87 87 <view style='height:40rpx'>
88 88 <text class='text_333_32 float_left'>赡养老人</text>
89 89 <image class='arrow_img_wrap float_right' src="/images/arrow_right.png"></image>
90   - <text class='text_999_28' style='margin-bottom:8rpx;float:right' >查看</text>
  90 + <text class='text_999_28' style='margin-bottom:8rpx;float:right'>查看</text>
91 91 </view>
92 92 <view style='width:100%;padding:20rpx 20rpx;display:flex;flex-direction:row '>
93 93 <view class='float_left' style='flex:1'>
... ... @@ -104,7 +104,7 @@
104 104 <view style='height:40rpx'>
105 105 <text class='text_333_32 float_left'>住房</text>
106 106 <image class='arrow_img_wrap float_right' src="/images/arrow_right.png"></image>
107   - <text class='text_999_28' style='margin-bottom:8rpx;float:right' >查看</text>
  107 + <text class='text_999_28' style='margin-bottom:8rpx;float:right'>查看</text>
108 108 </view>
109 109 <view style='width:100%;padding:20rpx 20rpx;display:flex;flex-direction:row '>
110 110 <view class='float_left' style='flex:1'>
... ... @@ -121,4 +121,65 @@
121 121 </block>
122 122 </view>
123 123
  124 + <view wx:elif="{{additiondata.addition_items&&additiondata.addition_items.length>0}}">
  125 + <block wx:for="{{additiondata.addition_items}}" wx:key="" wx:for-item="itemData" wx:for-index="idx">
  126 + <view wx:if="{{itemData.addition_category!='medical_fund'}}">
  127 + <view style='margin:0 50rpx;background:#e5e5e5;height:2rpx;'></view>
  128 + <view style='padding:30rpx 40rpx;display:flex;flex-direction:column ' bindtap='lookandadd02' id='{{idx}}'>
  129 + <view style='height:40rpx'>
  130 + <text class='text_333_32 float_left'>{{additiontitle[itemData.addition_category]}}</text>
  131 + <text class='text_333_32 float_left' hidden="{{(itemData.addition_category=='continuing_education'||itemData.addition_category=='house_fund')||itemData.count<2}}">({{itemData.count}})</text>
  132 + <image class='arrow_img_wrap float_right' src="/images/arrow_right.png"></image>
  133 + <text class='text_999_28' style='margin-bottom:8rpx;float:right'>查看</text>
  134 + </view>
  135 + <view wx:if="{{itemData.addition_category=='continuing_education'&&itemData.detail_items.length>0}}" style='padding:20rpx'>
  136 + <view wx:for="{{itemData.majors}}" wx:key="" wx:for-item="major">
  137 + <view wx:if="{{index==0}}">
  138 + <text wx:if='{{itemData.majors.length>1}}' style='font-size:28rpx;color:#666'>学历(学位)继续教育 ({{itemData.majors.length}})</text>
  139 + <text wx:else style='font-size:28rpx;color:#666'>学历(学位)继续教育</text>
  140 + <view style='width:100%;display:flex;flex-direction:row '>
  141 + <view class='float_left' style='flex:1'>
  142 + <text class='text_999_24 '>扣除方式</text>
  143 + <text class='text_gray_28' style='margin-left:20rpx'>{{reducetype[major.deduction_type]}}度</text>
  144 + </view>
  145 + <view class='float_right' style='flex:1'>
  146 + <text class='text_999_24 '>可扣除金额</text>
  147 + <text class='text_orange_28 ' style='margin-left:20rpx'>¥{{major.deduction_amount}}/{{reducetype[major.deduction_type]}}</text>
  148 + </view>
  149 + </view>
  150 + </view>
  151 + </view>
  152 + <view wx:for="{{itemData.professions}}" wx:key="" wx:for-item="profession">
  153 + <view wx:if="{{index==0}}">
  154 + <text wx:if='{{itemData.professions.length>1}}' style='font-size:28rpx;color:#666'>职业资格继续教育 ({{itemData.professions.length}})</text>
  155 + <text wx:else style='font-size:28rpx;color:#666'>职业资格继续教育</text>
  156 + <text style='font-size:28rpx;color:#666' hidden='{{profession.detail_count<2}}'>({{profession.detail_count}})</text>
  157 + <view style='width:100%;display:flex;flex-direction:row '>
  158 + <view class='float_left' style='flex:1'>
  159 + <text class='text_999_24 '>扣除方式</text>
  160 + <text class='text_gray_28' style='margin-left:20rpx'>{{reducetype[profession.deduction_type]}}度</text>
  161 + </view>
  162 + <view class='float_right' style='flex:1'>
  163 + <text class='text_999_24 '>可扣除金额</text>
  164 + <text class='text_orange_28 ' style='margin-left:20rpx'>¥{{profession.deduction_amount}}/{{reducetype[profession.deduction_type]}}</text>
  165 + </view>
  166 + </view>
  167 + </view>
  168 + </view>
  169 + </view>
  170 + <view wx:else style='width:100%;padding:20rpx 20rpx;display:flex;flex-direction:row '>
  171 + <view class='float_left' style='flex:1'>
  172 + <text class='text_999_24 '>扣除方式</text>
  173 + <text class='text_gray_28' style='margin-left:20rpx'>{{reducetype[itemData.deduction_type]}}度</text>
  174 + </view>
  175 + <view class='float_right' style='flex:1'>
  176 + <text class='text_999_24 '>可扣除金额</text>
  177 + <text class='text_orange_28 ' style='margin-left:20rpx'>¥{{itemData.deduction_amount}}/{{reducetype[itemData.deduction_type]}}</text>
  178 + </view>
  179 + </view>
  180 + </view>
  181 + </view>
  182 + </block>
  183 + </view>
  184 +
124 185 </view>
\ No newline at end of file
... ...
注册登录 后发表评论