智慧保安互联网APP
shuishen
2021-11-25 112036c6ba16ba4c3007832211ddc8bb9e92929f
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_app
9 files modified
2 files added
1136 ■■■■■ changed files
components/submit/submit.vue 1 ●●●● patch | view | raw | blame | history
pages/dispatch/receive.vue 4 ●●●● patch | view | raw | blame | history
pages/examine/addpeople.vue 13 ●●●● patch | view | raw | blame | history
pages/examine/addunit.vue 21 ●●●●● patch | view | raw | blame | history
pages/examine/examine.vue 1013 ●●●● patch | view | raw | blame | history
pages/groupChat/chating.vue 8 ●●●●● patch | view | raw | blame | history
pages/groupChat/chatingQZ.vue 70 ●●●● patch | view | raw | blame | history
pages/groupChat/groupChat.vue 5 ●●●● patch | view | raw | blame | history
static/start-audio.png patch | view | raw | blame | history
static/start-input.png patch | view | raw | blame | history
store/index.js 1 ●●●● patch | view | raw | blame | history
components/submit/submit.vue
@@ -262,7 +262,6 @@
                            latitude: res.latitude,
                            longitude: res.longitude
                        }
                        this.send(data, 3)
                        console.log('位置名称' + res.name)
                        console.log('详细地址' + res.address)
                        console.log('维度' + res.latitude)
pages/dispatch/receive.vue
@@ -14,7 +14,7 @@
                    </u-search>
                    <view v-show="newsList.length > 0">
                        <view class="inTmain" v-for="(item,index) in newsList">
                        <view class="inTmain" v-for="(item,index) in newsList" :key="index">
                            <u-card :title="item.content" @click="goDetail(item)">
                                <view class="" slot="body">
                                    <view>
