receiveList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="rbox">
  3. <u-list @scrolltolower="scrolltolower" height="100%">
  4. <u-list-item v-for="(item, index) in list" :key="item.id">
  5. <view class="rbox-item">
  6. <view class="rbox-item-top adfac">
  7. <view class="rbox-item-top-type">{{typeCfg[item.type]||'个人版'}}</view>
  8. <view class="rbox-item-top-title">{{item.reportName||''}}</view>
  9. </view>
  10. <view class="rbox-item-p adf">
  11. <view class="rbox-item-p-left">团队名称:</view>
  12. <view class="rbox-item-p-right">{{item.teamName||''}}</view>
  13. </view>
  14. <view class="rbox-item-p adf">
  15. <view class="rbox-item-p-left">发送教练:</view>
  16. <view class="rbox-item-p-right">{{item.coachName||''}}</view>
  17. </view>
  18. <view class="rbox-item-p adf">
  19. <view class="rbox-item-p-left">报告时间:</view>
  20. <view class="rbox-item-p-right">{{item.createDate||''}}</view>
  21. </view>
  22. <image class="rbox-item-ask" :src="imgBase+'report_ask.png'" @click="askReport(item)"></image>
  23. <view class="rbox-item-bottom adfacjb">
  24. <view class="gbox-item-bottom-left adfac"></view>
  25. <view class="rbox-item-bottom-right" @click="reviewReport(item)">查看报告</view>
  26. </view>
  27. </view>
  28. </u-list-item>
  29. </u-list>
  30. </view>
  31. </template>
  32. <script>
  33. import { getPlatformInfo } from '@/utils/platform.js';
  34. export default {
  35. props:{
  36. list:{
  37. typeof:Array,
  38. default:[]
  39. }
  40. },
  41. data(){
  42. return {
  43. typeCfg:{
  44. 1:'个人版',
  45. 2:'团队版',
  46. 0:'团队PRO版'
  47. },
  48. }
  49. },
  50. methods:{
  51. scrolltolower(){
  52. this.$emit('scrolltolower')
  53. },
  54. reviewReport(item){
  55. // uni.navigateTo({
  56. // url:`/pagesHome/reportDetail?pdfUrl=${item.fileUrl}&reportId=${item.reportId}&fileName=${this.typeCfg[item.type]||'个人版'}-${item.reportName}`
  57. // })
  58. // wx.downloadFile({
  59. // url:item.fileUrl,
  60. // success: function (res) {
  61. // const filePath = res.tempFilePath
  62. // wx.openDocument({
  63. // filePath: filePath
  64. // })
  65. // }
  66. // })
  67. const { isPC, isMobile, platform } = getPlatformInfo();
  68. if (isPC) {
  69. this.$showModal('请在手机端该微信小程序中查看报告')
  70. } else if (isMobile||platform==='devtools') {
  71. if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
  72. uni.navigateTo({
  73. url:'/pages/webView?src='+item.fileUrl
  74. })
  75. }
  76. },
  77. askReport(item){
  78. uni.navigateTo({
  79. url:`/pages/reportAsk?pdfUrl=${item.fileUrl}&fileName=${this.typeCfg[item.type]||'个人版'}-${item.reportName}`
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .rbox{
  87. height: 100%;
  88. &-item{
  89. margin-top: 20rpx;
  90. background: #FFFFFF;
  91. border-radius: 24rpx;
  92. padding: 40rpx 24rpx 10rpx;
  93. position: relative;
  94. &-top{
  95. &-type{
  96. padding: 2rpx 13rpx;
  97. background: #FFF7DC;
  98. border-radius: 6rpx;
  99. font-family: PingFangSC, PingFang SC;
  100. font-weight: 400;
  101. font-size: 24rpx;
  102. color: #BA9B31;
  103. line-height: 33rpx;
  104. }
  105. &-title{
  106. font-family: PingFang-SC, PingFang-SC;
  107. font-weight: bold;
  108. font-size: 32rpx;
  109. color: #002846;
  110. line-height: 32rpx;
  111. text-indent: 17rpx;
  112. }
  113. }
  114. &-p{
  115. margin-top: 36rpx;
  116. &>view{
  117. font-family: PingFangSC, PingFang SC;
  118. font-weight: 400;
  119. font-size: 24rpx;
  120. color: #667E90;
  121. line-height: 24rpx;
  122. }
  123. &-left{
  124. width: 134rpx;
  125. }
  126. &-right{
  127. width: calc(100% - 134rpx);
  128. }
  129. }
  130. &-ask{
  131. width: 64rpx;
  132. height: 64rpx;
  133. position: absolute;
  134. right: 24rpx;
  135. top: 180rpx;
  136. }
  137. &-bottom{
  138. margin-top: 30rpx;
  139. border-top: 1rpx solid #EFEFEF;
  140. padding-top: 18rpx;
  141. &-left{
  142. &>view{
  143. font-family: PingFangSC, PingFang SC;
  144. font-weight: 400;
  145. font-size: 24rpx;
  146. color: #667E90;
  147. line-height: 24rpx;
  148. }
  149. }
  150. &-right{
  151. padding: 17rpx 20rpx;
  152. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  153. border-radius: 30rpx;
  154. font-family: PingFang-SC, PingFang-SC;
  155. font-weight: bold;
  156. font-size: 24rpx;
  157. color: #FFFFFF;
  158. line-height: 26rpx;
  159. letter-spacing: 2rpx;
  160. }
  161. }
  162. &-btn{
  163. padding: 17rpx 20rpx;
  164. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  165. border-radius: 30rpx;
  166. font-family: PingFang-SC, PingFang-SC;
  167. font-weight: bold;
  168. font-size: 24rpx;
  169. color: #FFFFFF;
  170. line-height: 26rpx;
  171. letter-spacing: 2rpx;
  172. position: absolute;
  173. bottom: 40rpx;
  174. right: 24rpx;
  175. &.ask{
  176. right: 180rpx;
  177. }
  178. }
  179. }
  180. }
  181. </style>