Browse Source

供需修改

zhaoxiaohai 3 years ago
parent
commit
2b4df7b1f0

+ 1 - 1
app.wxss

@@ -1,5 +1,5 @@
 page {
 page {
-  font-family: PingFangSC-Medium, PingFang SC;
+  font-family: PingFangSC-Regular, PingFang SC;
   background-color: #F6F7F8;
   background-color: #F6F7F8;
   padding-bottom: 80rpx;
   padding-bottom: 80rpx;
 }
 }

+ 1 - 0
components/My_Checkbox/index.wxml

@@ -9,4 +9,5 @@
     <view>
     <view>
         <van-button type="info" size="large" color="#4EBFCF" custom-class="customClass" bindtap="confirm">确定</van-button>
         <van-button type="info" size="large" color="#4EBFCF" custom-class="customClass" bindtap="confirm">确定</van-button>
     </view>
     </view>
+    <view style="height: 36rpx;"></view>
 </view>
 </view>

+ 5 - 0
components/My_DisplayItem/index.js

@@ -19,6 +19,11 @@ Component({
         },
         },
         content: {
         content: {
             type: Object
             type: Object
+        },
+        /* 匿名 */
+        anonymity: {
+            type: Boolean,
+            value: false
         }
         }
     },
     },
 
 

+ 1 - 1
components/My_DisplayItem/index.wxml

@@ -10,7 +10,7 @@
         <view class="textExplain-explain u-line-1">{{content.fcontent}}</view>
         <view class="textExplain-explain u-line-1">{{content.fcontent}}</view>
         <view class="textExplain-userData-time">
         <view class="textExplain-userData-time">
             <view class="textExplain-userData">
             <view class="textExplain-userData">
-                <image src="{{content.headportraiturl}}" mode="aspectFit"></image>{{content.createby}}
+                <image src="{{content.headportraiturl}}" mode="aspectFit"></image>{{anonymity?'匿名用户':content.createby}}
                 <slot name="button">
                 <slot name="button">
 
 
                 </slot>
                 </slot>

+ 1 - 1
components/My_MultipleChoice/index.js

