homelist.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view style="border-top: 1px solid #cfcfcf;">
  3. <u-list>
  4. <view v-if="!list">
  5. <image style="margin: 0 auto; width: 100%;" src="../../static/img/page/empty_view.png"></image>
  6. </view>
  7. <u-list-item v-for="(item, index) in list" :key="index" @click="downLoad(item.link)">
  8. <view @click="downLoad(item.link)">
  9. <u-row style="border-bottom: 1px solid #cfcfcf;">
  10. <view>
  11. <u-image :src="url+item.imgPath" width="120px" height="90px" style="margin: 7px;">
  12. </u-image>
  13. </view>
  14. <view>
  15. <u-text :text="item.text" mode="text" :lines="3" size="18">
  16. </u-text>
  17. <view style="padding: 20px 0 0 0;">
  18. <u-text :text="item.updateTime" mode="text" color="#b1b1b1" size="14">
  19. </u-text>
  20. </view>
  21. </view>
  22. </u-col>
  23. </u-row>
  24. </view>
  25. </u-list-item>
  26. </u-list>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. props: {
  32. list: {
  33. type: Array,
  34. default: () => []
  35. },
  36. url: {
  37. type: String,
  38. }
  39. },
  40. name: "homelist",
  41. data() {
  42. return {
  43. baseURL: uni.$BASE_URL
  44. };
  45. },
  46. methods: {
  47. // 打开自定义链接
  48. openCustomLink(link = '') {
  49. console.log(`link: ${link}`)
  50. window.location.href = "https://" + link
  51. },
  52. downLoad(item) {
  53. if (item) {
  54. let url = encodeURIComponent(item)
  55. uni.navigateTo({
  56. url: '../../pages/home/myWebView?url=' + url
  57. })
  58. }
  59. },
  60. }
  61. }
  62. </script>
  63. <style>
  64. </style>