cause.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="content">
  3. <view class="jg" style="height: 1rpx;">
  4. </view>
  5. <view class="list-box" v-for="(item,index) in science" :key='index' @click="navTo('/pages/applic/info?id='+item.id)">
  6. <view class="box-left">
  7. <image :src="item.image" mode="" class="left-img"></image>
  8. </view>
  9. <view class="box-right">
  10. <view class="right-top word1_ellipsis">
  11. {{item.title}}
  12. </view>
  13. <view class="right-center">
  14. {{item.synopsis}}
  15. </view>
  16. <view class="right-foot">
  17. 已阅读人数:{{item.visit || 0}}
  18. </view>
  19. </view>
  20. </view>
  21. <uni-load-more :status="loadingType"></uni-load-more>
  22. </view>
  23. </template>
  24. <script>
  25. import { getArticList} from '@/api/index.js';
  26. export default {
  27. data() {
  28. return {
  29. science: [],
  30. loadingType: 'more',
  31. page: 1,
  32. limit: 10
  33. }
  34. },
  35. onLoad() {
  36. this.loadData()
  37. },
  38. onReachBottom() {
  39. this.loadData()
  40. },
  41. methods: {
  42. navTo(url) {
  43. uni.navigateTo({
  44. url
  45. })
  46. },
  47. loadData(){
  48. let obj = this;
  49. if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  50. return
  51. }
  52. obj.loadingType = 'loading'
  53. getArticList({
  54. paga: obj.page,
  55. limit: obj.limit,
  56. ifyid: 1
  57. }).then(({ data }) => {
  58. obj.science = obj.science.concat(data);
  59. console.log(obj.science,1236);
  60. if(obj.limit == data.length) {
  61. obj.loadingType = 'more'
  62. }else {
  63. obj.loadingType = 'noMore'
  64. }
  65. });
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .list-box{
  72. width: 725rpx;
  73. height: 200rpx;
  74. margin: 20rpx auto 0;
  75. background: #FFFFFF;
  76. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  77. border-radius: 7rpx;
  78. padding:0 20rpx;
  79. display: flex;
  80. align-items: center;
  81. &:first-of-type {
  82. margin-top: 0;
  83. }
  84. .box-left{
  85. width: 230rpx;
  86. height: 145rpx;
  87. margin-right: 20rpx;
  88. .left-img{
  89. width: 230rpx;
  90. height: 145rpx;
  91. }
  92. }
  93. .box-right{
  94. width: 430rpx;
  95. height: 145rpx;
  96. position: relative;
  97. .right-top{
  98. font-size: 25rpx;
  99. font-weight: bold;
  100. color: #333333;
  101. margin-bottom: 24rpx;
  102. }
  103. .right-center{
  104. width: 362rpx;
  105. // height: 53rpx;
  106. font-size: 21rpx;
  107. font-weight: bold;
  108. color: #999999;
  109. line-height: 33rpx;
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. display: -webkit-box;
  113. -webkit-line-clamp: 2;//在第几行显示...
  114. -webkit-box-orient: vertical;
  115. }
  116. .right-foot{
  117. font-size: 21rpx;
  118. font-weight: bold;
  119. color: #999999;
  120. line-height: 31rpx;
  121. text-align: right;
  122. // margin-top: 13rpx;
  123. position: absolute;
  124. right: 0;
  125. bottom: 0;
  126. }
  127. }
  128. }
  129. </style>