@@ -35,7 +35,7 @@ Component({
                 let dataList = []
                 let dataList = []
                 for (let i = 0; i < res.data.length; i++) {
                 for (let i = 0; i < res.data.length; i++) {
                     let checked = false;
                     let checked = false;
-                    if (res.data[i] == this.data.pitchOnItem) checked = true;
+                    if (res.data[i].ftype == this.data.pitchOnItem) checked = true;
                     dataList.push({
                     dataList.push({
                         value: res.data[i].ftype,
                         value: res.data[i].ftype,
                         index: i,
                         index: i,

+ 2 - 1
components/My_MultipleChoice/index.wxml

@@ -9,4 +9,5 @@
     <view>
     <view>
         <van-button type="info" size="large" color="#4EBFCF" custom-class="customClass" bindtap="confirm">确定</van-button>
         <van-button type="info" size="large" color="#4EBFCF" custom-class="customClass" bindtap="confirm">确定</van-button>
     </view>
     </view>
-</view>
+</view>
+<view style="height: 36rpx;"></view>

+ 2 - 2
components/My_MultipleChoice/index.wxss

@@ -10,7 +10,6 @@
 .checkbox_list {
 .checkbox_list {
     display: flex;
     display: flex;
     flex-wrap: wrap;
     flex-wrap: wrap;
-    justify-content: space-between;
     width: 100vw;
     width: 100vw;
     min-height: 200rpx;
     min-height: 200rpx;
     padding: 0 60rpx;
     padding: 0 60rpx;
@@ -30,6 +29,7 @@
     color: rgba(0, 0, 0, .5);
     color: rgba(0, 0, 0, .5);
     padding: 0 8rpx;
     padding: 0 8rpx;
     margin-bottom: 30rpx;
     margin-bottom: 30rpx;
+    margin-right: 15rpx;
 }
 }
 
 
 /* 选中后背景颜色 */
 /* 选中后背景颜色 */
@@ -56,7 +56,7 @@
     overflow: hidden;
     overflow: hidden;
 }
 }
 
 
-.customClass{
+.customClass {
     width: 100% !important;
     width: 100% !important;
     height: 100% !important;
     height: 100% !important;
 }
 }

+ 0 - 9
components/My_SupplyAndDemandItemBox/index.js

@@ -23,15 +23,6 @@ Component({
             type: Function
             type: Function
         },
         },
     },
     },
-    lifetimes: {
-        ready: function () {
-            // 在组件实例进入页面节点树时执行
-            console.log(this.data.isMine)
-        },
-        detached: function () {
-            // 在组件实例被从页面节点树移除时执行
-        },
-    },
 
 
     /**
     /**
      * 组件的初始数据
      * 组件的初始数据

+ 12 - 9
components/My_navBar/index.js

@@ -10,17 +10,20 @@ Component({
 
 
     },
     },
     lifetimes: {
     lifetimes: {
-        attached: function () {
+        ready: function () {
             // 在组件实例进入页面节点树时执行
             // 在组件实例进入页面节点树时执行
             //获取当前登录用户名
             //获取当前登录用户名
-            let data = getApp().globalData.account_list[wx.getStorageSync('userData').index];
-            let userName = '';
-            (data.fagentname != null && data.fagentname != undefined) ? userName = data.fagentname + '-': userName = data.fname + '-'
-            userName += data.frole;
-            console.log(userName)
-            this.setData({
-                userName
-            })
+            const that = this;
+            setTimeout(() => {
+                let data = getApp().globalData.account_list[wx.getStorageSync('userData').index];
+                let userName = '';
+                (data.fagentname != null && data.fagentname != undefined) ? userName = data.fagentname + '-': userName = data.fname + '-'
+                userName += data.frole;
+                console.log(userName)
+                that.setData({
+                    userName
+                })
+            }, 300)
         },
         },
         detached: function () {
         detached: function () {
             // 在组件实例被从页面节点树移除时执行
             // 在组件实例被从页面节点树移除时执行

+ 8 - 2
css/form.wxss

@@ -81,12 +81,18 @@
 /* 获取验证码 */
 /* 获取验证码 */
 .input_text_code {
 .input_text_code {
     position: relative;
     position: relative;
+    display: flex;
+    align-items: center;
     width: 60rpx;
     width: 60rpx;
+    height: 100%;
     text-align: center;
     text-align: center;
     font-size: 28rpx;
     font-size: 28rpx;
     font-weight: 600;
     font-weight: 600;
     color: #4CBECF;
     color: #4CBECF;
     z-index: 99999;
     z-index: 99999;
+    padding-left: 18rpx;
+    padding-right: 30rpx;
+    margin-right: -30rpx;
 }
 }
 
 
 /* 隔断 | */
 /* 隔断 | */
@@ -97,6 +103,6 @@
     height: 40rpx;
     height: 40rpx;
     background-color: #979797;
     background-color: #979797;
     opacity: 0.2;
     opacity: 0.2;
-    top: 0;
-    left: -18rpx;
+    top: 15rpx;
+    left: 0rpx;
 }
 }

+ 66 - 45
pages/announceDemand/index.js

@@ -27,7 +27,8 @@ Page({
         dateStart: null, //日期选择开始时间 当前时间+1天
         dateStart: null, //日期选择开始时间 当前时间+1天
         dateEnd: null, //日期选择结束时间 当前时间+6个月
         dateEnd: null, //日期选择结束时间 当前时间+6个月
         optionDate: "选择日期", //选择日期
         optionDate: "选择日期", //选择日期
-        opitonTime: '设置时间', //选择时间
+        checked: true, //开关
+        fstatus: '', //状态
     },
     },
 
 
     /**
     /**
@@ -44,6 +45,7 @@ Page({
         /* 修改参数 */
         /* 修改参数 */
         if (options.data != undefined) {
         if (options.data != undefined) {
             const data = JSON.parse(options.data);
             const data = JSON.parse(options.data);
+            console.log(data)
             let attinfos = [];
             let attinfos = [];
             /* 格式化图片 */
             /* 格式化图片 */
             for (let i = 0; i < data.attinfos.length; i++) {
             for (let i = 0; i < data.attinfos.length; i++) {
@@ -56,15 +58,17 @@ Page({
                 }
                 }
                 attinfos.push(arr)
                 attinfos.push(arr)
             };
             };
-            let optionDate = this.data.optionDate,
-                opitonTime = this.data.opitonTime;
+            let optionDate = this.data.optionDate;
             /* 格式化时间 */
             /* 格式化时间 */
-            if (data.fenddate != null || data.fenddate != '') {
-                const i = data.fenddate.lastIndexOf(':');
-                let end = data.fenddate.slice(0, i).split(" ");
-                optionDate = end[0];
-                opitonTime = end[1];
-            }
+            if (data.fenddate != null && data.fenddate != '') {
+                optionDate = data.fenddate
+                /* const i = data.fenddate.lastIndexOf(' ');
+                let end = data.fenddate.slice(1, i).split(" ");
+                optionDate = end[0]; */
+            };
+            /* 修改开关状态 */
+            let checked = true;
+            if (data.fstatus == "已过期" || data.fstatus == "已解决" || data.fstatus == "新建") checked = false;
             this.setData({
             this.setData({
                 ftype: data.ftype, //供需类型
                 ftype: data.ftype, //供需类型
                 ftitle: data.ftitle, //供需标题
                 ftitle: data.ftitle, //供需标题
@@ -73,7 +77,8 @@ Page({
                 attinfos, //附件列表
                 attinfos, //附件列表
                 tsupplyanddemandid: data.tsupplyanddemandid, //ID 0为新增
                 tsupplyanddemandid: data.tsupplyanddemandid, //ID 0为新增
                 optionDate,
                 optionDate,
-                opitonTime
+                fstatus: data.fstatus,
+                checked
             })
             })
         };
         };
     },
     },
@@ -86,26 +91,12 @@ Page({
             optionDate: detail.value
             optionDate: detail.value
         })
         })
     },
     },
