wangzhe 1 year ago
parent
commit
331cbd696e

+ 128 - 0
pages/highServer/cooperative/cooperative.css

@@ -0,0 +1,128 @@
+/* pages/wenda/wenda.wxss */
+.wendaFL {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin: 30rpx 0 0 0;
+}
+.wendaFL li {
+    width: 48%;
+    height: 168rpx;
+    position: relative;
+}
+.cooperativeBox{
+    position: relative;
+    left: 30rpx;
+    top: 10rpx;
+    z-index: 0;
+    width: 800rpx;
+    height: 100rpx;
+}
+.cooperativeImgBox{
+    position: relative;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 330rpx;
+    height: 100rpx;
+}
+.cooperativeImg{
+    position: relative;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.lbBj {
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 100%;
+}
+.wendaFL li h2 {
+    font-size: 36rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 40rpx;
+    z-index: 1;
+    font-weight: bold;
+}
+.wendaFL li span {
+    font-size: 30rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 88rpx;
+    z-index: 1;
+}
+.wendaFL li.sanNong {
+    color: #0d9970;
+}
+.wendaFL li.jiuYe {
+    color: #1e8fb4;
+}
+.wendaFL li.faLv {
+    color: #1e5dab;
+}
+.wendaFL li.jiuZhen {
+    color: #4a700d;
+}
+/* 列表 */
+.rnwdList {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin: 20rpx 0;
+}
+.list {
+    width: 79%;
+}
+.lb {
+    background: #0d9970;
+    color: #fff;
+    font-size: 24rpx;
+    width: 12%;
+    text-align: center;
+    padding: 2rpx 0;
+    line-height: 40rpx;
+    height: 40rpx;
+    border-radius: 10rpx;
+}
+.listTitle {
+    font-size: 32rpx;
+    color: #333;
+    line-height: 40rpx;
+}
+.jlSj {
+    height: 40rpx;
+    display: flex;
+    justify-content: space-between;
+    font-size: 24rpx;
+    margin: 20rpx 0 0 0;
+}
+.jf {
+    color: #07c160;
+}
+.icon-jifen {
+    font-size: 28rpx;
+    color: #07c160;
+    margin: 0 0 0 6rpx;
+}
+.ck {
+    color: #c4c4c4;
+}
+.icon-pinglun,
+.icon-chakan,
+.icon-shoucang {
+    font-size: 28rpx;
+    margin: 0 6rpx 0 20rpx;
+    color: #c4c4c4;
+}
+.icon-xiangyoujiantou {
+    font-size: 30rpx;
+    color: #c4c4c4;
+    line-height: 60rpx;
+}

+ 119 - 0
pages/highServer/cooperative/cooperative.vue

@@ -0,0 +1,119 @@
+<template>
+    <view class="container">
+        <!-- 供销社列表 -->
+        <view class="rnwdList" v-for="(item, index) in list" :key="index">
+            <view @tap="goDetails(item.id)" class="cooperativeImgBox">
+                <!--<image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>-->
+                <image :src="loadImgSrc(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:"-"
+                }
+            ],
+        };
+    },
+    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().then(response => {
+                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>

+ 2 - 2
pages/highServer/cooperative/details.vue

@@ -2,8 +2,8 @@
     <view class="container">
     <view class="container">
         <!-- 供销社详情 -->
         <!-- 供销社详情 -->
         <view class="cooperativeImgBox">
         <view class="cooperativeImgBox">
-            <image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>
-            <!--<image :src="loadImgSrc(imgUrl)" class="cooperativeImg"></image>-->
+            <!--<image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>-->
+            <image :src="loadImgSrc(imgUrl)" class="cooperativeImg"></image>
         </view>
         </view>
         <view class="itemBox" v-for="(item, index) in list" :key="index">
         <view class="itemBox" v-for="(item, index) in list" :key="index">
             <view class="item">
             <view class="item">