zhaoxiaohai hace 3 años
padre
commit
6dadfdf18d

+ 2 - 0
README.md

@@ -62,6 +62,8 @@
 
 ​	My_CenterTheTitle -- 居中标题 两侧带有居中蓝线
 
+​	My_TwoDimensionalCode -- 二维码
+
 # 缓存
 
 ​	userData -- 用户基本数据 -- 保存数据:index-用户列表下标,token,fisadministrator--是否主账号,tagentsid,tenterpriseid,userid

+ 23 - 0
components/My_TwoDimensionalCode/index.js

@@ -0,0 +1,23 @@
+// components/My_TwoDimensionalCode/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 4 - 0
components/My_TwoDimensionalCode/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 2 - 0
components/My_TwoDimensionalCode/index.wxml

@@ -0,0 +1,2 @@
+<My_DisplayBox title="请求列表" isMore="{{false}}">
+</My_DisplayBox>

+ 1 - 0
components/My_TwoDimensionalCode/index.wxss

@@ -0,0 +1 @@
+/* components/My_TwoDimensionalCode/index.wxss */

+ 1 - 0
css/form2.wxss

@@ -26,4 +26,5 @@
 
 .custom-class {
     width: 100% !important;
+    z-index: 99;
 }

+ 26 - 3
pages/businessPartner/applyFor.js

@@ -13,19 +13,33 @@ Page({
         pattern: false, //显示方式选择
         dropDownList: false, //显示下拉菜单
         methodsList: ['上游', '下游', '双向合作'],
-        addvalue: ""
+        addvalue: "",
+        scrolltolowerThrottle: true, //下拉触底截流
+        pageNumber: 1, //请求分页
+        pageTotal: 1, //总页数
     },
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+        this.getList();
+    },
+    /* 下拉触底 */
+    scrolltolower() {
+        if (!this.data.scrolltolowerThrottle) return;
+        this.setData({
+            scrolltolowerThrottle: false
+        })
+        if (this.data.pageTotal > this.data.pageNumber) this.getList();
+    },
+    getList() {
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
             "classname": "customer.tagents.tagents",
             "method": "query_cooperation",
             "content": {
                 "getdatafromdbanyway": true,
-                "pageNumber": 1,
+                "pageNumber": this.data.pageNumber,
                 "pageSize": 20,
                 "where": {
                     "condition": "",
@@ -39,8 +53,17 @@ Page({
                 title: res.data,
                 icon: 'none'
             })
+            let requestList = [];
+            if (res.pageNumber == 1) {
+                requestList = res.data
+            } else {
+                requestList = this.data.requestList.concat(res.data)
+            }
             this.setData({
-                requestList: res.data
+                requestList,
+                scrolltolowerThrottle: true,
+                pageTotal: res.pageTotal,
+                pageNumber: this.data.pageNumber + 1
             })
         })
     },

+ 27 - 22
pages/businessPartner/applyFor.wxml

@@ -1,27 +1,32 @@
 <My_DisplayBox title="请求列表" isMore="{{false}}">
     <image slot="display-box-img" class="display-title_image" src="/static/icon-05.png" mode="aspectFit"></image>
-    <view class="company-data" wx:for="{{requestList}}" data-index="{{index}}" bindtap="showBtnIndex">
-        <image class="company-data-image" src="{{item.attinfos[0].fobsurl}}"></image>
-        <view class="company-data-brandName u-line-1">
-            {{item.fbrand}}
-        </view>
-        <!-- 按钮 -->
-        <view wx:if="{{showBtn==index}}" class="company-data-but">
-            <view wx:if="{{!pattern}}">
-                <van-button data-index="{{index}}" custom-class="custom-class-company-data jujue" style="margin-right: 20rpx;" catchtap="refuse">拒绝</van-button>
-                <van-button data-index="{{index}}" custom-class="custom-class-company-data" catchtap="ratify">同意</van-button>
+    <scroll-view class="list-scroll-view" scroll-y bindscrolltolower="scrolltolower">
+    <!-- requestList -->
+        <view class="company-data" wx:for="{{2}}" data-index="{{index}}" bindtap="showBtnIndex">
+            <image class="company-data-image" src="{{item.attinfos[0].fobsurl}}"></image>
+            <view class="company-data-brandName u-line-1">
+                {{item.fbrand}}
             </view>
-            <!-- 下拉选择 -->
-            <view wx:else class="pattern">
-                <input type="text" readonly="readonly" autocomplete="off" bindfocus="chooseCooperationMode" bindblur="hiddenDropDown" style="width: 100%; height: 100%;position: absolute; opacity: 0;" />
-                选择合作方式
-                <van-icon name="arrow-down" />
-                <van-transition show="{{dropDownList}}" class="pattern-item-box" name="fade-down">
-                    <view class="pattern-item" bindtap="modeSelect">
-                        <view wx:for="{{methodsList}}" data-index="{{index}}">{{item}}</view>
-                    </view>
-                </van-transition>
+            <!-- 按钮 -->
+            <view wx:if="{{showBtn==index}}" class="company-data-but">
+                <view wx:if="{{!pattern}}">
+                    <van-button data-index="{{index}}" custom-class="custom-class-company-data jujue" style="margin-right: 20rpx;" catchtap="refuse">拒绝</van-button>
+                    <van-button data-index="{{index}}" custom-class="custom-class-company-data" catchtap="ratify">同意</van-button>
+                </view>
+                <!-- 下拉选择 -->
+                <view wx:else class="pattern">
+                    <input type="text" disabled="{{!dropDownList}}" readonly bindfocus="chooseCooperationMode" bindblur="hiddenDropDown" style="width: 100%; height: 100%;position: absolute; opacity: 0;" />
+                    选择合作方式
+                    <van-icon name="arrow-down" />
+                    <van-transition show="{{dropDownList}}" class="pattern-item-box" name="fade-down">
+                        <view class="pattern-item" bindtap="modeSelect">
+                            <view wx:for="{{methodsList}}" data-index="{{index}}">{{item}}</view>
+                        </view>
+                    </van-transition>
+                </view>
             </view>
         </view>
