zx 3 years ago
parent 9396c9c903
commit c3772c8cf2

@ -104,6 +104,13 @@ Page({
this.setData({ranking: [], endDate: this.data.dateList[0], startDate: this.data.dateList[2], currentDate: '近3个月'}) this.setData({ranking: [], endDate: this.data.dateList[0], startDate: this.data.dateList[2], currentDate: '近3个月'})
} else if(value == 'past6') { } else if(value == 'past6') {
this.setData({ranking: [], endDate: this.data.dateList[0], startDate: this.data.dateList[5], currentDate: '近6个月'}) this.setData({ranking: [], endDate: this.data.dateList[0], startDate: this.data.dateList[5], currentDate: '近6个月'})
} else if(value == 'thisyear') {
let start = new Date(this.data.dateList[0]).getFullYear() + '-01';
this.setData({ranking: [], endDate: this.data.dateList[0], startDate: start, currentDate: '今年'})
} else if(value == 'lastyear') {
let start = (new Date(this.data.dateList[0]).getFullYear() - 1) + '-01';
let end = (new Date(this.data.dateList[0]).getFullYear() - 1) + '-12';
this.setData({ranking: [], endDate: end, startDate: start, currentDate: '去年'})
} }
this.getTrend(); this.getTrend();
}, },

@ -27,6 +27,14 @@
<view data-value="past6" wx-if="{{currentDate == '近6个月'}}" class="more-item-active" style="width: 200rpx" bindtap="changePast">近6个月</view> <view data-value="past6" wx-if="{{currentDate == '近6个月'}}" class="more-item-active" style="width: 200rpx" bindtap="changePast">近6个月</view>
<view data-value="past6" wx-if="{{currentDate != '近6个月'}}" class="more-item" style="width: 200rpx" bindtap="changePast">近6个月</view> <view data-value="past6" wx-if="{{currentDate != '近6个月'}}" class="more-item" style="width: 200rpx" bindtap="changePast">近6个月</view>
</view> </view>
<view>
<view data-value="thisyear" wx-if="{{currentDate == '今年'}}" class="more-item-active" style="width: 200rpx" bindtap="changePast">今年</view>
<view data-value="thisyear" wx-if="{{currentDate != '今年'}}" class="more-item" style="width: 200rpx" bindtap="changePast">今年</view>
</view>
<view>
<view data-value="lastyear" wx-if="{{currentDate == '去年'}}" class="more-item-active" style="width: 200rpx" bindtap="changePast">去年</view>
<view data-value="lastyear" wx-if="{{currentDate != '去年'}}" class="more-item" style="width: 200rpx" bindtap="changePast">去年</view>
</view>
</view> </view>
</view> </view>
</van-dropdown-item> </van-dropdown-item>

Loading…
Cancel
Save