Browse Source

即时通讯

zhaoxiaohai 4 năm trước cách đây
mục cha
commit
aa59ee2d7a

+ 3 - 1
app.json

@@ -53,7 +53,9 @@
         "pages/annunciate/newAndChange",
         "pages/annunciate/details",
         "pages/annunciate/glanceover",
-        "pages/portal/details"
+        "pages/portal/details",
+        "pages/chatRoom/index",
+        "pages/chatRoom/dialogbox"
     ],
     "usingComponents": {
         "van-button": "@vant/weapp/button/index",

+ 38 - 0
pages/chatRoom/MsgBubble/index.js

@@ -0,0 +1,38 @@
+// pages/chatRoom/MsgBubble/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        role: {
+            type: String, //角色 my 我的 you 别人
+        },
+        type: {
+            type: String,
+            value: "text" //消息类型
+        },
+        content: {
+            type: String //消息内容
+        },
+        userImg: {
+            type: String //用户头像
+        },
+        time: {
+            type: String //时间
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+
+    }
+})

+ 4 - 0
pages/chatRoom/MsgBubble/index.json

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

+ 16 - 0
pages/chatRoom/MsgBubble/index.wxml

@@ -0,0 +1,16 @@
+<!-- 对方 -->
+<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>
+    <view class="content">{{content}}
+        <view class="msg-time">{{time}}</view>
+    </view>
+</view>
+<!-- 自己 -->
+<view wx:if="{{role=='my'}}" class='my-msg'>
+    <view class="content">{{content}}
+        <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>
+</view>

+ 64 - 0
pages/chatRoom/MsgBubble/index.wxss

@@ -0,0 +1,64 @@
+/* 对面 */
+.opposite-side {
+    display: flex;
+    width: 100vw;
+    padding-left: 30rpx;
+    box-sizing: border-box;
+    margin-bottom: 78rpx;
+}
+
+.opposite-side .userImg {
+    width: 70rpx;
+    height: 70rpx;
+    border-radius: 50%;
+    margin-right: 20rpx;
+}
+
+.opposite-side .content {
+    position: relative;
+    max-width: 457rpx;
+    font-size: 28rpx;
+    color: #000000;
+    line-height: 40rpx;
+    padding: 20rpx 26rpx 20rpx 30rpx;
+    background-color: #F6F7F8;
+    border-radius: 10rpx;
+}
+
+.msg-time {
+    position: absolute;
+    height: 34rpx;
+    font-size: 24rpx;
+    color: rgba(0, 0, 0, 0.39);
+    line-height: 34rpx;
+    bottom: -45rpx;
+    right: 20rpx;
+}
+
+/* 自己 */
+.my-msg {
+    display: flex;
+    justify-content: flex-end;
+    width: 100vw;
+    padding-right: 30rpx;
+    box-sizing: border-box;
+    margin-bottom: 78rpx;
+}
+
+.my-msg .userImg {
+    width: 70rpx;
+    height: 70rpx;
+    border-radius: 50%;
+    margin-left: 20rpx;
+}
+
+.my-msg .content {
+    position: relative;
+    max-width: 457rpx;
+    font-size: 28rpx;
+    color: #000000;
+    line-height: 40rpx;
+    padding: 20rpx 26rpx 20rpx 30rpx;
+    background-color: #F6F7F8;
+    border-radius: 10rpx;
+}

+ 69 - 0
pages/chatRoom/dialogbox.js

