report.vue 4.6 KB

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