Browse Source

商户合作

zhaoxiaohai 3 years ago
parent
commit
6fc2aa1c7c

+ 3 - 1
README.md

@@ -18,6 +18,8 @@
 
 ​	tradeShow -- 展会
 
+​	businessPartner -- index-合作伙伴 details-合作详情 applyFor-合作申请
+
 # 自定义组件:
 
 ​	My_Background -- 背景图片 //登录页面背景
@@ -32,7 +34,7 @@
 
 ​	My_GeneralTemplate -- 通用模板 个人主页 个人信息 团队管理 产品管理
 
-​	My_GreyRectangle -- 灰色矩形 用于个人信息表单
+​	My_GreyRectangleForm -- 灰色矩形 用于个人信息表单
 
 ​	My_MembersAndProducts -- 团队管理与产品管理
 

+ 6 - 2
app.json

@@ -38,7 +38,10 @@
         "pages/tabbar-pages/user/index",
         "pages/tabbar-pages/supplyAndDemand/particulars",
         "pages/tradeShow/index",
-        "pages/liveStreaming/index"
+        "pages/liveStreaming/index",
+        "pages/businessPartner/index",
+        "pages/businessPartner/details",
+        "pages/businessPartner/applyFor"
     ],
     "usingComponents": {
         "van-button": "@vant/weapp/button/index",
@@ -54,7 +57,8 @@
         "van-action-sheet": "@vant/weapp/action-sheet/index",
         "My_Checkbox": "/components/My_Checkbox/index",
         "My_navBar": "/components/My_navBar/index",
-        "My_pageReachBottom": "/components/My_pageReachBottom/index"
+        "My_pageReachBottom": "/components/My_pageReachBottom/index",
+        "van-transition": "@vant/weapp/transition/index"
     },
     "window": {
         "backgroundTextStyle": "light",

+ 4 - 0
components/My_DisplayBox/index.js

@@ -14,6 +14,10 @@ Component({
         /* 更多点击回调 */
         getExhibitionTitle: {
             type: Function
+        },
+        isMore:{
+            type:Boolean,
+            value:true
         }
     },
 

+ 1 - 1
components/My_DisplayBox/index.wxml

@@ -4,7 +4,7 @@
         <view class="display-box-title">
             <slot name="display-box-img"></slot>{{title}}
         </view>
-        <view class="display-box-more" bindtap="moreClick">
+        <view wx:if="{{isMore}}" class="display-box-more" bindtap="moreClick">
             更多
         </view>
     </view>

+ 16 - 0
components/My_SearchInputBox/index.js

@@ -15,6 +15,22 @@ Component({
         /* 是否主账号 */
         fisadministrator: {
             type: Boolean
+        },
+        butText: {
+            type: String,
+            value: "新增"
+        },
+        marTop: {
+            type: Number,
+            value: 30
+        },
+        inputColor: {
+            type: String,
+            value: "#FFFF"
+        },
+        inputRadius: {
+            type: String,
+            value: "10"
         }
     },
 

+ 3 - 3
components/My_SearchInputBox/index.wxml

@@ -1,5 +1,5 @@
-<view class="search_box">
-    <view class="searc" wx:if="{{route!='team'}}">
+<view class="search_box" style="margin-top: {{marTop}}rpx;">
+    <view class="searc" style="background-color: {{inputColor}}; border-radius:{{inputRadius}}rpx;" wx:if="{{route!='team'}}">
         <van-icon name="search" /><input type="search" confirm-type="search" placeholder="请输入搜索关键字" value="{{text}}" bindblur='searchBlur' bindinput="inputText" />
         <view class="clear" bindtap="clearInput">
             <van-icon name="clear" />
@@ -7,6 +7,6 @@
     </view>
     <view class="searc" wx:else style="opacity: 0;"></view>
     <view class="searc_but" bindtap="itemAdd" wx:if="{{fisadministrator}}">
-        <van-icon name="add" />新增
+        <van-icon wx:if="{{butText=='新增'}}" name="add" />{{butText}}
     </view>
 </view>

+ 0 - 3
components/My_SearchInputBox/index.wxss

@@ -6,7 +6,6 @@
     width: 100vw;
     padding: 0 24rpx;
     box-sizing: border-box;
-    margin-top: 30rpx;
 }
 
 .searc {
@@ -14,8 +13,6 @@
     display: flex;
     align-items: center;
     height: 100%;
-    background: #FFFFFF;
-    border-radius: 10rpx;
     opacity: 0.37;
     padding-left: 20rpx;
 }

+ 1 - 1
components/My_navBar/index.wxss

@@ -1,7 +1,7 @@
 .header_nav {
     position: fixed;
     width: 100vw;
-    background-color: #3CC1CE;
+    background-color: #51C3D5;
     top: 0;
     left: 0;
     z-index: 99999;

+ 97 - 0
pages/businessPartner/applyFor.js

@@ -0,0 +1,97 @@
+// pages/businessPartner/applyFor.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        showBtn: -1,//选中下标
+        pattern: false,//显示方式选择
+        dropDownList:false,//显示下拉菜单
+        methodsList:['上游','下游','双向合作']
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+    /* 选择 */
+    showBtnIndex(e) {
+        const {
+            index
+        } = e.currentTarget.dataset;
+        if(index==this.data.showBtn) return;
+        this.setData({
+            pattern: false,
+            showBtn: index,
+        })
+    },
+    /* 选择合作方式 */
+    chooseCooperationMode(){
+        this.setData({
+            dropDownList:true
+        })
+    },
+    hiddenDropDown(){
+        this.setData({
+            dropDownList:false
+        })
+    },
+    /* 同意 */
+    ratify(e) {
+        this.setData({
+            pattern: true
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/businessPartner/applyFor.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "My_DisplayBox": "/components/My_DisplayBox/index"
+  }
+}

+ 24 - 0
pages/businessPartner/applyFor.wxml

@@ -0,0 +1,24 @@
+<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="{{3}}" data-index="{{index}}" bindtap="showBtnIndex">
+        <image class="company-data-image"></image>
+        <view class="company-data-brandName">
+            品牌a
+        </view>
+        <view wx:if="{{showBtn==index}}" class="company-data-but" >
+            <view wx:if="{{!pattern}}">
+                <van-button custom-class="custom-class-company-data jujue" style="margin-right: 20rpx;" catchtap="jumpForDetails">拒绝</van-button>
+                <van-button custom-class="custom-class-company-data" catchtap="ratify">同意</van-button>
+            </view> 
+            <view wx:else class="pattern">
+                <input type="text" 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">
+                        <view wx:for="{{methodsList}}" >{{item}}</view>
+                    </view>
+                </van-transition>
+            </view>
+        </view>
+    </view>
+</My_DisplayBox>

+ 112 - 0
pages/businessPartner/applyFor.wxss

@@ -0,0 +1,112 @@
+.SearchInputBox {
+    width: 100%;
+    background-color: #ffffff;
+    padding: 20rpx 0rpx;
+    box-sizing: border-box;
+}
+
+/* 展示区域title image */
+.display-title_image {
+    width: 32rpx;
+    height: 32rpx;
+    margin: 0 6rpx;
+}
+
+/* 相关商家信息 */
+.company-data {
+    display: flex;
+    width: 100%;
+    height: 114rpx;
+    padding-bottom: 20rpx;
+    border-bottom: 2rpx solid rgba(151, 151, 151, .1);
+    margin-bottom: 20rpx;
+}
+
+.company-data-image {
+    width: 114rpx;
+    height: 114rpx;
+    border-radius: 10rpx;
+    margin-right: 20rpx;
+    background-color: royalblue;
+}
+
+.company-data-brandName {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    font-size: 28rpx;
+    color: #000000;
+}
+
+.company-data-but {
+    display: flex;
+    align-items: center;
+    height: 100%;
+}
+
+.custom-class-company-data {
+    width: 88rpx;
+    height: 46rpx !important;
+    background: linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%) !important;
+    box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.1) !important;
+    border-radius: 10rpx !important;
+    padding: 0 !important;
+    color: #ffffff !important;
+    font-weight: 500;
+    font-size: 24rpx;
+    text-shadow: 0px 0px 12px rgba(0, 0, 0, 0.1);
+}
+
+.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;
+}
+.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%;
+}

