zhaoxiaohai 3 năm trước cách đây
mục cha
commit
7c5d128705

+ 3 - 1
app.json

@@ -57,7 +57,9 @@
         "pages/chatRoom/index",
         "pages/chatRoom/dialogbox",
         "pages/chatRoom/history",
-        "pages/portal/search"
+        "pages/portal/search",
+        "pages/chatRoom/create",
+        "pages/chatRoom/stats"
     ],
     "usingComponents": {
         "van-button": "@vant/weapp/button/index",

+ 89 - 0
pages/chatRoom/create.js

@@ -0,0 +1,89 @@
+// pages/chatRoom/create.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        inputValue: '', //群名
+        activeNames: ['1']
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    /* 编辑群名称 */
+    nameInput(e) {
+        const {
+            value
+        } = e.detail;
+        this.setData({
+            inputValue: value
+        })
+    },
+
+    /* 折叠面板 */
+    collapseChange(event) {
+        this.setData({
+            activeNames: event.detail,
+        });
+    },
+    /* 标题选择框 */
+    titleRadio(e) {
+        const {
+            index
+        } = e.target.dataset;
+        console.log(index)
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 8 - 0
pages/chatRoom/create.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "van-collapse": "@vant/weapp/collapse/index",
+    "van-collapse-item": "@vant/weapp/collapse-item/index",
+    "van-checkbox": "@vant/weapp/checkbox/index",
+    "van-checkbox-group": "@vant/weapp/checkbox-group/index"
+  }
+}

+ 35 - 0
pages/chatRoom/create.wxml

@@ -0,0 +1,35 @@
+<view class="box">
+    <!-- 编辑群名 -->
+    <view class="group-name">
+        <view class="name">
+            <text style="opacity: 0;">{{inputValue==''?'编辑群名':inputValue}}</text>
+            <input type="text" bindinput="nameInput" value="{{inputValue}}" placeholder="编辑群名" />
+        </view>
+        <image confirm-type='done' src="/static/icon-17.png"></image>
+    </view>
+    <!-- 搜索 -->
+    <view class="search">
+        <image src="/static/icon-16.png"></image>
+        <input type="text" placeholder="搜索" />
+    </view>
+    <!-- 人员选择 -->
+    <view class="choose">
+        <view class="title">
+            职位选择
+        </view>
+        <view style="flex: 1; max-height: 65vh;">
+            <scroll-view style="height: 100%; width: 100vw;" scroll-y>
+                <van-collapse custom-class="collapse-cus" value="{{ activeNames }}" bind:change="collapseChange">
+                    <van-collapse-item custom-class="collapse-item" wx:for="{{20}}" name="{{index}}">
+                        <view slot="title" class="collapse-title" name="{{index}}">
+                            <van-checkbox shape='round' value='true' icon-size="14px" checked-color="#4DC2D4" data-index="{{index}}" catchtap="titleRadio"><text class="u-line-1" data-index="{{index}}" style="max-width: 400rpx;display: inline-block;">复选框复选框复选框复选框复选框复选框复选框复选框复选框复选框</text></van-checkbox>
+                        </view>
+                        提供多样店铺模板,快速搭建网上商城
+                        <icon></icon>
+                    </van-collapse-item>
+                </van-collapse>
+            </scroll-view>
+        </view>
+        <van-button custom-class='vanBut'>立即创建</van-button>
+    </view>
+</view>

+ 132 - 0
pages/chatRoom/create.wxss

