123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <view class="fuli">
- <view class="swiper-box">
- <u-swiper :list="swiperlisi" name="logo" height="320" @click="tobanner" border-radius="20"></u-swiper>
- </view>
- <view class="u-flex u-row-between u-flex-wrap list-box">
- <image :src="item.logo" v-for="(item,index) in list" :key="index" @click="toinfo(item)" mode="aspectFill"></image>
- </view>
- </view>
- </template>
- <script>
- export default {
- data(){
- return{
- swiperlisi: [],
- list:[],
- page:1
- }
- },
- onLoad() {
- this.getbanner()
- this.getlist()
- },
- onReachBottom() {
- if(this.list.length % 20 == 0){
- this.page++
- this.getlist()
- }
- },
- methods:{
- tobanner(e) {
- if (this.swiperlisi[e].url) {
- uni.navigateTo({
- url: this.swiperlisi[e].url
- })
- }
- },
- getlist(){
- this.$u.post('/api/welfare/welfare_list',{
- page:this.page,
- page_num:20
- }).then(res => {
- this.list = this.list.concat(res.data)
- })
- },
- getbanner() {
- this.$u.post('/api/Index/banner',{
- location:3
- }).then(res => {
- this.swiperlisi = res.data
- })
- },
- toinfo(item){
- uni.navigateTo({
- url:"./fuli-info?id=" + item.id
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .fuli{
- .swiper-box{
- margin: 24rpx;
- }
- .list-box{
- padding: 0 24rpx;
- image{
- width: 340rpx;
- height: 110rpx;
- border-radius: 10rpx;
- margin-bottom: 20rpx;
- }
- }
- }
- </style>
|