+ 71 - 0
pages/businessPartner/details.js

@@ -0,0 +1,71 @@
+// pages/businessPartner/details.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        checked:true
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+
+    onChange({ detail }) {
+        // 需要手动对 checked 状态进行更新
+        this.setData({ checked: detail });
+      },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/businessPartner/details.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "van-switch": "@vant/weapp/switch/index"
+  }
+}

+ 20 - 0
pages/businessPartner/details.wxml

@@ -0,0 +1,20 @@
+<My_GeneralTemplate>
+    <view style="padding: 0 30rpx; box-sizing: border-box;">
+        <My_GreyRectangleForm title="商户名" required>
+            <view class="right-text">商户名称</view>
+        </My_GreyRectangleForm>
+        <My_GreyRectangleForm title="商户logo" required>
+            <image class="logo" src="/static/changeImg.png" mode="aspectFit"></image>
+        </My_GreyRectangleForm>
+        <My_GreyRectangleForm title="是否合作">
+            <van-switch checked="{{ checked }}" bind:change="onChange" />
+        </My_GreyRectangleForm>
+        <My_GreyRectangleForm title="合作方式" required>
+            <view class="right-text">商户名称</view>
+        </My_GreyRectangleForm>
+    </view>
+</My_GeneralTemplate>
+<!-- 提交按钮 -->
+<view class="submit_but">
+    <van-button bindtap="submit" custom-class="custom-class" round color="linear-gradient(180deg, #82E0E9 0%, #4BBECF 100%);">保存</van-button>
+</view>

+ 12 - 0
pages/businessPartner/details.wxss