-    /* 时间选择 */
-    timeChange({
-        detail
-    }) {
-        this.setData({
-            opitonTime: detail.value
-        })
-    },
     /* 添加图片 */
     /* 添加图片 */
     imageChange(data) {
     imageChange(data) {
         this.setData({
         this.setData({
             attinfos: data.detail.fileList
             attinfos: data.detail.fileList
         })
         })
     },
     },
-    /* 设置下架 */
-    setSoldOut(date) {
-        this.setData({
-            fenddate: date.detail
-        })
-    },
     /* 表单验证 */
     /* 表单验证 */
     formVerify() {
     formVerify() {
         let errTips = this.data.errTips,
         let errTips = this.data.errTips,
@@ -139,17 +130,27 @@ Page({
         if (this.data.throttle) return;
         if (this.data.throttle) return;
         this.addOrModify()
         this.addOrModify()
     },
     },
+    /*  */
+    checkedOnChange({
+        detail
+    }) {
+        const that = this;
+        wx.showModal({
+            title: '提示',
+            content: (detail) ? '是否确认上架' : "是否确认下架",
+            success: function (res) {
+                if (res.confirm) {
+                    that.setData({
+                        checked: detail
+                    })
+                }
+            }
+        })
+    },
     /* 新增或修改 */
     /* 新增或修改 */
     addOrModify() {
     addOrModify() {
-        let fenddate = "";
-        if (this.data.optionDate != '选择日期') {
-            fenddate = this.data.optionDate;
-            if (this.data.opitonTime != '设置时间') {
-                fenddate += ' ' + this.data.opitonTime + ':00'
-            } else {
-                fenddate += ' ' + '00:00:00'
-            }
-        };
+        let fenddate = this.data.optionDate;
+        if (this.data.optionDate == '选择日期') fenddate = '';
         /* 发送请求 */
         /* 发送请求 */
         _Http.basic({
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
             "accesstoken": wx.getStorageSync('userData').token,
@@ -178,19 +179,39 @@ Page({
                 tattachmentid: 0
                 tattachmentid: 0
             };
             };
             this.selectComponent("#UploadFiles").saveTheChanges(content);
             this.selectComponent("#UploadFiles").saveTheChanges(content);
-            if (res.data[0].fstatus == '新建') {
-                _Http.basic({
-                    "accesstoken": wx.getStorageSync('userData').token,
-                    "classname": "customer.supplyanddemand.supplyanddemand",
-                    "method": "updatesupplyanddemandstatus",
-                    "content": {
-                        "tsupplyanddemandid": res.data[0].tsupplyanddemandid,
-                        "fstatus": "发布"
-                    }
-                }).then(res => {
-                    console.log(res)
-                })
+            let httpData = {
+                "accesstoken": wx.getStorageSync('userData').token,
+                "classname": "customer.supplyanddemand.supplyanddemand",
+                "method": "updatesupplyanddemandstatus",
+                "content": {
+                    "tsupplyanddemandid": res.data[0].tsupplyanddemandid,
+                    "fstatus": "发布"
+                }
             }
             }
+            //判断是否上架
+            if ((res.data[0].fstatus == '新建' || res.data[0].fstatus == '已解决' || res.data[0].fstatus == '已过期')) {
+                if (this.data.checked) {
+                    _Http.basic(httpData).then(res => {
+                        if (res.msg != '成功') return wx.showToast({
+                            title: res.data,
+                            icon: "none"
+                        })
+                    })
+                }
+            };
+            //判断是否下架
+            if ((res.data[0].fstatus == '待对接' || res.data[0].fstatus == '正在对接')) {
+                if (!this.data.checked) {
+                    httpData.content.fstatus = '新建';
+                    _Http.basic(httpData).then(res => {
+                        if (res.msg != '成功') return wx.showToast({
+                            title: res.data,
+                            icon: "none"
+                        })
+                    })
+                }
+            };
+
             wx.showToast({
             wx.showToast({
                 title: '保存成功',
                 title: '保存成功',
             })
             })

+ 2 - 1
pages/announceDemand/index.json

@@ -1,6 +1,7 @@
 {
 {
   "usingComponents": {
   "usingComponents": {
     "My_MultipleChoice": "/components/My_MultipleChoice/index",
     "My_MultipleChoice": "/components/My_MultipleChoice/index",
-    "van-calendar": "@vant/weapp/calendar/index"
+    "van-calendar": "@vant/weapp/calendar/index",
+    "van-switch": "@vant/weapp/switch/index"
   }
   }
 }
 }

+ 7 - 4
pages/announceDemand/index.wxml

@@ -1,13 +1,13 @@
 <My_GeneralTemplate padBot="20rpx">
 <My_GeneralTemplate padBot="20rpx">
     <view class="store_message">
     <view class="store_message">
         <My_GreyRectangleForm title="需求分类" required>
         <My_GreyRectangleForm title="需求分类" required>
-            <view class="clickPop" bindtap="showPop">{{ftype?ftype:"点击选择"}}</view>
+            <view class="clickPop {{ftype==''?'':'selected'}} {{errTips.ftype?'selected':''}}" style="color: {{errTips.ftype?'#EF2C48':'#000'}};" bindtap="showPop">{{ftype?ftype:"点击选择"}}</view>
         </My_GreyRectangleForm>
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="需求标题" required>
         <My_GreyRectangleForm title="需求标题" required>
-            <van-field autosize type="textarea" model:value="{{ ftitle }}" data-name="ftitle" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.ftitle}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field model:value="{{ ftitle }}" data-name="ftitle" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.ftitle}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="需求内容" required>
         <My_GreyRectangleForm title="需求内容" required>
-            <van-field autosize type="textarea" model:value="{{ fcontent }}" data-name="fcontent" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontent}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field model:value="{{ fcontent }}" data-name="fcontent" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontent}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="产品图">
         <My_GreyRectangleForm title="产品图">
             <My_UploadFiles id="UploadFiles" fileList="{{attinfos}}" upType="SupplyAndDemand" UploadShow="2" previewSize="60px" maxCount="3" tsupplyanddemand="{{tsupplyanddemand}}" previewSize="65px" bindimageChange="imageChange"></My_UploadFiles>
             <My_UploadFiles id="UploadFiles" fileList="{{attinfos}}" upType="SupplyAndDemand" UploadShow="2" previewSize="60px" maxCount="3" tsupplyanddemand="{{tsupplyanddemand}}" previewSize="65px" bindimageChange="imageChange"></My_UploadFiles>
@@ -15,11 +15,14 @@
         <My_GreyRectangleForm title="下架日期">
         <My_GreyRectangleForm title="下架日期">
             <!-- 时间选择器 -->
             <!-- 时间选择器 -->
             <picker mode="date" start="{{dateStart}}" end="{{dateEnd}}" bindchange="dateChange">
             <picker mode="date" start="{{dateStart}}" end="{{dateEnd}}" bindchange="dateChange">
-                <view class="picker">
+                <view class="picker {{optionDate!='选择日期'?'selected':''}}" >
                     {{optionDate}}
                     {{optionDate}}
                 </view>
                 </view>
             </picker>
             </picker>
         </My_GreyRectangleForm>
         </My_GreyRectangleForm>
+        <My_GreyRectangleForm title="是否上架">
+            <van-switch checked="{{ checked }}" size="24px" active-color="#4CBECF" bind:change="checkedOnChange" />
+        </My_GreyRectangleForm>
     </view>
     </view>
 </My_GeneralTemplate>
 </My_GeneralTemplate>
 
 

+ 5 - 0
pages/announceDemand/index.wxss

@@ -11,4 +11,9 @@
     font-size: 32rpx;
     font-size: 32rpx;
     color: #000000;
     color: #000000;
     opacity: .3;
     opacity: .3;
+}
+
+/* 已选择分类和时间 */
+.selected {
+    opacity: 1;
 }
 }

