resource - 副本.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="zaiui-news-box" :class="show?'show':''">
  3. <!--标题栏-->
  4. <bar-title bgColor="bg-white" title="资源" :isBack="false">
  5. <block slot="content">资源</block>
  6. </bar-title>
  7. <!--消息列表-->
  8. <view class="bg-white zaiui-news-list-box">
  9. <view class="margin-bottom cu-list menu-avatar">
  10. <view class="cu-item goods" v-for="item in list" :key="item.id" :class="modalName=='move-box-'+ 1?'move-cur':''" :data-id="item.id" @tap="tapNews">
  11. <view class="action">
  12. <view class="cu-avatar radius" :style="`background-image:url(${item.pic});`"/>
  13. </view>
  14. <view class="content">
  15. <view class="text-black">
  16. <text class="margin-right-xs">{{item.name}}</text>
  17. <!-- <text class="cu-tag bg-blue sm radius">
  18. <text class="cuIcon-male"></text>
  19. </text> -->
  20. </view>
  21. <view class="text-gray text-sm text-cut">{{item.info||'-'}}</view>
  22. <view class="text-gray text-sm">{{item.cdate_str}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <!--占位底部距离-->
  28. <view class="cu-tabbar-height"/>
  29. </view>
  30. </template>
  31. <script>
  32. import barTitle from '@/components/zaiui-common/basics/bar-title';
  33. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  34. export default {
  35. name: 'news',
  36. components: {
  37. barTitle
  38. },
  39. data() {
  40. return {
  41. list: [],
  42. modalName: ''
  43. }
  44. },
  45. props: {
  46. show: {
  47. type: Boolean,
  48. default: true
  49. },
  50. scrollY: {
  51. type: Number,
  52. default: 0
  53. },
  54. scrollBottom: {
  55. type: Number,
  56. default: 0
  57. }
  58. },
  59. watch: {
  60. },
  61. created() {
  62. //加载虚拟数据
  63. this.loadList()
  64. },
  65. mounted() {
  66. _tool.setBarColor(true);
  67. uni.pageScrollTo({
  68. scrollTop: 0,
  69. duration: 0
  70. });
  71. },
  72. methods: {
  73. loadList() {
  74. this.req({
  75. url: '?l=resource.home',
  76. data: {type: 1},
  77. success: res => {
  78. if(res.data.status == 1) {
  79. console.log(res.data.data)
  80. this.list = res.data.data.list;
  81. }else {
  82. this.error = res.data.msg
  83. }
  84. }
  85. })
  86. },
  87. //被点击
  88. tapNews(e) {
  89. uni.navigateTo({
  90. url: '/pages/goods/resource?id='+e.currentTarget.dataset.id
  91. });
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .zaiui-news-box {
  98. width: 100%;
  99. display: none;
  100. .zaiui-follow-box {
  101. .action-text-cut {
  102. width: 70%;
  103. }
  104. }
  105. .zaiui-grid-menu {
  106. .cu-list.grid.no-border>.cu-item {
  107. .cu-avatar {
  108. margin: 0 auto;
  109. }
  110. }
  111. }
  112. .zaiui-news-list-box {
  113. padding: 0 9.09upx;
  114. .cu-list.menu-avatar>.cu-item>.cu-avatar {
  115. width: 81.81upx;
  116. height: 81.81upx;
  117. }
  118. .cu-list.menu-avatar>.cu-item {
  119. height: 163.63upx;
  120. align-items: inherit;
  121. .cu-avatar {
  122. margin-top: 25.45upx;
  123. .cu-tag.badge {
  124. width: 21.81upx;
  125. height: 21.81upx;
  126. top: 0;
  127. right: 0;
  128. border: 1.81upx solid #fff;
  129. }
  130. }
  131. .content {
  132. left: 160upx;
  133. margin-top: 18.18upx;
  134. width: calc(100% - 90.9upx - 54.54upx - 18.18upx);
  135. line-height: 1.7em;
  136. .cu-tag {
  137. padding: 0 3.63upx;
  138. text {
  139. position: relative;
  140. top: -2upx;
  141. }
  142. }
  143. }
  144. &:after {
  145. width: 0;
  146. height: 0;
  147. border-bottom: 0;
  148. }
  149. }
  150. .cu-list.menu-avatar>.cu-item.goods {
  151. .content {
  152. width: calc(100% - 309.09upx);
  153. }
  154. .action {
  155. position: absolute;
  156. left: 11upx;
  157. width: 127.27upx;
  158. .cu-avatar {
  159. width: 127.27upx;
  160. height: 127.27upx;
  161. margin-top: 18.18upx;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. .zaiui-news-box.show {
  168. display: block;
  169. }
  170. </style>