@@ -121,7 +121,7 @@
                }
                uni.request({
                    url: this.$store.state.piAPI + "/directive/page?receiveDirectiveIds=" + this.$store.state
                    url: this.$store.state.piAPI + "/directive/page?sendDirectiveId=" + this.$store.state
                        .puserID,
                    method: "get",
                    data: {
pages/examine/addpeople.vue
@@ -118,7 +118,6 @@
        methods: {
            peopleClick() {
                uni.request({
                    url: this.$store.state.piAPI + "/blade-user/seleL",
                    method: "get",
@@ -152,7 +151,6 @@
            },
            peopleConfirm(e) {
                this.form.people = e[0].value
                this.form.peopleText = e[0].label
            },
@@ -183,6 +181,17 @@
                this.$refs.uForm.validate(valid => {
                    if (valid) {
                        let d = {
                            examinerId: this.createData.Id,
                            examinerDeptId: this.createData.dept_id,
                            // realname: this.form.peopleText,
                            // sname: this.form.unitText,
                            securityId: this.form.people,
                            // reviewtime: this.getCurrentTime(),
                            content: this.form.content,
                            result: this.form.outcome,
                            url: imgurl
                        };
                        uni.request({
                            url: this.$store.state.piAPI + "/seinspect/save",
                            method: "post",
pages/examine/addunit.vue
@@ -15,7 +15,7 @@
                    <u-input v-model="form.unitText" type="select" placeholder="请选择被检查单位" :border="false"
                        @click="unitClick" />
                    <u-select v-model="unitShow" mode="single-column" :list="unitList" @confirm="unitConfirm">
                    <u-select v-model="unitShow" mode="mutil-column-auto" :list="unitList" @confirm="unitConfirm">
                    </u-select>
                </u-form-item>
@@ -177,7 +177,24 @@
                    }
                })
                this.$refs.uForm.validate(valid => {
                    if (valid) {
                    if (valid && this.form.unit != 112233) {
                        let d = {
                            // name: this.createData.nick_name,
                            // deptname: this.createData.deptName,
                            // sname: this.form.unitText,
                            // reviewtime: this.getCurrentTime(),
                            // insid: this.form.content,
                            // results: this.form.outcome,
                            // url: imgurl
                            examinerId: this.createData.Id,
                            examinerDeptId: this.createData.dept_id,
                            reviewedDeptId: this.form.unit,
                            // reviewtime: this.getCurrentTime(),
                            insid: this.form.content,
                            results: this.form.outcome,
                            url: imgurl
                        };
                        console.log(d, "dddddddddddddddddd")
                        uni.request({
                            url: this.$store.state.piAPI + "/coinspect/save",
                            method: "post",
pages/examine/examine.vue
@@ -1,572 +1,619 @@
<template>
    <view class="page-container" style="height: 100%; position: relative;">
        <view class="head top-absolute">
            <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title=""
                :background="{ background: '#0BB9C8' }">
                <view class="nav-wrap">
    <view class="page-container"
          style="height: 100%; position: relative;">
        <view class="head top-absolute">
            <u-navbar :is-fixed="false"
                      :border-bottom="false"
                      :is-back="false"
                      title=""
                      :background="{ background: '#0BB9C8' }">
                <view class="nav-wrap">
                    <view style="position: relative;">
                    <view style="position: relative;">
                        <view class="btn-return-box">
                            <view class="btn-return">
                                <i class="uni-btn-icon" @click="goReturnPage"
                                    style="color: rgb(255, 255, 255); font-size: 27px;"></i>
                            </view>
                        </view>
                        <view class="btn-return-box">
                            <view class="btn-return">
                                <i class="uni-btn-icon"
                                   @click="goReturnPage"
                                   style="color: rgb(255, 255, 255); font-size: 27px;"></i>
                            </view>
                        </view>
                        <span class="header-title">现场检查</span>
                        <span class="header-title">现场检查</span>
                        <u-icon v-if="$store.state.UserData.rname[0].indexOf('保安') == -1" @click="goToAddPage" top='4'
                            class="header-add" name="plus" color="#fff">
                        </u-icon>
                        <u-icon v-if="$store.state.UserData.rname[0].indexOf('保安') == -1"
                                @click="goToAddPage"
                                top='4'
                                class="header-add"
                                name="plus"
                                color="#fff">
                        </u-icon>
                    </view>
                    </view>
                </view>
            </u-navbar>
        </view>
        <view class="head">
            <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title=""
                :background="{ background: '#0BB9C8' }">
                <view class="nav-wrap">
                </view>
            </u-navbar>
        </view>
        <view class="head">
            <u-navbar :is-fixed="false"
                      :border-bottom="false"
                      :is-back="false"
                      title=""
                      :background="{ background: '#0BB9C8' }">
                <view class="nav-wrap">
                    <view style="position: relative;">
                    <view style="position: relative;">
                        <view class="btn-return-box">
                            <view class="btn-return">
                                <i class="uni-btn-icon" @click="goReturnPage"
                                    style="color: rgb(255, 255, 255); font-size: 27px;"></i>
                            </view>
                        </view>
                        <view class="btn-return-box">
                            <view class="btn-return">
                                <i class="uni-btn-icon"
                                   @click="goReturnPage"
                                   style="color: rgb(255, 255, 255); font-size: 27px;"></i>
                            </view>
                        </view>
                        <span class="header-title">现场检查</span>
                        <span class="header-title">现场检查</span>
                        <u-icon @click="goToAddPage" top='4' class="header-add" name="plus" color="#fff">
                        </u-icon>
                        <u-icon @click="goToAddPage"
                                top='4'
                                class="header-add"
                                name="plus"
                                color="#fff">
                        </u-icon>
                    </view>
                    </view>
                </view>
            </u-navbar>
        </view>
                </view>
            </u-navbar>
        </view>
        <view class="wrapper">
        <view class="wrapper">
            <view class="body">
            <view class="body">
                <view class="body-content">
                <view class="body-content">
                    <u-tabs :list="list" :is-scroll="false" :current="current" active-color="#14B9C8"
                        inactive-color="#595959" height="100" @change="change"></u-tabs>
                    <u-tabs :list="list"
                            :is-scroll="false"
                            :current="current"
                            active-color="#14B9C8"
                            inactive-color="#595959"
                            height="100"
                            @change="change"></u-tabs>
                    <u-search v-show="current == 0" v-model='keyValue' placeholder='请输入被检查保安员名称' shape="round"
                        class="u-search" input-align="center" height="70" @search='searchValue' @custom='searchValue'
                        @clear='clearValue' @change='changeValue'>
                    </u-search>
                    <u-search v-show="current == 0"
                              v-model='keyValue'
                              placeholder='请输入被检查保安员名称'
                              shape="round"
                              class="u-search"
                              input-align="center"
                              height="70"
                              @search='searchValue'
                              @custom='searchValue'
                              @clear='clearValue'
                              @change='changeValue'>
                    </u-search>
                    <u-search v-show="current == 1" v-model='keyValue' placeholder='请输入被检查公司名称' shape="round"
                        class="u-search" input-align="center" height="70" @search='searchValue' @custom='searchValue'
                        @clear='clearValue' @change='changeValue'>
                    </u-search>
                    <u-search v-show="current == 1"
                              v-model='keyValue'
                              placeholder='请输入被检查公司名称'
                              shape="round"
                              class="u-search"
                              input-align="center"
                              height="70"
                              @search='searchValue'
                              @custom='searchValue'
                              @clear='clearValue'
                              @change='changeValue'>
                    </u-search>
                    <view v-show="current == 0 && newsList.length > 0">
                        <view class="inTmain" v-for="(item,index) in newsList">
                            <u-card :title="item.realname" @click="goDetail(item)">
                                <view class="" slot="body">
                                    <view>
                                        <view style="margin-bottom: 10px;" class="u-body-item-title u-line-1">
                                            检查人姓名:{{item.inspectman}}
                                        </view>
                                    </view>
                                    <view>
                                        <view class="u-body-item-title u-line-1">
                                            检查人单位:{{item.deptname}}</view>
                                    </view>
                                </view>
                                <view class="" slot="foot">
                                    </u-icon>检查日期:{{item.reviewtime}}</view>
                            </u-card>
                        </view>
                        <u-loadmore class='msg' :status="status" />
                    </view>
                    <view v-show="current == 0 && newsList.length > 0">
                        <view class="inTmain"
                              v-for="(item,index) in newsList"
                              :key="index">
                            <u-card :title="item.realname"
                                    @click="goDetail(item)">
                                <view class=""
                                      slot="body">
                                    <view>
                                        <view style="margin-bottom: 10px;"
                                              class="u-body-item-title u-line-1">
                                            检查人姓名:{{item.realName}}
                                        </view>
                                    </view>
                                    <view>
                                        <view class="u-body-item-title u-line-1">
                                            检查人单位:{{item.examinerDeptName}}</view>
                                    </view>
                                </view>
                                <view class=""
                                      slot="foot">
                                    </u-icon>检查日期:{{item.reviewtime}}</view>
                            </u-card>
                        </view>
                        <u-loadmore class='msg'
                                    :status="status" />
                    </view>
                    <view v-show="current == 1 && newsList.length > 0">
                        <view class="inTmain" v-for="(item,index) in newsList">
                            <u-card :title="item.sname" @click="goDetail(item)">
                                <view class="" slot="body">
                                    <view>
                                        <view style="margin-bottom: 10px;" class="u-body-item-title u-line-1">
                                            检查人姓名:{{item.name}}
                                        </view>
                                    </view>
                                    <view>
                                        <view class="u-body-item-title u-line-1">
                                            检查人单位:{{item.deptname}}</view>
                                    </view>
                                </view>
                                <view class="" slot="foot">
                                    </u-icon>检查日期:{{item.reviewtime}}</view>
                            </u-card>
                        </view>
                        <u-loadmore class='msg' :status="status" />
                    </view>
                    <view v-show="current == 1 && newsList.length > 0">
                        <view class="inTmain"
                              v-for="(item,index) in newsList"
                              :key="index">
                            <u-card :title="item.reviewedDeptName"
                                    @click="goDetail(item)">
                                <view class=""
                                      slot="body">
                                    <view>
                                        <view style="margin-bottom: 10px;"
                                              class="u-body-item-title u-line-1">
                                            检查人姓名:{{item.realName}}
                                        </view>
                                    </view>
                                    <view>
                                        <view class="u-body-item-title u-line-1">
                                            检查人单位:{{item.examinerDeptName}}</view>
                                    </view>
                                </view>
                                <view class=""
                                      slot="foot">
                                    </u-icon>检查日期:{{item.reviewtime}}</view>
                            </u-card>
                        </view>
                        <u-loadmore class='msg'
                                    :status="status" />
                    </view>
                    <view class="msg" v-show='newsList.length == 0'>
                        暂无数据
                    </view>
                    <view class="msg"
                          v-show='newsList.length == 0'>
                        暂无数据
                    </view>
                </view>
                </view>
            </view>
            </view>
        </view>
    </view>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
export default {
    data () {
        return {
                list: [{
                        name: '保安员检查列表'
                    },
                    {
                        name: '单位检查列表'
                    }
                ],
            list: [{
                name: '保安员检查列表'
            },
            {
                name: '单位检查列表'
            }
            ],
                current: 0,
            current: 0,
                dataList: [],
                newsList: [],
            dataList: [],
            // newsList: [],
                status: 'loadmore',
                keyValue: '',
            status: 'loadmore',
            keyValue: '',
                dataList: [],
                newsList: [],
                pagelist: 0,
                pages: 0,
                flag: true,
            dataList: [],
            newsList: [],
            pagelist: 0,
            pages: 0,
            flag: true,
                pullDown: false
            pullDown: false
            };
        },
        onLoad() {
        };
    },
    onLoad () {
        },
        onReachBottom() {
            var that = this;
    },
    onReachBottom () {
        var that = this;
            if (that.flag == false) {
                that.status = 'nomore';
                return
            }
            // 后续将改为与后端联动
            that.status = 'loading';
        if (that.flag == false) {
            that.status = 'nomore';
            return
        }
        // 后续将改为与后端联动
        that.status = 'loading';
            setTimeout(() => {
                if (that.current == 0) {
                    that.getReceive();
                } else {
                    that.getSend();
                }
            }, 1000);
        },
        setTimeout(() => {
            if (that.current == 0) {
                that.getReceive();
            } else {
                that.getSend();
            }
        }, 1000);
    },
        onPullDownRefresh: function() {
            var that = this;
    onPullDownRefresh: function () {
        var that = this;
            this.pullDown = true;
            this.pagelist = 0;
            this.pages = 0;
            this.flag = true;
            this.dataList = [];
            this.newsList = [];
            this.status = 'loading';
            this.keyValue = '';
            setTimeout(() => {
                if (that.current == 0) {
                    that.getReceive();
                } else {
                    that.getSend();
                }
            }, 1000)
        this.pullDown = true;
        this.pagelist = 0;
        this.pages = 0;
        this.flag = true;
        this.dataList = [];
        this.newsList = [];
        this.status = 'loading';
        this.keyValue = '';
        setTimeout(() => {
            if (that.current == 0) {
                that.getReceive();
            } else {
                that.getSend();
            }
        }, 1000)
        },
    },
        mounted() {
            this.getReceive();
        },
        methods: {
            getReceive() {
                var that = this;
    mounted () {
        this.getReceive();
    },
    methods: {
        getReceive () {
            var that = this;
                if (that.pagelist < that.pages || that.pagelist == 0) {
                    that.pagelist++
                } else if (that.pagelist == that.pages) {
                    that.flag = false
                    that.status = 'nomore';
                    return
                }
            if (that.pagelist < that.pages || that.pagelist == 0) {
                that.pagelist++
            } else if (that.pagelist == that.pages) {
                that.flag = false
                that.status = 'nomore';
                return
            }
                uni.request({
                    url: this.$store.state.piAPI + "/seinspect/list",
                    method: "get",
                    data: {
                        deptId: this.$store.state.UserData
                            .dept_id,
                        current: that.pagelist,
                        size: 10
                    },
                    success: (res) => {
                        that.pages = res.data.data.pages;
            uni.request({
                url: this.$store.state.piAPI + "/seinspect/page",
                method: "get",
                data: {
                    deptId: this.$store.state.UserData
                        .dept_id,
                    current: that.pagelist,
                    size: 10
                },
                success: (res) => {
                    that.pages = res.data.data.pages;
                        var resdata = res.data.data.records;
                    var resdata = res.data.data.records;
                        if (this.pullDown == true) {
                            this.pullDown = false;
                            uni.stopPullDownRefresh();
                        }
                    if (this.pullDown == true) {
                        this.pullDown = false;
                        uni.stopPullDownRefresh();
                    }
                        if (resdata.length == 0) {
                            that.flag = false
                            that.status = 'nomore';
                            return
                        } else {
                            resdata.forEach(item => {
                                that.newsList.push(item)
                                that.dataList.push(item)
                            })
                        }
                    if (resdata.length == 0) {
                        that.flag = false
                        that.status = 'nomore';
                        return
                    } else {
                        if (that.pagelist == that.pages) {
                            that.flag = false
                            that.status = 'nomore';
                            return
                        }
                        resdata.forEach(item => {
                            that.newsList.push(item)
                            that.dataList.push(item)
                        })
                    }
                    }
                });
            },
            getSend() {
                var that = this;
                    if (that.pagelist == that.pages) {
                        that.flag = false
                        that.status = 'nomore';
                        return
                    }
                if (that.pagelist < that.pages || that.pagelist == 0) {
                    that.pagelist++
                } else if (that.pagelist == that.pages) {
                    that.flag = false
                    that.status = 'nomore';
                    return
                }
                }
            });
        },
        getSend () {
            var that = this;
                uni.request({
                    url: this.$store.state.piAPI + "/coinspect/list?deptId=" + this.$store.state.UserData
                        .dept_id + '&userId=' + this.$store.state.puserID,
                    method: "get",
                    data: {
                        current: that.pagelist,
                        size: 10
                    },
                    success: (res) => {
                        that.pages = res.data.data.pages;
            if (that.pagelist < that.pages || that.pagelist == 0) {
                that.pagelist++
            } else if (that.pagelist == that.pages) {
                that.flag = false
                that.status = 'nomore';
                return
            }
                        var resdata = res.data.data.records;
            uni.request({
                // url: this.$store.state.piAPI + "/coinspect/page?deptId=" + this.$store.state.UserData
                //     .dept_id + '&userId=' + this.$store.state.puserID,
                url: this.$store.state.piAPI + "/coinspect/page",
                method: "get",
                data: {
                    current: that.pagelist,
                    size: 10
                },
                success: (res) => {
                    that.pages = res.data.data.pages;
                        if (this.pullDown == true) {
                            this.pullDown = false;
                            uni.stopPullDownRefresh();
                        }
                    var resdata = res.data.data.records;
                        if (resdata.length == 0) {
                            that.flag = false
                            that.status = 'nomore';
                            return
                        } else {
                            resdata.forEach(item => {
                                that.newsList.push(item)
                                that.dataList.push(item)
                            })
                        }
                    if (this.pullDown == true) {
                        this.pullDown = false;
                        uni.stopPullDownRefresh();
                    }
                        if (that.pagelist == that.pages) {
                            that.flag = false
                            that.status = 'nomore';
                            return
                        }
                    if (resdata.length == 0) {
                        that.flag = false
                        that.status = 'nomore';
                        return
                    } else {
                        resdata.forEach(item => {
                            that.newsList.push(item)
                            that.dataList.push(item)
                        })
                    }
                    console.log(that.newsList)
                    if (that.pagelist == that.pages) {
                        that.flag = false
                        that.status = 'nomore';
                        return
                    }
                    }
                });
            },
            goDetail(item) {
                if (this.current == 0) {
                    uni.navigateTo({
                        url: './peopleDetail?detailData=' + JSON.stringify(item)
                    });
                } else {
                    uni.navigateTo({
                        url: './unitDetail?detailData=' + JSON.stringify(item)
                    });
                }
            },
            change(index) {
                if (this.current == index) return;
                this.dataList = [];
                this.newsList = [];
                this.pagelist = 0;
                this.pages = 0;
                this.flag = true;
                this.current = index;
                this.keyValue = "";
                if (index == 0) {
                    this.getReceive();
                } else {
                    this.getSend();
                }
            },
            searchValue(value) {
                var that = this;
                var str = value.replace(/\s*/g, "");
                if (str == '') {
                    return
                } else {
                    that.newsList = [];
                }
            });
        },
        goDetail (item) {
            if (this.current == 0) {
                uni.navigateTo({
                    url: './peopleDetail?detailData=' + JSON.stringify(item)
                });
            } else {
                uni.navigateTo({
                    url: './unitDetail?detailData=' + JSON.stringify(item)
                });
            }
        },
        change (index) {
            if (this.current == index) return;
            this.dataList = [];
            this.newsList = [];
            this.pagelist = 0;
            this.pages = 0;
            this.flag = true;
            this.current = index;
            this.keyValue = "";
            if (index == 0) {
                this.getReceive();
            } else {
                this.getSend();
            }
        },
        searchValue (value) {
            var that = this;
            var str = value.replace(/\s*/g, "");
            if (str == '') {
                return
            } else {
                that.newsList = [];
                    if (that.current == 0) {
                        uni.request({
                            url: this.$store.state.piAPI + "/seinspect/list",
                            method: "get",
                            data: {
                                current: 1,
                                size: 999999,
                                realName: str
                            },
                            success: (res) => {
                                var resdata = res.data.data.records;
                if (that.current == 0) {
                    uni.request({
                        url: this.$store.state.piAPI + "/seinspect/page",
                        method: "get",
                        data: {
                            current: 1,
                            size: 999999,
                            realName: str
                        },
                        success: (res) => {
                            var resdata = res.data.data.records;
                                resdata.forEach(item => {
                                    that.newsList.push(item)
                                })
                            resdata.forEach(item => {
                                that.newsList.push(item)
                            })
                            }
                        });
                    } else {
                        uni.request({
                            url: this.$store.state.piAPI + "/coinspect/list?deptId=" + this.$store.state.UserData
                                .dept_id + '&userId=' + this.$store.state.puserID,
                            method: "get",
                            data: {
                                current: 1,
                                size: 999999,
                                sname: str
                            },
                            success: (res) => {
                                var resdata = res.data.data.records;
                        }
                    });
                } else {
                    uni.request({
                        url: this.$store.state.piAPI + "/coinspect/page?deptId=" + this.$store.state.UserData
                            .dept_id + '&userId=' + this.$store.state.puserID,
                        method: "get",
                        data: {
                            current: 1,
                            size: 999999,
                            sname: str
                        },
                        success: (res) => {
                            var resdata = res.data.data.records;
                                resdata.forEach(item => {
                                    that.newsList.push(item)
                                })
                            resdata.forEach(item => {
                                that.newsList.push(item)
                            })
                            }
                        });
                    }
                        }
                    });
                }
                    that.flag = false
                    that.status = 'nomore';
                }
            },
            clearValue() {
                this.keyValue = ''
                this.newsList = [];
                that.flag = false
                that.status = 'nomore';
            }
        },
        clearValue () {
            this.keyValue = ''
            this.newsList = [];
                this.dataList.forEach(item => {
                    this.newsList.push(item)
                })
            this.dataList.forEach(item => {
                this.newsList.push(item)
            })
                if (this.pagelist < this.pages) {
                    this.flag = true;
                    this.status = 'loading';
                } else {
                    this.flag = false;
                    this.status = 'nomore';
                }
            },
            changeValue(value) {
                if (value == '') {
                    this.newsList = [];
            if (this.pagelist < this.pages) {
                this.flag = true;
                this.status = 'loading';
            } else {
                this.flag = false;
                this.status = 'nomore';
            }
        },
        changeValue (value) {
            if (value == '') {
                this.newsList = [];
                    this.dataList.forEach(item => {
                        this.newsList.push(item)
                    })
                this.dataList.forEach(item => {
                    this.newsList.push(item)
                })
                    if (this.pagelist < this.pages) {
                        this.flag = true;
                        this.status = 'loading';
                    } else {
                        this.flag = false;
                        this.status = 'nomore';
                    }
                }
            },
            goReturnPage() {
                uni.switchTab({
                    url: '/pages/home/home'
                });
            },
            goToAddPage() {
                if (this.current == 0) {
                    uni.navigateTo({
                        url: './addpeople'
                    });
                } else {
                    uni.navigateTo({
                        url: './addunit'
                    });
                }
            },
        }
    };
                if (this.pagelist < this.pages) {
                    this.flag = true;
                    this.status = 'loading';
                } else {
                    this.flag = false;
                    this.status = 'nomore';
                }
            }
        },
        goReturnPage () {
            uni.switchTab({
                url: '/pages/home/home'
            });
        },
        goToAddPage () {
            if (this.current == 0) {
                uni.navigateTo({
                    url: './addpeople'
                });
            } else {
                uni.navigateTo({
                    url: './addunit'
                });
            }
        },
    }
};
</script>
<style lang="scss">
    .page-container {
        position: fixed;
        display: block;
        width: 100%;
        max-height: 100vh;
.page-container {
    position: fixed;
    display: block;
    width: 100%;
    max-height: 100vh;
    .head {
        position: relative;
        width: 100%;
        .head {
            position: relative;
        .nav-wrap {
            width: 100%;
            height: 44px;
            line-height: 30px;
            padding: 7px 3px;
            height: calc(44px + constant(safe-area-inset-top));
            height: calc(44px + env(safe-area-inset-top));
            color: rgb(255, 255, 255);
            .btn-return-box {
                display: flex;
                align-items: center;
                font-size: 16px;
                box-sizing: border-box;
            width: 100%;
                .btn-return {
                    position: relative;
                    width: auto;
                    margin: 0 2px;
                    word-break: keep-all;
                    white-space: pre;
                    cursor: pointer;
                }
            }
            .header-title {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                margin: auto;
                width: 60%;
                font-weight: 700;
                line-height: 30px;
                font-size: 16px;
                opacity: 1;
                text-overflow: ellipsis;
                text-align: center;
                min-width: 1em;
            }
            .nav-wrap {
                width: 100%;
                height: 44px;
                line-height: 30px;
                padding: 7px 3px;
                height: calc(44px + constant(safe-area-inset-top));
                height: calc(44px + env(safe-area-inset-top));
                color: rgb(255, 255, 255);
            .header-add {
                position: absolute;
                top: 0;
                left: auto;
                right: 10px;
                bottom: 0;
                margin: auto;
                display: inline-block;
                font: normal normal normal 14px/1 unibtn;
                text-rendering: auto;
                -webkit-font-smoothing: antialiased;
                font-size: 24px;
            }
        }
    }
                .btn-return-box {
                    display: flex;
                    align-items: center;
                    font-size: 16px;
                    box-sizing: border-box;
    .top-absolute {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 101;
    }
                    .btn-return {
                        position: relative;
                        width: auto;
                        margin: 0 2px;
                        word-break: keep-all;
                        white-space: pre;
                        cursor: pointer;
                    }
                }
    .wrapper {
        width: 100%;
        display: block;
        height: calc(100% - 44px);
        height: calc(100% - 44px - constant(safe-area-inset-top));
        height: calc(100% - 44px - env(safe-area-inset-top));
                .header-title {
                    position: absolute;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    margin: auto;
                    width: 60%;
                    font-weight: 700;
                    line-height: 30px;
                    font-size: 16px;
                    opacity: 1;
                    text-overflow: ellipsis;
                    text-align: center;
                    min-width: 1em;
                }
        .body {
            width: 100%;
            height: 100%;
            overflow-x: hidden;
            overflow-y: auto;
                .header-add {
                    position: absolute;
                    top: 0;
                    left: auto;
                    right: 10px;
                    bottom: 0;
                    margin: auto;
                    display: inline-block;
                    font: normal normal normal 14px/1 unibtn;
                    text-rendering: auto;
                    -webkit-font-smoothing: antialiased;
                    font-size: 24px;
                }
            }
            .body-content {
                height: auto;
            }
        }
    }
}
        }
.u-card-wrap {
    background-color: $u-bg-color;
    padding: 1px;
}
        .top-absolute {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 101;
        }
.u-body-item {
    font-size: 32rpx;
    color: #333;
    padding: 20rpx 10rpx;
}
        .wrapper {
.u-body-item image {
    width: 120rpx;
    flex: 0 0 120rpx;
    height: 120rpx;
    border-radius: 8rpx;
    margin-left: 12rpx;
}
            width: 100%;
            display: block;
            height: calc(100% - 44px);
            height: calc(100% - 44px - constant(safe-area-inset-top));
            height: calc(100% - 44px - env(safe-area-inset-top));
.u-search {
    padding: 20rpx 30rpx 0 30rpx;
}
            .body {
                width: 100%;
                height: 100%;
                overflow-x: hidden;
                overflow-y: auto;
.inTmain {
}
                .body-content {
                    height: auto;
                }
            }
        }
    }
    .u-card-wrap {
        background-color: $u-bg-color;
        padding: 1px;
    }
    .u-body-item {
        font-size: 32rpx;
        color: #333;
        padding: 20rpx 10rpx;
    }
    .u-body-item image {
        width: 120rpx;
        flex: 0 0 120rpx;
        height: 120rpx;
        border-radius: 8rpx;
        margin-left: 12rpx;
    }
    .u-search {
        padding: 20rpx 30rpx 0 30rpx;
    }
    .inTmain {}
    .msg {
        height: 72rpx;
        line-height: 72rpx;
        text-align: center;
        color: #999;
    }
.msg {
    height: 72rpx;
    line-height: 72rpx;
    text-align: center;
    color: #999;
}
</style>
pages/groupChat/chating.vue
@@ -145,7 +145,6 @@
            console.log(data, 55555555555555555555555)
            this.name = ['wo', option.chatID];
            // console.log(data)
            if (typeof data.recipientName == "undefined") {
                this.callName = data.realName;
            } else {
@@ -247,6 +246,7 @@
                                that.recAvatar = resdata[i].avatar;
                                that.recName = resdata[i].realName;
                            }
                        }
                        let msg = res.data.data.chatRecordsIPage
                        that.getData = msg;
@@ -282,6 +282,7 @@
                            }
                            that.msgs.unshift(msg[i])
                        }
                        that.$nextTick(() => {
@@ -390,7 +391,6 @@
                    mesagess = e.message
                }
                uni.request({
                    url: this.$store.state.piAPI + "/chat-records/insertSingleChat",
                    method: "post",
@@ -410,6 +410,9 @@
                });
                this.msgs.push(sendMsg)
                console.log(this.msgs, 789)
                this.$nextTick(() => {
                    this.scrollToView = 'msg' + len
                })
@@ -421,7 +424,6 @@
            heights(e) {
                this.inputh = e
                this.goBottom()
                // console.log('高度' + e)
            },
            // 滚动到底部
            goBottom() {
pages/groupChat/chatingQZ.vue
@@ -37,10 +37,12 @@
                            </view>
                            <!-- voice -->
                            <view class="message" v-if="item.message_type == 2">
                                <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 'px'}"
                                    @tap="playVoice(item.post_message.voice)">
                                <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 60 + 'px'}"
                                    @tap="playVoice(item.post_message)">
                                    <image src="../../static/images/chatroom/sound.png" mode="" class="voice-img" />
                                    {{ item.post_message.time }} "
                                    {{ item.post_message.time }}"
                                </view>
                            </view>
                            <!-- location -->
@@ -66,9 +68,9 @@
                        </view>
                        <!-- voice -->
                        <view class="message" v-if="item.message_type == 2">
                            <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 'px'}"
                                @tap="playVoice(item.post_message.voice)">
                                {{ item.post_message.time }} "
                            <view class="msg-text voice" :style="{width:item.post_message.time * 4 + 60 + 'px'}"
                                @tap="playVoice(item.post_message)">
                                {{ item.post_message.time }}"
                                <image src="@/static/images/chatroom/sound.png" mode="" class="voice-img" />
                            </view>
                        </view>
@@ -101,7 +103,6 @@
    import filter from '@/config/filter.js'
    import submit from '@/components/submit/submit.vue'
    import WxStorage from "../../static/lib/wxStorage.js"
    const innerAudioContext = uni.createInnerAudioContext()
    export default {
        data() {
@@ -256,6 +257,12 @@
                                msg[i].message = '../../static/images/index/friend-list/' + msg[i].message
                                that.imgMsg.unshift(msg[i].message)
                            }
                            if (that.isJSON(msg[i].post_message) == true) {
                                msg[i].post_message = JSON.parse(msg[i].post_message)
                            }
                            that.msgs.unshift(msg[i])
                        }
@@ -269,11 +276,32 @@
                        this.isload = true
                        // 开启加载
                        this.begainloading = true
                        console.log(that.msgs, 456)
                    }
                })
            },
            isJSON(str) {
                if (typeof str == 'string') {
                    try {
                        var obj = JSON.parse(str);
                        if (typeof obj == 'object' && obj) {
                            return true;
                        } else {
                            return false;
                        }
                    } catch (e) {
                        return false;
                    }
                }
            },
            // 预览图片
            previewImage(e) {
@@ -299,12 +327,20 @@
            },
            // 音频播放
            playVoice(e) {
                console.log('ok')
                innerAudioContext.src = e
                var innerAudioContext = this.innerAudioContext = uni.createInnerAudioContext()
                // innerAudioContext.autoplay = false
                innerAudioContext.src = e.voice
                innerAudioContext.play()
                setTimeout(() => {
                    innerAudioContext.destroy()
                }, e.time * 1000)
            },
            // 接收输入内容
            inputs(e) {
                console.log(e, 123)
                var that = this;
                this.isanimation = true
                let len = this.msgs.length - 1
@@ -318,19 +354,27 @@
                let sendMsg = {
                    sender_id: that.senId,
                    post_message: e.message,
                    message_type: 0,
                    message_type: e.types,
                    status: 0,
                    post_time: nowTime,
                    avatar: that.senAvatar
                }
                var mesagess = null;
                if (e.message instanceof Object) {
                    mesagess = JSON.stringify(e.message)
                } else {
                    mesagess = e.message
                }
                uni.request({
                    url: this.$store.state.piAPI + "/chatgroupc/submit",
                    method: "post",
                    data: {
                        senderId: that.senId,
                        postMessage: e.message,
                        messageType: 0,
                        postMessage: mesagess,
                        messageType: e.types,
                        status: 0,
                        postTime: sentTime,
                        gid: that.recipientId
pages/groupChat/groupChat.vue
@@ -313,9 +313,12 @@
            }
        },
        mounted() {
        },
        onShow() {
            this.beginObj();
            this.getdataList(0);
        },
        onPageScroll(e) {
            this.rect = e.scrollTop
static/start-audio.png
static/start-input.png
store/index.js
@@ -34,6 +34,7 @@
        },
        logPath: '',
        piAPI: 'http://223.82.109.183:2080/api',
        // piAPI: 'http://192.168.0.114:81',
        api: 'http://223.82.109.183:2080/api',
        // piAPI: 'http://localhost:81/',
        // piAPI: 'http://192.168.0.108:81',