+ 1 - 0
pages/businessPartner/details.wxml

@@ -25,4 +25,5 @@
 <view class="submit_but" wx:if="{{!fisadministrator}}">
 <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>
     <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>
 <view wx:if="{{dropDownList}}" style="height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; opacity: 0.3; z-index: 0;" bindtap="closeTheDropDown"></view>

+ 2 - 2
pages/login/index.js

@@ -105,7 +105,7 @@ Page({
             "errTips.fphonenumber": true
             "errTips.fphonenumber": true
         })
         })
         /* 验证验证码 */
         /* 验证验证码 */
-        if (this.data.password.length < 6) {
+        if (this.data.password == null) {
             this.setData({
             this.setData({
                 "errTips.password": true
                 "errTips.password": true
             })
             })
@@ -358,7 +358,7 @@ Page({
             "method": "update_usermsg",
             "method": "update_usermsg",
             "content": data
             "content": data
         }).then(res => {
         }).then(res => {
-            console.log(res)
+            getApp().globalData.account_list = res.data
         })
         })
     },
     },
     /* 多用户选择下标传递 */
     /* 多用户选择下标传递 */

+ 2 - 2
pages/login/index.wxml

@@ -16,8 +16,8 @@
             <!-- 验证码 -->
             <!-- 验证码 -->
             <view class="input_text_box">
             <view class="input_text_box">
                 <image class="input_text_img" src="../../static/login/verificationcode.png" mode="aspectFill"></image>
                 <image class="input_text_img" src="../../static/login/verificationcode.png" mode="aspectFill"></image>