@@ -0,0 +1,12 @@
+@import "/css/form2.wxss";
+
+.right-text{
+    font-size: 32rpx;
+    color: rgba(0, 0, 0, .3);
+}
+
+.logo{
+    width: 120rpx;
+    height: 120rpx;
+    border-radius: 8rpx;
+}

+ 95 - 0
pages/businessPartner/index.js

@@ -0,0 +1,95 @@
+import {
+    ApiModel
+} from "../../utils/api";
+const _Http = new ApiModel;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        showIndex:-1,//显示按钮的下标
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.tagents.tagents",
+            "method": "query_cooperation",
+            "content": {
+                "where": {
+                    "condition": "",
+                    "ftype":"",
+                    "fstatus":""
+                }
+            }
+        }).then(res=>{
+            console.log(res)
+        })
+    },
+    showBtnIndex(e) {
+        const {
+            index
+        } = e.currentTarget.dataset;
+        this.setData({
+            showIndex:index
+        })
+    },
+    /* 跳转商户 */
+    jumpForDetails(){
+        wx.navigateTo({
+          url: '/pages/businessPartner/details',
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/businessPartner/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "My_SearchInputBox": "/components/My_SearchInputBox/index",
+    "My_DisplayBox": "/components/My_DisplayBox/index"
+  }
+}

+ 17 - 0
pages/businessPartner/index.wxml

@@ -0,0 +1,17 @@
+<view class="SearchInputBox">
+    <My_SearchInputBox inputColor="#D8D8D8" inputRadius="30" fisadministrator="{{true}}" butText="新合作" marTop="0"></My_SearchInputBox>
+</view>
+
+<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="{{5}}" data-index="{{index}}" bindtap="showBtnIndex">
+        <image class="company-data-image"></image>
+        <view class="company-data-text">
+            <view class="company-data-brandName">品牌a</view>
+            <view>经营类目:窗帘布</view>
+        </view>
+        <view class="company-data-but">
+            <van-button wx:if="{{index==showIndex}}" custom-class="custom-class-company-data" catchtap="jumpForDetails">合作详情</van-button>
+        </view>
+    </view>
+</My_DisplayBox>

+ 64 - 0
pages/businessPartner/index.wxss

@@ -0,0 +1,64 @@
+.SearchInputBox {
+    width: 100%;
+    background-color: #ffffff;
+    padding: 20rpx 0rpx;
+    box-sizing: border-box;
+}
+
+/* 展示区域title image */
+.display-title_image {
+    width: 32rpx;
+    height: 32rpx;
+    margin: 0 6rpx;
+}
+
+/* 相关商家信息 */
+.company-data {
+    display: flex;
+    width: 100%;
+    height: 114rpx;
+    padding-bottom: 20rpx;
+    border-bottom: 2rpx solid rgba(151, 151, 151, .1);
+    margin-bottom: 20rpx;
+}
+
+.company-data-image {
+    width: 114rpx;
+    height: 114rpx;
+    border-radius: 10rpx;
+    margin-right: 20rpx;
+    background-color: royalblue;
+}
+
+.company-data-text {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    font-size: 24rpx;
+    color: rgba(51, 51, 51, .7);
+}
+
+.company-data-brandName {
+    font-size: 28rpx;
+    color: #000000;
+}
+
+.company-data-but {
+    display: flex;
+    align-items: center;
+    height: 100%;
+}
+
+.custom-class-company-data {
+    width: 138rpx !important;
+    height: 46rpx !important;
+    background: linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%) !important;
+    box-shadow: 0px 0px 12rpx 0px rgba(0, 0, 0, 0.1) !important;
+    border-radius: 10rpx !important;
+    padding: 0 !important;
+    color: #ffffff !important;
+    font-weight: 500;
+    font-size: 24rpx;
+    text-shadow: 0px 0px 12px rgba(0, 0, 0, 0.1);
+}

+ 5 - 2
pages/tabbar-pages/user/index.js

@@ -40,8 +40,7 @@ Page({
     gridJumpPage(e) {
         const {
             name
-        } = e.target.dataset
-        console.log(name)
+        } = e.target.dataset;
         if (name == "团队管理") {
             wx.navigateTo({
                 url: '/pages/teamManagement/index',
@@ -54,6 +53,10 @@ Page({
             wx.navigateTo({
                 url: '/pages/storeMessage/index'
             })
+        } else if (name == '合作商家') {
+            wx.navigateTo({
+                url: '/pages/businessPartner/index'
+            })
         }
     },
     /* 跳转用户信息 */

+ 18 - 0
project.private.config.json

@@ -89,6 +89,24 @@
                     "pathName": "pages/liveStreaming/index",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "name": "合作商家",
+                    "pathName": "pages/businessPartner/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "合作详情",
+                    "pathName": "pages/businessPartner/details",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/businessPartner/applyFor",
+                    "query": "",
+                    "scene": null
                 }
             ]
         }

BIN
static/icon-05.png