shop_uniapp/bundle_b/pages/local_verify/shop.vue

84 lines
2.2 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption">
<view class="shop-menu">
<view class="shop-menu-item" v-for="(item, index) in list" :key="index">
<view class="flex">
<u-image :src="item.shopLogo" width="120rpx" height="120rpx" border-radius="50%"></u-image>
<view>
<view class="bold lg m-l-10">{{item.shopName}}</view>
<view class="lg m-l-10 m-t-10">绑定日期:{{item.create_time}}</view>
</view>
</view>
</view>
</view>
</mescroll-uni>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import {storeList} from '@/api/local_store';
export default {
mixins: [MescrollMixin],
data() {
return {
upOption: {
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
empty: {
icon: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/order_null.png',
tip: '暂无数据~', // 提示
fixed: true
}
},
list: []
}
},
methods: {
refresh() {
this.mescroll.resetUpScroll()
},
async upCallback(page) {
let pageNum = page.num; // 页码, 默认从1开始
let pageSize = page.size; // 页长, 默认每页10条
storeList({
page_size: pageSize,
page_no: pageNum,
lstore_id: this.lstore_id
}).then(({
data
}) => {
let curPageData = data.lists;
let curPageLen = curPageData.length;
let hasNext = !!data.more;
if (page.num == 1) this.list = [];
this.list = this.list.concat(curPageData);
this.mescroll.endSuccess(curPageLen, hasNext);
})
}
}
}
</script>
<style lang="scss">
.content {
.shop-menu {
background-color: #F6F6F6;
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
.shop-menu-item {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
margin-bottom: 20rpx;
border-radius: 20rpx;
padding: 40rpx 12rpx;
}
}
}
</style>