-                <view class="input_text_input">
-                    <van-field autosize model:value="{{ password }}" data-name="password" bind:focus='inputFocus' type="number" input-class="input-class" error="{{errTips.password}}" placeholder="请输入验证码" border="{{ false }}" />
+                <view class="input_text_input" style="width: 250rpx; background-color: brown;">
+                    <van-field model:value="{{ password }}" data-name="password" bind:focus='inputFocus' type="number" input-class="input-class" error="{{errTips.password}}" placeholder="请输入验证码" border="{{ false }}" />
                 </view>
                 </view>
                 <view class="input_text_code" bindtap="getVerifyCode">
                 <view class="input_text_code" bindtap="getVerifyCode">
                     {{countDownTime==60?'获取':countDownTime+'s'}}
                     {{countDownTime==60?'获取':countDownTime+'s'}}

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

@@ -25,7 +25,7 @@
     <!-- <My_RoundedCornerButtonTabs list="{{roundedList}}" bind:tabsSelectedIitem="tabsSelectedIitem"></My_RoundedCornerButtonTabs> -->
     <!-- <My_RoundedCornerButtonTabs list="{{roundedList}}" bind:tabsSelectedIitem="tabsSelectedIitem"></My_RoundedCornerButtonTabs> -->
     <!-- 列表展示区 -->
     <!-- 列表展示区 -->
     <view slot="display-box-showList">
     <view slot="display-box-showList">
-        <My_DisplayItem wx:for="{{productList}}" content="{{item}}" padTop="{{index==0?'0':'20'}}" borTop="{{index==0?'0':'2'}}">
+        <My_DisplayItem wx:for="{{productList}}" content="{{item}}" padTop="{{index==0?'0':'20'}}" borTop="{{index==0?'0':'2'}}" anonymity="true">
             <view class="display-box-showList-button-box" slot="button">
             <view class="display-box-showList-button-box" slot="button">
                 <van-button custom-class="display-box-showList-button" catchtap="contact" color="linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%)"></van-button>
                 <van-button custom-class="display-box-showList-button" catchtap="contact" color="linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%)"></van-button>
                 <view class="display-box-showList-button-text">
                 <view class="display-box-showList-button-text">

+ 12 - 18
pages/tabbar-pages/supplyAndDemand/index.js

