weekReport.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="report-container">
  3. <cu-custom isBack="true" bgColor="#000000"><view slot="content" style="color: #FFFFFF">周报告</view></cu-custom>
  4. <view class="month-report-header self-center items-center">
  5. <view class="flex-row header-date self-center">
  6. <image class="image_1"
  7. src="../../static/report/reportIconLeft.png"
  8. />
  9. <text @click="openWeek" class="text_1">2023年第22周(05-29至06-04)</text>
  10. <image class="image_2"
  11. src="../../static/report/reportIconRight.png"
  12. />
  13. </view>
  14. </view>
  15. <uni-popup ref="popup" type="bottom">
  16. <!-- value值不传默认是当前周 -->
  17. <ccq-week-picker :value="value" @change="getWeeks"></ccq-week-picker>
  18. </uni-popup>
  19. <view class="month-report flex-col">
  20. <view class="block-month-report flex-col">
  21. <view class="header-block-report">
  22. <uni-section title="睡眠习惯" type="line"></uni-section>
  23. </view>
  24. <view class="chart-block-report">
  25. </view>
  26. </view>
  27. </view>
  28. <view class="month-report flex-col">
  29. <view class="block-month-report flex-col">
  30. <view class="header-block-report">
  31. <uni-section title="睡眠效率" type="line"></uni-section>
  32. </view>
  33. <view class="chart-block-report">
  34. </view>
  35. </view>
  36. </view>
  37. <view class="month-report flex-col">
  38. <view class="block-month-report flex-col">
  39. <view class="header-block-report">
  40. <uni-section title="安稳度" type="line"></uni-section>
  41. </view>
  42. <view class="chart-block-report">
  43. </view>
  44. </view>
  45. </view>
  46. <view class="month-report flex-col">
  47. <view class="block-month-report flex-col">
  48. <view class="header-block-report">
  49. <uni-section title="心脏系统" type="line"></uni-section>
  50. </view>
  51. <view class="chart-block-report">
  52. </view>
  53. </view>
  54. </view>
  55. <view class="month-report flex-col">
  56. <view class="block-month-report flex-col">
  57. <view class="header-block-report">
  58. <uni-section title="呼吸系统" type="line"></uni-section>
  59. </view>
  60. <view class="chart-block-report">
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import dayjs from 'dayjs';
  68. // 引入得到周信息函数
  69. import weekjs from '../../components/ccq-week-picker/week.js';
  70. export default {
  71. data() {
  72. return {
  73. today:dayjs().format('YYYY-MM-DD'),
  74. yearMonthWeek: '',
  75. week: '',
  76. value: ''
  77. };
  78. },
  79. onReady: function() {
  80. },
  81. methods: {
  82. // 默认选择当前周
  83. weekInit(){
  84. let y = dayjs().year();
  85. let m = dayjs().month();
  86. let res = weekjs.getWeeksByMonth(y, m+1,this.today,1);
  87. this.setResultInfo(res);
  88. },
  89. getWeeks(res) {
  90. if (res) {
  91. this.setResultInfo(res);
  92. }
  93. this.$refs['popup'].close()
  94. },
  95. // 设置结果集
  96. setResultInfo(i){
  97. console.log(i);
  98. let info = i.week;
  99. this.yearMonthWeek = `${info.year}年${info.month}月${info.text} `;
  100. this.week = info;
  101. this.value = info.val;
  102. },
  103. openWeek() {
  104. this.$refs['popup'].open()
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss">
  110. .report-container {
  111. background-color: #000000;
  112. padding-bottom: 2rem;
  113. .month-report {
  114. margin-top: 1rem;
  115. .block-month-report {
  116. margin: 0 1.25rem;
  117. opacity: 0.8;
  118. background-image: linear-gradient(180deg, #341a4b 0%, #167df2 100%);
  119. border-radius: 0.5rem;
  120. height: 7.81rem;
  121. .header-block-report {
  122. }
  123. .chart-block-report {
  124. }
  125. }
  126. }
  127. .month-report-header {
  128. padding: 0.5rem 1.2rem;
  129. background-color: #7e5a9d4d;
  130. border-radius: 1rem;
  131. -webkit-backdrop-filter: blur(0.31rem);
  132. backdrop-filter: blur(0.31rem);
  133. height: 2rem;
  134. width: fit-content;
  135. margin: 0 auto;
  136. text-align: center;
  137. margin-top: 1rem;
  138. .header-date {
  139. // display: inline-block;
  140. }
  141. .text_1 {
  142. color: #ffffff;
  143. padding: 0 0.3rem;
  144. }
  145. .image_1 {
  146. width: 0.63rem;
  147. height: 0.94rem;
  148. }
  149. .image_2 {
  150. width: 0.63rem;
  151. height: 0.94rem;
  152. }
  153. }
  154. }
  155. </style>