zhaoxiaohai 3 years ago
parent
commit
8d4ca35fb4

+ 1 - 1
components/My_pageReachBottom/index.wxml

@@ -2,4 +2,4 @@
 <view wx:elif="{{!loadMore}}" style="display: flex; justify-content: center; align-items: center;">
     <van-loading size="18px" color="#4BBECF"> 玩命加载中...</van-loading>
 </view>
-<van-divider wx:else contentPosition="center">我也是有底线的~</van-divider>
+<!-- <van-divider wx:else contentPosition="center">我也是有底线的~</van-divider> -->

+ 1 - 1
pages/announceDemand/index.wxml

@@ -6,7 +6,7 @@
         <My_GreyRectangleForm title="需求标题" required>
             <van-field value="{{ ftitle }}" bind:input='eliminate' data-name="ftitle" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.ftitle}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
-        <My_GreyRectangleForm title="需求内容" required>
+        <My_GreyRectangleForm title="文字描述" required>
             <van-field value="{{ fcontent }}" bind:input='eliminate' data-name="fcontent" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontent}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="图片">

+ 15 - 68
pages/businessPartner/applyFor.js

@@ -10,13 +10,11 @@ Page({
     data: {
         requestList: [], //请求列表
         showBtn: -1, //选中下标
-        addvalue: "",
         scrolltolowerThrottle: true, //下拉触底截流
         pageNumber: 1, //请求分页
         pageTotal: 1, //总页数
         tabsList: ['建立新合作', '合作请求'], //tabs
         tabsIndex: 0, //tabs 选中下标
-        show: false, //弹出层控制
     },
     /**
      * 生命周期函数--监听页面加载
@@ -59,12 +57,10 @@ Page({
                 "pageSize": 20,
                 "where": {
                     "condition": "",
-                    "ftype": "",
                     "fstatus": "申请"
                 }
             }
         }).then(res => {
-            console.log(res)
             if (res.msg != "成功") return wx.showToast({
                 title: res.data,
                 icon: 'none'
@@ -83,56 +79,29 @@ Page({
             })
         })
     },
-    onChange({
-        detail
-    }) {
-        this.setData({
-            addvalue: detail
-        })
-    },
-    onClick() {
-        _Http.basic({
-            "accesstoken": wx.getStorageSync('userData').token,
-            "classname": "customer.tagents.tagents",
-            "method": "apply_cooperation",
-            "content": {
-                "tcooperationagentsid": "27303",
-                "ftype": "1"
-            }
-        }).then(res => {
-            console.log(res)
-        })
-    },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
     onReady: function () {
 
     },
-    /* 回调 */
-    optionChange({
-        detail
-    }) {
-        let ftype = 1;
+    /* 选择 */
+    showBtnIndex(e) {
+        let {
+            index
+        } = e.currentTarget.dataset;
+        if (index == this.data.showBtn) index = -1;
+        this.setData({
+            showBtn: index,
+        })
+    },
+    /* 同意 */
+    ratify() {
         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;
-            case "下游":
-                ftype = 2;
-                break;
-            case "双向合作":
-                ftype = 3;
-                break;
-        };
-        console.log(ftype)
         wx.showModal({
             title: '提示',
-            content: content,
+            content: "是否同意“" + that.data.requestList[i].fbrand + '”的合作申请',
             success: function (res) {
                 if (res.confirm) {
                     _Http.basic({
@@ -140,8 +109,7 @@ Page({
                         "classname": "customer.tagents.tagents",
                         "method": "cooperation",
                         "content": {
-                            "tcooperationagentsid": that.data.requestList[i].tcooperationagentsid,
-                            "ftype": ftype
+                            "tcooperationagentsid": that.data.requestList[i].tcooperationagentsid
                         }
                     }).then(res => {
                         console.log(res)
@@ -156,34 +124,13 @@ Page({
                         requestList.splice(i, 1);
                         that.setData({
                             requestList,
-                            showBtn: -1,
-                            show: false
+                            showBtn: -1
                         })
                     })
-                } else {
-                    that.setData({
-                        show: false
-                    })
                 }
             }
         })
     },
-    /* 选择 */
-    showBtnIndex(e) {
-        let {
-            index
-        } = e.currentTarget.dataset;
-        if (index == this.data.showBtn) index = -1;
-        this.setData({
-            showBtn: index,
-        })
-    },
-    /* 同意 */
-    ratify() {
-        this.setData({
-            show: !this.data.show
-        })
-    },
     /* 拒绝 */
     refuse(e) {
         const {

+ 1 - 8
pages/businessPartner/applyFor.wxml

@@ -15,15 +15,8 @@
             <view wx:if="{{showBtn==index}}" class="company-data-but">
                 <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>
-
-<!-- 选择合作方式 -->
-<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>
+</My_DisplayBox>

+ 0 - 59
pages/businessPartner/details.js

@@ -3,84 +3,29 @@ import {
 } from "../../utils/api";
 const _Http = new ApiModel;
 Page({
-
     /**
      * 页面的初始数据
      */
     data: {
         checked: true, //开关
         partnerDetails: {}, //合作详情
-        dropDownList: false,
-        methodsList: ['上游', '下游', '双向合作'],
-        showType: '',
         seIndex: null, //合作方式
         throttle: true, //截流
         fisadministrator: null,
         isCancel: false, //是否取消合作
     },
-    /* 遮罩层点击关闭 */
-    closeTheDropDown() {
-        this.setData({
-            dropDownList: false
-        })
-    },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
         const data = JSON.parse(options.data)
-        let showType = '';
-        switch (data.ftype) {
-            case 1:
-                showType = '上游';
-                break;
-            case 2:
-                showType = '下游';
-                break;
-            case 3:
-                showType = '双向合作';
-                break;
-        };
         this.setData({
             partnerDetails: data,
-            showType,
             seIndex: data.ftype,
             fisadministrator: (wx.getStorageSync('userData').fisadministrator == 1) ? false : true,
         })
     },
-    /* 选择合作方式 */
-    modeSelect(e) {
-        const {
-            name
-        } = e.target.dataset, {
-                index
-            } = e.target.dataset,
-            that = this;
-        wx.showModal({
-            title: "提示",
-            content: "是否更改与“" + this.data.partnerDetails.fbrand + "”合作方式为" + name,
-            success(res) {
-                if (res.confirm) {
-                    that.setData({
-                        showType: name,
-                        seIndex: index + 1
-                    })
-                }
-                that.closeTheDropDown();
-            }
-        })
-    },
-    /* 下拉 */
-    dropDown() {
-        if (this.data.fisadministrator) return wx.showToast({
-            title: '当前账号无权限操作',
-            icon: "none"
-        });
-        this.setData({
-            dropDownList: true
-        })
-    },
     /* 开关 */
     onChange({
         detail
@@ -90,7 +35,6 @@ Page({
             title: '当前账号无权限操作',
             icon: "none"
         });
-        this.closeTheDropDown()
         if (this.data.checked) {
             wx.showModal({
                 title: "提示",
@@ -114,7 +58,6 @@ Page({
     /* 预览合作商logo */
     previewImg() {
         const urls = [this.data.partnerDetails.attinfos[0].fobsurl]
-        this.closeTheDropDown()
         wx.previewImage({
             current: 1, // 当前显示图片的http链接
             urls: urls
@@ -122,7 +65,6 @@ Page({
     },
     /* 提交 */
     submit() {
-        this.closeTheDropDown()
         /* 截流 */
         if (!this.data.throttle) return;
         this.setData({
@@ -182,7 +124,6 @@ Page({
             }, 500);
         }
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 1 - 13
pages/businessPartner/details.wxml

@@ -10,21 +10,9 @@
         <My_GreyRectangleForm title="是否合作">
             <van-switch checked="{{ checked }}" size="24px" active-color="#4CBECF" bind:change="onChange" />
         </My_GreyRectangleForm>
-        <My_GreyRectangleForm title="合作方式" required>
-            <view class="right-text" catchtap="dropDown">{{showType}}
-                <van-icon size="12px" name="arrow-down" />
-            </view>
-            <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>
-            </van-transition>
-        </My_GreyRectangleForm>
     </view>
 </My_GeneralTemplate>
 <!-- 提交按钮 -->
 <view class="submit_but" wx:if="{{!fisadministrator}}">
     <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">保存</van-button>
-</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>
+</view>

+ 4 - 54
pages/businessPartner/details.wxss

@@ -1,63 +1,13 @@
 @import "/css/form2.wxss";
-
-.list-scroll-view{
+.list-scroll-view {
     width: 100%;
     max-height: 79vh;
 }
-
-.right-text{
-    display: inline-block;
-    text-align: right;
-    width: 200rpx;
-    font-size: 32rpx;
-    color: rgba(0, 0, 0, .3);
-}
-
-.logo{
+.logo {
     width: 120rpx;
     height: 120rpx;
     border-radius: 8rpx;
 }
-
-.submit_but{
-    margin-top:160rpx;
-}
-
-
-/* 选择合作方式 */
-.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: 70rpx;
-    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%;
+.submit_but {
+    margin-top: 160rpx;
 }

+ 25 - 4
pages/businessPartner/index.js

@@ -30,8 +30,8 @@ Page({
         })
         this.getList();
     },
-    /* 跳转商户 */
-    jumpForDetails(e) {
+    /* 编辑 */
+    jumpForChange(e) {
         const {
             index
         } = e.currentTarget.dataset;
@@ -40,6 +40,15 @@ Page({
             url: '/pages/businessPartner/details?data=' + JSON.stringify(data),
         })
     },
+    /* 跳转商户 */
+    jumpForDetails(e) {
+        const {
+            index
+        } = e.currentTarget.dataset;
+        wx.navigateTo({
+            url: '/pages/storeMessage/storehomepage?id=' + this.data.cooperationList[index].tcooperationagentsid
+        })
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -62,6 +71,7 @@ Page({
         if (this.data.pageTotal < this.data.pageNumber) return;
         this.getList();
     },
+    /* 获取列表 */
     getList() {
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
@@ -73,16 +83,27 @@ Page({
                 "pageSize": 20,
                 "where": {
                     "condition": this.data.condition,
-                    "ftype": "",
                     "fstatus": "合作"
                 }
             }
         }).then(res => {
-            console.log(res)
+            console.log("合作列表", res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
             });
+            for (let i = 0; i < res.data.length; i++) {
+                let mySaleprodclass = '';
+                for (let k = 0; k < res.data[i].saleprodclass.length; k++) {
+                    if (k <= 2) {
+                        (k == 0) ? mySaleprodclass += res.data[i].saleprodclass[k]: mySaleprodclass += ',' + res.data[i].saleprodclass[k];
+                    } else {
+                        mySaleprodclass += '...'
+                        break;
+                    }
+                }
+                res.data[i].mySaleprodclass = mySaleprodclass;
+            }
             let cooperationList = res.data;
             if (res.pageNumber != 1) {
                 cooperationList = this.data.cooperationList.concat(cooperationList)

+ 9 - 5
pages/businessPartner/index.wxml

@@ -6,13 +6,17 @@
     <image slot="display-box-img" class="display-title_image" src="/static/icon-05.png" mode="aspectFit"></image>
     <scroll-view class="list-scroll-view" scroll-y bindscrolltolower="scrolltolower">
         <view class="company-data" wx:for="{{cooperationList}}" data-index="{{index}}" catchtap="jumpForDetails">
-            <image wx:if="{{item.attinfos[0]}}" class="company-data-image" src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
-            <image wx:else class="company-data-image" src="/static/tacitly-approve/MRuserImg.png" mode="aspectFill"></image>
+            <view>
+                <image wx:if="{{item.attinfos[0]}}" class="company-data-image" src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
+                <image wx:else class="company-data-image" src="/static/tacitly-approve/MRuserImg.png" mode="aspectFill"></image>
+            </view>
             <view class="company-data-text">
                 <view class="company-data-brandName u-line-1">{{item.fbrand}}</view>
-                <view wx:if="{{item.ftype==1}}">合作方式:上游</view>
-                <view wx:if="{{item.ftype==2}}">合作方式:下游</view>
-                <view wx:if="{{item.ftype==3}}">合作方式:双向合作</view>
+                <view class="u-line-1">联系方式:{{item.fphonenumber}}</view>
+                <view class="u-line-1">联系方式:{{item.mySaleprodclass}}</view>
+            </view>
+            <view class="company-data-change" data-index="{{index}}" catchtap="jumpForChange">
+                <image src="/static/changeImg.png"></image>
             </view>
         </view>
         <My_pageReachBottom loadMore="{{pageNumber > pageTotal}}" dummyStatus="{{cooperationList.length!=0}}"></My_pageReachBottom>

+ 19 - 1
pages/businessPartner/index.wxss

@@ -12,7 +12,7 @@
     margin: 0 6rpx;
 }
 
-.list-scroll-view{
+.list-scroll-view {
     width: 100%;
     max-height: 79vh;
 }
@@ -43,12 +43,30 @@
     color: rgba(51, 51, 51, .7);
 }
 
+.company-data-text>view {
+    width: 460rpx;
+}
+
 .company-data-brandName {
     width: 300rpx;
     font-size: 28rpx;
     color: #000000;
 }
 
+.company-data-change {
+    display: flex;
+    align-items: center;
+    width: 48rpx;
+    height: 100%;
+    margin-right: 10rpx;
+    flex-shrink: 0;
+}
+
+.company-data-change image {
+    width: 48rpx;
+    height: 48rpx;
+}
+
 /* .company-data-but {
     display: flex;
     align-items: center;

+ 0 - 1
pages/tabbar-pages/message/index.js

@@ -28,7 +28,6 @@ Page({
             h = getApp().globalData.myNavBorHeight + getApp().globalData.safeAreaBottom;
         wx.getSystemInfo({
             success(res) {
-                console.log(res)
                 that.setData({
                     scrollH: res.windowHeight - h - 7
                 })

+ 4 - 0
pages/teamManagement/change.wxml

@@ -16,6 +16,10 @@
             <van-switch style="position: absolute; margin-left: -110rpx; margin-top: 10rpx;" size="24px" active-color="#4CBECF" checked="{{ checked }}" bind:change="onChange" />
         </My_GreyRectangleForm>
 
+        <My_GreyRectangleForm title="是否设置为主账号">
+            <van-switch style="position: absolute; margin-left: -110rpx; margin-top: 10rpx;" size="24px" active-color="#4CBECF" checked="{{ checked }}" bind:change="onChange" />
+        </My_GreyRectangleForm>
+
     </view>
 </My_GeneralTemplate>