海南旅游项目 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.1 KiB

  1. <template>
  2. <view class="page-color">
  3. <view class="padding-lr lf-p-t-30">
  4. <view class="card-discover lf-m-b-30" v-for="(item,index) of article_list" :key="index">
  5. <view @click="$url('/pages/notice/article?article_id='+item.big.id)">
  6. <image :src="item.big.image" mode="aspectFill" style="width: 686rpx;height: 300rpx;"></image>
  7. </view>
  8. <view class="flex-direction bg-white discover-radius">
  9. <view class="flex align-center text-center lf-p-30 solid-bottom" v-for="(i,index) of item.children" @click="$url('/pages/notice/article?article_id='+i.id)">
  10. <view>
  11. <image src="../../static/logo.png" mode="aspectFill" style="width: 100rpx;height: 100rpx;"></image>
  12. </view>
  13. <view class="lf-line-2 lf-color-333 lf-font-28 lf-text-left lf-m-l-20" style="line-height: 44rpx;">
  14. {{i.title}}
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 加载 -->
  21. <view class="loading-more lf-p-b-40">
  22. <text v-if="article_list.length" :class="{'loading-more-text': loadingClass}">{{ loadingText }}</text>
  23. <lf-nocontent v-else></lf-nocontent>
  24. </view>
  25. <!-- 回到顶部 -->
  26. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. page: 1,
  34. article_list: [],
  35. loadingClass: true,
  36. loadingText: '正在加载中',
  37. isPage: false
  38. }
  39. },
  40. methods: {
  41. getArticle() {
  42. this.$http(this.API.API_FINDARTICLE,{page: this.page}).then(res => {
  43. let isPage = res.data.next_page_url == null?false:true;
  44. this.isPage = isPage;
  45. if(!isPage){
  46. this.loadingClass = false;
  47. this.loadingText = '没有更多数据啦~';
  48. }
  49. if(this.page == 1){
  50. this.article_list = res.data.data;
  51. }else{
  52. this.article_list.push(...res.data.data);
  53. }
  54. console.log(res)
  55. }).catch(err => {
  56. })
  57. },
  58. },
  59. onLoad() {
  60. this.getArticle()
  61. }
  62. }
  63. </script>
  64. <style scoped>
  65. .page-color {
  66. width: 100%;
  67. height: 100%;
  68. background-color: #F6F6F6;
  69. }
  70. .card-discover {
  71. border-radius: 20rpx;
  72. }
  73. .discover-radius {
  74. border-radius: 0 0 20rpx 20rpx;
  75. }
  76. </style>