fuli.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="fuli">
  3. <view class="swiper-box">
  4. <u-swiper :list="swiperlisi" name="logo" height="320" @click="tobanner" border-radius="20"></u-swiper>
  5. </view>
  6. <view class="u-flex u-row-between u-flex-wrap list-box">
  7. <image :src="item.logo" v-for="(item,index) in list" :key="index" @click="toinfo(item)" mode="aspectFill"></image>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data(){
  14. return{
  15. swiperlisi: [],
  16. list:[],
  17. page:1
  18. }
  19. },
  20. onLoad() {
  21. this.getbanner()
  22. this.getlist()
  23. },
  24. onReachBottom() {
  25. if(this.list.length % 20 == 0){
  26. this.page++
  27. this.getlist()
  28. }
  29. },
  30. methods:{
  31. tobanner(e) {
  32. if (this.swiperlisi[e].url) {
  33. uni.navigateTo({
  34. url: this.swiperlisi[e].url
  35. })
  36. }
  37. },
  38. getlist(){
  39. this.$u.post('/api/welfare/welfare_list',{
  40. page:this.page,
  41. page_num:20
  42. }).then(res => {
  43. this.list = this.list.concat(res.data)
  44. })
  45. },
  46. getbanner() {
  47. this.$u.post('/api/Index/banner',{
  48. location:3
  49. }).then(res => {
  50. this.swiperlisi = res.data
  51. })
  52. },
  53. toinfo(item){
  54. uni.navigateTo({
  55. url:"./fuli-info?id=" + item.id
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .fuli{
  63. .swiper-box{
  64. margin: 24rpx;
  65. }
  66. .list-box{
  67. padding: 0 24rpx;
  68. image{
  69. width: 340rpx;
  70. height: 110rpx;
  71. border-radius: 10rpx;
  72. margin-bottom: 20rpx;
  73. }
  74. }
  75. }
  76. </style>