bsrl.wxml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!--pages/minePages/bsrl/bsrl.wxml-->
  2. <view class="link-box">
  3. <view class="link"></view>
  4. <view class="link"></view>
  5. </view>
  6. <scroll-view class="bsrl-container" scroll-y enhanced show-scrollbar="{{false}}">
  7. <view class="date-box">
  8. <view class="date-title">
  9. <view class="date-title-left" hover-class="date-title-hover" bind:tap="lastMonth">
  10. <image src="../../../images/bsrl/chage.png" mode="widthFix" />
  11. </view>
  12. <view class="date-title-center">
  13. <view class="date-title-center-text">{{selectedDate.year}}年{{selectedDate.month}}月</view>
  14. <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>
  15. </view>
  16. <view class="date-title-right" hover-class="date-title-hover" bind:tap="nextMonth">
  17. <image src="../../../images/bsrl/chage.png" mode="widthFix" />
  18. </view>
  19. </view>
  20. <view class="date-week">
  21. <view class="week" wx:for="{{weeks}}" wx:key="index">{{item}}</view>
  22. </view>
  23. <view class="date-day">
  24. <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>
  25. </view>
  26. <view class="date-day">
  27. <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>
  28. </view>
  29. <view class="date-day">
  30. <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>
  31. </view>
  32. <view class="date-day">
  33. <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>
  34. </view>
  35. <view class="date-day">
  36. <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>
  37. </view>
  38. <view class="date-day">
  39. <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>
  40. </view>
  41. </view>
  42. <view class="tabbar">
  43. <view class="tab {{index == tabIndex?'tab-active':''}}" wx:for="{{tabbar}}" wx:key="index" data-index="{{index}}" bind:tap="tab">{{item}}</view>
  44. </view>
  45. <scroll-view wx:if="{{tabIndex === 0}}" scroll-y class="detail">
  46. <view class="dayDetail-box">
  47. <view class="dayDetail" wx:for="{{dayInfos}}" wx:key="index">{{item.bssz}}</view>
  48. </view>
  49. </scroll-view>
  50. <scroll-view wx:else scroll-y class="detail">
  51. <view class="monthDetail-box">
  52. <view class="monthDetail" wx:for="{{monthInfos}}" wx:key="index">
  53. <view class="monthDetail-date">{{tools.dateFormat(item.bsjssj)}}</view>
  54. <view class="monthDetail-content">{{item.bssz}}</view>
  55. </view>
  56. </view>
  57. </scroll-view>
  58. </scroll-view>
  59. <wxs module="tools">
  60. var splits = function (e, i) {
  61. if (e) {
  62. return e.slice(0 + (i * 7), 7 * (i + 1))
  63. } else {
  64. return ""
  65. }
  66. }
  67. var setClass = function (e, n, t, s) {
  68. if (e && n && t && s) {
  69. if (e.year == n.year && e.month == n.month && e.day == n.day) {
  70. return "day-now"
  71. } else if (e.year == t.year && e.month == t.month && e.day == t.day) {
  72. return "day-selected"
  73. } else if (e.year != s.year || e.month != s.month) {
  74. return "day-not"
  75. } else {
  76. return ""
  77. }
  78. } else {
  79. return ""
  80. }
  81. }
  82. var dateFormat = function (e, i) {
  83. if (e) {
  84. var date = e.substring(5, 10)
  85. date = date.split("-")
  86. return date[0] + '月' + date[1] + '日'
  87. } else {
  88. return ""
  89. }
  90. }
  91. var tools = {
  92. splits: splits,
  93. setClass: setClass,
  94. dateFormat: dateFormat
  95. }
  96. module.exports = tools;
  97. </wxs>