@@ -0,0 +1,132 @@
+page {
+    padding-bottom: 0 !important;
+    overflow: hidden;
+}
+
+.box {
+    display: flex;
+    flex-direction: column;
+    height: 100vh;
+    overflow: hidden;
+}
+
+/* 群聊名称 */
+.group-name {
+    display: flex;
+    align-items: center;
+    height: 84rpx;
+    width: 100vw;
+    background-color: #ffffff;
+    flex-shrink: 0;
+}
+
+.group-name .name {
+    position: relative;
+    height: 44rpx;
+    font-size: 32rpx;
+    color: #000000;
+    line-height: 44rpx;
+    opacity: .47;
+    margin-left: 40rpx;
+    max-width: 630rpx;
+}
+
+.group-name .name input {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    background-color: #ffffff;
+}
+
+.group-name image {
+    width: 26rpx;
+    height: 32rpx;
+    margin-left: 8rpx;
+}
+
+/* 搜索 */
+.search {
+    display: flex;
+    align-items: center;
+    width: 100vw;
+    height: 90rpx;
+    background-color: #ffffff;
+    margin-top: 10rpx;
+    flex-shrink: 0;
+}
+
+.search image {
+    width: 22rpx;
+    height: 22rpx;
+    margin: 0 6rpx 0 44rpx;
+}
+
+.search input {
+    height: 40rpx;
+    font-size: 28rpx;
+    line-height: 40rpx;
+    width: 635rpx;
+}
+
+/* 折叠面板 */
+.choose {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    width: 100vw;
+    background-color: #ffffff;
+    margin-top: 10rpx;
+    padding-top: 30rpx;
+}
+
+.choose .title {
+    width: 100vw;
+    height: 44rpx;
+    font-size: 32rpx;
+    color: #000000;
+    line-height: 44rpx;
+    margin-bottom: 40rpx;
+    padding-left: 40rpx;
+    box-sizing: border-box;
+    flex-shrink: 0;
+}
+
+.collapse-cus {
+    width: 630rpx;
+    margin: 0 auto;
+    border: 0 !important;
+}
+
+.collapse-item {
+    border: 0 !important;
+}
+
+.collapse-title {
+    display: flex;
+    align-items: center;
+    height: 102rpx;
+    font-size: 32rpx;
+    color: #000000;
+}
+
+.collapse-icon {
+    width: 28rpx;
+    height: 28rpx;
+}
+
+/* 按钮 */
+.vanBut {
+    width: 716rpx;
+    height: 84rpx;
+    background: #4BBECF !important;
+    border-radius: 10rpx !important;
+    border: 0 !important;
+    font-size: 32rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    color: #FFFFFF !important;
+    flex-shrink: 0;
+    margin-bottom: 60rpx;
+}

+ 19 - 3
pages/chatRoom/index.js

@@ -11,6 +11,7 @@ Page({
         iosX: false, //判断是否具有安全距离
         optionItem: 0, //底部选中
         reltionList: [], //沟通列表
+        discussionGroupList: [], //讨论组列表
     },
 
     /**
@@ -23,13 +24,19 @@ Page({
             iosX
         })
     },
+    /* 创建对话 */
+    createDialogue() {
+        wx.navigateTo({
+            url: './create',
+        })
+    },
     /* 进入对话 */
     enterTheDialogue(e) {
         const {
             item
         } = e.currentTarget.dataset;
         wx.navigateTo({
-          url: "./dialogbox?id=" + item.timdialogid
+            url: "./dialogbox?id=" + item.timdialogid
         })
     },
     /* 获取聊天列表 */
@@ -50,8 +57,18 @@ Page({
                 title: res.data,
                 icon: "none"
             });
+            let relationList = [],
+                discussionGroupList = [];
+            for (let i = 0; i < res.data.length; i++) {
+                if (res.data[i].fimdialogtype == '供需') {
+                    discussionGroupList.push(res.data[i])
+                } else {
+                    relationList.push(res.data[i])
+                }
+            }
             this.setData({
-                relationList: res.data
+                relationList,
+                discussionGroupList
             })
         })
     },
