index.wxml 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!--pages/data/index.wxml-->
  2. <view class="sg-container sg-index-bg">
  3. <view class="sg-flex sg-pad sg-align-center sg-index-bg">
  4. <view class="sg-white-bg sg-pad-sm sg-flex-grow sg-gray-color sg-flex sg-align-center" bindtap="switchShow"
  5. data-show="{{true}}" data-name="projectShow">
  6. <view class="sg-flex-grow">{{project_names ? project_names : '选择查看项目'}}</view>
  7. <van-icon name="arrow-down"></van-icon>
  8. </view>
  9. <van-icon name="search" class="sg-icon sg-white sg-pad-sm" style="padding-right: 0" bindtap="getData"></van-icon>
  10. </view>
  11. <van-popup show="{{ projectShow }}" position="bottom" custom-style="height: 100%;">
  12. <view>
  13. <view class="sg-flex sg-align-center sg-space-between sg-fix-top sg-white-bg sg-pad sg-white-bg" style="box-sizing: border-box;z-index:100">
  14. <view></view>
  15. <view class="sg-bold">选择项目</view>
  16. <view class="sg-gray-color" bindtap="closeProject" data-show="{{false}}" data-name="projectShow">确定</view>
  17. </view>
  18. <view class="sg-list sg-pad" style="margin-top: 80rpx">
  19. <view wx:for="{{projects}}" wx:key="index" class="sg-flex sg-align-center sg-space-between sg-pad-tb-sm sg-bottom-border {{item.checked ? 'sg-index-color' : ''}}" bindtap="switchCheck" data-index="{{index}}">
  20. <view>{{item.name}}</view>
  21. <van-icon name="{{item.checked ? 'passed' : 'circle'}}" class="sg-icon" />
  22. </view>
  23. </view>
  24. </view>
  25. </van-popup>
  26. <view class="sg-white sg-bold sg-flex sg-align-center sg-space-around">
  27. <view class="sg-center">
  28. <view class="sg-font-lg">{{data.total_project ? data.total_project : 0}}</view>
  29. <view class="sg-font-xs sg-pad-tb-sm">项目累计消费</view>
  30. </view>
  31. <view class="sg-center">
  32. <view class="sg-font-lg">{{data.total_month ? data.total_month : 0}}</view>
  33. <view class="sg-font-xs sg-pad-tb-sm">当月累计消费</view>
  34. </view>
  35. <view class="sg-center">
  36. <view>时间选择</view>
  37. <view class="sg-font-small sg-pad-tb-sm sg-flex sg-align-center">
  38. <text>{{date}}</text>
  39. <!-- <van-icon name="arrow-down" class="sg-icon"></van-icon> -->
  40. </view>
  41. </view>
  42. </view>
  43. <view class="sg-white-bg sg-chart-box sg-pad" wx:if="{{!projectShow && !dateShow}}">
  44. <block wx:if="{{project_names}}">
  45. <view class="sg-flex sg-pad-tb sg-align-center sg-space-between">
  46. <view>
  47. <picker bindchange="onChange" value="{{chartIndex}}" range="{{charts}}" range-key="name"
  48. data-name="chartIndex" class="sg-flex-grow">
  49. <view class="picker sg-flex sg-align-center">
  50. <text>{{chartIndex >= 0 ? charts[chartIndex].name : '显示类型'}}</text>
  51. <van-icon name="arrow-down"></van-icon>
  52. </view>
  53. </picker>
  54. </view>
  55. <view class="sg-flex sg-align-center">
  56. <view class="sg-radio-group sg-flex sg-align-center sg-fon-small sg-margin-right sg-light-gray-bg">
  57. <view class="sg-radio {{index == dateIndex ? 'sg-shadow sg-selected sg-index-bg sg-white sg-bold' : ''}}"
  58. wx:for="{{dateTypes}}" wx:key="index" data-index="{{index}}" data-name="dateIndex" bindtap="radioChange">
  59. {{item.name}}</view>
  60. </view>
  61. <van-icon name="notes-o" class="sg-icon-lg sg-margin-right" bindtap="switchShow" data-name="dateShow"
  62. data-show="{{true}}"></van-icon>
  63. <van-icon name="filter-o" class="sg-icon-lg" bindtap="navigate" data-url="/pages/filter-data/index"></van-icon>
  64. </view>
  65. </view>
  66. <view class="sg-chart">
  67. <ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
  68. </view>
  69. </block>
  70. <block wx:else>
  71. <view class="sg-center sg-gray-color sg-font-small">
  72. <view>筛选条件暂无</view>
  73. <view>请选择需要查看的项目后</view>
  74. <view>数据才可进行查看</view>
  75. </view>
  76. </block>
  77. </view>
  78. <van-popup show="{{ dateShow && dateIndex == 0 }}" position="bottom" custom-style="height: 60vh">
  79. <van-picker columns="{{ years_months }}" bind:change="onDateChange" class="sg-year-picker" title="请选择开始日期"
  80. show-toolbar bind:cancel="switchShow" bind:confirm="dateConfirm" data-name="dateShow" data-show="{{false}}" />
  81. </van-popup>
  82. <van-calendar show="{{ dateShow && dateIndex == 1 }}" bind:close="switchShow" bind:confirm="monthDateConfirm"
  83. data-name="dateShow" data-show="{{false}}" min-date="{{min_date}}" max-date="{{max_date}}" class="sg-calendar"
  84. position="top" />
  85. </view>