海南旅游项目 前端仓库
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.

108 lines
2.6 KiB

  1. <template>
  2. <view>
  3. <!-- 活动列表 -->
  4. <view class="content">
  5. <view class="item" v-for="item in list" :key="item">
  6. <view class="cover">
  7. <image src="../../static/logo.png" class="lf-w-100 lf-h-100" mode="aspectFill"></image>
  8. </view>
  9. <view style="width: 420rpx;">
  10. <view class="lf-font-28 lf-color-333 lf-m-b-20 lf-line-2" style="height: 78rpx;">南胜地 身处亚热带风情/玩转南澳转南澳转南澳转南澳转转南澳转南澳</view>
  11. <view class="lf-font-24 lf-color-gray">本套票只包含两个成人不可带小孩</view>
  12. <view class="lf-flex lf-m-t-25">
  13. <lf-price price="3599.00"></lf-price>
  14. <text class="lf-font-24 lf-color-gray lf-line-through lf-m-l-15">¥4599.00</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 加载 -->
  20. <view class="loading-more">
  21. <text v-if="list.length" :class="{'loading-more-text': loadingClass}">{{ loadingText }}</text>
  22. <lf-nocontent v-else></lf-nocontent>
  23. </view>
  24. <!-- 回到顶部 -->
  25. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data(){
  31. return {
  32. list: [1,2,3,4,5],
  33. loadingClass: false,
  34. loadingText: '已加载全部数据~',
  35. page: 1,
  36. isPage: true,
  37. pageSize: 20
  38. }
  39. },
  40. onLoad(){
  41. // this.getActivityList();
  42. },
  43. methods: {
  44. getActivityList(){
  45. return;
  46. this.$http(this.API.a).then(res => {
  47. this.isPage = res.data.has_more_page;
  48. let list = res.data.items;
  49. if(!res.data.has_more_page){
  50. this.loadingClass = false;
  51. this.loadingText = '已加载全部数据~';
  52. }
  53. if(this.page == 1){
  54. this.list = list;
  55. }else{
  56. this.list.push(...list);
  57. }
  58. })
  59. },
  60. // 进入商品详情页
  61. enterDetail(index){
  62. let goods_id = this.list[index].goods_id;
  63. this.$url('/pages/goodsDetail/index?id='+ goods_id);
  64. }
  65. },
  66. onReachBottom(){
  67. if(this.isPage){
  68. this.page = this.page + 1;
  69. this.getActivityList();
  70. }
  71. },
  72. onPullDownRefresh(){
  73. this.page = 1;
  74. this.isPage = true;
  75. this.loadingClass = true;
  76. this.loadingText = '正在加载中';
  77. this.getActivityList();
  78. uni.stopPullDownRefresh();
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped="scoped">
  83. .content{
  84. padding: 0 32rpx;
  85. box-sizing: border-box;
  86. width: 750rpx;
  87. height: max-content;
  88. .item{
  89. width: 100%;
  90. height: auto;
  91. border-bottom: 1rpx solid #E5E5E5;
  92. padding: 30rpx 0;
  93. display: flex;
  94. &:last-child{
  95. border-bottom: none;
  96. }
  97. .cover{
  98. width: 250rpx;
  99. height: 210rpx;
  100. border-radius: 20rpx;
  101. overflow: hidden;
  102. margin-right: 15rpx;
  103. }
  104. }
  105. }
  106. </style>