zhaoxiaohai před 3 roky
rodič
revize
805b8d14bd

+ 0 - 2
README.md

@@ -46,8 +46,6 @@
 
 ​	My_SupplyAndDemandItemBox -- 供需子项盒子
 
-​	My_adsorbRight -- 右边吸附按钮 -- 发布需求
-
 ​	My_pageReachBottom -- 上拉触底加载动画
 
 ​	My_DisplayBox -- 首页展示盒子

+ 2 - 1
components/My_SupplyAndDemandItemBox/index.js

@@ -21,11 +21,12 @@ Component({
         },
         stopOnShow: {
             type: Function
-        }
+        },
     },
     lifetimes: {
         ready: function () {
             // 在组件实例进入页面节点树时执行
+            console.log(this.data.isMine)
         },
         detached: function () {
             // 在组件实例被从页面节点树移除时执行

+ 2 - 4
components/My_SupplyAndDemandItemBox/index.wxml

@@ -1,10 +1,8 @@
 <view class="SupplyAndDemandItemBox">
+    <slot name='myState'></slot>
     <!-- 标题,按钮 -->
     <view class="title-and-but">
-        <view class="supply-and-demand-title u-line-2">{{title}}</view>
-        <view class="supply-and-demand-but">
-            <slot name='soldOutBut'></slot>
-        </view>
+        <view class="supply-and-demand-title u-line-1">{{title}}</view>
     </view>
     <!-- 时间,内容 -->
     <view class="time-content">

+ 6 - 9
components/My_SupplyAndDemandItemBox/index.wxss

@@ -1,13 +1,15 @@
 /* 盒子 */
 .SupplyAndDemandItemBox {
+    position: relative;
     width: 702rpx;
-    height: 286rpx;
     background: #FFFFFF;
     border-radius: 20rpx;
     padding: 0 14rpx;
     box-sizing: border-box;
     margin: 0 auto;
     margin-bottom: 30rpx;
+    padding-top: 20rpx;
+    padding-bottom: 16rpx;
 }
 
 /* 标题和按钮 */
@@ -15,23 +17,18 @@
     display: flex;
     justify-content: space-between;
     width: 100%;
-    padding: 30rpx 20rpx 0;
+    padding-left: 20rpx;
     box-sizing: border-box;
 }
 
 /* 标题 */
 .supply-and-demand-title {
-    width: 530rpx;
-    height: 80rpx;
+    width: 96%;
+    height: 40rpx;
     font-size: 28rpx;
     color: #000000;
 }
 
-/* 按钮 */
-.supply-and-demand-but {
-    margin-top: 8rpx;
-}
-
 /* 时间与内容 */
 .time-content {
     display: flex;

+ 0 - 37
components/My_adsorbRight/index.js

@@ -1,37 +0,0 @@
-// components/My_adsorbRight/index.js
-Component({
-    /**
-     * 组件的属性列表
-     */
-    properties: {
-
-    },
-
-    /**
-     * 组件的初始数据
-     */
-    data: {
-        show: false
-    },
-
-    /**
-     * 组件的方法列表
-     */
-    methods: {
-        /* 显示隐藏 */
-        isButtonShow() {
-            this.setData({
-                show: !this.data.show
-            })
-        },
-        /* 跳转到发布需求 */
-        jumpToRelease() {
-            this.setData({
-                show: false
-            })
-            wx.navigateTo({
-                url: '/pages/announceDemand/index',
-            })
-        }
-    }
-})

+ 0 - 6
components/My_adsorbRight/index.json

@@ -1,6 +0,0 @@
-{
-    "component": true,
-    "usingComponents": {
-        "van-transition": "@vant/weapp/transition/index"
-    }
-}

+ 0 - 10
components/My_adsorbRight/index.wxml

@@ -1,10 +0,0 @@
-<view class="adsorb-right">
-    <view class="but-left" bindtap="isButtonShow">
-        <image src="../../static/icon-01.png" mode="aspectFill"></image>
-    </view>
-    <van-transition show="{{ show }}" name="slide-right">
-        <view class="but-right" bindtap="jumpToRelease">
-            发布
-        </view>
-    </van-transition>
-</view>

+ 0 - 37
components/My_adsorbRight/index.wxss

@@ -1,37 +0,0 @@
-.adsorb-right {
-    position: fixed;
-    display: flex;
-    right: 0;
-    top: 70%;
-    box-shadow: 4rpx 8rpx 12rpx 0px rgba(0, 0, 0, 0.28);
-    border-radius: 38rpx 0 0 38rpx;
-    overflow: hidden;
-    background: linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%);
-}
-
-/* 按钮左侧 */
-.but-left {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    width: 54rpx;
-    height: 62rpx;
-}
-
-.but-left>image{
-    width: 26rpx;
-    height: 26rpx;
-    margin-left: 10rpx;
-}
-
-/* 按钮右侧 */
-.but-right {
-    display: flex;
-    align-items: center;
-    width: 82rpx;
-    height: 62rpx;
-    font-size: 32rpx;
-    font-weight: 500;
-    color: #FFFFFF;
-    margin-left: 8rpx;
-}

+ 0 - 6
pages/announceDemand/index.wxml

@@ -19,12 +19,6 @@
                     {{optionDate}}
                 </view>
             </picker>
-            <!-- 时间选择器 -->
-            <picker mode="time" start="{{tiemStart}}" end="{{tiemEnd}}" bindchange="timeChange">
-                <view wx:if="{{optionDate!='选择日期'}}" class="picker" style="margin-left: 8rpx;">
-                    {{opitonTime}}
-                </view>
-            </picker>
         </My_GreyRectangleForm>
     </view>
 </My_GeneralTemplate>

+ 64 - 47
pages/businessPartner/details.js

@@ -13,8 +13,10 @@ Page({
         dropDownList: false,
         methodsList: ['上游', '下游', '双向合作'],
         showType: '',
+        seIndex: null, //合作方式
         throttle: true, //截流
         fisadministrator: null,
+        isCancel: false, //是否取消合作
     },
     /* 遮罩层点击关闭 */
     closeTheDropDown() {
@@ -43,6 +45,7 @@ Page({
         this.setData({
             partnerDetails: data,
             showType,
+            seIndex: data.ftype,
             fisadministrator: (wx.getStorageSync('userData').fisadministrator == 1) ? false : true,
         })
     },
@@ -59,28 +62,12 @@ Page({
             content: "是否更改与“" + this.data.partnerDetails.fbrand + "”合作方式为" + name,
             success(res) {
                 if (res.confirm) {
-                    _Http.basic({
-                        "accesstoken": wx.getStorageSync('userData').token,
-                        "classname": "customer.tagents.tagents",
-                        "method": "update_cooperation",
-                        "content": {
-                            "tcooperationagentsid": that.data.partnerDetails.tcooperationagentsid,
-                            "ftype": index + 1
-                        }
-                    }).then(res => {
-                        if (res.msg != '成功') return wx.showToast({
-                            title: res.data,
-                            icon: "none"
-                        });
-                        wx.showToast({
-                            title: '修改成功'
-                        });
-                        that.setData({
-                            showType: name,
-                            "partnerDetails.ftype": index + 1
-                        })
+                    that.setData({
+                        showType: name,
+                        seIndex: index + 1
                     })
                 }
+                that.closeTheDropDown();
             }
         })
     },
@@ -111,32 +98,16 @@ Page({
                 success: function (res) {
                     if (res.confirm) {
                         that.setData({
-                            checked: detail
+                            checked: detail,
+                            isCancel: true
                         });
-                        _Http.basic({
-                            "accesstoken": wx.getStorageSync('userData').token,
-                            "classname": "customer.tagents.tagents",
-                            "method": "delete_cooperation",
-                            "content": {
-                                "tcooperationagentsid": that.data.partnerDetails.tcooperationagentsid
-                            }
-                        }).then(res => {
-                            if (res.msg != '成功') return wx.showToast({
-                                title: res.data,
-                                icon: "error"
-                            })
-                            setTimeout(() => {
-                                wx.navigateBack({
-                                    delta: 1,
-                                })
-                            }, 500);
-                        })
                     }
                 }
             })
         } else {
             that.setData({
-                checked: detail
+                checked: detail,
+                isCancel: false
             });
         }
     },
@@ -152,18 +123,64 @@ Page({
     /* 提交 */
     submit() {
         this.closeTheDropDown()
+        /* 截流 */
         if (!this.data.throttle) return;
         this.setData({
             throttle: false
         });
-        wx.showToast({
-            title: '保存成功'
-        });
-        setTimeout(() => {
-            wx.navigateBack({
-                delta: 1,
+        /* 取消合作 */
+        if (this.data.isCancel) return _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.tagents.tagents",
+            "method": "delete_cooperation",
+            "content": {
+                "tcooperationagentsid": this.data.partnerDetails.tcooperationagentsid
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "error"
             })
-        }, 500);
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 1,
+                })
+            }, 500);
+        })
+        /* 发送修改请求 */
+        if (this.data.seIndex != this.data.partnerDetails.ftype) {
+            _Http.basic({
+                "accesstoken": wx.getStorageSync('userData').token,
+                "classname": "customer.tagents.tagents",
+                "method": "update_cooperation",
+                "content": {
+                    "tcooperationagentsid": this.data.partnerDetails.tcooperationagentsid,
+                    "ftype": this.data.seIndex
+                }
+            }).then(res => {
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                wx.showToast({
+                    title: '修改成功'
+                });
+                setTimeout(() => {
+                    wx.navigateBack({
+                        delta: 1,
+                    })
+                }, 500);
+            });
+        } else {
+            wx.showToast({
+                title: '保存成功'
+            });
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 1,
+                })
+            }, 500);
+        }
     },
 
     /**

+ 1 - 1
pages/login/index.js

@@ -105,7 +105,7 @@ Page({
             "errTips.fphonenumber": true
         })
         /* 验证验证码 */