@@ -208,31 +208,22 @@ Page({
             }
             }
         }).then(res => {
         }).then(res => {
             if (res.msg != "成功") return;
             if (res.msg != "成功") return;
+            console.log(res)
             this.returnList(res);
             this.returnList(res);
         })
         })
     },
     },
     /* 返回列表 */
     /* 返回列表 */
     returnList(res) {
     returnList(res) {
         const data = handleList.checkdate(res.data)
         const data = handleList.checkdate(res.data)
-        const productList = data;
-        let pageNumber = this.data.pageNumber + 1;
+        let productList = data;
         //替换或拼接
         //替换或拼接
-        if (res.pageNumber == 1) {
-            this.InitializeDataPaging()
-            //第一页直接替换list
-            this.setData({
-                productList,
-                pageTotal: res.pageTotal,
-                pageNumber
-            });
-        } else {
-            //第二页开始拼接列表
-            let list = this.data.productList.concat(productList);
-            this.setData({
-                productList: list,
-                pageNumber
-            })
-        };
+        if (res.pageNumber != 1) {
+            productList = this.data.productList.concat(productList);
+        }
+        this.setData({
+            productList,
+            pageTotal: res.pageTotal,
+        });
     },
     },
     /* 我的需求编辑按钮跳转 */
     /* 我的需求编辑按钮跳转 */
     productEdit(e) {
     productEdit(e) {
@@ -309,6 +300,9 @@ Page({
      * 页面上拉触底事件的处理函数
      * 页面上拉触底事件的处理函数
      */
      */
     onReachBottom: function () {
     onReachBottom: function () {
+        this.setData({
+            pageNumber: this.data.pageNumber + 1
+        })
         if (this.data.pageNumber <= this.data.pageTotal) this.getList();
         if (this.data.pageNumber <= this.data.pageTotal) this.getList();
     },
     },
 
 

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

@@ -53,11 +53,12 @@
                 </view>
                 </view>
             </view>
             </view>
             <!-- 列表 -->
             <!-- 列表 -->
-            <My_SupplyAndDemandItemBox wx:for="{{productList}}" title="【{{item.ftitle}}】{{item.fcontent}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" bindtap="jumpForDetails">
+            <My_SupplyAndDemandItemBox wx:for="{{productList}}" title="【{{item.ftitle}}】{{item.fcontent}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-index="{{index}}" bindtap="jumpForDetails" bindstopOnShow="stopOnShow">
                 <!-- 我的需求左上状态插槽 -->
                 <!-- 我的需求左上状态插槽 -->
                 <view slot="myState" class="myState">
                 <view slot="myState" class="myState">
                     <view class="myShowState {{item.fstatus=='正在对接'?'myNoSoldOut':''}} {{item.fstatus=='待对接'?'myNoSoldOut':''}}">
                     <view class="myShowState {{item.fstatus=='正在对接'?'myNoSoldOut':''}} {{item.fstatus=='待对接'?'myNoSoldOut':''}}">
                         <view wx:if="{{item.fstatus=='已解决'}}">已下架</view>
                         <view wx:if="{{item.fstatus=='已解决'}}">已下架</view>
+                        <view wx:elif="{{item.fstatus=='新建'}}">未上架</view>
                         <view wx:elif="{{item.fstatus=='待对接'}}">上架中</view>
                         <view wx:elif="{{item.fstatus=='待对接'}}">上架中</view>
                         <view wx:elif="{{item.fstatus=='正在对接'}}">对接中</view>
                         <view wx:elif="{{item.fstatus=='正在对接'}}">对接中</view>
                         <view wx:else>已下架</view>
                         <view wx:else>已下架</view>

+ 104 - 38
pages/tradeShow/index.js

@@ -17,6 +17,9 @@ Page({
         fagentcount: null, //展示商
         fagentcount: null, //展示商
         flivecount: null, //正在直播
         flivecount: null, //正在直播
         ftotalcustcount: null, //观众总数
         ftotalcustcount: null, //观众总数
+        showDownIndex: -1, //显示下拉下标
+        liveSelectClassify: '全部', //直播分类选择
+        agentSelectClassify: '全部', //展商分类选择
     },
     },
 
 
     /**
     /**
@@ -32,58 +35,82 @@ Page({
         }
         }
         /* 云展会直播大厅 */
         /* 云展会直播大厅 */
         _Http.basic(data).then(res => {
         _Http.basic(data).then(res => {
-            if (res.msg != "成功") wx.showToast({
-                title: '直播大厅加载失败,请重新进入页面',
-                icon: "error",
-                duration: 5000
-            })
-            console.log("直播大厅", res)
-            const liveList = handleList.twoDimensionalArr(res.data.tlivelist, 4, 10);
-            this.setData({
-                liveList,
-                fagentcount: res.data.fagentcount,
-                flivecount: res.data.flivecount,
-                ftotalcustcount: res.data.ftotalcustcount
-            })
+            if (res.msg != "成功") {
+                wx.showToast({
+                    title: '直播大厅加载失败,请重新进入页面',
+                    icon: "error",
+                    duration: 5000
+                })
+            } else {
+                const liveList = handleList.twoDimensionalArr(res.data.tlivelist, 4, 10);
+                this.setData({
+                    liveList,
+                    fagentcount: res.data.fagentcount,
+                    flivecount: res.data.flivecount,
+                    ftotalcustcount: res.data.ftotalcustcount
+                })
+            }
         });
         });
         /* 热门展商 */
         /* 热门展商 */
         data.method = "agentList";
         data.method = "agentList";
         _Http.basic(data).then(res => {
         _Http.basic(data).then(res => {
-            console.log("热门展商", res)
-
-            if (res.msg != "成功") wx.showToast({
-                title: '热门展商加载失败,请重新进入页面',
-                icon: "error",
-                duration: 5000
-            })
-            const agentList = handleList.twoDimensionalArr(res.data, 4, 10);
-            this.setData({
-                agentList
-            })
+            if (res.msg != "成功") {
+                wx.showToast({
+                    title: '热门展商加载失败,请重新进入页面',
+                    icon: "error",
+                    duration: 5000
+                })
+            } else {
+                const agentList = handleList.twoDimensionalArr(res.data, 4, 10);
+                this.setData({
+                    agentList
+                })
+            }
         });
         });
         /* 热门展品 */
         /* 热门展品 */
         data.method = "prodList";
         data.method = "prodList";
         _Http.basic(data).then(res => {
         _Http.basic(data).then(res => {
-            console.log("热门展品", res)
-            if (res.msg != "成功") wx.showToast({
-                title: '热门展品加载失败,请重新进入页面',
-                icon: "error",
-                duration: 5000
-            })
-            const prodList = handleList.twoDimensionalArr(res.data, 6, 10);
-            this.setData({
-                prodList,
-
-            })
+            if (res.msg != "成功") {
+                wx.showToast({
+                    title: '热门展品加载失败,请重新进入页面',
+                    icon: "error",
+                    duration: 5000
+                })
+            } else {
+                const prodList = handleList.twoDimensionalArr(res.data, 6, 10);
+                this.setData({
+                    prodList,
+
+                })
+            }
         });
         });
-
+        /* 分类 */
+        _Http.basic({
+            "classname": "publicmethod.homepage.homepage",
+            "method": "query_typeselectList",
+            "content": {}
+        }).then(res => {
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: '分类加载失败,请重新进入页面',
+                    icon: "error",
+                    duration: 5000
+                })
+            } else {
+                res.data.unshift({
+                    ftype: "全部"
+                });
+                console.log(res.data)
+                this.setData({
+                    typeselectList: res.data
+                })
+            }
+        })
         /* 获取轮播图 */
         /* 获取轮播图 */
         const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'activity_head');
         const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'activity_head');
         this.setData({
         this.setData({
             swiperBannerList: bannerList[0].banner
             swiperBannerList: bannerList[0].banner
         });
         });