@@ -60,7 +77,6 @@ Page({
         const {
             index
         } = e.currentTarget.dataset;
-        console.log(index)
         this.setData({
             optionItem: index
         })

+ 30 - 4
pages/chatRoom/index.wxml

@@ -2,18 +2,18 @@
 <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" />
+        <input type="text" confirm-type='search' placeholder="{{optionItem==0?'搜索成员':'搜索群'}}" placeholder-class="input-placeholder" />
     </view>
     <view class="newly-built">
-        <van-button custom-class='newButton'>
+        <van-button custom-class='newButton' catchtap="createDialogue">
             <image class="newly-built-icon" src="/static/icon-15.png"></image>创建
         </van-button>
     </view>
 </view>
 <!-- 个人聊天 -->
-<view style="margin-top: 30rpx;">
+<view hidden="{{optionItem!=0}}" style="margin-top: 30rpx;">
     <view class="msg-box">
-        <navigator url="#" wx:for="{{relationList}}" data-item="{{item}}" bindtap="enterTheDialogue">
+        <navigator url="#" wx:for="{{relationList}}" wx:key="index" 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="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
@@ -34,6 +34,32 @@
     </view>
     <My_pageReachBottom dummyStatus="{{relationList.length>0}}" loadMore='{{5>=0}}'></My_pageReachBottom>
 </view>
+<!-- 讨论组 -->
+<view hidden="{{optionItem!=1}}" style="margin-top: 30rpx;">
+    <view class="msg-box">
+        <navigator url="#" wx:for="{{discussionGroupList}}" wx:key="index" 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="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
+            </view>
+            <view class="borTop">
+                <view class="msgText">
+                    <view class="title u-line-1">{{item.latestnews[0].fname}}</view>
+                    <view class="msg u-line-1">{{item.latestnews[0].message.ftype=='file'?'[图片]':item.latestnews[0].message.data.fcontent}}</view>
+                </view>
+                <view class="msgCount">
+                    <view class="time u-line-1">{{item.fjoindate}}</view>
+                    <view class="count u-line-1">
+                        <view wx:if="{{item.funreadmsgcount>0}}">{{item.funreadmsgcount}}</view>
+                    </view>
+                </view>
+            </view>
+        </navigator>
+    </view>
+    <My_pageReachBottom dummyStatus="{{relationList.length>0}}" loadMore='{{5>=0}}'></My_pageReachBottom>
+</view>
+
+
 <!-- 底部 -->
 <view class="footer">
     <view style="display: flex;justify-content: space-around;">

+ 72 - 0
pages/chatRoom/stats.js

@@ -0,0 +1,72 @@
+// pages/chatRoom/stats.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        tabsList: ['已读', '未读', '回复'],
+        tabsSelect: "已读"
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    tabsCallBack({
+        detail
+    }) {
+        this.setData({tabsSelect:detail})
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/chatRoom/stats.json

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

+ 17 - 0
pages/chatRoom/stats.wxml

@@ -0,0 +1,17 @@
+<view class="box">
+    <view class="tabs">
+        <My_RoundedCornerButtonTabs list='{{tabsList}}' bindtabsSelectedIitem='tabsCallBack' />
+    </view>
+    <view class="contents">
+        <view class="title">
+            合计{{tabsSelect}}:
+        </view>
+        <view class="list">
+            <view class="item" wx:for="{{30}}">
+                <image src="/static/changeImg.png"></image>
+                <text class="u-line-1">花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1</text>
+                20:35:45
+            </view>
+        </view>
+    </view>
+</view>

+ 62 - 0
pages/chatRoom/stats.wxss

@@ -0,0 +1,62 @@
+page {
+    padding: 0;
+}
+
+.box {
+    display: flex;
+    flex-direction: column;
+    min-height: 100vh;
+}
+
+.tabs {
+    width: 100vw;
+    height: 102rpx;
+    background-color: #ffffff;
+    margin-bottom: 10rpx;
+    flex-shrink: 0;
+    padding-top: 27rpx;
+    padding-left: 40rpx;
+    box-sizing: border-box;
+}
+
+.contents {
+    flex: 1;
+    width: 100vw;
+    background-color: #ffffff;
+}
+
+.contents .title {
+    height: 44rpx;
+    font-size: 32rpx;
+    color: #000000;
+    line-height: 44rpx;
+    box-sizing: border-box;
+    margin: 30rpx 0 30rpx 40rpx;
+}
+
+/* 列表 */
+.list {
+    width: 100vw;
+    padding-left: 60rpx;
+    box-sizing: border-box;
+}
+
+.list .item {
+    display: flex;
+    align-items: center;
+    height: 70rpx;
+    margin-bottom: 30rpx;
+}
+
+.list .item image {
+    width: 70rpx;
+    height: 70rpx;
+    border-radius: 50%;
+    margin-right: 20rpx;
+}
+
+.list .item text {
+    display: inline-block;
+    max-width: 400rpx;
+    margin-right: 15rpx;
+}

+ 14 - 0
project.private.config.json

@@ -240,6 +240,20 @@
                     "name": "门户搜索",
                     "pathName": "pages/portal/search",
                     "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "创建",
+                    "pathName": "pages/chatRoom/create",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "群聊数据统计",
+                    "pathName": "pages/chatRoom/stats",
+                    "query": "",
                     "scene": null,
                     "launchMode": "default"
                 }

BIN
static/icon-17.png


BIN
static/icon-18.png