zhaoxiaohai před 4 roky
rodič
revize
b54c480e34

+ 6 - 5
app.js

@@ -43,10 +43,9 @@ App({
     })
   },
   initSocket() {
-    console.log('websocket:', 'wss://www.buwanjia.com/bwj/webSocket/' + wx.getStorageSync('userData').token)
     let that = this;
     this.globalData.SocketTask = wx.connectSocket({
-      url: 'wss://www.buwanjia.com/bwj/webSocket/bwj/webSocket/' + wx.getStorageSync('userData').token,
+      url: 'wss://www.buwanjia.com/bwj/webSocket/' + wx.getStorageSync('userData').token,
       complete: (res) => {
         console.log(res)
       }
@@ -64,15 +63,17 @@ App({
     })
     this.globalData.SocketTask.onError(function (res) {
       console.log('readyState=' + that.globalData.SocketTask.readyState)
-      // that.initSocket()
+      setTimeout(() => {
+        that.initSocket()
+      }, 1000)
     })
     this.globalData.SocketTask.onClose(function (res) {
       console.log('WebSocket连接已关闭!readyState=' + that.globalData.SocketTask.readyState)
-      /* if (that.globalData.socketEstablish == false) {
+      if (that.globalData.socketEstablish == false) {
         that.initSocket()
       } else {
         that.globalData.socketEstablish = false;
-      } */
+      }
     })
   },
   globalData: {

+ 2 - 1
app.json

@@ -56,7 +56,8 @@
         "pages/portal/details",
         "pages/chatRoom/index",
         "pages/chatRoom/dialogbox",
-        "pages/chatRoom/history"
+        "pages/chatRoom/history",
+        "pages/portal/search"
     ],
     "usingComponents": {
         "van-button": "@vant/weapp/button/index",

+ 3 - 2
components/My_BannerSwiper/index.wxss

@@ -32,10 +32,11 @@
 .ad-swiper {
     width: 702rpx;
     height: 140rpx;
-    border-radius: 70rpx;
+    border-radius: 10rpx;
     overflow: hidden;
 }
-.ad-swiper image{
+
+.ad-swiper image {
     width: 100%;
     height: 100%;
 }

+ 11 - 11
pages/chatRoom/dialogbox.js

@@ -29,7 +29,7 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        //app.initSocket(); 链接websocket 用于测试
+        app.initSocket(); //链接websocket 用于测试
         const that = this;
         this.setData({
             timdialogid: options.id,
@@ -281,16 +281,16 @@ Page({
         })
     },
     /* 文本域行数变化 */
-    linechange(e) {
-        console.log(e)
-        const {
-            lineCount
-        } = e.detail;
-        if (lineCount == this.data.lineCount) return;
-        this.setData({
-            lineCount
-        })
-    },
+    /*     linechange(e) {
+            console.log(e)
+            const {
+                lineCount
+            } = e.detail;
+            if (lineCount == this.data.lineCount) return;
+            this.setData({
+                lineCount
+            })
+        }, */
     //获取表情包
     getMeme() {
         _Http.basic({

+ 1 - 1
pages/chatRoom/dialogbox.wxss

@@ -12,7 +12,7 @@ page {
     justify-content: space-between;
     width: 100vw;
     height: 92rpx;
-    background-color: #FCFCFD;
+    background-color: #f6f7f8;
     z-index: 99;
 }
 

+ 1 - 4
pages/chatRoom/history.js

@@ -6,10 +6,7 @@ Page({
     /**
      * 页面的初始数据
      */
-    data: {
-
-    },
-
+    data: {},
     /**
      * 生命周期函数--监听页面加载
      */

+ 38 - 0
pages/portal/annunciateList/index.js

@@ -0,0 +1,38 @@
+// pages/portal/annunciateList/index.js
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        list: {
+            type: Array
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        /* 跳转供需详情 */
+        toDetails(e) {
+            const {
+                index
+            } = e.currentTarget.dataset;
+            const data = this.data.list[index];
+            wx.navigateTo({
+                url: '/pages/portal/details?tagentsid=' + data.tagentsid + '&tsupplyanddemandid=' + data.tsupplyanddemandid,
+            })
+            console.log("报错")
+        },
+    }
+})

+ 4 - 0
pages/portal/annunciateList/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 29 - 0
pages/portal/annunciateList/index.wxml

@@ -0,0 +1,29 @@
+<view class="ann-box" style="margin-left: 44rpx;" wx:key="index" wx:for="{{list}}" data-index="{{index}}" catchtap="toDetails">
+    <view class="ann-img" wx:if="{{item.attinfos[0].fobsurl}}">
+        <image src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
+    </view>
+    <view class="ann-img" wx:else>
+        <image wx:if="{{item.ftype=='摄影摄像'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-01.png" mode="aspectFit"></image>
+        <image wx:elif="{{item.ftype=='产品策划'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-02.png" mode="aspectFit"></image>
+        <image wx:elif="{{item.ftype=='平面设计'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-03.png" mode="aspectFit"></image>
+        <image wx:elif="{{item.ftype=='寻找面料'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-04.png" mode="aspectFit"></image>
+        <image wx:elif="{{item.ftype=='商业培训'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-05.png" mode="aspectFit"></image>
+        <image wx:elif="{{item.ftype=='寻找主播'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-06.png" mode="aspectFit"></image>
+        <image wx:elif="{{item.ftype=='面料设计'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-07.png" mode="aspectFit"></image>
+        <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/tacitly-approve/MRproduct.png" mode="aspectFit"></image>
+    </view>
+    <view class="ann-text">
+        <view class="ann-text-title  u-line-1">[{{item.ftype}}]{{item.ftitle}}</view>
+        <view class="ann-text-center u-line-2">{{item.fcontent}}</view>
+        <view class="ann-text-bottom u-line-1" style="margin-top: 22rpx;">
+            <view class="userMsg">
+                <view class="img">
+                    <image wx:if="{{item.headportraiturl}}" src="{{item.headportraiturl}}"></image>
+                    <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
+                </view>
+                <view class="u-line-1" style="max-width: 160rpx;  padding-top: 3rpx;">{{item.createby}}</view>
+            </view>
+            <view>{{item.checkdate}}</view>
+        </view>
+    </view>
+</view>

+ 1 - 0
pages/portal/annunciateList/index.wxss

@@ -0,0 +1 @@
+@import "/pages/annunciate/index.wxss";

+ 1 - 0
pages/portal/details.js

@@ -15,6 +15,7 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+        console.log(options)
         //供需详情
         _Http.basic({
             "classname": "publicmethod.homepage.homepage",

+ 82 - 35
pages/portal/index.js

@@ -26,6 +26,7 @@ Page({
         newProductIndex1: 0,
         newProductIndex2: 0,
         repetitionSubmit: false, //是否重复提交招商表单
+        tiveList: [], //直播列表
     },
 
     /**
@@ -40,14 +41,17 @@ Page({
                 "pageSize": 3
             }
         }).then(res => {
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            });
-            processingData.imageType(res.data, 'cover');
-            this.setData({
-                annunciateList: res.data
-            })
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+            } else {
+                processingData.imageType(res.data, 'cover');
+                this.setData({
+                    annunciateList: res.data
+                })
+            }
         });
         //获取供需分类
         _Http.basic({
@@ -57,24 +61,56 @@ Page({
                 "siteid": "BWJ"
             }
         }).then(res => {
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            });
-            this.setData({
-                sadClassify: res.data
-            })
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+            } else {
+                this.setData({
+                    sadClassify: res.data
+                })
+            }
         });
-        //获取全部供需列表
-        this.query_supplyanddemandList('')
-        //新发布商品
-        this.getHotProductsList();
-        // 获取品牌关注榜
-        this.getHotAgentsList('沙发布')
+        //获取全部供需列表 this.query_supplyanddemandList('')
+        //获取直播列表
+        _Http.basic({
+            "classname": "publicmethod.live.live",
+            "method": "getHomeLive",
+            "content": {
+                "getdatafromdbanyway": true,
+                "livestatus": "unStart"
+            }
+        }, false).then(res => {
+            console.log("直播列表", res)
+            if (res.msg != '成功') {
+                wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+            } else {
+                this.setData({
+                    tiveList: res.data
+                })
+            }
+        })
         //获取轮播图
         setTimeout(() => {
             this.getBanner()
         }, 300)
+        //新发布商品
+        this.getHotProductsList();
+        // 获取品牌关注榜
+        this.getHotAgentsList('沙发布')
+    },
+    /* 品牌关注榜切换 */
+    concernsChange(e) {
+        const {
+            index
+        } = e.target.dataset;
+        this.setData({
+            brandSelect: index
+        })
     },
     /* 获取轮播图 */
     getBanner() {
@@ -227,6 +263,7 @@ Page({
                 "ftype": ftype
             }
         }, false).then(res => {
+            console.log("获取品牌关注榜", res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
@@ -243,19 +280,19 @@ Page({
         })
         if (ftype == '沙发布') this.getHotAgentsList('窗帘布')
     },
-    /* 品牌关注榜选项 */
-    selectOption(e) {
-        let index = null;
-        if (e.target.dataset.index) {
-            index = e.target.dataset.index;
-        } else {
-            index = e.detail.current;
-        }
-        if (index == this.data.brandSelect) return;
-        this.setData({
-            brandSelect: index
-        })
-    },
+    /* 品牌关注榜选项 */
+    /*     selectOption(e) {
+            let index = null;
+            if (e.target.dataset.index) {
+                index = e.target.dataset.index;
+            } else {
+                index = e.detail.current;
+            }
+            if (index == this.data.brandSelect) return;
+            this.setData({
+                brandSelect: index
+            })
+        }, */
     /* 跳转供需详情 */
     toDetails(e) {
         const {
@@ -266,13 +303,23 @@ Page({
             url: './details?tagentsid=' + data.tagentsid + '&tsupplyanddemandid=' + data.tsupplyanddemandid,
         })
     },
+    /* 搜索 */
+    toSearch() {
+        wx.navigateTo({
+            url: './search',
+        })
+    },
     /* 供需分类切换 */
     tabsOnChange(e) {
         const {
             title,
             index
         } = e.detail;
-        (title == '全部供需') ? this.query_supplyanddemandList(''): this.query_supplyanddemandList(title);
+        this.setData({
+            tabsActive: index
+        })
+        if (index != 0) this.query_supplyanddemandList(title);
+        // (title == '全部供需') ? this.query_supplyanddemandList(''): this.query_supplyanddemandList(title);
     },
     /* 拉取供需分类列表 */
     query_supplyanddemandList(type) {

+ 3 - 1
pages/portal/index.json

@@ -1,5 +1,7 @@
 {
   "usingComponents": {
-    "van-empty": "@vant/weapp/empty/index"
+    "van-empty": "@vant/weapp/empty/index",
+    "portalLice": "./portalLive/live",
+    "annunciateList": "./annunciateList/index"
   }
 }

+ 41 - 35
pages/portal/index.wxml

@@ -1,3 +1,7 @@
+<!-- 搜索 -->
+<view class="search" bindtap="toSearch">
+    <image src="/static/icon-09.png" />搜索关键字
+</view>
 <!-- 轮播图 -->
 <My_BannerSwiper swiperBannerList="{{swiperBannerList}}"></My_BannerSwiper>
 <!-- 最新通告 -->
@@ -28,17 +32,43 @@
 <!-- 广告位1 -->
 <My_BannerSwiper type="advertising" marTop='40' swiperBannerList="{{portal_middle_1}}" />
 <!-- 品牌关注榜 -->
-<view class="concerns-box">
+<view class="annunciate" style="padding-top: 40rpx;">
+    <!-- 标题 -->
+    <view class="annunciate_title">
+        <view class="annunciate_decorate"></view>
+        <view class="annunciate_text">品牌关注榜</view>
+    </view>
+    <view class="concerns-box">
+        <view class="concerns-head" bindtap="concernsChange">
+            <view class="label {{brandSelect==0?'active':''}}" data-index="0">窗帘布</view>
+            <view class="label {{brandSelect==1?'active':''}}" data-index="1">沙发布</view>
+        </view>
+        <view class="concerns-content" hidden="{{brandSelect!=0}}">
+            <view class="concerns-content-item u-line-1" wx:for="{{brandList0}}" wx:if="{{index<10}}">
+                <view class="img">
+                    <image src="/static/icon-02.png" mode="heightFix"></image>
+                </view>{{item.fname}}
+            </view>
+        </view>
+        <view class="concerns-content" hidden="{{brandSelect!=1}}">
+            <view class="concerns-content-item u-line-1" wx:for="{{brandList1}}" wx:if="{{index<10}}">
+                <view class="img">
+                    <image src="/static/icon-02.png" mode="heightFix"></image>
+                </view>{{item.fname}}
+            </view>
+        </view>
+    </view>
+</view>
+<!-- 老 品牌关注榜 -->
+<!-- <view class="concerns-box">
     <view class="concerns-con">
         <view class="concerns-title">品牌关注榜</view>
-        <!-- 分类 -->
         <view class="option-box" bindtap="selectOption">
             <view class="brand-type type-top {{brandSelect=='0'?'typeavtion':''}}">沙发布</view>
             <view class="brand-type type-bot {{brandSelect=='1'?'typeavtion':''}}">窗帘布</view>
             <view class="option op-top {{brandSelect=='0'?'opavtion':''}}" data-index="0"></view>
             <view class="option op-bot {{brandSelect=='1'?'opavtion':''}}" data-index="1"></view>
         </view>
-        <!-- 轮播图 -->
         <swiper class="option-swiper" current='{{brandSelect}}' circular vertical bindchange='selectOption'>
             <swiper-item>
                 <view class="brand-item u-line-1" wx:key="index" wx:for="{{brandList0}}">
@@ -53,7 +83,7 @@
         </swiper>
     </view>
     <image class="concerns-bg" src="/static/portal/bg.png"></image>
-</view>
+</view> -->
 <!-- 新品推荐 -->
 <view class="new-product">
     <view>
@@ -83,40 +113,16 @@
 <My_BannerSwiper type="advertising" marTop='40' swiperBannerList="{{portal_middle_2}}" />
 <!-- 供需 -->
 <van-tabs active="{{ tabsActive }}" color='#00C1D2' line-width='15' line-height='3' custom-class='tabs-custom-class' tab-class='tabs-tab-class' tab-active-class='tabs-tab-active-class' bind:change="tabsOnChange">
-    <van-tab title="全部供需" />
+    <van-tab title="私域直播">
+        <portalLice list='{{tiveList}}'></portalLice>
+    </van-tab>
     <van-tab wx:key="index" wx:for="{{sadClassify}}" title="{{item.ftype}}" />
 </van-tabs>
 <!-- 列表展示区 -->
-<view class="ann-box" style="margin-left: 44rpx;" wx:key="index" wx:for="{{sadList}}" data-index="{{index}}" catchtap="toDetails">
-    <view class="ann-img" wx:if="{{item.attinfos[0].fobsurl}}">
-        <image src="{{item.attinfos[0].fobsurl}}" mode="aspectFill"></image>
-    </view>
-    <view class="ann-img" wx:else>
-        <image wx:if="{{item.ftype=='摄影摄像'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-01.png" mode="aspectFit"></image>
-        <image wx:elif="{{item.ftype=='产品策划'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-02.png" mode="aspectFit"></image>
-        <image wx:elif="{{item.ftype=='平面设计'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-03.png" mode="aspectFit"></image>
-        <image wx:elif="{{item.ftype=='寻找面料'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-04.png" mode="aspectFit"></image>
-        <image wx:elif="{{item.ftype=='商业培训'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-05.png" mode="aspectFit"></image>
-        <image wx:elif="{{item.ftype=='寻找主播'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-06.png" mode="aspectFit"></image>
-        <image wx:elif="{{item.ftype=='面料设计'}}" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/icon-07.png" mode="aspectFit"></image>
-        <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/tacitly-approve/MRproduct.png" mode="aspectFit"></image>
-    </view>
-    <view class="ann-text">
-        <view class="ann-text-title  u-line-1">[{{item.ftype}}]{{item.ftitle}}</view>
-        <view class="ann-text-center u-line-2">{{item.fcontent}}</view>
-        <view class="ann-text-bottom u-line-1" style="margin-top: 22rpx;">
-            <view class="userMsg">
-                <view class="img">
-                    <image wx:if="{{item.headportraiturl}}" src="{{item.headportraiturl}}"></image>
-                    <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
-                </view>
-                <view class="u-line-1" style="max-width: 160rpx;  padding-top: 3rpx;">{{item.createby}}</view>
-            </view>
-            <view>{{item.checkdate}}</view>
-        </view>
-    </view>
-</view>
-<van-empty wx:if="{{1>sadList.length}}" description="暂无数据" />
+<block wx:if="{{tabsActive!=0}}">
+    <annunciateList list='{{sadList}}'></annunciateList>
+    <van-empty wx:if="{{1>sadList.length}}" description="暂无数据" />
+</block>
 <!-- 展厅照片 -->
 <view class="exhibition-hall">
     <image src="{{portal_middle_3[0].attinfos[0].fobsurl}}" mode="aspectFill"></image>

+ 86 - 5
pages/portal/index.wxss

@@ -2,6 +2,26 @@ page {
     background-color: #ffffff;
 }
 
+/* 搜索 */
+.search {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 702rpx;
+    height: 60rpx;
+    background: rgba(0, 0, 0, 0.05);
+    border-radius: 30rpx;
+    margin: 20rpx auto 0;
+    font-size: 28rpx;
+    color: rgba(0, 0, 0, 0.3);
+}
+
+.search image {
+    width: 26rpx;
+    height: 26rpx;
+    margin-right: 8rpx;
+}
+
 /* 通告 */
 .annunciate {
     width: 100vw;
@@ -86,8 +106,8 @@ page {
     height: 14rpx;
 }
 
-/* 品牌关注榜 */
-.concerns-box {
+/* 品牌关注榜 */
+/* .concerns-box {
     position: relative;
     width: 670rpx;
     height: 412rpx;
@@ -124,6 +144,70 @@ page {
     z-index: 1;
     top: 0;
     left: 0;
+} */
+
+/* 新 品牌关注 */
+.concerns-box {
+    width: 670rpx;
+    border-radius: 10rpx;
+    overflow: hidden;
+    margin: 30rpx auto 0;
+}
+
+.concerns-head {
+    display: flex;
+    width: 100%;
+}
+
+.concerns-head .label {
+    width: 50%;
+    height: 76rpx;
+    line-height: 76rpx;
+    text-align: center;
+    background-color: #F5F5F5;
+    font-size: 32rpx;
+    color: #333333;
+}
+
+.concerns-head .active {
+    background: #55C3D0 !important;
+    font-family: PingFangSC-Medium, PingFang SC !important;
+    color: #FFFFFF !important;
+}
+
+.concerns-content {
+    float: left;
+    width: 100%;
+    height: 340rpx;
+    box-sizing: border-box;
+    border: 4rpx solid #55C3D0;
+    border-radius: 0px 0px 10rpx 10rpx;
+    padding-top: 6rpx;
+}
+
+.concerns-content-item {
+    float: left;
+    width: 50%;
+    height: 40rpx;
+    line-height: 40rpx;
+    padding-left: 40rpx;
+    box-sizing: border-box;
+    font-size: 28rpx;
+    color: #333333;
+    margin-top: 20rpx;
+}
+
+.concerns-content-item .img {
+    float: left;
+    width: 46rpx;
+    height: 32rpx;
+    margin-right: 20rpx;
+    margin-top: 4rpx;
+    text-align: center;
+}
+
+.concerns-content-item .img image {
+    height: 32rpx;
 }
 
 /* 新品推荐 */
@@ -209,9 +293,6 @@ page {
     color: #00C1D2 !important;
 }
 
-/* 供需 */
-@import"/pages/annunciate/index.wxss";
-
 /* 展厅照片 */
 .exhibition-hall,
 .attract-investment {

+ 49 - 0
pages/portal/portalLive/live.js

@@ -0,0 +1,49 @@
+// pages/portal/portalLive/live.js
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        list: {
+            type: Array
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        toViewLive(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            if (item.fisneedauth == 1) {
+                console.log('需要授权')
+                /* {
+    "accesstoken": "5301810557137557e6a7ada3f2d96bba",
+    "classname": "enterprise.live.live",
+    "method": "liveauthorization",
+    "content": {
+        "tliveid": "2"
+    }
+} */
+            } else {
+                let str = item.fliveshowurl;
+                const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8)
+                wx.navigateTo({
+                    url: '/pages/webView/index?url=' + url,
+                })
+            }
+        },
+    }
+})

+ 4 - 0
pages/portal/portalLive/live.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 14 - 0
pages/portal/portalLive/live.wxml

@@ -0,0 +1,14 @@
+<view class="live-list" style="padding-bottom: 20rpx;">
+    <view class="list-box">
+        <view class="live-item" wx:for="{{list}}" catchtap="toViewLive" data-item="{{item}}">
+            <image class="img" src="{{item.channelcoverimageurl}}" mode="aspectFill" />
+            <view class="brand-audience">
+                <view class="brand u-line-1">{{item.fagentname!=null?item.fagentname:'暂无'}}</view>
+                <view class="audience">
+                    <image src="/static/icon-11.png" />{{item.viewers}}
+                </view>
+            </view>
+            <view class="explain u-line-1">{{item.faddress!=null?item.faddress:'暂无'}}</view>
+        </view>
+    </view>
+</view>

+ 69 - 0
pages/portal/portalLive/live.wxss

@@ -0,0 +1,69 @@
+.blive-list {
+    width: 100vw;
+    box-sizing: border-box;
+}
+
+.list-box {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+    width: 662rpx;
+    margin: 0 auto;
+}
+
+.live-item {
+    width: 322rpx;
+    height: 332rpx;
+    border-radius: 10rpx;
+    box-shadow: 0px 0px 16rpx 0px rgba(170, 170, 170, 0.3);
+    margin-top: 20rpx;
+    overflow: hidden;
+}
+
+.img {
+    width: 322rpx;
+    height: 240rpx;
+    overflow: hidden;
+}
+
+.explain {
+    width: 100%;
+    height: 34rpx;
+    font-size: 24rpx;
+    color: #333333;
+    line-height: 34rpx;
+    padding: 0 10rpx;
+    box-sizing: border-box;
+}
+
+.brand-audience {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    height: 40rpx;
+    line-height: 40rpx;
+    padding: 0 10rpx;
+    box-sizing: border-box;
+}
+
+.brand {
+    flex: 1;
+    font-size: 28rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 550;
+    color: #000000;
+}
+
+.audience {
+    font-size: 28rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 550;
+    color: #4DC2D4;
+    flex-shrink: 0;
+}
+
+.audience image {
+    width: 20rpx;
+    height: 20rpx;
+    margin-right: 4rpx;
+}

+ 159 - 0
pages/portal/search.js

@@ -0,0 +1,159 @@
+import {
+    TestVerify
+} from "../../utils/verify";
+import {
+    ApiModel
+} from "../../utils/api"
+const _Http = new ApiModel();
+const _Verify = new TestVerify();
+const processingData = require("../../utils/processingData.js");
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        tabsList: ['通告', '供需', '直播'],
+        ftype: 3, //1:直播,2:供需,3:通告
+        annunciateList: [], //通告列表
+        liveList: [], //直播列表
+        supplyanddemandList: [], //供需列表
+        showPlaceholder: true, //是否显示占位图
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    //切换搜索类型
+    tabsSelectedIitem({
+        detail
+    }) {
+        let ftype = this.data.ftype;
+        switch (detail) {
+            case "通告":
+                ftype = 3;
+                break;
+            case "供需":
+                ftype = 2;
+                break;
+            case "直播":
+                ftype = 1;
+                break;
+        }
+        if (ftype == this.data.ftype) return;
+        this.setData({
+            ftype
+        });
+        this.isPlaceholder()
+    },
+    /* 搜索关键字 */
+    searchContent(e) {
+        let {
+            value
+        } = e.detail;
+        value = _Verify.Eliminate(value.trim());
+        if (value) {
+            _Http.basic({
+                "classname": "publicmethod.homepage.homepage",
+                "method": "searchPortalInfo",
+                "content": {
+                    "getdatafromdbanyway": true,
+                    "keyStr": value,
+                    "ftype": ""
+                }
+            }).then(res => {
+                console.log("搜索", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: 'none'
+                })
+                let annunciateList = res.data.TNOTICE,
+                    supplyanddemandList = res.data.tsupplyanddemand;
+                if (annunciateList.length != 0) annunciateList = processingData.annunciateCheckdate(annunciateList);
+                if (supplyanddemandList.length != 0) supplyanddemandList = processingData.checkdate(supplyanddemandList);
+                this.setData({
+                    annunciateList,
+                    liveList: res.data.tlive,
+                    supplyanddemandList
+                })
+                this.isPlaceholder()
+            })
+        } else {
+            this.setData({
+                annunciateList: [],
+                liveList: [],
+                supplyanddemandList: []
+            })
+            this.isPlaceholder()
+        }
+    },
+    /* 是否显示占位图 */
+    isPlaceholder() {
+        let showPlaceholder = false;
+        switch (this.data.ftype) {
+            case 3:
+                showPlaceholder = (this.data.annunciateList.length == 0) ? true : false;
+                break;
+            case 2:
+                showPlaceholder = (this.data.supplyanddemandList.length == 0) ? true : false;
+                break;
+            case 1:
+                showPlaceholder = (this.data.liveList.length == 0) ? true : false;
+                break;
+        }
+        this.setData({
+            showPlaceholder
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 8 - 0
pages/portal/search.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "My_RoundedCornerButtonTabs": "../../components/My_RoundedCornerButtonTabs/index",
+    "van-empty": "@vant/weapp/empty/index",
+    "portalLice": "./portalLive/live",
+    "annunciateList": "./annunciateList/index"
+  }
+}

+ 19 - 0
pages/portal/search.wxml

@@ -0,0 +1,19 @@
+<!-- 搜索框 -->
+<view class="search-box">
+    <image src="/static/icon-09.png" />
+    <input type="text" placeholder="搜索关键字" placeholder-class="placeholder" confirm-type='search' bindblur='searchContent' bindconfirm='searchContent' />
+</view>
+<!-- tbas -->
+<view class="tabs">
+    <My_RoundedCornerButtonTabs list='{{tabsList}}' bindtabsSelectedIitem='tabsSelectedIitem'></My_RoundedCornerButtonTabs>
+</view>
+<!-- 直播 -->
+<view hidden="{{ftype!=1}}">
+    <portalLice list='{{liveList}}'></portalLice>
+</view>
+<!-- 供需 -->
+<view hidden="{{ftype!=2}}">
+    <annunciateList list='{{supplyanddemandList}}'></annunciateList>
+</view>
+<!-- 占位图 -->
+<van-empty wx:if="{{showPlaceholder}}" image="search" description="暂无内容" />

+ 41 - 0
pages/portal/search.wxss

@@ -0,0 +1,41 @@
+/* pages/portal/search.wxss */
+@import "./index.wxss";
+
+.search-box {
+    display: flex;
+    align-items: center;
+    width: 702rpx;
+    height: 60rpx;
+    background: rgba(0, 0, 0, 0.05);
+    border-radius: 30rpx;
+    margin: 20rpx auto 60rpx;
+    overflow: hidden;
+    padding: 0 20rpx;
+    box-sizing: border-box;
+}
+
+.search-box image {
+    width: 26rpx;
+    height: 26rpx;
+    flex-shrink: 0;
+    margin-right: 10rpx;
+}
+
+.search-box input {
+    flex: 1;
+    height: 100%;
+    font-size: 28rpx !important;
+}
+
+.placeholder {
+    font-size: 28rpx !important;
+    color: #000000 !important;
+    opacity: .3 !important;
+}
+
+/* tabs */
+.tabs {
+    width: 100vw;
+    padding-left: 40rpx;
+    box-sizing: border-box;
+}

+ 6 - 4
pages/tabbar-pages/supplyAndDemand/index.js

@@ -35,6 +35,7 @@ Page({
             "method": "query_typeselectList",
             "content": {}
         }).then(res => {
+            console.log("分类", res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
@@ -135,17 +136,16 @@ Page({
                 "tsupplyanddemandid": item.tsupplyanddemandid
             }
         }).then(res => {
+            console.log('沟通列表', res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
             })
-            console.log('沟通列表', res.data[0].imdialogs)
             imdialogs = res.data[0].imdialogs;
             for (let i = 0; i < imdialogs.length; i++) {
                 let checkdate = imdialogs[i].createdate;
                 if (checkdate != null && checkdate != undefined) imdialogs[i].createdate = checkdate.slice(0, checkdate.lastIndexOf('.'));
             }
-            
             this.setData({
                 ifShowCommunicationOfNumber: true,
                 imdialogs
@@ -232,7 +232,8 @@ Page({
             where = {
                 "condition": condition, //模糊搜索
                 "ftype": ftype, //数据类型
-                "fissupply": "" // 0需 1供
+                "fissupply": 0, // 0需 1供
+                "fstatus": ""
             };
         /* 暂时不分供需 */
         if (fstatus) {
@@ -254,9 +255,10 @@ Page({
                 "where": where
             }
         }).then(res => {
-            console.log(res)
+            console.log("供需列表", res)
             if (res.msg != "成功") return wx.showToast({
                 title: res.data,
+                icon: "none"
             })
             this.returnList(res);
         })

+ 4 - 4
pages/tabbar-pages/supplyAndDemand/index.wxml

@@ -36,13 +36,13 @@
             </My_SupplyAndDemandItemBox>
         </van-tab>
         <van-tab title="正在对接">
-            <view class="abutting-joint-box">
+            <view class="abutting-joint-box" wx:for="{{productList}}">
                 <view class="abutting-joint-titleAndMsg">
-                    <view class="abutting-joint-title">各位老板看下有以下面料的联系我,高价收!</view>
-                    <view class="abutting-joint-msg"><text style="color: #FF0000; opacity: .5;">[23条]</text>李老板:多少钱收?多少钱收?</view>
+                    <view class="abutting-joint-title u-line-1">[{{item.ftype}}]{{item.ftitle}}</view>
+                    <view class="abutting-joint-msg u-line-1"><text style="color: #FF0000; opacity: .5;">[23条]</text>李老板:多少钱收?多少钱收?</view>
                 </view>
                 <view class="abutting-joint-timeAndBut">
-                    <view class="abutting-joint-time">2021-11-10 14:23:43</view>
+                    <view class="abutting-joint-time">{{item.checkdate}}</view>
                     <van-button custom-class="abutting-joint-but"><text class="abutting-joint-but-text">继续沟通</text></van-button>
                 </view>
             </view>

+ 7 - 0
project.private.config.json

@@ -233,6 +233,13 @@
                     "name": "",
                     "pathName": "pages/tabbar-pages/supplyAndDemand/particulars",
                     "query": "tsupplyanddemandid=2002&type=2",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "门户搜索",
+                    "pathName": "pages/portal/search",
+                    "query": "",
                     "scene": null,
                     "launchMode": "default"
                 }