-    </view>
-</My_DisplayBox>
+        <My_pageReachBottom loadMore="{{scrolltolowerThrottle==true}}" dummyStatus="{{requestList.length>1}}"></My_pageReachBottom>
+    </scroll-view>
+</My_DisplayBox>
+<view wx:if="{{dropDownList}}" style="height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; background: #000; opacity: 0.3; z-index: 0;" bindtap="closeTheDropDown"></view>

+ 11 - 8
pages/businessPartner/details.js

@@ -15,6 +15,12 @@ Page({
         showType: '',
         throttle: true, //截流
     },
+    /* 遮罩层点击关闭 */
+    closeTheDropDown() {
+        this.setData({
+            dropDownList: false
+        })
+    },
 
     /**
      * 生命周期函数--监听页面加载
@@ -76,23 +82,18 @@ Page({
             }
         })
     },
-    /* 下拉获取焦点 */
-    dropDownFocus() {
+    /* 下拉 */
+    dropDown() {
         this.setData({
             dropDownList: true
         })
     },
-    /* 下拉失去焦点 */
-    dropDownBlur() {
-        this.setData({
-            dropDownList: false
-        })
-    },
     /* 开关 */
     onChange({
         detail
     }) {
         const that = this;
+        this.closeTheDropDown()
         if (this.data.checked) {
             wx.showModal({
                 title: "提示",
@@ -132,6 +133,7 @@ Page({
     /* 预览合作商logo */
     previewImg() {
         const urls = [this.data.partnerDetails.attinfos[0].fobsurl]
+        this.closeTheDropDown()
         wx.previewImage({
             current: 1, // 当前显示图片的http链接
             urls: urls
@@ -139,6 +141,7 @@ Page({
     },
     /* 提交 */
     submit() {
+        this.closeTheDropDown()
         if (!this.data.throttle) return;
         this.setData({
             throttle: false

+ 6 - 6
pages/businessPartner/details.wxml

@@ -1,20 +1,19 @@
-<My_GeneralTemplate  overflowHidden="{{false}}"  padBot="20rpx">
+<My_GeneralTemplate overflowHidden="{{false}}" padBot="20rpx">
     <view style="padding: 0 30rpx; box-sizing: border-box;">
         <My_GreyRectangleForm title="商户名" required>
             <view class="right-text">{{partnerDetails.fbrand}}</view>
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="商户logo" required>
-            <image class="logo" src="{{partnerDetails.attinfos[0].fobsurl}}" mode="aspectFill" catchtap="previewImg"></image>
+            <image style="z-index: 9;" class="logo" src="{{partnerDetails.attinfos[0].fobsurl}}" mode="aspectFill" catchtap="previewImg"></image>
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="是否合作">
             <van-switch checked="{{ checked }}" bind:change="onChange" />
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="合作方式" required>
-            <input style="background-color: brown; position: absolute; opacity: 0;" readonly type="text" bindfocus="dropDownFocus" bindblur="dropDownBlur" />
-            <view class="right-text">{{showType}}
+            <view class="right-text" catchtap="dropDown">{{showType}}
                 <van-icon size="12px" name="arrow-down" />
             </view>
-            <van-transition show="{{dropDownList}}" class="pattern-item-box" name="fade-down">
+            <van-transition show="{{dropDownList}}" class="pattern-item-box" style="z-index: 999;" name="fade">
                 <view class="pattern-item" bindtap="modeSelect">
                     <view wx:for="{{methodsList}}" data-index="{{index}}" data-name="{{item}}">{{item}}</view>
                 </view>
@@ -25,4 +24,5 @@
 <!-- 提交按钮 -->
 <view class="submit_but">
     <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">保存</van-button>
-</view>
+</view>
+<view wx:if="{{dropDownList}}" style="height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; opacity: 0.3; z-index: 0;" bindtap="closeTheDropDown"></view>

+ 5 - 0
pages/businessPartner/details.wxss

@@ -1,5 +1,10 @@
 @import "/css/form2.wxss";
 
+.list-scroll-view{
+    width: 100%;
+    max-height: 79vh;
+}
+
 .right-text{
     display: inline-block;
     text-align: right;

+ 9 - 2
pages/businessPartner/index.js

@@ -65,6 +65,7 @@ Page({
         });
         this.getList()
     },
+    /* 下拉触底 */
     scrolltolower() {
         if (!this.data.scrolltolowerThrottle) return;
         this.setData({
@@ -93,12 +94,18 @@ Page({
                 title: res.data,
                 icon: "none"
             });
+            let cooperationList = [];
+            if (res.pageNumber == 1) {
+                cooperationList = res.data
+            } else {
+                cooperationList = this.data.requestList.concat(res.data)
+            };
             this.setData({
-                cooperationList: res.data,
+                cooperationList,
                 pageTotal: res.pageTotal,
                 pageNumber: this.data.pageNumber + 1,
                 scrolltolowerThrottle: true
-            })
+            });
         })
     },