homelist.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view style="background-color: #ffffff;">
  3. <view style="background-color: #f4f4f4;">
  4. <u-row>
  5. <u-col span="10">
  6. <view style="padding: 10rpx 15px;" class="font-jianju">
  7. <u-text :text="title" size="18" color="rgb(55,186,189)"></u-text>
  8. </view>
  9. </u-col>
  10. <u-col span="2">
  11. <view @tap.stop="onClick">
  12. <u-text v-if="limit !== 0" text="更多>>" color="rgb(83, 201, 255)"></u-text>
  13. </view>
  14. </u-col>
  15. </u-row>
  16. </view>
  17. <view v-if="list.length === 0 || null === list || undefined === list"
  18. style="text-align: center;padding: 50px 0;color: #5a5a5a;">
  19. <view class="font-jianju">
  20. 暂无数据
  21. </view>
  22. </view>
  23. <view v-if="1 === showType" v-for="(item, index) in list" :key="index">
  24. <view v-if="limit == 0 || index < limit" @click="ononclick(1,item)"
  25. style="border-bottom: 1rpx solid #cfcfcf;">
  26. <view style="padding: 10rpx 40rpx;">
  27. <u-row>
  28. <u-col>
  29. <view class="font-jianju">
  30. <u-text :text="item.noticeTitle" size="14" color="#474747" mode="text">
  31. </u-text>
  32. </view>
  33. </u-col>
  34. </u-row>
  35. <u-row>
  36. <view style="padding-top: 3px;">
  37. <view>
  38. <view>
  39. <u-text :text="item.createTime" color="#b1b1b1" size="12">
  40. </u-text>
  41. </view>
  42. </view>
  43. </view>
  44. </u-row>
  45. </view>
  46. </view>
  47. </view>
  48. <view v-if="2 === showType" v-for="(item, index) in list" :key="index">
  49. <view v-if="limit == 0 || index < limit" style="border-bottom: 1px solid #cfcfcf;padding: 0;"
  50. @click="ononclick(2,item)">
  51. <view style="padding: 10rpx 40rpx;">
  52. <view class="uni-flex uni-row">
  53. <view>
  54. <img :src="url+item.imgPath"
  55. style="border-radius: 5px;width: 198rpx; height: 150.5rpx ;border: 1px solid #f3f3f3;">
  56. </img>
  57. </view>
  58. <view>
  59. <view class="font-jianju" style="padding-left: 10px;height: 100%;width: 490rpx">
  60. <u-text :text="item.text" mode="text" color="#6c6c6c" size="15">
  61. </u-text>
  62. </view>
  63. </view>
  64. </view>
  65. <view>
  66. <view
  67. style="height: 5rpx;padding: 0;position: relative;bottom: 20rpx;text-align: right;color:#b1b1b1;">
  68. <view style="font-size: 20rpx;">
  69. {{item.updateTime}}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <view v-if="3 === showType" v-for="(item, index) in list" :key="index">
  77. <u-row style="border-bottom: 1px solid #cfcfcf;padding: 10rpx;">
  78. <view>
  79. <view style="padding: 0 5px 2px 5px;">
  80. <u-text :text="item.text" mode="text" bold :lines="3" size="18">
  81. </u-text>
  82. </view>
  83. <view style="padding: 0 5px;">
  84. <img :src="url+item.imgPath" width="100%" height="100%"
  85. style="border-radius: 5px;border: 1px solid #f3f3f3;">
  86. </img>
  87. </view>
  88. <view style="padding: 0 5px;">
  89. <u-text :text="item.updateTime" mode="text" color="#b1b1b1" size="14">
  90. </u-text>
  91. </view>
  92. </view>
  93. </u-col>
  94. </u-row>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. export default {
  100. props: {
  101. list: {
  102. type: Array,
  103. default: () => []
  104. },
  105. url: {
  106. type: String
  107. },
  108. title: {
  109. type: String
  110. },
  111. showType: {
  112. type: Number,
  113. default: 0
  114. },
  115. limit: {
  116. type: Number,
  117. default: 0
  118. }
  119. },
  120. name: "homelist",
  121. data() {
  122. return {
  123. data: {},
  124. show: false,
  125. open: false,
  126. baseURL: uni.$BASE_URL,
  127. timeFormat: uni.$u.timeFormat
  128. }
  129. },
  130. onLoad() {},
  131. methods: {
  132. ononclick(type, item) {
  133. item.type = type
  134. uni.setStorageSync("noticeData", item)
  135. this.$goto("../../pageA/notice/notice")
  136. },
  137. // close() {
  138. // uni.showTabBar({
  139. // animation: true,
  140. // })
  141. // //this.$refs.popup[0].close()
  142. // },
  143. // dialogConfirm() {
  144. // uni.showTabBar({
  145. // animation: true,
  146. // })
  147. // },
  148. onClick() {
  149. const form = {
  150. titile: this.title,
  151. limit: 0,
  152. showType: this.showType,
  153. list: this.list
  154. }
  155. uni.setStorageSync("moreData", form)
  156. this.$goto('../../pages/home/more')
  157. },
  158. // 打开自定义链接
  159. openCustomLink(link = '') {
  160. console.log(`link: ${link}`)
  161. window.location.href = "https://" + link
  162. },
  163. downLoad(item) {
  164. if (item) {
  165. let url = encodeURIComponent(item)
  166. uni.navigateTo({
  167. url: '../../pages/home/myWebView?url=' + url
  168. })
  169. }
  170. }
  171. }
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. page {
  176. padding: 0px;
  177. }
  178. .font-jianju {
  179. letter-spacing: 5rpx;
  180. }
  181. </style>