Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_app
| New file |
| | |
| | | // 获取服务按钮数据 |
| | | export function fakeServiceButton() { |
| | | return new Promise((resolute, reject) => { |
| | | try { |
| | | const list = [{ |
| | | name: '下发指令查询', |
| | | img: '/static/images/dispatch/up-down.png', |
| | | url: '../dispatch/send' |
| | | }, |
| | | { |
| | | name: '接收指令查询', |
| | | img: '/static/images/dispatch/look.png', |
| | | url: '../dispatch/receive' |
| | | }, |
| | | { |
| | | name: '文字指令下发', |
| | | img: '/static/images/dispatch/issue.png', |
| | | url: '../dispatch/text' |
| | | }, |
| | | { |
| | | name: '图片指令下发', |
| | | img: '/static/images/dispatch/imgissue.png', |
| | | url: '../dispatch/imgissue' |
| | | } |
| | | ]; |
| | | resolute(list); |
| | | } catch (e) { |
| | | //模拟接口请求失败 |
| | | reject(e); |
| | | } |
| | | }) |
| | | } |
| New file |
| | |
| | | // 获取部门数据 |
| | | export function fakePosition() { |
| | | return new Promise((resolute, reject) => { |
| | | try { |
| | | const detail = { |
| | | position: "保安", |
| | | positionArr: ['保安', '民警'] |
| | | } |
| | | resolute(detail); |
| | | } catch (e) { |
| | | //模拟接口请求失败 |
| | | reject(e); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 获取公告数据 |
| | | export function fakeBannerList() { |
| | | return new Promise((resolute, reject) => { |
| | | try { |
| | | const list = [{ |
| | | id: '1', |
| | | img: '/static/images/home/banner.png', |
| | | url: '' |
| | | }, { |
| | | id: '2', |
| | | img: '/static/images/home/banner.png', |
| | | url: '' |
| | | }, { |
| | | id: '3', |
| | | img: '/static/images/home/banner.png', |
| | | url: '' |
| | | }]; |
| | | resolute(list); |
| | | } catch (e) { |
| | | //模拟接口请求失败 |
| | | reject(e); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 获取公告数据 |
| | | export function fakeNoticeList() { |
| | | return new Promise((resolute, reject) => { |
| | | try { |
| | | const list = [{ |
| | | id: '1', |
| | | img: '/static/images/home/focus.png', |
| | | title: '神舟十二号载人发射任务取得圆满成功' |
| | | }, { |
| | | id: '2', |
| | | img: '/static/images/home/service.png', |
| | | title: '全国累计报告接种新冠疫苗超9亿剂次' |
| | | }]; |
| | | resolute(list); |
| | | } catch (e) { |
| | | //模拟接口请求失败 |
| | | reject(e); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 获取顶部按钮数据 |
| | | export function fakeNavButton() { |
| | | return new Promise((resolute, reject) => { |
| | | try { |
| | | const list = [{ |
| | | name: '公积金', |
| | | img: '/static/images/home/n1.png', |
| | | url: '' |
| | | }, |
| | | { |
| | | name: '社保', |
| | | img: '/static/images/home/n2.png', |
| | | url: '' |
| | | }, |
| | | { |
| | | name: '医保', |
| | | img: '/static/images/home/n3.png', |
| | | url: '' |
| | | }, |
| | | { |
| | | name: '企业', |
| | | img: '/static/images/home/n4.png', |
| | | url: '' |
| | | }, |
| | | { |
| | | name: '教育', |
| | | img: '/static/images/home/n5.png', |
| | | url: '' |
| | | } |
| | | ]; |
| | | resolute(list); |
| | | } catch (e) { |
| | | //模拟接口请求失败 |
| | | reject(e); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 获取服务按钮数据 |
| | | export function fakeServiceButton() { |
| | | return new Promise((resolute, reject) => { |
| | | try { |
| | | const list = [{ |
| | | name: '保安单位', |
| | | img: '/static/images/home/s1.png', |
| | | url: '../company/company' |
| | | }, |
| | | { |
| | | name: '保安管理', |
| | | img: '/static/images/home/s2.png', |
| | | url: '../securityStaff/exhibition' |
| | | }, |
| | | // { |
| | | // name: '调度指令', |
| | | // img: '/static/images/home/s4.png', |
| | | // url: '' |
| | | // }, |
| | | { |
| | | name: '工作汇报', |
| | | img: '/static/images/home/report001.png', |
| | | url: '../report/report' |
| | | }, |
| | | { |
| | | name: '调度指令', |
| | | img: '/static/images/home/s11.png', |
| | | url: '../dispatch/index' |
| | | }, |
| | | { |
| | | name: '通知通告', |
| | | img: '/static/images/home/s10.png', |
| | | url: '../message/message' |
| | | }, |
| | | { |
| | | name: '现场检查', |
| | | img: '/static/images/home/s5.png', |
| | | url: '../examine/examine' |
| | | }, |
| | | { |
| | | name: '保安员位置', |
| | | img: '/static/images/wz.png', |
| | | url: '../map/map' |
| | | } |
| | | ]; |
| | | resolute(list); |
| | | } catch (e) { |
| | | //模拟接口请求失败 |
| | | reject(e); |
| | | } |
| | | }) |
| | | } |
| New file |
| | |
| | | <template> |
| | | <view class="container"> |
| | | <view class="service-box"> |
| | | <u-grid :col="3" :border="false"> |
| | | <u-grid-item bg-color="transparent" v-for="(item, index) in serviceButton" :key="index" |
| | | @click="goBusinessPage(item.url,index)"> |
| | | <view class="service-item"> |
| | | <image :src="item.img" mode="widthFix" class="img"></image> |
| | | <view class="name">{{ item.name }}</view> |
| | | </view> |
| | | </u-grid-item> |
| | | </u-grid> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | fakeServiceButton |
| | | } from "@/api/mock/dispatch.js"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataList: [], |
| | | serviceButton: [] |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | |
| | | }, |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | onLoad() { |
| | | // 加载服务按钮数据 |
| | | fakeServiceButton().then(data => { |
| | | this.serviceButton = data; |
| | | }); |
| | | }, |
| | | //页面跳转 |
| | | goBusinessPage(url, index) { |
| | | uni.navigateTo({ |
| | | url: url |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style lang="scss"> |
| | | .container { |
| | | background-color: #f7f7f7; |
| | | min-height: 100%; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .service-box { |
| | | background: #ffffff; |
| | | border-radius: 20px 20px 20px 20px; |
| | | margin: 30rpx 20rpx 0; |
| | | padding: 0rpx 20rpx; |
| | | |
| | | .service-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | width: 100%; |
| | | height: 120rpx; |
| | | font-size: 26rpx; |
| | | font-family: PingFang SC; |
| | | font-weight: 500; |
| | | color: #585b61; |
| | | |
| | | .img { |
| | | width: 70rpx; |
| | | height: auto; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | |
| | | <view class="page-container" style="height: 100%; position: relative;"> |
| | | |
| | | <view class="wrapper"> |
| | | |
| | | <view class="body"> |
| | | |
| | | <view class="body-content"> |
| | | |
| | | <u-search 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="newsList.length > 0"> |
| | | <view class="inTmain" v-for="(item,index) in newsList" :key="index"> |
| | | <u-card :title="item.content" @click="goDetail(item)"> |
| | | <view class="" slot="body"> |
| | | <view> |
| | | <view style="margin-bottom: 10px;" class="u-body-item-title u-line-2"> |
| | | 发送指令人:{{item.sendName}}</view> |
| | | </view> |
| | | <view> |
| | | <view class="u-body-item-title u-line-2">接受指令人:{{item.receiveName}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="" slot="foot"> |
| | | </u-icon>发送指令时间:{{item.sendTime}}</view> |
| | | </u-card> |
| | | </view> |
| | | <u-loadmore class='msg' :status="status" /> |
| | | </view> |
| | | |
| | | <view class="msg" v-show='newsList.length == 0'> |
| | | 暂无数据 |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | |
| | | dataList: [], |
| | | newsList: [], |
| | | |
| | | status: 'loadmore', |
| | | keyValue: '', |
| | | |
| | | dataList: [], |
| | | newsList: [], |
| | | pagelist: 0, |
| | | pages: 0, |
| | | flag: true, |
| | | |
| | | pullDown: false |
| | | |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | |
| | | this.getSend(); |
| | | |
| | | }, |
| | | onReachBottom() { |
| | | var that = this; |
| | | |
| | | if (that.flag == false) { |
| | | that.status = 'nomore'; |
| | | return |
| | | } |
| | | // 后续将改为与后端联动 |
| | | that.status = 'loading'; |
| | | |
| | | setTimeout(() => { |
| | | |
| | | that.getSend(); |
| | | |
| | | }, 1000); |
| | | }, |
| | | |
| | | 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(() => { |
| | | |
| | | that.getSend(); |
| | | |
| | | }, 1000) |
| | | |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | |
| | | getSend() { |
| | | 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 |
| | | } |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/directive/page?sendDirectiveId=" + this.$store.state |
| | | .puserID, |
| | | method: "get", |
| | | data: { |
| | | current: that.pagelist, |
| | | size: 10 |
| | | }, |
| | | success: (res) => { |
| | | that.pages = res.data.data.pages; |
| | | |
| | | var resdata = res.data.data.records; |
| | | |
| | | 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 (that.pagelist == that.pages) { |
| | | that.flag = false |
| | | that.status = 'nomore'; |
| | | return |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | goDetail(item) { |
| | | uni.navigateTo({ |
| | | url: './lookDetail?detailData=' + JSON.stringify(item) |
| | | }); |
| | | }, |
| | | searchValue(value) { |
| | | var that = this; |
| | | var str = value.replace(/\s*/g, ""); |
| | | if (str == '') { |
| | | return |
| | | } else { |
| | | that.newsList = []; |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/directive/page?receiveDirectiveIds=" + this.$store |
| | | .state |
| | | .puserID, |
| | | method: "get", |
| | | data: { |
| | | current: 1, |
| | | size: 999999, |
| | | content: str |
| | | }, |
| | | success: (res) => { |
| | | var resdata = res.data.data.records; |
| | | |
| | | resdata.forEach(item => { |
| | | that.newsList.push(item) |
| | | }) |
| | | |
| | | } |
| | | }); |
| | | |
| | | that.flag = false |
| | | that.status = 'nomore'; |
| | | } |
| | | }, |
| | | clearValue() { |
| | | this.keyValue = '' |
| | | this.newsList = []; |
| | | |
| | | 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 = []; |
| | | |
| | | 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'; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .page-container { |
| | | position: fixed; |
| | | display: block; |
| | | width: 100%; |
| | | max-height: 100vh; |
| | | |
| | | |
| | | |
| | | .head { |
| | | position: relative; |
| | | |
| | | |
| | | width: 100%; |
| | | |
| | | |
| | | .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; |
| | | |
| | | .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; |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | .top-absolute { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 101; |
| | | } |
| | | |
| | | .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)); |
| | | |
| | | .body { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow-x: hidden; |
| | | overflow-y: auto; |
| | | |
| | | .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; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | |
| | | <view class="page-container" style="height: 100%; position: relative;"> |
| | | |
| | | <view class="wrapper"> |
| | | |
| | | <view class="body"> |
| | | |
| | | <view class="body-content"> |
| | | |
| | | <u-search 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="newsList.length > 0"> |
| | | <view class="inTmain" v-for="(item,index) in newsList"> |
| | | <u-card :title="item.content" @click="goDetail(item)"> |
| | | <view class="" slot="body"> |
| | | <view> |
| | | <view style="margin-bottom: 10px;" class="u-body-item-title u-line-2"> |
| | | 发送指令人:{{item.sendName}}</view> |
| | | </view> |
| | | <view> |
| | | <view class="u-body-item-title u-line-2">接受指令人:{{item.receiveName}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="" slot="foot"> |
| | | </u-icon>发送指令时间:{{item.sendTime}}</view> |
| | | </u-card> |
| | | </view> |
| | | <u-loadmore class='msg' :status="status" /> |
| | | </view> |
| | | |
| | | <view class="msg" v-show='newsList.length == 0'> |
| | | 暂无数据 |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | |
| | | dataList: [], |
| | | newsList: [], |
| | | |
| | | status: 'loadmore', |
| | | keyValue: '', |
| | | |
| | | dataList: [], |
| | | newsList: [], |
| | | pagelist: 0, |
| | | pages: 0, |
| | | flag: true, |
| | | |
| | | pullDown: false |
| | | |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | |
| | | this.getReceive() |
| | | |
| | | }, |
| | | onReachBottom() { |
| | | var that = this; |
| | | |
| | | if (that.flag == false) { |
| | | that.status = 'nomore'; |
| | | return |
| | | } |
| | | // 后续将改为与后端联动 |
| | | that.status = 'loading'; |
| | | |
| | | setTimeout(() => { |
| | | |
| | | that.getReceive(); |
| | | |
| | | }, 1000); |
| | | }, |
| | | |
| | | 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(() => { |
| | | |
| | | that.getReceive(); |
| | | |
| | | }, 1000) |
| | | |
| | | }, |
| | | mounted() {}, |
| | | 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 |
| | | } |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/directive/page?sendDirectiveId=" + this.$store.state |
| | | .puserID, |
| | | method: "get", |
| | | data: { |
| | | current: that.pagelist, |
| | | size: 10 |
| | | }, |
| | | success: (res) => { |
| | | that.pages = res.data.data.pages; |
| | | |
| | | var resdata = res.data.data.records; |
| | | |
| | | 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 (that.pagelist == that.pages) { |
| | | that.flag = false |
| | | that.status = 'nomore'; |
| | | return |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | goDetail(item) { |
| | | uni.navigateTo({ |
| | | url: './lookDetail?detailData=' + JSON.stringify(item) |
| | | }); |
| | | }, |
| | | |
| | | searchValue(value) { |
| | | var that = this; |
| | | var str = value.replace(/\s*/g, ""); |
| | | if (str == '') { |
| | | return |
| | | } else { |
| | | that.newsList = []; |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/directive/page?sendDirectiveId=" + this.$store.state |
| | | .puserID, |
| | | method: "get", |
| | | data: { |
| | | current: 1, |
| | | size: 999999, |
| | | content: str |
| | | }, |
| | | success: (res) => { |
| | | var resdata = res.data.data.records; |
| | | |
| | | resdata.forEach(item => { |
| | | that.newsList.push(item) |
| | | }) |
| | | |
| | | } |
| | | }); |
| | | |
| | | that.flag = false |
| | | that.status = 'nomore'; |
| | | } |
| | | }, |
| | | clearValue() { |
| | | this.keyValue = '' |
| | | this.newsList = []; |
| | | |
| | | 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 = []; |
| | | |
| | | 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'; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .page-container { |
| | | position: fixed; |
| | | display: block; |
| | | width: 100%; |
| | | max-height: 100vh; |
| | | |
| | | |
| | | |
| | | .head { |
| | | position: relative; |
| | | |
| | | |
| | | width: 100%; |
| | | |
| | | |
| | | .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; |
| | | |
| | | .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; |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | .top-absolute { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 101; |
| | | } |
| | | |
| | | .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)); |
| | | |
| | | .body { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow-x: hidden; |
| | | overflow-y: auto; |
| | | |
| | | .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; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <view class="container"> |
| | | |
| | | <view class="group-chat-box"> |
| | | |
| | | <u-form :model="form" ref="uForm"> |
| | | |
| | | <u-form-item label-width='132' prop="content" label="指令内容" :required="true"> |
| | | <u-input type='textarea' v-model="form.content" placeholder="请输入指令内容" /> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label-width='158' prop="recipientText" label="指令接收人" :required="true"> |
| | | |
| | | <u-input type='textarea' v-model="form.recipientPeople" placeholder="请选择指令接收人" |
| | | @click="recipientClick" autoHeight /> |
| | | |
| | | <u-popup :closeable="true" v-model="recipientShow" mode="bottom" height="50%" border-radius="14"> |
| | | |
| | | <view> |
| | | |
| | | <u-checkbox-group v-show="recipientList.length > 0" @change="checkboxGroupChange" |
| | | :wrap='true' :size="40"> |
| | | |
| | | <u-checkbox v-model="item.checked" v-for="(item, index) in recipientList" :key="index" |
| | | :name="item.id" shape="circle" |
| | | style="padding: 0 40rpx; height: 92rpx; position: relative; box-sizing: border-box;"> |
| | | |
| | | <view style="margin-left: 22rpx"> |
| | | {{item.real_name}} |
| | | </view> |
| | | |
| | | </u-checkbox> |
| | | |
| | | </u-checkbox-group> |
| | | |
| | | <view style=" height: 92rpx; padding: 0 40rpx;" v-show="recipientList.length == 0"> |
| | | |
| | | 暂无数据 |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </u-popup> |
| | | |
| | | </u-form-item> |
| | | |
| | | </u-form> |
| | | |
| | | </view> |
| | | |
| | | <view class="establish-box"> |
| | | |
| | | <u-button class="submit" type="primary" @click="initiateClick">发送</u-button> |
| | | |
| | | </view> |
| | | |
| | | <view> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | |
| | | data() { |
| | | return { |
| | | recipientShow: false, |
| | | recipientList: [], |
| | | |
| | | form: { |
| | | content: '', |
| | | recipient: '', |
| | | recipientData: [], |
| | | recipientPeople: '' |
| | | }, |
| | | rules: { |
| | | |
| | | content: [{ |
| | | min: 5, |
| | | required: true, |
| | | message: '指令内容不能少于5个字', |
| | | trigger: ['change', 'blur'], |
| | | }], |
| | | |
| | | }, |
| | | }; |
| | | }, |
| | | onLoad() {}, |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | mounted() {}, |
| | | onReady() { |
| | | this.$refs.uForm.setRules(this.rules); |
| | | }, |
| | | methods: { |
| | | recipientClick() { |
| | | if (this.recipientList.length > 0) { |
| | | this.recipientShow = true; |
| | | return; |
| | | } |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/blade-user/seleL", |
| | | method: "get", |
| | | data: { |
| | | type: 1, |
| | | jurisdiction: this.$store.state |
| | | .UserData.jurisdiction, |
| | | }, |
| | | success: (res) => { |
| | | this.recipientList = [] |
| | | |
| | | res.data.data.forEach(item => { |
| | | var flag = true |
| | | |
| | | if (this.recipientList.length > 0) { |
| | | this.recipientList.forEach(it => { |
| | | if (item.id == it.id) flag = false |
| | | }) |
| | | } |
| | | |
| | | if (flag == true) { |
| | | if (item.id != this.$store.state |
| | | .UserData.user_id |
| | | ) { |
| | | item.checked = false; |
| | | this.recipientList.push(item) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | this.recipientShow = true; |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | |
| | | initiateClick() { |
| | | |
| | | this.$refs.uForm.validate(valid => { |
| | | if (valid) { |
| | | |
| | | if (this.form.recipientData.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: '请最少选择一个接收人', |
| | | }) |
| | | return |
| | | } |
| | | |
| | | var str = ''; |
| | | |
| | | this.form.recipientData.forEach(item => { |
| | | str += item + ',' |
| | | }) |
| | | |
| | | str = str.substr(0, str.length - 1); |
| | | |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/directive/saveDirectiveAndFile", |
| | | method: "post", |
| | | data: { |
| | | // 接收 |
| | | receiveDirectiveIds: str, |
| | | // 发送 |
| | | sendDirectiveId: this.$store.state |
| | | .UserData.user_id, |
| | | content: this.form.content |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.msg.indexOf('成功') != -1) { |
| | | this.$refs.uToast.show({ |
| | | title: '指令下发成功', |
| | | type: 'success', |
| | | url: '/pages/dispatch/dispatch' |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | console.log('验证失败'); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | checkboxGroupChange(e) { |
| | | var that = this |
| | | |
| | | this.form.recipientData = e |
| | | |
| | | var str = "" |
| | | var num = 0 |
| | | |
| | | that.form.recipientData.forEach((item, index) => { |
| | | that.recipientList.forEach((it, index) => { |
| | | if (item == it.id) { |
| | | if (num > 0) { |
| | | str += '、'; |
| | | str += it.real_name; |
| | | } else { |
| | | str += it.real_name |
| | | } |
| | | num += 1 |
| | | return |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | this.form.recipientPeople = str |
| | | }, |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style lang="scss"> |
| | | .submit { |
| | | border: none; |
| | | width: 94%; |
| | | height: 86rpx; |
| | | line-height: 86rpx; |
| | | box-sizing: border-box; |
| | | border-radius: 15rpx; |
| | | color: #ffffff; |
| | | font-size: 38rpx; |
| | | |
| | | } |
| | | |
| | | .container { |
| | | height: 100%; |
| | | |
| | | .group-chat-box { |
| | | height: calc(100% - 116rpx); |
| | | padding: 0 36rpx; |
| | | box-sizing: border-box; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .establish-box { |
| | | position: relative; |
| | | height: 116rpx; |
| | | background: #fff; |
| | | text-align: center; |
| | | |
| | | uni-button { |
| | | margin: 0; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | margin: auto; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | </style> |