@@ -15,4 +15,12 @@ export const getLoginUser = (params) => { | |||
method: 'GET', | |||
params | |||
}) | |||
} | |||
// 修改用户信息 | |||
export const updateUserInfo = (data) => { | |||
return http.request({ | |||
url: '/api/userCenter/updateUserInfo', | |||
method: 'POST', | |||
data | |||
}) | |||
} |
@@ -0,0 +1,11 @@ | |||
import http from '@/http/api.js' | |||
const url = '/api/business/passengerFlowApi/' | |||
// 获取列表 | |||
export const page = (params) => { | |||
return http.request({ | |||
url: url + '/getPageList', | |||
method: 'get', | |||
params | |||
}) | |||
} |
@@ -0,0 +1,20 @@ | |||
import http from '@/http/api.js' | |||
const url = '/api/business/dormitory' | |||
// 获取归寝寝室列表 | |||
export const returnPageList = (params) => { | |||
return http.request({ | |||
url: url + '/getReturnPageList', | |||
method: 'get', | |||
params | |||
}) | |||
} | |||
// 获取归寝人员列表 | |||
export const returnInfo = (params) => { | |||
return http.request({ | |||
url: url + '/getReturnInfo', | |||
method: 'get', | |||
params | |||
}) | |||
} |
@@ -80,25 +80,34 @@ | |||
data() { | |||
return { | |||
show: false, | |||
title_: this.title || this.placeholder, | |||
// title_: this.title || this.placeholder, | |||
value_: this.value, | |||
searchText: '', | |||
cellValue: [], | |||
}; | |||
}, | |||
computed: { | |||
title_() { | |||
if (!this.multiple) { | |||
let obj = this.options.find(e1 => e1.value == this.value) | |||
return obj ? obj.label : this.placeholder | |||
} else { | |||
let arr = this.options.filter(e1 => this.value_.includes(e1.value)) | |||
this.cellValue = arr.map(e => e.label) | |||
return this.placeholder | |||
} | |||
} | |||
}, | |||
mounted() { | |||
this.value_ = JSON.parse(JSON.stringify(this.value)) | |||
if (!this.multiple) { | |||
let obj = this.options.find(e1 => e1.value == this.value_) | |||
if (obj) { | |||
this.title_ = obj.label | |||
this.$emit("update:title", this.title_) | |||
}else{ | |||
} else { | |||
this.$emit("update:title", '') | |||
} | |||
} else { | |||
let arr = this.options.filter(e1 => this.value_.includes(e1.value)) | |||
this.cellValue = arr.map(e => e.label) | |||
this.$emit("update:title", this.cellValue) | |||
} | |||
}, | |||
@@ -117,14 +126,11 @@ | |||
if (!this.multiple) { | |||
let obj = this.options.find(e1 => e1.value == this.value_) | |||
if (obj) { | |||
this.title_ = obj.label | |||
this.$emit("update:title", this.title_ ) | |||
}else{ | |||
this.$emit("update:title", this.title_) | |||
} else { | |||
this.$emit("update:title", '') | |||
} | |||
} else { | |||
let arr = this.options.filter(e1 => this.value_.includes(e1.value)) | |||
this.cellValue = arr.map(e => e.label) | |||
this.$emit("update:title", this.cellValue) | |||
} | |||
this.close() | |||
@@ -9,7 +9,6 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操 | |||
let token = uni.getStorageSync('token'); | |||
if (token) { | |||
config.header['Authorization'] = 'Bearer ' + token; | |||
const jwt = decryptJWT(token); | |||
const exp = getJWTDate(jwt.exp); | |||
// token 已经过期 | |||
@@ -43,6 +42,15 @@ http.interceptors.response.use((response) => { | |||
icon: 'none' | |||
}); | |||
}) | |||
if (response.data.code == 401) { | |||
const pages = getCurrentPages() | |||
const currentPage = pages[pages.length - 1] | |||
store.dispatch('clearToken') | |||
uni.redirectTo({ | |||
url: `/pages/login?redirect=/${currentPage.route}` | |||
}) | |||
} | |||
return Promise.reject(response); | |||
} | |||
return response.data; | |||
@@ -54,15 +62,7 @@ http.interceptors.response.use((response) => { | |||
icon: 'none' | |||
}); | |||
}) | |||
if (response.statusCode == 401) { | |||
const pages = getCurrentPages() | |||
const currentPage = pages[pages.length - 1] | |||
this.$store.dispatch('clearToken') | |||
uni.redirectTo({ | |||
url: `/pages/login?redirect=/${currentPage.route}` | |||
}) | |||
} | |||
return Promise.reject(response) | |||
}) | |||
/** | |||
@@ -41,9 +41,6 @@ var options = { | |||
// return statusCode >= 200 && statusCode < 300 | |||
// } | |||
// 预览地址 | |||
// previewUrl: 'https://www.bjjyp.org.cn/preview/onlinePreview', | |||
// previewUrl: 'http://114.255.136.189:6696/onlinePreview', | |||
// previewUrl: 'http://192.168.100.236:85/onlinePreview', | |||
previewUrl: '', | |||
}; | |||
export { options }; |
@@ -74,9 +74,11 @@ | |||
} | |||
}, | |||
onLoad(e) { | |||
if (e.redirect) this.redirect = redirect | |||
this.form.account = 'superAdmin' | |||
this.form.password = '123456' | |||
if (e.redirect) this.redirect = e.redirect | |||
if (process.env.NODE_ENV === 'development') { | |||
this.form.account = 'superAdmin' | |||
this.form.password = '123456' | |||
} | |||
}, | |||
methods: { | |||
async login() { | |||
@@ -87,7 +89,9 @@ | |||
}).then(res => { | |||
if (res.code != 200) return | |||
let data = res.data | |||
this.$store.dispatch('setToken',{token:data.token}) | |||
this.$store.dispatch('setToken', { | |||
token: data.token | |||
}) | |||
this.$store.dispatch('getUserInfo') | |||
this.$store.dispatch('getAllOptions') | |||
this.NAV_TO('/') | |||
@@ -96,8 +100,8 @@ | |||
}) | |||
}) | |||
}, | |||
getLoginUser(){ | |||
return getLoginUser().then(res=>{ | |||
getLoginUser() { | |||
return getLoginUser().then(res => { | |||
if (res.code != 200) return | |||
this.$u.vuex('userInfo', res.data) | |||
}) | |||
@@ -2,14 +2,14 @@ | |||
<view style="padding: 0 30rpx;"> | |||
<view class="header"> | |||
<view style="padding-top: 44rpx;" class="headerContent"> | |||
<u-avatar src="/static/image/test/test.png" size="180rpx"></u-avatar> | |||
<u-avatar :src="userInfo.avatar" size="180rpx"></u-avatar> | |||
<view class="right"> | |||
<view class="name"> | |||
张云 | |||
{{userInfo.name}} | |||
</view> | |||
<view class="des"> | |||
<image src="/static/image/school.png" mode=""></image> | |||
山西科技大学 | 校长 | |||
{{userInfo.orgNames}} | {{userInfo.positionName}} | |||
</view> | |||
</view> | |||
</view> | |||
@@ -20,31 +20,31 @@ | |||
</view> | |||
<u-cell title="账号" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false"> | |||
<view slot="value" class="valueBox disabled"> | |||
543asd25a1 | |||
{{userInfo.account}} | |||
</view> | |||
</u-cell> | |||
<u-cell title="姓名" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | |||
@click="cellClick('修改姓名')"> | |||
<view slot="value" class="valueBox"> | |||
杨云 | |||
{{userInfo.name}} | |||
</view> | |||
</u-cell> | |||
<u-cell title="手机" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | |||
@click="cellClick('修改手机号')"> | |||
<view slot="value" class="valueBox"> | |||
18633460001 | |||
{{userInfo.phone}} | |||
</view> | |||
</u-cell> | |||
<u-cell title="昵称" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | |||
@click="cellClick('设置昵称')"> | |||
<view slot="value" class="valueBox"> | |||
未设置 | |||
{{userInfo.nickname||'未设置'}} | |||
</view> | |||
</u-cell> | |||
<picker mode="date" :value="date" @change="dateChange"> | |||
<picker mode="date" :value="userInfo.birthday" @change="dateChange"> | |||
<u-cell title="出生日期" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink> | |||
<view slot="value" class="valueBox"> | |||
{{date}} | |||
{{userInfo.birthday}} | |||
</view> | |||
</u-cell> | |||
</picker> | |||
@@ -73,16 +73,18 @@ | |||
</template> | |||
<script> | |||
import {updateUserInfo} from '@/api/user.js' | |||
export default { | |||
data() { | |||
return { | |||
show: false, | |||
action: '', | |||
inputValue: '', | |||
date: '1990-06-15', | |||
} | |||
}, | |||
mounted() {}, | |||
onShow() { | |||
this.$store.dispatch('getUserInfo') | |||
}, | |||
methods: { | |||
cellClick(action) { | |||
this.action = action | |||
@@ -96,6 +98,13 @@ | |||
this.TOAST('请输入姓名') | |||
return | |||
} | |||
this.LOADING() | |||
updateUserInfo({...this.userInfo,name:this.inputValue}).then(res=>{ | |||
this.HIDE_LOADING() | |||
if(res.code != 200)return | |||
this.$store.dispatch('getUserInfo') | |||
this.cancel() | |||
}) | |||
break | |||
case '修改手机号': | |||
if (!this.inputValue) { | |||
@@ -108,12 +117,26 @@ | |||
this.TOAST('请输入正确的手机号') | |||
return | |||
} | |||
this.LOADING() | |||
updateUserInfo({...this.userInfo,phone:this.inputValue}).then(res=>{ | |||
this.HIDE_LOADING() | |||
if(res.code != 200)return | |||
this.$store.dispatch('getUserInfo') | |||
this.cancel() | |||
}) | |||
break | |||
case '设置昵称': | |||
if (!this.inputValue) { | |||
this.TOAST('请输入昵称') | |||
return | |||
} | |||
// if (!this.inputValue) { | |||
// this.TOAST('请输入昵称') | |||
// return | |||
// } | |||
this.LOADING() | |||
updateUserInfo({...this.userInfo,nickname:this.inputValue}).then(res=>{ | |||
this.HIDE_LOADING() | |||
if(res.code != 200)return | |||
this.$store.dispatch('getUserInfo') | |||
this.cancel() | |||
}) | |||
break | |||
} | |||
}, | |||
@@ -121,10 +144,17 @@ | |||
this.show = false | |||
}, | |||
dateChange(e) { | |||
this.date = e.detail.value | |||
this.LOADING() | |||
updateUserInfo({...this.userInfo,birthday:e.detail.value}).then(res=>{ | |||
this.HIDE_LOADING() | |||
if(res.code != 200)return | |||
this.$store.dispatch('getUserInfo') | |||
this.cancel() | |||
}) | |||
}, | |||
loginOut() { | |||
this.CONFIRM('您是否确认退出登录?').then(()=>{ | |||
this.CONFIRM('您是否确认退出登录?').then(res=>{ | |||
if(!res)return | |||
this.CLEAR_STORAGE() | |||
this.JUMP_TO('/pages/login') | |||
}) | |||
@@ -9,8 +9,8 @@ | |||
</uni-tr> | |||
<!-- 表格数据行 --> | |||
<uni-tr v-for="(item,index) in list" :key="index"> | |||
<uni-td>2020-10-20</uni-td> | |||
<uni-td>50</uni-td> | |||
<uni-td>{{item.time}}</uni-td> | |||
<uni-td>{{item.nums}}</uni-td> | |||
</uni-tr> | |||
</uni-table> | |||
</view> | |||
@@ -18,10 +18,24 @@ | |||
</template> | |||
<script> | |||
import { | |||
dateFormat | |||
} from '../../../utils/date' | |||
export default { | |||
data() { | |||
return { | |||
list: [{},{},{},{},{},{},{},{},{}], | |||
list: [], | |||
} | |||
}, | |||
mounted() { | |||
const { | |||
extJson | |||
} = this.options | |||
if (extJson) { | |||
this.list = JSON.parse(extJson).map(e => { | |||
e.time = dateFormat(new Date(e.time)) | |||
return e | |||
}) | |||
} | |||
}, | |||
methods: {} | |||
@@ -29,19 +43,23 @@ | |||
</script> | |||
<style scoped lang="scss"> | |||
.table{ | |||
.table { | |||
padding: 30rpx; | |||
tr:nth-child(2n+1){ | |||
background-color: #F2F8FF!important; | |||
tr:nth-child(2n+1) { | |||
background-color: #F2F8FF !important; | |||
} | |||
tr:first-child{ | |||
background-color: #F5F5F5!important; | |||
tr:first-child { | |||
background-color: #F5F5F5 !important; | |||
} | |||
th{ | |||
th { | |||
color: #777777; | |||
font-size: 28rpx; | |||
} | |||
td{ | |||
td { | |||
color: #333333; | |||
font-size: 28rpx; | |||
} | |||
@@ -5,28 +5,28 @@ | |||
<u-list-item v-for="(item, index) in list" :key="index"> | |||
<view class="whiteCard"> | |||
<view class="row1"> | |||
摄像头:教室(海康)、大厅(魔豆) | |||
摄像头:{{item.cameraNames}} | |||
</view> | |||
<view class="row2"> | |||
查询时间:2024-08-14 08:34:59 | |||
查询时间:{{item.queryTime}} | |||
</view> | |||
<view class="row3"> | |||
<view class=""> | |||
<text>开始时间:</text>2024-08-14 08:34:59 | |||
<text>开始时间:</text>{{item.startTime}} | |||
</view> | |||
<view class=""> | |||
<text>结束时间:</text>2024-08-14 08:34:59 | |||
<text>结束时间:</text>{{item.endTime}} | |||
</view> | |||
<view class="type"> | |||
<text>分片类型:<text style="color: #333;">小时</text></text> | |||
<text>分片类型:<text style="color: #333;">{{item.split ? "小时" : "天"}}</text></text> | |||
<view class="peopleNum"> | |||
<image src="@/static/image/peopleNum.png" mode="aspectFill"></image> | |||
<text>总人数:6</text> | |||
<text>总人数:{{item.total}}</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="bottom"> | |||
<view class="btn" @click="NAV_TO('./detail')"> | |||
<view class="btn" @click="NAV_TO('./detail',item)"> | |||
<image src="@/static/image/see.png" mode="aspectFill"></image> | |||
<text>分片详情</text> | |||
</view> | |||
@@ -38,10 +38,13 @@ | |||
</view> | |||
</template> | |||
<script> | |||
import { | |||
page | |||
} from '@/api/work/passengerFlow.js' | |||
export default { | |||
data() { | |||
return { | |||
list: [{}, {}, {}, {}, {}, {}, {}, {}, {}, ], | |||
list: [], | |||
isLoading: false, | |||
status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了 | |||
page: { | |||
@@ -57,17 +60,18 @@ | |||
loadmore() { | |||
if (this.status != 'loadmore') return | |||
this.status = 'loading' | |||
setTimeout(() => { | |||
for (let i = 0; i < 1; i++) { | |||
this.list.push({}, {}, {}, {}) | |||
} | |||
// 获取到的总条数>=接口总条数 || 接口总条数为0 | |||
if (this.list.length >= 14) { | |||
page({ | |||
...this.page, | |||
}).then(res => { | |||
if(res.code != 200)return | |||
this.list = this.list.concat(res.data.list) | |||
// 获取到的总条数>=接口总条数 | |||
if (this.list.length >= res.data.total) { | |||
this.status = 'nomore' | |||
} else { | |||
this.status = 'loadmore' | |||
} | |||
}, 2000) | |||
}) | |||
}, | |||
refresh() { | |||
this.status = 'loadmore' | |||
@@ -4,15 +4,15 @@ | |||
<image src="@/static/image/home.png" mode="aspectFill" | |||
style="width: 38rpx;height: 38rpx;margin-right: 8rpx;"> | |||
</image> | |||
寝室104 | |||
寝室{{info.name}} | |||
</view> | |||
<view class="listTitlte"> | |||
<view class="listTitlte" v-if="list.filter(e=>e.tick).length"> | |||
已归寝 | |||
</view> | |||
<view class="list"> | |||
<view v-for="(item, index) in list" :key="index" class="item"> | |||
<view v-for="(item, index) in list" :key="index" class="item" v-show="item.tick"> | |||
<view class="topBox"> | |||
<image src="@/static/image/test/test.png" mode="aspectFill" style="width: 160rpx;height: 160rpx;border-radius:10rpx"> | |||
<image :src="item.faceUrl" mode="aspectFill" style="width: 160rpx;height: 160rpx;border-radius:10rpx"> | |||
</image> | |||
<view class="des"> | |||
<view class="top"> | |||
@@ -20,30 +20,30 @@ | |||
已归寝 | |||
</view> | |||
<view class="name"> | |||
杨云 | |||
{{item.name}} | |||
</view> | |||
</view> | |||
<view class="depart"> | |||
系部:安环部 | |||
系部:{{item.majorName}} | |||
</view> | |||
<view class="bottom"> | |||
<view class="major">专业:环艺</view> | |||
<view class="class">班级:第二班</view> | |||
<view class="major">专业:{{item.depName}}</view> | |||
<view class="class">班级:{{item.personSetName}}</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="returnTime"> | |||
归寝时间:2024-08-15 11:59:12 | |||
归寝时间:{{item.tick?item.tick:'-'}} | |||
</view> | |||
</view> | |||
</view> | |||
<view class="listTitlte"> | |||
<view class="listTitlte" v-if="list.filter(e=>!e.tick).length"> | |||
未归寝 | |||
</view> | |||
<view class="list"> | |||
<view v-for="(item, index) in list" :key="index" class="item"> | |||
<view v-for="(item, index) in list" :key="index" class="item" v-show="!item.tick"> | |||
<view class="topBox"> | |||
<image src="@/static/image/test/test.png" mode="aspectFill" style="width: 160rpx;height: 160rpx;border-radius:10rpx"> | |||
<image :src="item.faceUrl" mode="aspectFill" style="width: 160rpx;height: 160rpx;border-radius:10rpx"> | |||
</image> | |||
<view class="des"> | |||
<view class="top"> | |||
@@ -51,20 +51,20 @@ | |||
未归寝 | |||
</view> | |||
<view class="name"> | |||
杨云 | |||
{{item.name}} | |||
</view> | |||
</view> | |||
<view class="depart"> | |||
系部:安环部 | |||
系部:{{item.majorName}} | |||
</view> | |||
<view class="bottom"> | |||
<view class="major">专业:环艺</view> | |||
<view class="class">班级:第二班</view> | |||
<view class="major">专业:{{item.depName}}</view> | |||
<view class="class">班级:{{item.personSetName}}</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="returnTime"> | |||
归寝时间:2024-08-15 11:59:12 | |||
归寝时间:{{item.tick?item.tick:'-'}} | |||
</view> | |||
</view> | |||
</view> | |||
@@ -73,19 +73,32 @@ | |||
</template> | |||
<script> | |||
import { | |||
returnInfo | |||
} from '@/api/work/returnBed.js' | |||
export default { | |||
data() { | |||
return { | |||
list: [{ | |||
name: 1 | |||
}, { | |||
name: 2 | |||
}, { | |||
name: 3 | |||
}], | |||
list: [], | |||
info:{}, | |||
checkboxValue: [], | |||
} | |||
}, | |||
mounted() { | |||
const {id,ReturnTime} = this.options | |||
returnInfo({id,ReturnTime}).then(res=>{ | |||
if(res.code != 200)return | |||
this.info = res.data | |||
this.list = res.data.personInfos || [] | |||
this.list.forEach(e=>{ | |||
e.faceUrl = e.faces&&e.faces.length?'/api/'+e.faces[0].faceUrl:'' | |||
if(res.data.attendanceDtos){ | |||
let obj = res.data.attendanceDtos.find(e1=>e1.personId==e.personId) | |||
if(obj)e.tick = obj.tick | |||
} | |||
}) | |||
}) | |||
}, | |||
methods: {} | |||
} | |||
</script> | |||
@@ -1,28 +1,28 @@ | |||
<template> | |||
<view style="height: 100%;"> | |||
<view class="searchBox"> | |||
<selectRadio v-model="search.loudong" :options="this.allOptions.monitorList" | |||
title="楼栋" /> | |||
<selectSearch v-model="search.qinshi" :options="[{value:1,label:'寝室302'},{value:2,label:'寝室305'},{value:3,label:'寝室303'}]" | |||
placeholder="请选择寝室" popupTitle="选择寝室" search-placeholder="请输入宿舍号"/> | |||
<selectRadio v-model="search.buildId" :options="allOptions.buildingList" title="楼栋" @change="()=>{room = '';refresh()}" /> | |||
<selectSearch v-model="room" | |||
:options="list.map(e=>{return {...e,label:'寝室'+e.label}})" placeholder="请选择寝室" | |||
popupTitle="选择寝室" search-placeholder="请输入宿舍号" /> | |||
</view> | |||
<u-empty marginTop="100rpx" :show="false" mode="list" text="暂无数据"></u-empty> | |||
<u-list @scrolltolower="scrolltolower" style="height: calc(100% - 220rpx);"> | |||
<u-list-item v-for="(item, index) in list" :key="index"> | |||
<u-list-item v-for="(item, index) in list" :key="index" v-show="!room || room == item.id"> | |||
<view class="whiteCard"> | |||
<view class="row1"> | |||
<text class="room">寝室302</text> | |||
<text class="room">寝室{{item.name}}</text> | |||
</view> | |||
<view class="row2"> | |||
<text class="returnNum">归寝人数:4</text> | |||
<text class="noReturnNum">未归寝人数:2</text> | |||
<text class="returnNum">归寝人数:{{item.dormitoryCount}}</text> | |||
<text class="noReturnNum">未归寝人数:{{item.personCount - item.dormitoryCount}}</text> | |||
</view> | |||
<view class="bottom"> | |||
<view class="peopleNum"> | |||
<image src="@/static/image/peopleNum1.png" mode="aspectFill"></image> | |||
<text>寝室人数:6</text> | |||
<text>寝室人数:{{item.personCount}}</text> | |||
</view> | |||
<view class="btn" @click="NAV_TO('./detail')"> | |||
<view class="btn" @click="NAV_TO('./detail',{id:item.id,ReturnTime:search.ReturnTime})"> | |||
<text>查看</text> | |||
</view> | |||
</view> | |||
@@ -36,6 +36,10 @@ | |||
<script> | |||
import selectRadio from "@/components/selectRadio.vue" | |||
import selectSearch from "@/components/selectSearch.vue" | |||
import { | |||
returnPageList | |||
} from '@/api/work/returnBed.js' | |||
import {dateFormat} from '@/utils/date.js' | |||
export default { | |||
components: { | |||
selectRadio, | |||
@@ -43,52 +47,59 @@ | |||
}, | |||
data() { | |||
return { | |||
list: [{}, {}, {}, {}, {}, {}, {}, {}, {}, ], | |||
list: [], | |||
isLoading: false, | |||
status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了 | |||
search: { | |||
loudong: 1, | |||
qinshi: '' | |||
buildId: '', | |||
ReturnTime:'', | |||
}, | |||
room:'', | |||
page: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
pageSize: 1000, | |||
}, | |||
} | |||
}, | |||
mounted() { | |||
}, | |||
methods: { | |||
scrolltolower() { | |||
this.loadmore() | |||
}, | |||
loadmore() { | |||
if(!this.search.buildId)this.search.buildId = this.allOptions.buildingList[0].value | |||
if(!this.search.ReturnTime)this.search.ReturnTime = dateFormat(new Date(),'yyyy-MM-dd') | |||
if (this.status != 'loadmore') return | |||
this.status = 'loading' | |||
setTimeout(() => { | |||
for (let i = 0; i < 1; i++) { | |||
this.list.push({}, {},{},{}) | |||
} | |||
// 获取到的总条数>=接口总条数 || 接口总条数为0 | |||
if (this.list.length >= 14) { | |||
returnPageList({ | |||
...this.page, | |||
...this.search | |||
}).then(res => { | |||
if(res.code != 200)return | |||
this.list = this.list.concat(res.data.list.map(e=>{return{...e,value:e.id,label:e.name}})) | |||
// 获取到的总条数>=接口总条数 | |||
if (this.list.length >= res.data.total) { | |||
this.status = 'nomore' | |||
} else { | |||
this.status = 'loadmore' | |||
} | |||
}, 2000) | |||
}) | |||
}, | |||
refresh(){ | |||
refresh() { | |||
this.status = 'loadmore' | |||
this.list = [] | |||
this.page.page = 1 | |||
this.loadmore() | |||
}, | |||
pullDownRefresh(){ | |||
pullDownRefresh() { | |||
this.refresh() | |||
} | |||
}, | |||
onLoad() { | |||
this.loadmore() | |||
}, | |||
onPullDownRefresh(){ | |||
onPullDownRefresh() { | |||
uni.stopPullDownRefresh() | |||
this.refresh() | |||
} | |||
@@ -143,8 +154,10 @@ | |||
margin-top: 24rpx; | |||
padding-top: 30rpx; | |||
position: relative; | |||
.peopleNum { | |||
padding-top: 4rpx; | |||
uni-image { | |||
width: 34rpx; | |||
height: 34rpx; | |||
@@ -157,6 +170,7 @@ | |||
font-size: 26rpx; | |||
} | |||
} | |||
.btn { | |||
text-align: center; | |||
line-height: 60rpx; | |||
@@ -165,6 +179,7 @@ | |||
color: #fff; | |||
border-radius: 30rpx; | |||
font-size: 26rpx; | |||
uni-image { | |||
width: 34rpx; | |||
height: 34rpx; | |||
@@ -18,7 +18,7 @@ | |||
<template v-for="(item, index) in list"> | |||
<view class="item" @click="popupShow(item)" :key="index" v-show="cateList.length&&cateList[cate].show(item)"> | |||
<view class="right"> | |||
<image src="@/static/image/test/image2.png" mode="aspectFill" | |||
<image :src="item.faceUrl" mode="aspectFill" | |||
style="width: 160rpx;height: 160rpx;border-radius:10rpx"></image> | |||
<view class="des"> | |||
<view class="top"> | |||
@@ -45,7 +45,7 @@ | |||
</view> | |||
<u-popup :show="show" mode="center" :round="10"> | |||
<view class="popupInfo"> | |||
<image src="/static/image/test/image.png" mode="widthFix" style="width: 480rpx;border-radius:10rpx"> | |||
<image :src="popupInfo.faceUrl" mode="widthFix" style="width: 480rpx;border-radius:10rpx"> | |||
</image> | |||
<view class="top"> | |||
<view class="status" :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }"> | |||
@@ -114,7 +114,7 @@ | |||
if (res.code != 200) return | |||
this.alarmList = res.data.list | |||
this.list = this.list.map(e => { | |||
e.alarmTypes = [] | |||
e.faceUrl = e.faces&&e.faces.length?'/api/'+e.faces[0].faceUrl:'' | |||
// alarmType:lie_on_table 趴桌子 class_room_call 点名(实到) | |||
let arr = this.alarmList.filter(e1 => e1.personId == e.personId) | |||
e.alarmTypes = arr.map(e=>e.alarmType) | |||
@@ -71,7 +71,8 @@ | |||
this.status = 'loading' | |||
taskPage({ | |||
...this.page, | |||
...this.search | |||
...this.search, | |||
}).then(res => { | |||
if(res.code != 200)return | |||
res.data.list.forEach(e=>{ | |||
@@ -37,10 +37,11 @@ const saveLifeData = function(key, value) { | |||
uni.setStorageSync('lifeData', tmp); | |||
} | |||
if (key == 'refreshToken') { | |||
uni.setStorageSync('token', { | |||
content: value, | |||
datetime: new Date().getTime() | |||
}) | |||
uni.setStorageSync('token',value) | |||
// { | |||
// content: value, | |||
// datetime: new Date().getTime() | |||
// } | |||
} | |||
} | |||
const store = new Vuex.Store({ | |||
@@ -51,7 +52,7 @@ const store = new Vuex.Store({ | |||
refreshToken: lifeData.refreshToken || '', | |||
allOptions: lifeData.allOptions || { | |||
monitorList: [], //摄像头列表 | |||
monitorList:[], //楼栋列表 | |||
buildingList:[], //楼栋列表 | |||
}, | |||
}, | |||
actions: { | |||
@@ -103,13 +104,11 @@ const store = new Vuex.Store({ | |||
}) | |||
}) | |||
// 楼栋列表 | |||
await buildingList({ | |||
pageSize: 1000 | |||
}).then(res => { | |||
await buildingList().then(res => { | |||
if (res.code != 200) return | |||
allOptions.monitorList = res.data.list.map(e => { | |||
e.value = e.sensorId | |||
e.label = e.sensorName | |||
allOptions.buildingList = res.data.map(e => { | |||
e.value = e.id | |||
e.label = e.name | |||
return e | |||
}) | |||
}) | |||