123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <!--pages/minePages/bsrl/bsrl.wxml-->
- <view class="link-box">
- <view class="link"></view>
- <view class="link"></view>
- </view>
- <scroll-view class="bsrl-container" scroll-y enhanced show-scrollbar="{{false}}">
- <view class="date-box">
- <view class="date-title">
- <view class="date-title-left" hover-class="date-title-hover" bind:tap="lastMonth">
- <image src="../../../images/bsrl/chage.png" mode="widthFix" />
- </view>
- <view class="date-title-center">
- <view class="date-title-center-text">{{selectedDate.year}}年{{selectedDate.month}}月</view>
- <view wx:if="{{selectedDate.month != nowDate.month || selectedDate.year != nowDate.year}}" class="date-title-center-back" hover-class="date-title-hover" bind:tap="getNowDate">回今日</view>
- </view>
- <view class="date-title-right" hover-class="date-title-hover" bind:tap="nextMonth">
- <image src="../../../images/bsrl/chage.png" mode="widthFix" />
- </view>
- </view>
- <view class="date-week">
- <view class="week" wx:for="{{weeks}}" wx:key="index">{{item}}</view>
- </view>
- <view class="date-day">
- <view class="day {{tools.setClass(item,nowDate,tapDate,selectedDate)}}" wx:for="{{tools.splits(calender,0)}}" wx:key="index" data-item="{{item}}" bind:tap="tapCalender">{{item.day}}</view>
- </view>
- <view class="date-day">
- <view class="day {{tools.setClass(item,nowDate,tapDate,selectedDate)}}" wx:for="{{tools.splits(calender,1)}}" wx:key="index" data-item="{{item}}" bind:tap="tapCalender">{{item.day}}</view>
- </view>
- <view class="date-day">
- <view class="day {{tools.setClass(item,nowDate,tapDate,selectedDate)}}" wx:for="{{tools.splits(calender,2)}}" wx:key="index" data-item="{{item}}" bind:tap="tapCalender">{{item.day}}</view>
- </view>
- <view class="date-day">
- <view class="day {{tools.setClass(item,nowDate,tapDate,selectedDate)}}" wx:for="{{tools.splits(calender,3)}}" wx:key="index" data-item="{{item}}" bind:tap="tapCalender">{{item.day}}</view>
- </view>
- <view class="date-day">
- <view class="day {{tools.setClass(item,nowDate,tapDate,selectedDate)}}" wx:for="{{tools.splits(calender,4)}}" wx:key="index" data-item="{{item}}" bind:tap="tapCalender">{{item.day}}</view>
- </view>
- <view class="date-day">
- <view class="day {{tools.setClass(item,nowDate,tapDate,selectedDate)}}" wx:for="{{tools.splits(calender,5)}}" wx:key="index" data-item="{{item}}" bind:tap="tapCalender">{{item.day}}</view>
- </view>
- </view>
- <view class="tabbar">
- <view class="tab {{index == tabIndex?'tab-active':''}}" wx:for="{{tabbar}}" wx:key="index" data-index="{{index}}" bind:tap="tab">{{item}}</view>
- </view>
- <scroll-view wx:if="{{tabIndex === 0}}" scroll-y class="detail">
- <view class="dayDetail-box">
- <view class="dayDetail" wx:for="{{dayInfos}}" wx:key="index">{{item.bssz}}</view>
- </view>
- </scroll-view>
- <scroll-view wx:else scroll-y class="detail">
- <view class="monthDetail-box">
- <view class="monthDetail" wx:for="{{monthInfos}}" wx:key="index">
- <view class="monthDetail-date">{{tools.dateFormat(item.bsjssj)}}</view>
- <view class="monthDetail-content">{{item.bssz}}</view>
- </view>
- </view>
- </scroll-view>
- </scroll-view>
- <wxs module="tools">
- var splits = function (e, i) {
- if (e) {
- return e.slice(0 + (i * 7), 7 * (i + 1))
- } else {
- return ""
- }
- }
- var setClass = function (e, n, t, s) {
- if (e && n && t && s) {
- if (e.year == n.year && e.month == n.month && e.day == n.day) {
- return "day-now"
- } else if (e.year == t.year && e.month == t.month && e.day == t.day) {
- return "day-selected"
- } else if (e.year != s.year || e.month != s.month) {
- return "day-not"
- } else {
- return ""
- }
- } else {
- return ""
- }
- }
- var dateFormat = function (e, i) {
- if (e) {
- var date = e.substring(5, 10)
- date = date.split("-")
- return date[0] + '月' + date[1] + '日'
- } else {
- return ""
- }
- }
- var tools = {
- splits: splits,
- setClass: setClass,
- dateFormat: dateFormat
- }
- module.exports = tools;
- </wxs>
|