123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <template>
- <view class="container">
- <!-- 供销社列表 -->
- <view class="rnwdList" v-for="(item, index) in list" :key="index">
- <view @tap="goDetails(item.id)" class="cooperativeImgBox" style="width: 30%;">
- <!--<image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>-->
- <image :src="loadImgSrcLocalhost(item.imgUrl)" class="cooperativeImg"></image>
- </view>
- <view @tap="goDetails(item.id)" class="cooperativeBox">
- <view class="list">
- <span class="listTitle">{{ item.name }}</span>
- <view class="jlSj">
- <span class="jf">
- {{ item.address?item.address:'' }}
- </span>
- </view>
- </view>
- </view>
- <em class="iconfont icon-xiangyoujiantou"></em>
- </view>
- <uni-load-more :status="status" :content-text="contentText"/>
- <uni-fab ref="fab" horizontal="right" vertical="bottom"
- @fabClick="handleAdd()"/>
- </view>
- </template>
- <script>
- import { getList, getDetails } from '@/api/highFrequencyService/cooperative/cooperative';
- export default {
- data() {
- return {
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 15,
- id: null,
- status:"1",
- },
- // 加载更多
- status: 'more',
- contentText: {
- contentdown: '查看更多',
- contentrefresh: '加载中',
- contentnomore: '------------------我是有底线的------------------'
- },
- // 列表数据
- list: [
- {
- name:"-",
- address:"-",
- chargePeople:"-",
- chargePhone:"-",
- imgUrl:"-"
- }
- ],
- total:0
- };
- },
- onPullDownRefresh() {
- this.queryParams.pageNum = 1;
- this.list = [];
- this.getList()
- },
- //上拉加载
- onReachBottom(){
- let pageNum = this.queryParams.pageNum;
- let pageSize = this.queryParams.pageSize;
- let total = this.total;
- if(pageNum * pageSize >= total){
- uni.showToast({
- title:'暂无更多数据'
- });
- return;
- } else {
- this.queryParams.pageNum += 1;
- this.getList()
- }
- }
- /**
- * 生命周期函数--监听页面加载
- */,
- onLoad(options) {
- this.getList();
- },
- methods: {
- /** 新增按钮操作 */
- handleAdd(){
- uni.navigateTo({
- url: '/pages/highServer/cooperative/addCooperative'
- });
- },
- /** 查询列表 */
- getList(type) {
- this.loading = true;
- getList(this.queryParams).then(response => {
- this.total = response.total
- if (this.queryParams.pageNum === 1) {
- this.list = response.rows;
- } else {
- this.list = this.list.concat(response.rows);
- }
- // 判断是否还有更多数据
- if (response.rows.length < this.queryParams.pageSize) {
- this.status = 'noMore'; // 没有更多数据
- } else {
- this.status = 'more'; // 还有更多数据
- }
- });
- },
- /** 查询详情 */
- goDetails(id) {
- uni.navigateTo({
- url: '/pages/highServer/cooperative/details?id='+id
- });
- }
- }
- };
- </script>
- <style>
- @import './cooperative.css';
- </style>
|