zhaoxiaohai vor 3 Jahren
Ursprung
Commit
210a6a8297

+ 5 - 5
app.js

@@ -43,10 +43,10 @@ App({
     })
   },
   initSocket() {
-    console.log('websocket:', 'ws://www.buwanjia.com:80/bwj/webSocket/' + wx.getStorageSync('userData').token)
+    console.log('websocket:', 'wss://www.buwanjia.com/bwj/webSocket/' + wx.getStorageSync('userData').token)
     let that = this;
     this.globalData.SocketTask = wx.connectSocket({
-      url: 'ws://www.buwanjia.com:80/bwj/webSocket/' + wx.getStorageSync('userData').token,
+      url: 'wss://www.buwanjia.com/bwj/webSocket/bwj/webSocket/' + wx.getStorageSync('userData').token,
       complete: (res) => {
         console.log(res)
       }
@@ -64,15 +64,15 @@ App({
     })
     this.globalData.SocketTask.onError(function (res) {
       console.log('readyState=' + that.globalData.SocketTask.readyState)
-      that.initSocket()
+      // that.initSocket()
     })
     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

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

+ 2 - 2
pages/chatRoom/MsgBubble/index.wxml

@@ -1,7 +1,7 @@
 <!-- 对方 -->
 <view wx:if="{{role=='you'}}" class='opposite-side'>
     <image wx:if="{{userImg}}" class="userImg" src="{{userImg}}"></image>
-    <image wx:else class="userImg" src="/static/tacitly-approve/MRproduct.png"></image>
+    <image wx:else class="userImg" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
     <view class="content" style="background: {{type=='text'?'':'#fff'}}; padding: {{type=='text'?'':'20rpx 0 0 0'}};">
         <block wx:if="{{type=='text'}}">
             {{content}}</block>
@@ -22,5 +22,5 @@
         <view class="msg-time">{{time}}</view>
     </view>
     <image wx:if="{{userImg}}" class="userImg" src="{{userImg}}"></image>
-    <image wx:else class="userImg" src="/static/tacitly-approve/MRproduct.png"></image>
+    <image wx:else class="userImg" src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
 </view>

+ 76 - 7
pages/chatRoom/dialogbox.js

@@ -4,7 +4,6 @@ import {
 } from "../../utils/api";
 const _Http = new ApiModel();
 Page({
-
     /**
      * 页面的初始数据
      */
@@ -22,13 +21,15 @@ Page({
         pageTotal: 1,
         triggered: false, //下拉状态
         unreadCount: 0, //对方发送未读信息
+        joinHands: false, //是否显示合作按钮
+        ownerid: 0, //供需id
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        app.initSocket(); //链接websocket 用于测试
+        //app.initSocket(); 链接websocket 用于测试
         const that = this;
         this.setData({
             timdialogid: options.id,
@@ -44,9 +45,31 @@ Page({
             }
         }).then(res => {
             console.log("详情", res)
-            let title = res.data[0].fimdialogname.split('-');
+            let title = res.data[0].fimdialogname.split('-'),
+                headerTitle = (title[0] == res.data[0].fname) ? title[1] : title[0],
+                joinHands = false;
+            if (res.data[0].ownerid != 0) {
+                _Http.basic({
+                    "accesstoken": wx.getStorageSync('userData').token,
+                    "classname": "customer.supplyanddemand.supplyanddemand",
+                    "method": "updatesupplyanddemandstatus",
+                    "content": {
+                        "tsupplyanddemandid": res.data[0].ownerid,
+                        "fstatus": "对接中",
+                        "timdialogid": res.data[0].timdialogid
+                    }
+                }).then(res => {
+                    console.log("对接中", res)
+                })
+                if (res.data[0].fimuserid != wx.getStorageSync('userData').userid) {
+                    joinHands = true;
+                }
+            }
             this.setData({
-                headerTitle: title[0]
+                headerTitle,
+                joinHands,
+                ownerid: res.data[0].ownerid,
+                initiator: res.data[0].fimuserid
             })
         })
         //群历史信息
@@ -58,6 +81,36 @@ Page({
         //获取表情包
         this.getMeme()
     },
+    /* 确认合作 */
+    confirmTheCooperation() {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "updatesupplyanddemandstatus",
+            "content": {
+                "tsupplyanddemandid": this.data.ownerid,
+                "fstatus": "已解决",
+                "tenterprise_userid": this.data.initiator
+            }
+        }).then(res => {
+            console.log("确认合作", res)
+        })
+    },
+    /* 拒绝合作 */
+    refuseToCooperate() {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "updatesupplyanddemandstatus",
+            "content": {
+                "tsupplyanddemandid": this.data.ownerid,
+                "fstatus": "待对接",
+                "timdialogid": this.data.timdialogid
+            }
+        }).then(res => {
+            console.log("拒绝合作", res)
+        })
+    },
     //历史信息查询
     query_imdialogMessage() {
         _Http.basic({
@@ -74,9 +127,9 @@ Page({
                 title: res.data,
                 icon: "none"
             })
-            console.log(res)
             if (res.pageNumber != 1) {
                 let list = res.data;
+                list = list.reverse();
                 list = list.concat(this.data.socketMsgQueue);
                 this.setData({
                     socketMsgQueue: list,
@@ -84,11 +137,18 @@ Page({
                     triggered: false
                 })
             } else {
+                let list = res.data;
+                list = list.reverse();
                 this.setData({
-                    socketMsgQueue: res.data,
+                    socketMsgQueue: list,
                     toView: `item${res.data.length - 1}`,
                     pageTotal: res.pageTotal
                 })
+                setTimeout(() => {
+                    this.setData({
+                        toView: 'bottom'
+                    })
+                }, 500)
             }
 
         })
@@ -100,6 +160,10 @@ Page({
                 triggered: true
             })
             this.query_imdialogMessage();
+        } else {
+            this.setData({
+                triggered: true
+            })
         }
     },
     //键盘弹出高度
@@ -169,7 +233,6 @@ Page({
         } = e.target.dataset,
             that = this;
         if (name == undefined || name == "") return;
-        console.log(name)
         if (name == '表情') {
             let keyboardHeight = (this.data.iosX == true) ? 220 : 200;
             this.setData({
@@ -198,6 +261,10 @@ Page({
                     that.afterRead(data)
                 }
             })
+        } else if (name == '历史') {
+            wx.navigateTo({
+                url: './history?id=' + that.data.timdialogid,
+            })
         }
     },
     textareaFocus() {
@@ -215,9 +282,11 @@ Page({
     },
     /* 文本域行数变化 */
     linechange(e) {
+        console.log(e)
         const {
             lineCount
         } = e.detail;
+        if (lineCount == this.data.lineCount) return;
         this.setData({
             lineCount
         })

+ 5 - 5
pages/chatRoom/dialogbox.wxml

@@ -1,9 +1,9 @@
 <!-- 头部 -->
 <view class="header">
     <view class="header_title">{{headerTitle}}</view>
-    <view class="header_botton">
-        <van-button custom-class='head-bot-class head-bot-l'>暂不合作</van-button>
-        <van-button custom-class='head-bot-class head-bot-r'>确认合作</van-button>
+    <view class="header_botton" wx:if="{{joinHands}}">
+        <van-button custom-class='head-bot-class head-bot-l' catchtap="refuseToCooperate">暂不合作</van-button>
+        <van-button custom-class='head-bot-class head-bot-r' catchtap="confirmTheCooperation">确认合作</van-button>
     </view>
 </view>
 <!-- 聊天   bindscrolltoupper='scrolltoupper' -->
@@ -14,8 +14,8 @@
     <view id="bottom" style="height: {{iosX?'102':'85'}}px;"></view>
 </scroll-view>
 <!-- 底部输入 -->
-<view class="input-box" style="bottom:{{keyboardHeight}}px;">
-    <textarea class="input-text {{lineCount==1?'':'multi-row'}}" bindfocus="textareaFocus" adjust-position='{{false}}' bindconfirm='sendMsg' bindblur="sendMsg" show-confirm-bar='{{false}}' confirm-type='send' confirm-hold='true' cursor-spacing='45' bindinput='sendInput' value='{{sendText}}' maxlength='-1' fixed='true' type="text" bindlinechange='linechange' bindkeyboardheightchange='keyboardheightchange'></textarea>
+<view class="input-box" style="bottom:{{keyboardHeight}}px;"><!-- {{lineCount>1?'multi-row':''}} -->
+    <textarea class="input-text " bindfocus="textareaFocus" adjust-position='{{false}}' bindconfirm='sendMsg' show-confirm-bar='{{false}}' confirm-type='send' confirm-hold='true' cursor-spacing='45' bindinput='sendInput' value='{{sendText}}' maxlength='-1' fixed='true' type="text" bindlinechange='linechange' bindkeyboardheightchange='keyboardheightchange'></textarea>
     <view class="functionalZone" catchtap="selectionFunction">
         <image data-name='表情' mode="heightFix" src="/static/chatRoom/icon-01.png" />
         <image data-name='图片' mode="heightFix" src="/static/chatRoom/icon-02.png" />

+ 109 - 0
pages/chatRoom/history.js

@@ -0,0 +1,109 @@
+import {
+    ApiModel
+} from "../../utils/api";
+const _Http = new ApiModel();
+Page({
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        this.setData({
+            userid: wx.getStorageSync('userData').userid,
+            timdialogid: options.id
+        })
+        this.query_imdialogMessage();
+    },
+    query_imdialogMessage() {
+        let condition = "",
+            begdate = '',
+            enddate = '';
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "system.im.imdialog.imdialog",
+            "method": "query_imdialogMessage",
+            "content": {
+                "pageNumber": this.data.pageNumber,
+                "pageSize": 50,
+                "timdialogid": this.data.timdialogid,
+                "where": {
+                    "condition": condition,
+                    "begdate": begdate,
+                    "enddate": enddate
+                }
+            }
+        }).then(res => {
+            if (res.pageNumber != 1) {
+                let list = res.data;
+                list = list.reverse();
+                list = list.concat(this.data.socketMsgQueue);
+                this.setData({
+                    socketMsgQueue: list
+                })
+            } else {
+                let list = res.data;
+                list = list.reverse();
+                this.setData({
+                    socketMsgQueue: list,
+                    toView: `item${res.data.length - 1}`,
+                    pageTotal: res.pageTotal
+                })
+            }
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/chatRoom/history.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "MsgBubble": "./MsgBubble/index"
+  }
+}

+ 1 - 0
pages/chatRoom/history.wxml

@@ -0,0 +1 @@
+<MsgBubble wx:for="{{socketMsgQueue}}" id="item{{index}}" type='{{item.message.ftype}}' fobsurl='{{item.message.data[0].fobsurl}}' role="{{userid==item.message.sendfrom.userid?'my':'you'}}" userImg='{{item.message.sendfrom.headpic}}' content='{{item.message.data.fcontent}}' time='{{item.message.fdatetime}}' />

+ 3 - 0
pages/chatRoom/history.wxss

@@ -0,0 +1,3 @@
+page {
+    background-color: #ffffff;
+}

+ 1 - 1
pages/chatRoom/index.wxml

@@ -16,7 +16,7 @@
         <navigator url="#" wx:for="{{relationList}}" data-item="{{item}}" bindtap="enterTheDialogue">
             <view class="msgImg">
                 <image wx:if="{{item.latestnews[0].message.sendfrom.headpic}}" src="{{item.latestnews[0].message.sendfrom.headpic}}"></image>
-                <image wx:else src="/static/tacitly-approve/MRproduct.png"></image>
+                <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
             </view>
             <view class="borTop">
                 <view class="msgText">

+ 19 - 1
pages/storeMessage/storehomepage.js

@@ -83,7 +83,25 @@ Page({
             })
         })
     },
-
+    toLinkUp() {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "system.im.imdialog.imdialog",
+            "method": "quickcontact",
+            "content": {
+                "tenterprise_userid": this.data.storeMsg.tenterprise_userid
+            }
+        }).then(res => {
+            console.log("创建聊天", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            wx.navigateTo({
+                url: '/pages/chatRoom/dialogbox?id=' + res.data[0].timdialogid,
+            })
+        })
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 3 - 3
pages/storeMessage/storehomepage.wxml

@@ -12,9 +12,9 @@
         </view>
         <view class="grey-rectangle-right">
             <image src="{{storeMsg.attinfos[0].fobsurl}}" mode="aspectFill"></image>
-            <!-- <view>
-                <van-button size="large" color="linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%)" custom-class='relation'>一键联系</van-button>
-            </view> -->
+            <view>
+                <van-button size="large" color="linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%)" custom-class='relation' catchtap="toLinkUp">一键联系</van-button>
+            </view>
         </view>
     </view>
     <My_CenterTheTitle title="公司介绍"></My_CenterTheTitle>

+ 25 - 7
pages/tabbar-pages/home/index.js

@@ -38,6 +38,31 @@ Page({
     /* tabsSelectedIitem(text) {
         console.log(text.detail)
     }, */
+    /* 建立联系 */
+    toLinkUp(e) {
+        const {
+            tsupplyanddemandid,
+            tenterprise_userid
+        } = e.currentTarget.dataset.item;
+        if (tenterprise_userid == wx.getStorageSync('userData').userid) return;
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "OpenImDialog",
+            "content": {
+                "tsupplyanddemandid": tsupplyanddemandid
+            }
+        }).then(res => {
+            console.log("创建聊天", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            wx.navigateTo({
+                url: '/pages/chatRoom/dialogbox?id=' + res.data[0].timdialogid,
+            })
+        })
+    },
     /* 宫格区跳转 */
     gridJumpPage(e) {
         const {
@@ -274,13 +299,6 @@ Page({
             });
         }
     },
-    /* 一键联系 */
-    contact() {
-        /* wx.showToast({
-            title: '功能尚在开发',
-            icon: "none"
-        }) */
-    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

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

@@ -54,7 +54,7 @@
     <view slot="display-box-showList">
         <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">
-                <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" data-item="{{item}}" catchtap="toLinkUp" color="linear-gradient(180deg, #84E3EC 0%, #4DC2D4 100%)"></van-button>
                 <view class="display-box-showList-button-text">
                     一键联系
                 </view>

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

@@ -21,6 +21,7 @@ Page({
         productList: [],
         //轮播图列表
         swiperBannerList: [],
+        imdialogs: [], //沟通列表
     },
 
     /**
@@ -70,6 +71,15 @@ Page({
             swiperBannerList: bannerList[0].banner
         });
     },
+    //跳转聊天
+    toLinkUpPage(e) {
+        const {
+            timdialogid
+        } = e.currentTarget.dataset.item;
+        wx.navigateTo({
+            url: '/pages/chatRoom/dialogbox?id=' + timdialogid,
+        })
+    },
     /* tabs切换接口 */
     getList() {
         if (this.data.active == 0) return this.getSupplyAndDemand();
@@ -112,9 +122,40 @@ Page({
         })
     },
     /* 显示沟通数量 */
-    showCommunicationOfNumber() {
+    showCommunicationOfNumber(e) {
+        let {
+            item
+        } = e.currentTarget.dataset;
+        let imdialogs = [];
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "query_mysupplyanddemandMain",
+            "content": {
+                "tsupplyanddemandid": item.tsupplyanddemandid
+            }
+        }).then(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
+            })
+        })
+
+    },
+    endShowCommunicationOfNumber() {
         this.setData({
-            ifShowCommunicationOfNumber: !this.data.ifShowCommunicationOfNumber
+            ifShowCommunicationOfNumber: false
         })
     },
     postDemand() {
@@ -126,9 +167,29 @@ Page({
     stop() {
         /* 所有供需列表中,已过期或已解决 不做操作 */
     },
-    /* 一键联系 */
-    contact() {
-        console.log('一键联系')
+    toLinkUp(e) {
+        const {
+            tsupplyanddemandid,
+            tenterprise_userid
+        } = e.currentTarget.dataset.item;
+        if (tenterprise_userid == wx.getStorageSync('userData').userid) return;
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "OpenImDialog",
+            "content": {
+                "tsupplyanddemandid": tsupplyanddemandid
+            }
+        }).then(res => {
+            console.log("创建聊天", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            wx.navigateTo({
+                url: '/pages/chatRoom/dialogbox?id=' + res.data[0].timdialogid,
+            })
+        })
     },
     /* 供需下架 */
     soldOut(e) {
@@ -179,7 +240,7 @@ Page({
                 "condition": condition, //模糊搜索
                 "ftype": ftype, //数据类型
                 "fissupply": 0, // 0需 1供
-                "fstatus": "正在对接"
+                "fstatus": "对接"
             }
         };
         _Http.basic({
@@ -193,6 +254,7 @@ Page({
                 "where": where
             }
         }).then(res => {
+            console.log(res)
             if (res.msg != "成功") return wx.showToast({
                 title: res.data,
             })

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

@@ -28,7 +28,7 @@
                             浏览次数:{{item.freadtimes}}次 意向沟通人数:{{item.fcommunicationtimes}}次
                         </view>
                         <view class="dataAndBut_but">
-                            <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" catchtap="contact">一键联系</van-button>
+                            <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" data-item="{{item}}" catchtap="toLinkUp">一键联系</van-button>
                             <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut" catchtap="stop">{{item.fstatus}}</van-button>
                         </view>
                     </view>
@@ -36,7 +36,7 @@
             </My_SupplyAndDemandItemBox>
         </van-tab>
         <van-tab title="正在对接">
-            <!-- <view class="abutting-joint-box">
+            <view class="abutting-joint-box">
                 <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>
@@ -45,7 +45,7 @@
                     <view class="abutting-joint-time">2021-11-10 14:23:43</view>
                     <van-button custom-class="abutting-joint-but"><text class="abutting-joint-but-text">继续沟通</text></van-button>
                 </view>
-            </view> -->
+            </view>
         </van-tab>
         <van-tab title="我的需求">
             <!-- 搜索 -->
@@ -75,7 +75,7 @@
                 <view slot="dataAndBut">
                     <view class="dataAndBut">
                         <view class="dataAndBut_data">
-                            浏览次数:{{item.freadtimes}}<text catchtap="showCommunicationOfNumber">意向沟通人数</text>:{{item.fcommunicationtimes}}次
+                            浏览次数:{{item.freadtimes}}<text data-item="{{item}}" catchtap="showCommunicationOfNumber">意向沟通人数</text>:{{item.fcommunicationtimes}}次
                         </view>
                         <view class="dataAndBut_but">
                             <van-button color="#4DC2D4" data-index="{{index}}" style="margin-left: 16rpx;" custom-class="custom-slotBut" catchtap="productEdit">编辑</van-button>
@@ -87,11 +87,11 @@
     </van-tabs>
 </view>
 <!-- 我的需求弹框 -->
-<van-action-sheet show="{{ ifShowCommunicationOfNumber }}" bind:close="showCommunicationOfNumber">
+<van-action-sheet show="{{ ifShowCommunicationOfNumber }}" bind:close="endShowCommunicationOfNumber">
     <view class="CommunicationOfNumber">
         <view class="CommunicationOfNumber-title">沟通列表</view>
         <view class="CommunicationOfNumber-list">
-            <view wx:for="{{5}}">2021-02-13 16:34:45<text>用户:啊9999</text>发起联系,遗憾未达成合作</view>
+            <view wx:for="{{imdialogs}}">{{item.createdate}}<text data-item="{{item}}" catchtap="toLinkUpPage" class="text">用户:{{item.fname}}</text><text wx:if="{{item.fdatastatus==0}}">发起联系,遗憾未达成合作</text><text wx:elif='{{item.fdatastatus==2}}'>发起联系,正在对接中</text><text wx:elif='{{item.fdatastatus==1}}'>发起联系,恭喜达成合作</text></view>
         </view>
     </view>
     <view style="height: 50px;"></view>

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

@@ -241,10 +241,11 @@
     box-sizing: border-box;
 }
 
-.CommunicationOfNumber-list text {
+.CommunicationOfNumber-list .text {
     color: #4DC2D4;
     padding: 0 8rpx;
 }
+
 /* 我的供需 状态 */
 .myState {
     height: 40rpx;

+ 23 - 2
pages/tabbar-pages/supplyAndDemand/particulars.js

@@ -95,8 +95,29 @@ Page({
 
     },
     /* 一键联系 */
-    contact() {
-        console.log('一键联系')
+    toLinkUp(e) {
+        const {
+            tsupplyanddemandid,
+            tenterprise_userid
+        } = e.currentTarget.dataset.item;
+        if (tenterprise_userid == wx.getStorageSync('userData').userid) return;
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "OpenImDialog",
+            "content": {
+                "tsupplyanddemandid": tsupplyanddemandid
+            }
+        }).then(res => {
+            console.log("创建聊天", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            wx.navigateTo({
+                url: '/pages/chatRoom/dialogbox?id=' + res.data[0].timdialogid,
+            })
+        })
     },
     /**
      * 生命周期函数--监听页面初次渲染完成

+ 3 - 2
pages/tabbar-pages/supplyAndDemand/particulars.wxml

@@ -11,7 +11,8 @@
                 <view class="header-userMessage-textMsg">{{particulars.createby}} {{particulars.checkdate}}</view>
             </view>
             <view class="but-box">
-                <van-button wx:if="{{particulars.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut details-custom-slotBut">一键联系</van-button>
+                <van-button wx:if="{{particulars.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut details-custom-slotBut" data-item='{{particulars}}' catchtap="toLinkUp">一键联系</van-button>
+                <van-button wx:elif='{{particulars.fstatus == "新建"}}' color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut details-custom-slotBut">未上架</van-button>
                 <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut details-custom-slotBut">{{particulars.fstatus}}</van-button>
             </view>
         </view>
@@ -34,7 +35,7 @@
                     <view class="dataAndBut_data">
                         浏览次数:{{item.freadtimes}}次 意向沟通人数:{{item.fcommunicationtimes}}次
                     </view>
-                    <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" catchtap="contact">一键联系</van-button>
+                    <van-button wx:if="{{item.fstatus == '待对接'}}" color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-slotBut" data-item='{{item}}' catchtap="toLinkUp">一键联系</van-button>
                     <van-button wx:else color="#4DC2D4" style="margin-left: 16rpx;" custom-class="custom-NoSlotBut" catchtap="stop">{{item.fstatus}}</van-button>
                 </view>
             </view>

+ 1 - 1
project.config.json

@@ -4,7 +4,7 @@
         "ignore": []
     },
     "setting": {
-        "urlCheck": false,
+        "urlCheck": true,
         "es6": true,
         "enhance": true,
         "postcss": true,

+ 28 - 0
project.private.config.json

@@ -205,6 +205,34 @@
                     "name": "即时沟通",
                     "pathName": "pages/chatRoom/index",
                     "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/storeMessage/storehomepage",
+                    "query": "id=36113",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/tabbar-pages/supplyAndDemand/particulars",
+                    "query": "tsupplyanddemandid=2413&type=1",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/chatRoom/history",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/tabbar-pages/supplyAndDemand/particulars",
+                    "query": "tsupplyanddemandid=2002&type=2",
                     "scene": null,
                     "launchMode": "default"
                 }