提交 639da0f149181a22d3c1bde0c5a007263e433740

作者 pangy
1 个父辈 41285960

继续教育展示修改

@@ -1147,11 +1147,11 @@ Page({ @@ -1147,11 +1147,11 @@ Page({
1147 return 1147 return
1148 } 1148 }
1149 if (this.data.studystartdate.selected.length < 1) { 1149 if (this.data.studystartdate.selected.length < 1) {
1150 - this.showToast('请选择入学时间') 1150 + this.showToast('请选择入学时间')
1151 return 1151 return
1152 } 1152 }
1153 if (this.data.studyenddate.selected.length < 1) { 1153 if (this.data.studyenddate.selected.length < 1) {
1154 - this.showToast('请选择毕业时间') 1154 + this.showToast('请选择毕业时间')
1155 return 1155 return
1156 } else { 1156 } else {
1157 var activedDate = (Date.parse(new Date('2019-01-01')) / 1000) 1157 var activedDate = (Date.parse(new Date('2019-01-01')) / 1000)
@@ -101,7 +101,7 @@ Page({ @@ -101,7 +101,7 @@ Page({
101 if (res && res.data) { 101 if (res && res.data) {
102 console.log("res", res) 102 console.log("res", res)
103 that.setData({ 103 that.setData({
104 - additionlist: res.data.items 104 + additionlist: that.handleData(res.data.items)
105 }) 105 })
106 } 106 }
107 wx.hideLoading() 107 wx.hideLoading()
@@ -114,7 +114,30 @@ Page({ @@ -114,7 +114,30 @@ Page({
114 } 114 }
115 }) 115 })
116 }, 116 },
117 - 117 + handleData: function (items) {
  118 + for (var i = 0; i < items.length ; i++){
  119 + var bigItem = items[i]
  120 + for (var j = 0; j < bigItem.addition_items.length; j++) {
  121 + var midItem = bigItem.addition_items[j]
  122 + if (midItem.addition_category == 'continuing_education'){
  123 + var majors = [], professions = []
  124 + for (var k = 0; k < midItem.detail_items.length; k++) {
  125 + var smallItem = midItem.detail_items[k]
  126 + if (smallItem.continue_education_type == 'major'){
  127 + majors.push(smallItem)
  128 + } else if (smallItem.continue_education_type == 'nomajor'){
  129 + professions.push(smallItem)
  130 + }
  131 + }
  132 + items[i].addition_items[j].majors = majors
  133 + items[i].addition_items[j].professions = professions
  134 + break;
  135 + }
  136 + }
  137 + }
  138 + console.log('ddddd', items)
  139 + return items
  140 + },
118 /** 141 /**
119 * Lifecycle function--Called when page hide 142 * Lifecycle function--Called when page hide
120 */ 143 */
@@ -22,7 +22,40 @@ @@ -22,7 +22,40 @@
22 <text class='text_999_28' style='margin-bottom:8rpx;float:right'>查看</text> 22 <text class='text_999_28' style='margin-bottom:8rpx;float:right'>查看</text>
23 </view> 23 </view>
24 <view wx:if="{{itemData.addition_category=='continuing_education'&&itemData.detail_items.length>0}}" style='padding:20rpx'> 24 <view wx:if="{{itemData.addition_category=='continuing_education'&&itemData.detail_items.length>0}}" style='padding:20rpx'>
25 - <view wx:for="{{itemData.detail_items}}" wx:key="" wx:for-item="itemtypedetail"> 25 + <view wx:for="{{itemData.majors}}" wx:key="" wx:for-item="major">
  26 + <view wx:if="{{index==0}}">
  27 + <text wx:if='{{itemData.majors.length>1}}' style='font-size:28rpx;color:#666'>学历教育 ({{itemData.majors.length}})</text>
  28 + <text wx:else style='font-size:28rpx;color:#666'>学历教育</text>
  29 + <view style='width:100%;display:flex;flex-direction:row '>
  30 + <view class='float_left' style='flex:1'>
  31 + <text class='text_999_24 '>扣除方式</text>
  32 + <text class='text_gray_28' style='margin-left:20rpx'>{{reducetype[major.deduction_type]}}度</text>
  33 + </view>
  34 + <view class='float_right' style='flex:1'>
  35 + <text class='text_999_24 '>可扣除金额</text>
  36 + <text class='text_orange_28 ' style='margin-left:20rpx'>¥{{major.deduction_amount}}/{{reducetype[major.deduction_type]}}</text>
  37 + </view>
  38 + </view>
  39 + </view>
  40 + </view>
  41 + <view wx:for="{{itemData.professions}}" wx:key="" wx:for-item="profession">
  42 + <view wx:if="{{index==0}}">
  43 + <text wx:if='{{itemData.professions.length>1}}' style='font-size:28rpx;color:#666'>非学历教育 ({{itemData.professions.length}})</text>
  44 + <text wx:else style='font-size:28rpx;color:#666'>非学历教育</text>
  45 + <text style='font-size:28rpx;color:#666' hidden='{{profession.detail_count<2}}'>({{profession.detail_count}})</text>
  46 + <view style='width:100%;display:flex;flex-direction:row '>
  47 + <view class='float_left' style='flex:1'>
  48 + <text class='text_999_24 '>扣除方式</text>
  49 + <text class='text_gray_28' style='margin-left:20rpx'>{{reducetype[profession.deduction_type]}}度</text>
  50 + </view>
  51 + <view class='float_right' style='flex:1'>
  52 + <text class='text_999_24 '>可扣除金额</text>
  53 + <text class='text_orange_28 ' style='margin-left:20rpx'>¥{{profession.deduction_amount}}/{{reducetype[profession.deduction_type]}}</text>
  54 + </view>
  55 + </view>
  56 + </view>
  57 + </view>
  58 + <!-- <view wx:for="{{itemData.detail_items}}" wx:key="" wx:for-item="itemtypedetail">
26 <view wx:if="{{itemtypedetail.continue_education_type=='major'}}"> 59 <view wx:if="{{itemtypedetail.continue_education_type=='major'}}">
27 <text style='font-size:28rpx;color:#666'>学历教育</text> 60 <text style='font-size:28rpx;color:#666'>学历教育</text>
28 <view style='width:100%;display:flex;flex-direction:row '> 61 <view style='width:100%;display:flex;flex-direction:row '>
@@ -50,7 +83,7 @@ @@ -50,7 +83,7 @@
50 </view> 83 </view>
51 </view> 84 </view>
52 </view> 85 </view>
53 - </view> 86 + </view> -->
54 87
55 </view> 88 </view>
56 <view wx:else style='width:100%;padding:20rpx 20rpx;display:flex;flex-direction:row '> 89 <view wx:else style='width:100%;padding:20rpx 20rpx;display:flex;flex-direction:row '>
注册登录 后发表评论