-
-
     },
     },
     /* 数据展示 */
     /* 数据展示 */
 
 
@@ -93,6 +120,45 @@ Page({
         } = e.detail;
         } = e.detail;
         console.log(value)
         console.log(value)
     },
     },
+    /* 显示下拉 */
+    showPullDown(e) {
+        const {
+            index
+        } = e.target.dataset;
+        if (this.data.showDownIndex == index) return this.setData({
+            showDownIndex: -1
+        });
+        this.setData({
+            showDownIndex: index
+        })
+    },
+    /* 关闭 */
+    closeTheDropDown() {
+        this.setData({
+            showDownIndex: -1
+        })
+    },
+    /* 选择分类 */
+    modeSelect(e) {
+        const {
+            name,
+            index
+        } = e.target.dataset
+        console.log(index, name)
+        if (this.data.showDownIndex == 1) {
+            //直播大厅
+            this.setData({
+                showDownIndex: -1,
+                liveSelectClassify: name
+            })
+        } else {
+            //热门展商
+            this.setData({
+                showDownIndex: -1,
+                agentSelectClassify: name
+            })
+        }
+    },
 
 
     /**
     /**
      * 生命周期函数--监听页面初次渲染完成
      * 生命周期函数--监听页面初次渲染完成

+ 23 - 9
pages/tradeShow/index.wxml

@@ -20,10 +20,16 @@
 <My_DisplayBox title="云展会直播大厅" isMore="{{false}}">
 <My_DisplayBox title="云展会直播大厅" isMore="{{false}}">
     <!-- 分类和搜索 -->
     <!-- 分类和搜索 -->
     <view class="classify-and-search">
     <view class="classify-and-search">
-        <view class="classify">
-            全部
-            <van-icon style="margin-left: 8rpx;" name="arrow-down" />
+        <view class="classify" data-index="1" catchtap="showPullDown">
+            {{liveSelectClassify}}
+            <van-icon style="margin-left: 8rpx;  pointer-events: none;" name="arrow-down" />
         </view>
         </view>
+        <van-transition show="{{showDownIndex==1}}" class="pattern-item-box" style="z-index: 999;" name="fade">
+            <view class="pattern-item" bindtap="modeSelect">
+                <text class="square"></text>
+                <view wx:for="{{typeselectList}}" class="{{liveSelectClassify==item.ftype?'SelectClassify':''}}" data-index="{{index}}" data-name="{{item.ftype}}">{{item.ftype}}</view>
+            </view>
+        </van-transition>
         <view class="liveSearch">
         <view class="liveSearch">
             <input class="liveSearch-input" type="text" confirm-type='search' placeholder="搜索直播间" bindblur="searchBlur" />
             <input class="liveSearch-input" type="text" confirm-type='search' placeholder="搜索直播间" bindblur="searchBlur" />
             <view class="liveSearch-icon">
             <view class="liveSearch-icon">
@@ -39,7 +45,7 @@
             <view wx:for="{{item}}" class="exhibition">
             <view wx:for="{{item}}" class="exhibition">
                 <image class="exhibition-img" src="{{item.channelcoverimageurl}}" mode="aspectFill"></image>
                 <image class="exhibition-img" src="{{item.channelcoverimageurl}}" mode="aspectFill"></image>
                 <view class="exhibition-bottom">
                 <view class="exhibition-bottom">
-                    <view class="exhibition-bottom-title u-line-1">{{item.fbrand}}5555555555555555555555555555555555555555</view>
+                    <view class="exhibition-bottom-title u-line-1">{{item.fbrand}}</view>
                     <view class="exhibition-bottom-data">
                     <view class="exhibition-bottom-data">
                         <image src="/static/icon-11.png"></image>
                         <image src="/static/icon-11.png"></image>
                         <view class="exhibition-bottom-data-text u-line-1">{{item.fcustcount}}</view>
                         <view class="exhibition-bottom-data-text u-line-1">{{item.fcustcount}}</view>
@@ -53,10 +59,16 @@
 <My_DisplayBox title="热门展商" isMore="{{false}}">
 <My_DisplayBox title="热门展商" isMore="{{false}}">
     <!-- 分类和搜索 -->
     <!-- 分类和搜索 -->
     <view class="classify-and-search">
     <view class="classify-and-search">
-        <view class="classify">
-            全部
-            <van-icon style="margin-left: 8rpx;" name="arrow-down" />
+        <view class="classify" data-index="2" catchtap="showPullDown">
+            {{agentSelectClassify}}
+            <van-icon style="margin-left: 8rpx; pointer-events: none;" name="arrow-down" />
         </view>
         </view>
+        <van-transition show="{{showDownIndex==2}}" class="pattern-item-box" style="z-index: 999;" name="fade">
+            <view class="pattern-item" bindtap="modeSelect">
+                <text class="square"></text>
+                <view wx:for="{{typeselectList}}" class="{{agentSelectClassify==item.ftype?'SelectClassify':''}}" data-index="{{index}}" data-name="{{item.ftype}}">{{item.ftype}}</view>
+            </view>
+        </van-transition>
     </view>
     </view>
     <!-- 标题前图片 -->
     <!-- 标题前图片 -->
     <image slot="display-box-img" class="display-title_image" src="/static/icon-04.png" mode="aspectFit"></image>
     <image slot="display-box-img" class="display-title_image" src="/static/icon-04.png" mode="aspectFit"></image>
@@ -80,9 +92,11 @@
 <My_DisplayBox title="热门商品" isMore="{{false}}">
 <My_DisplayBox title="热门商品" isMore="{{false}}">
     <!-- 标题前图片 -->
     <!-- 标题前图片 -->
     <image slot="display-box-img" class="display-title_image" src="/static/icon-04.png" mode="aspectFit"></image>
     <image slot="display-box-img" class="display-title_image" src="/static/icon-04.png" mode="aspectFit"></image>
-    <swiper class="show-prod-list" indicator-active-color="#4DC2D4" indicator-color="#D8D8D8" indicator-dots 	snap-to-edge>
+    <swiper class="show-prod-list" autoplay circular indicator-active-color="#4DC2D4" indicator-color="#D8D8D8" indicator-dots snap-to-edge>
         <swiper-item wx:for="{{prodList}}">
         <swiper-item wx:for="{{prodList}}">
             <My_VerticalBox list='{{item}}' pageType="zhanhui"></My_VerticalBox>
             <My_VerticalBox list='{{item}}' pageType="zhanhui"></My_VerticalBox>
         </swiper-item>
         </swiper-item>
     </swiper>
     </swiper>
-</My_DisplayBox>
+</My_DisplayBox>
+
+<view wx:if="{{showDownIndex!=-1}}" style="height: 250%; width: 100vw; position: absolute; top: 0; left: 0; opacity: 0.3; z-index: 0; background-color: #000;" bindtap="closeTheDropDown"></view>

+ 49 - 1
pages/tradeShow/index.wxss

@@ -118,6 +118,7 @@
 
 
 /* 分类和搜索盒子 */
 /* 分类和搜索盒子 */
 .classify-and-search {
 .classify-and-search {
+    position: relative;
     display: flex;
     display: flex;
     justify-content: space-between;
     justify-content: space-between;
     height: 40rpx;
     height: 40rpx;
@@ -138,6 +139,7 @@
     color: #4DC2D4;
     color: #4DC2D4;
     padding: 0 12rpx;
     padding: 0 12rpx;
     box-sizing: border-box;
     box-sizing: border-box;
+    overflow: hidden;
 }
 }
 
 
 .liveSearch {
 .liveSearch {
@@ -149,7 +151,6 @@
     border-radius: 49rpx;
     border-radius: 49rpx;
     opacity: 0.7;
     opacity: 0.7;
     border: 2rpx solid #979797;
     border: 2rpx solid #979797;
-    box-sizing: border-box;
     padding: 0 12rpx 0 16rpx;
     padding: 0 12rpx 0 16rpx;
 }
 }
 
 
