exchange-item.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view>
  3. <view class="box" >
  4. <view class="leftbox" @click="linkDetails(info[0])">
  5. <view class="leftbox_title">
  6. <u--image class="" width="40rpx" height="40rpx" src="/static/index/iconm_goutong.png" ></u--image>
  7. <view style="margin-left:16rpx">精选互动</view>
  8. </view>
  9. <view class="leftbox_content">
  10. {{info[0].title}}
  11. </view>
  12. <view class="leftbox_num">
  13. {{info[0].views}} 人正在互动
  14. </view>
  15. </view>
  16. <view class="rightbox">
  17. <view class="rightbox_item" @click="linkDetails(info[1])">
  18. <view class="rightbox_title">
  19. <u--image style="float: left;margin-left: 20rpx;" class="" width="40rpx" height="40rpx" src="/static/index/iconm_goutong.png" ></u--image>
  20. <view style="margin-left:16rpx">{{info[1].title}}</view>
  21. </view>
  22. <view class="leftbox_num">
  23. {{info[1].views}} 人正在互动
  24. </view>
  25. </view>
  26. <view style="margin-top: 20rpx;background: #EAF0FF;" class="rightbox_item" @click="linkDetails(info[2])">
  27. <view class="rightbox_title">
  28. <u--image style="float: left;margin-left: 20rpx;" class="" width="40rpx" height="40rpx" src="/static/index/iconm_goutong.png" ></u--image>
  29. <view style="margin-left:16rpx">{{info[2].title}}</view>
  30. </view>
  31. <view class="leftbox_num">
  32. {{info[2].views}} 人正在互动
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. props: {
  42. info: {
  43. type: Array,
  44. default: [],
  45. },
  46. },
  47. // watch:{
  48. // info: {
  49. // immediate: true,
  50. // handler(val) {
  51. // console.log(val);
  52. // },
  53. // }
  54. // },
  55. data() {
  56. return {
  57. }
  58. },
  59. onLoad() {
  60. },
  61. methods: {
  62. linkDetails(e){
  63. uni.navigateTo({
  64. url: '/pages/home/ArticleDetails?id=' + e.id
  65. });
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. .box{
  72. display: flex;
  73. margin: 20rpx auto;
  74. justify-content: center;
  75. background: white;
  76. padding: 20rpx 0;
  77. }
  78. .leftbox{
  79. width: 343rpx;
  80. height: 400rpx;
  81. background: #FFF7EC;
  82. border-radius: 16rpx 16rpx 16rpx 16rpx;
  83. opacity: 1;
  84. display: flex;
  85. flex-direction: column;
  86. justify-content: space-around;
  87. }
  88. .rightbox{
  89. margin-left: 20rpx;
  90. width: 356rpx;
  91. height: 320rpx;
  92. background: white;
  93. opacity: 1;
  94. }
  95. .rightbox_item{
  96. width: 343rpx;
  97. height: 192rpx;
  98. background: #EFF9F1;
  99. border-radius: 16rpx 16rpx 16rpx 16rpx;
  100. opacity: 1;
  101. display: flex;
  102. flex-direction: column;
  103. justify-content: space-around;
  104. }
  105. .leftbox_title{
  106. display: flex;
  107. font-weight: 400;
  108. color: #666666;
  109. font-size: 28rpx;
  110. padding-left: 40rpx;
  111. }
  112. .leftbox_content{
  113. width: 252rpx;
  114. font-size: 28rpx;
  115. font-weight: bold;
  116. color: #333333;
  117. margin: 0 auto;
  118. height: 180rpx;
  119. display: -webkit-box;
  120. word-break: break-all;
  121. text-overflow: ellipsis;
  122. overflow: hidden;
  123. -webkit-box-orient: vertical;
  124. -webkit-line-clamp:3;
  125. }
  126. .leftbox_num{
  127. width: 185rpx;
  128. height: 33rpx;
  129. font-size: 24rpx;
  130. font-weight: 400;
  131. color: #999999;
  132. padding-left: 40rpx;
  133. }
  134. .rightbox_title{
  135. display: flex;
  136. margin-left: 20rpx;
  137. width: 288rpx;
  138. height: 70rpx;
  139. font-size: 28rpx;
  140. font-weight: bold;
  141. color: #333333;
  142. /* display: -webkit-box; */
  143. word-break: break-all;
  144. text-overflow: ellipsis;
  145. overflow: hidden;
  146. -webkit-box-orient: vertical;
  147. -webkit-line-clamp:2;
  148. }
  149. </style>