receiveList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. <view class="rbox-item-btn" @click="reviewReport(item)">查看报告</view>
  23. <view class="rbox-item-btn ask" @click="askReport(item)">提问</view>
  24. </view>
  25. </u-list-item>
  26. </u-list>
  27. </view>
  28. </template>
  29. <script>
  30. import { getPlatformInfo } from '@/utils/platform.js';
  31. export default {
  32. props:{
  33. list:{
  34. typeof:Array,
  35. default:[]
  36. }
  37. },
  38. data(){
  39. return {
  40. typeCfg:{
  41. 1:'个人版',
  42. 2:'团队版',
  43. 0:'团队PRO版'
  44. },
  45. }
  46. },
  47. methods:{
  48. scrolltolower(){
  49. this.$emit('scrolltolower')
  50. },
  51. reviewReport(item){
  52. // uni.navigateTo({
  53. // url:`/pagesHome/reportDetail?pdfUrl=${item.fileUrl}&reportId=${item.reportId}&fileName=${this.typeCfg[item.type]||'个人版'}-${item.reportName}`
  54. // })
  55. // wx.downloadFile({
  56. // url:item.fileUrl,
  57. // success: function (res) {
  58. // const filePath = res.tempFilePath
  59. // wx.openDocument({
  60. // filePath: filePath
  61. // })
  62. // }
  63. // })
  64. const { isPC, isMobile, platform } = getPlatformInfo();
  65. if (isPC) {
  66. this.$showModal('请在手机端该微信小程序中查看报告')
  67. } else if (isMobile||platform==='devtools') {
  68. if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
  69. uni.navigateTo({
  70. url:'/pages/webView?src='+item.fileUrl
  71. })
  72. }
  73. },
  74. askReport(item){
  75. uni.navigateTo({
  76. url:`/pages/reportAsk?pdfUrl=${item.fileUrl}&fileName=${this.typeCfg[item.type]||'个人版'}-${item.reportName}`
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. .rbox{
  84. height: 100%;
  85. &-item{
  86. margin-top: 20rpx;
  87. background: #FFFFFF;
  88. border-radius: 24rpx;
  89. padding: 40rpx 24rpx;
  90. position: relative;
  91. &-top{
  92. &-type{
  93. padding: 2rpx 13rpx;
  94. background: #FFF7DC;
  95. border-radius: 6rpx;
  96. font-family: PingFangSC, PingFang SC;
  97. font-weight: 400;
  98. font-size: 24rpx;
  99. color: #BA9B31;
  100. line-height: 33rpx;
  101. }
  102. &-title{
  103. font-family: PingFang-SC, PingFang-SC;
  104. font-weight: bold;
  105. font-size: 32rpx;
  106. color: #002846;
  107. line-height: 32rpx;
  108. text-indent: 17rpx;
  109. }
  110. }
  111. &-p{
  112. margin-top: 36rpx;
  113. &>view{
  114. font-family: PingFangSC, PingFang SC;
  115. font-weight: 400;
  116. font-size: 24rpx;
  117. color: #667E90;
  118. line-height: 24rpx;
  119. }
  120. &-left{
  121. width: 134rpx;
  122. }
  123. &-right{
  124. width: calc(100% - 134rpx);
  125. }
  126. }
  127. &-btn{
  128. padding: 17rpx 20rpx;
  129. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  130. border-radius: 30rpx;
  131. font-family: PingFang-SC, PingFang-SC;
  132. font-weight: bold;
  133. font-size: 24rpx;
  134. color: #FFFFFF;
  135. line-height: 26rpx;
  136. letter-spacing: 2rpx;
  137. position: absolute;
  138. bottom: 40rpx;
  139. right: 24rpx;
  140. &.ask{
  141. right: 180rpx;
  142. }
  143. }
  144. }
  145. }
  146. </style>