-        if (this.data.password.length != 6) {
+        if (this.data.password.length < 6) {
             this.setData({
                 "errTips.password": true
             })

+ 1 - 1
pages/login/index.wxml

@@ -98,7 +98,7 @@
             <view class="input_text_title">公司介绍</view>
             <view class="input_text_box box_mar_bot textarea">
                 <!-- 未做数据绑定 -->
-                <textarea value="{{fintroduction}}" placeholder="公司介绍" placeholder-style="color:#DAD9DB; font-size:30rpx;"></textarea>
+                <textarea value="{{fintroduction}}" placeholder="请填写公司介绍" placeholder-style="color:#DAD9DB; font-size:30rpx;"></textarea>
             </view>
             <!-- 地址 -->
             <view class="input_text_title">地址</view>

+ 1 - 1
pages/tabbar-pages/home/index.wxml

@@ -36,7 +36,7 @@
     </view>
 </My_DisplayBox>
 
-<My_DisplayBox title="合作商家" bind:getExhibitionTitle="getExhibitionTitle">
+<My_DisplayBox wx:if="{{partnerList.length>=2}}" title="合作商家" bind:getExhibitionTitle="getExhibitionTitle">
     <!-- 标题前图片 -->
     <image slot="display-box-img" class="display-title_image" src="/static/icon-04.png" mode="aspectFit"></image>
     <!-- 轮播 -->

+ 8 - 2
pages/tabbar-pages/supplyAndDemand/index.js

@@ -90,9 +90,14 @@ Page({
             ifShowCommunicationOfNumber: !this.data.ifShowCommunicationOfNumber
         })
     },
+    postDemand() {
+        wx.navigateTo({
+            url: '/pages/announceDemand/index',
+        })
+    },
     /* 阻止冒泡 */
     stop() {
-
+        /* 所有供需列表中,已过期或已解决 不做操作 */
     },
     /* 一键联系 */
     contact() {
@@ -141,6 +146,7 @@ Page({
             "ftype": this.data.ftype, //数据类型
             "fissupply": "" // 0需 1供
         };
+        /* 暂时不分供需 */
         if (fstatus) {
             where = {
                 "condition": condition, //模糊搜索
@@ -208,7 +214,7 @@ Page({
     /* 返回列表 */
     returnList(res) {
         const data = handleList.checkdate(res.data)
-        const productList = handleList.listOrdering(data);
+        const productList = data;
         let pageNumber = this.data.pageNumber + 1;
         //替换或拼接
         if (res.pageNumber == 1) {

+ 1 - 2
pages/tabbar-pages/supplyAndDemand/index.json

@@ -1,7 +1,6 @@
 {
   "navigationStyle": "custom",
   "usingComponents": {
-    "My_SupplyAndDemandItemBox": "/components/My_SupplyAndDemandItemBox/index",
-    "My_adsorbRight": "/components/My_adsorbRight/index"
+    "My_SupplyAndDemandItemBox": "/components/My_SupplyAndDemandItemBox/index"
   }
 }

+ 18 - 2
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -54,6 +54,15 @@
             </view>
             <!-- 列表 -->
             <My_SupplyAndDemandItemBox wx:for="{{productList}}" title="【{{item.ftitle}}】{{item.fcontent}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" bindtap="jumpForDetails">
+                <!-- 我的需求左上状态插槽 -->
+                <view slot="myState" class="myState">
+                    <view class="myShowState {{item.fstatus=='正在对接'?'myNoSoldOut':''}} {{item.fstatus=='待对接'?'myNoSoldOut':''}}">
+                        <view wx:if="{{item.fstatus=='已解决'}}">已下架</view>
+                        <view wx:elif="{{item.fstatus=='待对接'}}">上架中</view>
+                        <view wx:elif="{{item.fstatus=='正在对接'}}">对接中</view>
+                        <view wx:else>已下架</view>
+                    </view>
+                </view>
                 <!-- 下架按钮插槽 -->
                 <view slot="soldOutBut">
                     <van-button data-index="{{index}}" plain color="#4DC2D4" custom-class="soldOutBut" catchtap="soldOut">下架</van-button>
@@ -83,8 +92,15 @@
     </view>
     <view style="height: 50px;"></view>
 </van-action-sheet>
-<!-- 右侧吸附按钮 -->
-<My_adsorbRight></My_adsorbRight>
+<!-- 右侧吸附固定按钮 -->
+<view class="fixedButton" catchtap="postDemand">
+    <van-button custom-class="custom-fixedButton" color="linear-gradient(180deg, #FFE274 0%, #FF8700 100%)">
+    </van-button>
+    <view class="fixedButtonText">
+        <image src="/static/icon-01.png"></image>
+        <view>发布</view>
+    </view>
+</view>
 <!-- 触底展示 -->
 <My_pageReachBottom dummyStatus="{{productList.length>=1}}" loadMore="{{pageTotal<pageNumber}}"></My_pageReachBottom>
 <!-- 安全距离 -->

+ 66 - 0
pages/tabbar-pages/supplyAndDemand/index.wxss

@@ -242,4 +242,70 @@
 .CommunicationOfNumber-list text {
     color: #4DC2D4;
     padding: 0 8rpx;
+}
+
+/* 右侧吸附按钮 */
+.fixedButton {
+    position: fixed;
+    width: 132rpx;
+    height: 68rpx;
+    font-size: 32rpx;
+    color: #FFFFFF;
+    box-shadow: 0px 6rpx 6rpx 0px rgba(0, 0, 0, 0.1);
+    border-radius: 34rpx 0 0 34rpx;
+    top: 68%;
+    right: 0;
+    z-index: 999;
+    overflow: hidden;
+}
+
+.custom-fixedButton {
+    position: absolute !important;
+    width: 100% !important;
+    height: 100% !important;
+    top: 0;
+}
+
+.fixedButtonText {
+    position: absolute;
+    display: flex;
+    align-items: center;
+    width: 100%;
+    height: 100%;
+    z-index: 9;
+    pointer-events: none;
+}
+
+.fixedButtonText image {
+    width: 26rpx;
+    height: 26rpx;
+    margin-left: 18rpx;
+}
+
+.fixedButtonText view {
+    margin: -3.5rpx 10rpx 0;
+}
+
+/* 我的供需 状态 */
+.myState {
+    height: 40rpx;
+}
+
+.myShowState {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    position: absolute;
+    width: 108rpx;
+    height: 44rpx;
+    background-color: #A7A8A8;
+    border-radius: 20rpx 0px 20rpx 0px;
+    top: 0;
+    left: 0;
+    font-size: 20rpx;
+    color: #FFFFFF;
+}
+
+.myNoSoldOut {
+    background: #4DC2D4;
 }

+ 17 - 6
pages/tradeShow/index.js

@@ -17,15 +17,26 @@ Page({
      */
     onLoad: function (options) {
         console.log(options)
-        /* 热门展商 */
-        _Http.basic({
+        let data = {
             "classname": "publicmethod.live.live",
-            "method": "agentList",
+            "method": "getLiveChannelData",
             "content": {
-                "tactivityidid": options.id
+                "tactivityid": options.id
             }
-        }).then(res => {
-            console.log(res)
+        }
+        /* 云展会直播大厅 */
+        _Http.basic(data).then(res => {
+            console.log("云展会直播大厅", res)
+        });
+        /* 热门展商 */
+        data.method = "agentList";
+        _Http.basic(data).then(res => {
+            console.log("热门展商", res)
+        });
+        /* 热门展品 */
+        data.method = "prodList";
+        _Http.basic(data).then(res => {
+            console.log("热门展品", res)
         });
 
         /* 获取轮播图 */