zhaoxiaohai 3 سال پیش
والد
کامیت
36907b4c83
4فایلهای تغییر یافته به همراه31 افزوده شده و 100 حذف شده
  1. 20 32
      pages/businessPartner/applyFor.js
  2. 2 1
      pages/businessPartner/applyFor.json
  3. 9 15
      pages/businessPartner/applyFor.wxml
  4. 0 52
      pages/businessPartner/applyFor.wxss

+ 20 - 32
pages/businessPartner/applyFor.js

@@ -10,15 +10,13 @@ Page({
     data: {
         requestList: [], //请求列表
         showBtn: -1, //选中下标
-        pattern: false, //显示方式选择
-        dropDownList: false, //显示下拉菜单
-        methodsList: ['上游', '下游', '双向合作'],
         addvalue: "",
         scrolltolowerThrottle: true, //下拉触底截流
         pageNumber: 1, //请求分页
         pageTotal: 1, //总页数
         tabsList: ['建立新合作', '合作请求'], //tabs
         tabsIndex: 0, //tabs 选中下标
+        show: false, //弹出层控制
     },
     /**
      * 生命周期函数--监听页面加载
@@ -112,15 +110,16 @@ Page({
     onReady: function () {
 
     },
-    modeSelect(e) {
-        const {
-            index
-        } = e.target.dataset,
-            i = this.data.showBtn,
-            that = this;
-        const content = (this.data.methodsList[index] == '双向合作') ? '是否确定将“' + this.data.requestList[i].fbrand + '”作为您的“' + this.data.methodsList[index] + '”伙伴' : '是否确定将“' + this.data.requestList[i].fbrand + '”作为您的“' + this.data.methodsList[index] + '合作”伙伴';
+    /* 回调 */
+    optionChange({
+        detail
+    }) {
+        console.log(detail)
         let ftype = Number;
-        switch (this.data.methodsList[index]) {
+        const i = this.data.showBtn,
+            content = (detail == '双向合作') ? '是否确定将“' + this.data.requestList[i].fbrand + '”作为您的“' + detail + '”伙伴' : '是否确定将“' + this.data.requestList[i].fbrand + '”作为您的“' + detail + '合作”伙伴',
+            that = this;
+        switch (detail) {
             case "上游":
                 ftype = 1;
                 break;
@@ -130,7 +129,7 @@ Page({
             case "双向合作":
                 ftype = 3;
                 break;
-        }
+        };
         wx.showModal({
             title: '提示',
             content: content,
@@ -156,43 +155,32 @@ Page({
                         requestList.splice(i, 1);
                         that.setData({
                             requestList,
-                            showBtn: -1
+                            showBtn: -1,
+                            show: false
                         })
                     })
                 } else {
-                    console.log('取消')
+                    that.setData({
+                        show: false
+                    })
                 }
             }
         })
     },
     /* 选择 */
     showBtnIndex(e) {
-        const {
+        let {
             index
         } = e.currentTarget.dataset;
-        this.closeTheDropDown();
-        if (index == this.data.showBtn) return;
+        if (index == this.data.showBtn) index = -1;
         this.setData({
-            pattern: false,
             showBtn: index,
         })
     },
-    /* 选择合作方式 */
-    chooseCooperationMode() {
-        this.setData({
-            dropDownList: !this.data.dropDownList
-        })
-    },
-    /* 点击遮罩层关闭 */
-    closeTheDropDown() {
-        this.setData({
-            dropDownList: false
-        })
-    },
     /* 同意 */
-    ratify(e) {
+    ratify() {
         this.setData({
-            pattern: true
+            show: !this.data.show
         })
     },
     /* 拒绝 */

+ 2 - 1
pages/businessPartner/applyFor.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
     "My_DisplayBox": "/components/My_DisplayBox/index",
-    "My_TwoDimensionalCode": "/components/My_TwoDimensionalCode/index"
+    "My_TwoDimensionalCode": "/components/My_TwoDimensionalCode/index",
+    "My_MultipleChoice": "/components/My_MultipleChoice/index"
   }
 }

+ 9 - 15
pages/businessPartner/applyFor.wxml

@@ -13,23 +13,17 @@
             </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>
-                </view>
-                <!-- 下拉选择 -->
-                <view wx:else class="pattern" catchtap="chooseCooperationMode">
-                    选择合作方式
-                    <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>
+                <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 class="pattern-item" bindtap="modeSelect">-->
             </view>
         </view>
         <My_pageReachBottom loadMore="{{scrolltolowerThrottle==true}}" dummyStatus="{{requestList.length!=0}}"></My_pageReachBottom>
     </scroll-view>
 </My_DisplayBox>
-<view wx:if="{{dropDownList}}" style="height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; z-index: 0;" bindtap="closeTheDropDown"></view>
+
+<!-- 选择合作方式 -->
+<van-action-sheet show="{{ show }}" bind:close="ratify">
+    <view style="font-size: 32rpx;font-family: PingFangSC-Medium, PingFang SC;font-weight: 550;color: #000000;margin-left: 54rpx;margin-top: 40rpx;">合作方式</view>
+    <My_MultipleChoice type='cooperation' pitchOnItem="上游" bind:optionChange='optionChange'></My_MultipleChoice>
+</van-action-sheet>

+ 0 - 52
pages/businessPartner/applyFor.wxss

@@ -61,56 +61,4 @@
 
 .jujue {
     background: linear-gradient(180deg, #D3D3D3 0%, #A7A8A8 100%) !important;
-}
-
-/* 选择合作方式 */
-.pattern {
-    position: relative;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    font-size: 24rpx;
-    color: #4BBECF;
-    width: 198rpx;
-    height: 46rpx;
-    border-radius: 10rpx;
-    border: 2rpx solid #4BBECF;
-    z-index: 99;
-}
-
-.pattern-item-box {
-    position: absolute;
-    width: 100%;
-    top: 65rpx;
-}
-
-.pattern-item {
-    width: 100%;
-    background-color: #ffffff;
-    border: 2rpx solid #e8e8e8;
-    border-radius: 8rpx;
-    bottom: -70rpx;
-    box-shadow: 0 0 8rpx 0 rgba(0, 0, 0, 0.1);
-}
-
-.pattern-item>view {
-    line-height: 50rpx;
-    text-align: center;
-    color: rgba(0, 0, 0, 0.5);
-}
-
-.pattern-item::after {
-    position: absolute;
-    content: '';
-    display: block;
-    width: 15rpx;
-    height: 15rpx;
-    background-color: #fff;
-    transform: rotate(45deg);
-    border: 2rpx solid #e8e8e8;
-    border-bottom: 0;
-    border-right: 0;
-    top: 0;
-    margin-top: -9rpx;
-    left: 75%;
 }