gglist.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="content">
  3. <view class="list" v-for="(item, index) in listInfo" @click="navTo('/pages/index/ggDetail?id=' + item.id)">
  4. <view class="icon"><image src="../../static/img/gglist.png" mode=""></image></view>
  5. <view class="main">
  6. <view class="main-title">{{ item.title }}</view>
  7. <view class="main-info clamp2" v-html="item.content"></view>
  8. <view class="main-time">{{ item.addtime }}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import { gglist } from '@/api/index.js';
  15. export default {
  16. data() {
  17. return {
  18. listInfo: []
  19. };
  20. },
  21. onLoad() {},
  22. onShow() {
  23. this.getgg();
  24. },
  25. methods: {
  26. getgg() {
  27. const obj = this;
  28. gglist({ page: 1, limit: 1000 }).then(e => {
  29. obj.listInfo = e.data;
  30. });
  31. },
  32. navTo(url) {
  33. uni.navigateTo({
  34. url
  35. });
  36. }
  37. }
  38. };
  39. </script>
  40. <style lang="scss">
  41. page,
  42. .content {
  43. min-height: 100%;
  44. height: auto;
  45. background: #fff;
  46. }
  47. .list {
  48. margin-top: 20rpx;
  49. padding: 0 40rpx;
  50. display: flex;
  51. align-items: flex-start;
  52. .icon {
  53. padding-top: 10rpx;
  54. flex-shrink: 0;
  55. width: 68rpx;
  56. height: 50rpx;
  57. image {
  58. width: 100%;
  59. height: 100%;
  60. }
  61. }
  62. .main {
  63. margin-left: 10rpx;
  64. .main-title {
  65. font-size: 32rpx;
  66. color: #707a8a;
  67. }
  68. .main-info {
  69. color: #707a8a;
  70. }
  71. .main-time {
  72. font-size: 24rpx;
  73. color: #707a8a;
  74. }
  75. }
  76. }
  77. </style>