receiveList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. export default {
  31. props:{
  32. list:{
  33. typeof:Array,
  34. default:[]
  35. }
  36. },
  37. data(){
  38. return {
  39. typeCfg:{
  40. 1:'基础版',
  41. 2:'专业版',
  42. 3:'专家版'
  43. },
  44. }
  45. },
  46. methods:{
  47. scrolltolower(){
  48. this.$emit('scrolltolower')
  49. },
  50. reviewReport(item){
  51. if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
  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. uni.navigateTo({
  65. url:'/pages/webView?src='+item.fileUrl
  66. })
  67. },
  68. askReport(item){
  69. uni.navigateTo({
  70. url:`/pages/reportAsk?pdfUrl=${item.fileUrl}&fileName=${this.typeCfg[item.type]||'基础版'}-${item.reportName}`
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style scoped lang="scss">
  77. .rbox{
  78. height: 100%;
  79. &-item{
  80. margin-top: 20rpx;
  81. background: #FFFFFF;
  82. border-radius: 24rpx;
  83. padding: 40rpx 24rpx;
  84. position: relative;
  85. &-top{
  86. &-type{
  87. padding: 2rpx 13rpx;
  88. background: #FFF7DC;
  89. border-radius: 6rpx;
  90. font-family: PingFangSC, PingFang SC;
  91. font-weight: 400;
  92. font-size: 24rpx;
  93. color: #BA9B31;
  94. line-height: 33rpx;
  95. }
  96. &-title{
  97. font-family: PingFang-SC, PingFang-SC;
  98. font-weight: bold;
  99. font-size: 32rpx;
  100. color: #002846;
  101. line-height: 32rpx;
  102. text-indent: 17rpx;
  103. }
  104. }
  105. &-p{
  106. margin-top: 36rpx;
  107. &>view{
  108. font-family: PingFangSC, PingFang SC;
  109. font-weight: 400;
  110. font-size: 24rpx;
  111. color: #667E90;
  112. line-height: 24rpx;
  113. }
  114. &-left{
  115. width: 134rpx;
  116. }
  117. &-right{
  118. width: calc(100% - 134rpx);
  119. }
  120. }
  121. &-btn{
  122. padding: 17rpx 20rpx;
  123. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  124. border-radius: 30rpx;
  125. font-family: PingFang-SC, PingFang-SC;
  126. font-weight: bold;
  127. font-size: 24rpx;
  128. color: #FFFFFF;
  129. line-height: 26rpx;
  130. letter-spacing: 2rpx;
  131. position: absolute;
  132. bottom: 40rpx;
  133. right: 24rpx;
  134. &.ask{
  135. right: 180rpx;
  136. }
  137. }
  138. }
  139. }
  140. </style>