index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view>
  3. <view v-if="listData.data.length>0">
  4. <view class="top">
  5. <image class="top-img" mode="scaleToFill" src="@/static/icon/index/phb_bg.png"></image>
  6. </view>
  7. <view class="wrapper" v-if="listData.data.length>0">
  8. <view v-for="(value,key) in listData.data" :key="key" class="wrapper-inner" @click="detail(value)">
  9. <view class="box flex" style="width:30%; border-radius:20rpx;">
  10. <image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
  11. </view>
  12. <view class="text-wrapper">
  13. <view class="text-rank plr10 ft20 ftw600 text-over cl-main">TOP{{key+1}}</view>
  14. <view class="text-name plr10 ft16 ftw600 text-over cl-main">{{value.name}}</view>
  15. <view class="text-dec plr10 ft14 ftw400 text-over4 cl-main">
  16. {{value.note}}
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="empty-box" v-else>
  23. <image src="/static/img/orders/emty.png" mode=""></image>
  24. <p class="ft14 line-1-txt">暂无数据</p>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  30. import {
  31. getMiniprogramRank
  32. } from '@/common/apis/index.js'
  33. import cellGroup from '../../../uni_modules/uview-ui/libs/config/props/cellGroup';
  34. export default {
  35. components: {
  36. uniLoadMore
  37. },
  38. data() {
  39. return {
  40. banners: [],
  41. searchValue: '',
  42. total: 0,
  43. selectIndex: 0,
  44. scrollTop: 0,
  45. keytext: '',
  46. listData: {
  47. data: []
  48. },
  49. last_id: 0,
  50. reload: true,
  51. status: 'more',
  52. contentText: {
  53. contentdown: '上拉加载更多',
  54. contentrefresh: '加载中',
  55. contentnomore: '没有数据了'
  56. }
  57. }
  58. },
  59. onLoad(e) {
  60. if (e.selectIndex) {
  61. this.selectIndex = e.selectIndex * 1
  62. }
  63. this.status = 'more';
  64. this.getList();
  65. this.banners = uni.getStorageSync("config").banner
  66. },
  67. onPageScroll(e) {
  68. this.scrollTop = e.scrollTop;
  69. },
  70. onReachBottom() {
  71. this.status = 'more';
  72. // this.getList();
  73. },
  74. methods: {
  75. detail(value) {
  76. uni.navigateTo({
  77. url: '/pages/video/index?video_id=' + value.video_id
  78. })
  79. },
  80. getList() {
  81. getMiniprogramRank().then(res => {
  82. console.log(res, 'getMiniprogramRecentvideogetMiniprogramRecentvideogetMiniprogramRecentvideo')
  83. this.listData = res.data
  84. })
  85. },
  86. getdata() {
  87. this.last_id = 0
  88. this.reload = true
  89. this.getList()
  90. },
  91. search(res) {
  92. this.listData = [];
  93. this.last_id = 0;
  94. this.keytext = res.value;
  95. this.type = '';
  96. this.getList(0)
  97. },
  98. cancel(res) {
  99. this.keytext = '';
  100. this.type = '';
  101. this.getList(0)
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. @import "./style/index.scss"
  108. </style>