@@ -0,0 +1,69 @@
+// pages/chatRoom/dialogbox.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        iosX: false
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        let iosX = (getApp().globalData.safeAreaBottom == 0) ? false : true;
+        this.setData({
+            iosX
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/chatRoom/dialogbox.json

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

+ 22 - 0
pages/chatRoom/dialogbox.wxml

@@ -0,0 +1,22 @@
+<!-- 头部 -->
+<view class="header">
+    <view class="header_title">王梅</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>
+</view>
+<MsgBubble role='my' userImg='/static/icon-02.png' content='这是消息内容' time='8.30' />
+<MsgBubble role='you' userImg='/static/icon-05.png' content='好多文字好多文字好多文字好多文字好多文字好多文字好多文字好多文字好多文字好多文字' time='8.30' />
+<!-- 底部输入 -->
+<view class="input-box">
+    <input class="input-text" type="text" />
+    <view class="functionalZone">
+        <image mode="heightFix" src="/static/chatRoom/icon-01.png" />
+        <image mode="heightFix" src="/static/chatRoom/icon-02.png" />
+        <image mode="heightFix" src="/static/chatRoom/icon-03.png" />
+    </view>
+    <view style="height: {{iosX?'34':'0'}}rpx;"></view>
+</view>
+<!-- 底部占位 -->
+<view style="height: {{iosX?'102':'85'}}rpx;"></view>

+ 87 - 0
pages/chatRoom/dialogbox.wxss

@@ -0,0 +1,87 @@
+page {
+    background-color: #ffffff;
+    padding-top: 112rpx;
+}
+
+.header {
+    position: fixed;
+    top: 0;
+    left: 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 100vw;
+    height: 92rpx;
+    background-color: #FCFCFD;
+    z-index: 9999999;
+}
+
+.header_title {
+    font-size: 32rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    color: #000000;
+    height: 52rpx;
+    line-height: 52rpx;
+    margin-left: 40rpx;
+    font-weight: 550;
+}
+
+.head-bot-class {
+    text-align: center !important;
+    width: 140rpx !important;
+    height: 52rpx !important;
+    border-radius: 10rpx !important;
+    margin-right: 20rpx !important;
+    padding: 0 !important;
+    font-size: 24rpx !important;
+}
+
+.head-bot-l {
+    background: rgba(255, 182, 0, 0.1) !important;
+    border: 2rpx solid rgba(255, 182, 0, 0.6) !important;
+    box-sizing: border-box !important;
+    color: #FFB600 !important;
+}
+
+.head-bot-r {
+    background: linear-gradient(180deg, #FFDC00 0%, #FFB600 100%) !important;
+    font-family: PingFangSC-Medium, PingFang SC !important;
+    color: #FFFFFF !important;
+    border: 0 !important;
+}
+
+
+
+/* 粘底输入框 */
+.input-box {
+    position: fixed;
+    width: 100vw;
+    background-color: #F6F7F8;
+    left: 0;
+    bottom: 0;
+    z-index: 999999999999;
+}
+
+.input-text {
+    width: 710rpx;
+    height: 64rpx;
+    background-color: #ffffff;
+    border-radius: 32rpx;
+    margin: 20rpx auto 74rpx;
+    padding: 0 25rpx;
+    box-sizing: border-box;
+}
+
+/* 功能 */
+.functionalZone {
+    display: flex;
+    justify-content: space-around;
+    height: 40rpx;
+    width: 80vw;
+    margin: -54rpx auto 0;
+    padding-bottom: 26rpx;
+}
+
+.functionalZone image {
+    height: 100%;
+}

+ 79 - 0
pages/chatRoom/index.js

@@ -0,0 +1,79 @@
+// pages/chatRoom/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        iosX: false, //判断是否具有安全距离
+        optionItem: 0, //底部选中
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        let iosX = (getApp().globalData.safeAreaBottom == 0) ? false : true;
+        this.setData({
+            iosX
+        })
+    },
+    /* 底部选中 */
+    footerOption(e) {
+        const {
+            index
+        } = e.currentTarget.dataset;
+        console.log(index)
+        this.setData({
+            optionItem: index
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/chatRoom/index.json

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

+ 53 - 0
pages/chatRoom/index.wxml

@@ -0,0 +1,53 @@
+<!-- 搜索/新建 -->
+<view class="search-box">
+    <view class="search-input">
+        <image src="/static/icon-16.png"></image>
+        <input type="text" confirm-type='search' placeholder="搜索成员" placeholder-class="input-placeholder" />
+    </view>
+    <view class="newly-built">
+        <van-button custom-class='newButton'>
+            <image class="newly-built-icon" src="/static/icon-15.png"></image>创建
+        </van-button>
+    </view>
+</view>
+<!-- 个人聊天 -->
+<view style="margin-top: 30rpx;">
+    <view class="msg-box">
+        <navigator url="#" wx:for="{{15}}">
+            <view class="msgImg">
+                <image src="/static/tacitly-approve/MRproduct.png"></image>
+            </view>
+            <view class="borTop">
+                <view class="msgText">
+                    <view class="title u-line-1">王梅</view>
+                    <view class="msg u-line-1">你好你好你好你好你好你好</view>
+                </view>
+                <view class="msgCount">
+                    <view class="time u-line-1">上午 9:34</view>
+                    <view class="count u-line-1">
+                        <view>32</view>
+                    </view>
+                </view>
+            </view>
+        </navigator>
+    </view>
+    <!-- <My_pageReachBottom dummyStatus="{{msgList.length>0}}" loadMore='{{pageNumber>=pageTotal}}'></My_pageReachBottom> -->
+</view>
+<!-- 底部 -->
+<view class="footer">
+    <view style="display: flex;justify-content: space-around;">
+        <view class="option-item" data-index="0" catchtap="footerOption">
+            <image hidden="{{optionItem!=0}}" mode="heightFix" src="/static/chatRoom/one-to-one-ac.png"></image>
+            <image hidden="{{optionItem==0}}" mode="heightFix" src="/static/chatRoom/one-to-one.png"></image>
+            <view class="item-text">个聊</view>
+        </view>
+        <view class="option-item" data-index="1" catchtap="footerOption">
+            <image hidden="{{optionItem!=1}}" mode="heightFix" src="/static/chatRoom/group-of-people-ac.png"></image>
+            <image hidden="{{optionItem==1}}" mode="heightFix" src="/static/chatRoom/group-of-people.png"></image>
+            <view class="item-text">群聊</view>
+        </view>
+    </view>
+    <view wx:if="{{iosX}}" style="height: 34rpx;"></view>
+</view>
+<!-- 底部占位 -->
+<view style="height:{{iosX?'134':'100'}}rpx;"></view>

+ 146 - 0
pages/chatRoom/index.wxss

@@ -0,0 +1,146 @@
+page {
+    background-color: #ffffff;
+}
+
+/* 搜索框 */
+.search-box {
+    display: flex;
+    width: 100vw;
+    height: 60rpx;
+    margin-top: 30rpx;
+    padding: 0 24rpx;
+    box-sizing: border-box;
+}
+
+.search-input {
+    display: flex;
+    align-items: center;
+    width: 568rpx;
+    height: 60rpx;
+    background: #F6F7F8;
+    border-radius: 30rpx;
+    overflow: hidden;
+}
+
+.search-input>image {
+    width: 28rpx;
+    height: 28rpx;
+    margin-left: 24rpx;
+}
+
+.search-input>input {
+    flex: 1;
+    font-size: 28rpx !important;
+    height: 60rpx;
+    line-height: 60rpx;
+    margin-left: 10rpx;
+}
+
+.input-placeholder {
+    font-size: 28rpx !important;
+    color: rgba(0, 0, 0, .3) !important;
+    line-height: 40px;
+}
+
+/* 新建按钮 */
+.newButton {
+    width: 118rpx !important;
+    height: 60rpx !important;
+    background: #FFB600 !important;
+    border: 0 !important;
+    border-radius: 10rpx !important;
+    margin-left: 16rpx !important;
+    padding: 0 !important;
+    font-size: 28rpx !important;
+    font-family: PingFangSC-Medium, PingFang SC !important;
+    color: #FFFFFF !important;
+}
+
+.newly-built-icon {
+    width: 20rpx;
+    height: 20rpx;
+    margin-right: 4rpx;
+}
+
+/* 底部 */
+.footer {
+    position: fixed;
+    width: 100vw;
+    background: #FFFFFF;
+    box-shadow: 0px -2rpx 16rpx 0px rgba(0, 0, 0, 0.1);
+    bottom: 0;
+    left: 0;
+    padding: 14rpx 0 2rpx;
+}
+
+.option-item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    width: 80rpx;
+    height: 84rpx;
+}
+
+.option-item .item-text {
+    height: 34rpx;
+    font-size: 24rpx;
+    color: #000000;
+    line-height: 34rpx;
+    margin-top: 6rpx;
+}
+
+.option-item image {
+    width: 62rpx;
+    height: 44rpx;
+}
+
+@import "/pages/tabbar-pages/message/index.wxss";
+
+.msgImg {
+    border-radius: 50%;
+    overflow: hidden;
+}
+
+.msg-box {
+    border: 0 !important;
+}
+
+.msgCount {
+    width: 110rpx;
+    height: 100rpx;
+}
+
+.msgCount .time {
+    width: 110rpx;
+    height: 44rpx;
+    font-size: 24rpx;
+    font-weight: 400;
+    color: rgba(0, 0, 0, .4);
+    line-height: 44rpx;
+    text-align: right;
+}
+
+.msgCount .count {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    margin-top: 8rpx;
+    height: 40rpx;
+}
+
+.msgCount .count>view {
+    height: 30rpx;
+    line-height: 30rpx;
+    padding: 0 12rpx;
+    border-radius: 30rpx;
+    font-size: 24rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 550;
+    color: #FFFFFF;
+    background-color: #4DC2D4;
+}
+
+.borTop::after {
+    content: '';
+    height: 0rpx;
+}

+ 0 - 15
pages/liveStreaming/index.js

@@ -221,21 +221,6 @@ Page({
         accountMsg: res.data[0],
         isSy
       })
-      //获取授权地址
-      if (res.data[0].fisneedauth == 1) {
-        _Http.basic({
-          "accesstoken": wx.getStorageSync('userData').token,
-          "classname": "enterprise.live.live",
-          "method": "liveauthorization",
-          "content": {
-            "tliveid": res.data[0].tliveid
-          }
-        }).then(res => {
-          this.setData({
-            "accountMsg.fliveshowurl": res.msg
-          })
-        })
-      }
       //获取实时数据
       this.realTime()
       //直播场次列表查询

+ 14 - 0
project.private.config.json

@@ -191,6 +191,20 @@
                     "name": "门户供需详情",
                     "pathName": "pages/portal/details",
                     "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/chatRoom/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "对话框",
+                    "pathName": "pages/chatRoom/dialogbox",
+                    "query": "",
                     "scene": null,
                     "launchMode": "default"
                 }

BIN
static/chatRoom/group-of-people-ac.png


BIN
static/chatRoom/group-of-people.png


BIN
static/chatRoom/icon-01.png


BIN
static/chatRoom/icon-02.png


BIN
static/chatRoom/icon-03.png


BIN
static/chatRoom/one-to-one-ac.png


BIN
static/chatRoom/one-to-one.png


BIN
static/icon-15.png


BIN
static/icon-16.png


BIN
static/位图@2x.png


BIN
static/位图备份 2@2x.png