@@ -172,4 +173,51 @@
 
 
 .show-prod-list swiper-item {
 .show-prod-list swiper-item {
     height: 570rpx !important;
     height: 570rpx !important;
+}
+
+/* 下拉 */
+.pattern-item-box {
+    position: absolute;
+    top: 60rpx;
+}
+
+.pattern-item {
+    font-size: 24rpx;
+    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 {
+    position: relative;
+    line-height: 60rpx;
+    padding: 0 30rpx;
+    text-align: center;
+    color: rgba(0, 0, 0, 0.5);
+    z-index: 999;
+}
+
+.pattern-item .square {
+    position: absolute;
+    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: 35%;
+    z-index: 0;
+}
+
+/* 选中项 */
+.SelectClassify {
+    color: #4DC2D4 !important;
+    font-weight: 550;
+    z-index: 9999 !important;
 }
 }

+ 2 - 1
utils/processingData.js

@@ -12,7 +12,8 @@ function twoDimensionalArr(data, nub, max = 3) {
 function checkdate(data) {
 function checkdate(data) {
     for (let i = 0; i < data.length; i++) {
     for (let i = 0; i < data.length; i++) {
         let checkdate = data[i].checkdate;
         let checkdate = data[i].checkdate;
-        data[i].checkdate = checkdate.slice(0, checkdate.lastIndexOf('.'));
+        console.log(typeof checkdate)
+        if(checkdate == String) data[i].checkdate = checkdate.slice(0, checkdate.lastIndexOf('.'));
     }
     }
     return data;
     return data;
 }
 }