report.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的报告'></cus-header>
  4. <div class="tabs adf">
  5. <div class="t_pre" :class="{'active':tidx===2}" @tap="changeTab(2)">个人报告</div>
  6. <div class="t_pre" :class="{'active':tidx===1}" @tap="changeTab(1)">团队报告</div>
  7. </div>
  8. <template v-if="list.length">
  9. <div class="list">
  10. <div class="l_item" v-for="(item,index) in list" :key="index">
  11. <div class="li_title">{{item.reportName||''}}</div>
  12. <div class="li_pre">报告时间:<span>{{item.createDate||''}}</span></div>
  13. <div class="li_pre" v-if="item.type==1">作答人数:<span>{{item.answerNum||0}}/{{item.finishNum||0}}</span></div>
  14. <div class="li_pre">团队名称:<span>{{item.teamName||''}}</span></div>
  15. <div class="li_jd adfacjb" v-if="item.type==1">
  16. <div class="lj_l">
  17. <div class="ljl_box" :style="{'width':((item.answerNum||0)/(item.finishNum||0)*100)+'%'}"></div>
  18. </div>
  19. <div class="lj_r">进度<span>{{item.answerNum||0}}/{{item.finishNum||0}}</span></div>
  20. </div>
  21. <div class="li_view" @tap="viewReport(item)">查看</div>
  22. </div>
  23. </div>
  24. </template>
  25. <template v-else>
  26. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  27. </template>
  28. </view>
  29. </template>
  30. <script>
  31. import pageEmpty from '@/components/pageEmpty/index.vue'
  32. export default {
  33. components:{ pageEmpty },
  34. data(){
  35. return {
  36. tidx:2,
  37. list:[]
  38. }
  39. },
  40. onLoad() {
  41. this.getReportList();
  42. },
  43. methods:{
  44. changeTab(idx){
  45. this.tidx = idx;
  46. this.getReportList();
  47. },
  48. getReportList(){
  49. this.$api.get('/core/report/member/personalReportList/'+this.tidx).then(res=>{
  50. if(res.data.code!==0) return this.$showToast(res.data.msg)
  51. this.list = res.data.data;
  52. })
  53. },
  54. viewReport(item){
  55. if(!item.fileUrl) return this.$showToast('报告pdf为空,请联系教练。')
  56. uni.navigateTo({
  57. url:`/pages/reportDetail?pdfUrl=${item.fileUrl}&reportId=${item.reportId}`
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style scoped lang="less">
  64. .page{
  65. background: #F7F7F7;
  66. padding-bottom: 40rpx;
  67. box-sizing: border-box;
  68. .tabs{
  69. width: 100%;
  70. height: 90rpx;
  71. background: #FFFFFF;
  72. .t_pre{
  73. width: 50%;
  74. height: 90rpx;
  75. font-family: PingFang-SC, PingFang-SC;
  76. font-weight: bold;
  77. font-size: 32rpx;
  78. color: #666666;
  79. line-height: 90rpx;
  80. text-align: center;
  81. position: relative;
  82. &.active{
  83. color: #761E6A;
  84. &::after{
  85. content: '';
  86. width: 148rpx;
  87. height: 6rpx;
  88. background: #761E6A;
  89. border-radius: 9rpx;
  90. position: absolute;
  91. left: 50%;
  92. margin-left: -74rpx;
  93. bottom: 0;
  94. }
  95. }
  96. }
  97. }
  98. .list{
  99. padding: 0 24rpx;
  100. overflow: hidden;
  101. .l_item{
  102. margin-top: 20rpx;
  103. background: #FFFFFF;
  104. border-radius: 16rpx;
  105. padding: 40rpx 24rpx;
  106. position: relative;
  107. .li_title{
  108. width: calc(100% - 100rpx);
  109. font-family: PingFang-SC, PingFang-SC;
  110. font-weight: bold;
  111. font-size: 30rpx;
  112. color: #252525;
  113. line-height: 30rpx;
  114. overflow: hidden;
  115. text-overflow: ellipsis;
  116. white-space: nowrap;
  117. }
  118. .li_pre{
  119. margin-top: 40rpx;
  120. font-family: PingFangSC, PingFang SC;
  121. font-weight: 400;
  122. font-size: 26rpx;
  123. color: #86909C;
  124. line-height: 26rpx;
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. white-space: nowrap;
  128. span{
  129. color: #1D2129;
  130. }
  131. }
  132. .li_jd{
  133. margin-top: 27rpx;
  134. .lj_l{
  135. width: calc(100% - 181rpx);
  136. height: 10rpx;
  137. background: #EFEFEF;
  138. border-radius: 5rpx;
  139. position: relative;
  140. .ljl_box{
  141. height: 100%;
  142. background: #FFD750;
  143. border-radius: 5rpx;
  144. position: absolute;
  145. left: 0;
  146. top: 0;
  147. }
  148. }
  149. .lj_r{
  150. font-family: PingFangSC, PingFang SC;
  151. font-weight: 400;
  152. font-size: 24rpx;
  153. color: #A6A6A6;
  154. line-height: 24rpx;
  155. span{
  156. color: #1D2129;
  157. margin-left: 8rpx;
  158. }
  159. }
  160. }
  161. .li_view{
  162. width: 88rpx;
  163. height: 54rpx;
  164. background: #833478;
  165. border-radius: 24rpx;
  166. font-family: PingFang-SC, PingFang-SC;
  167. font-weight: bold;
  168. font-size: 24rpx;
  169. color: #FFFFFF;
  170. line-height: 54rpx;
  171. text-align: center;
  172. position: absolute;
  173. top: 40rpx;
  174. right: 24rpx;
  175. }
  176. }
  177. }
  178. }
  179. </style>