@@ -15,4 +15,12 @@ export const getLoginUser = (params) => { | |||||
method: 'GET', | method: 'GET', | ||||
params | 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() { | data() { | ||||
return { | return { | ||||
show: false, | show: false, | ||||
title_: this.title || this.placeholder, | |||||
// title_: this.title || this.placeholder, | |||||
value_: this.value, | value_: this.value, | ||||
searchText: '', | searchText: '', | ||||
cellValue: [], | 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() { | mounted() { | ||||
this.value_ = JSON.parse(JSON.stringify(this.value)) | this.value_ = JSON.parse(JSON.stringify(this.value)) | ||||
if (!this.multiple) { | if (!this.multiple) { | ||||
let obj = this.options.find(e1 => e1.value == this.value_) | let obj = this.options.find(e1 => e1.value == this.value_) | ||||
if (obj) { | if (obj) { | ||||
this.title_ = obj.label | |||||
this.$emit("update:title", this.title_) | this.$emit("update:title", this.title_) | ||||
}else{ | |||||
} else { | |||||
this.$emit("update:title", '') | this.$emit("update:title", '') | ||||
} | } | ||||
} else { | } 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.$emit("update:title", this.cellValue) | ||||
} | } | ||||
}, | }, | ||||
@@ -117,14 +126,11 @@ | |||||
if (!this.multiple) { | if (!this.multiple) { | ||||
let obj = this.options.find(e1 => e1.value == this.value_) | let obj = this.options.find(e1 => e1.value == this.value_) | ||||
if (obj) { | if (obj) { | ||||
this.title_ = obj.label | |||||
this.$emit("update:title", this.title_ ) | |||||
}else{ | |||||
this.$emit("update:title", this.title_) | |||||
} else { | |||||
this.$emit("update:title", '') | this.$emit("update:title", '') | ||||
} | } | ||||
} else { | } 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.$emit("update:title", this.cellValue) | ||||
} | } | ||||
this.close() | this.close() | ||||
@@ -9,7 +9,6 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操 | |||||
let token = uni.getStorageSync('token'); | let token = uni.getStorageSync('token'); | ||||
if (token) { | if (token) { | ||||
config.header['Authorization'] = 'Bearer ' + token; | config.header['Authorization'] = 'Bearer ' + token; | ||||
const jwt = decryptJWT(token); | const jwt = decryptJWT(token); | ||||
const exp = getJWTDate(jwt.exp); | const exp = getJWTDate(jwt.exp); | ||||
// token 已经过期 | // token 已经过期 | ||||
@@ -43,6 +42,15 @@ http.interceptors.response.use((response) => { | |||||
icon: 'none' | 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 Promise.reject(response); | ||||
} | } | ||||
return response.data; | return response.data; | ||||
@@ -54,15 +62,7 @@ http.interceptors.response.use((response) => { | |||||
icon: 'none' | 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) | return Promise.reject(response) | ||||
}) | }) | ||||
/** | /** | ||||
@@ -71,6 +71,7 @@ http.interceptors.response.use((response) => { | |||||
* @returns <any>object | * @returns <any>object | ||||
*/ | */ | ||||
function decryptJWT(token) { | function decryptJWT(token) { | ||||
console.log(token) | |||||
token = token.replace(/_/g, "/").replace(/-/g, "+"); | token = token.replace(/_/g, "/").replace(/-/g, "+"); | ||||
const json = decodeURIComponent(escape(window.atob(token.split(".")[1]))); | const json = decodeURIComponent(escape(window.atob(token.split(".")[1]))); | ||||
return JSON.parse(json); | return JSON.parse(json); | ||||
@@ -41,9 +41,6 @@ var options = { | |||||
// return statusCode >= 200 && statusCode < 300 | // 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: '', | previewUrl: '', | ||||
}; | }; | ||||
export { options }; | export { options }; |
@@ -74,9 +74,11 @@ | |||||
} | } | ||||
}, | }, | ||||
onLoad(e) { | 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: { | methods: { | ||||
async login() { | async login() { | ||||
@@ -87,7 +89,9 @@ | |||||
}).then(res => { | }).then(res => { | ||||
if (res.code != 200) return | if (res.code != 200) return | ||||
let data = res.data | 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('getUserInfo') | ||||
this.$store.dispatch('getAllOptions') | this.$store.dispatch('getAllOptions') | ||||
this.NAV_TO('/') | this.NAV_TO('/') | ||||
@@ -96,8 +100,8 @@ | |||||
}) | }) | ||||
}) | }) | ||||
}, | }, | ||||
getLoginUser(){ | |||||
return getLoginUser().then(res=>{ | |||||
getLoginUser() { | |||||
return getLoginUser().then(res => { | |||||
if (res.code != 200) return | if (res.code != 200) return | ||||
this.$u.vuex('userInfo', res.data) | this.$u.vuex('userInfo', res.data) | ||||
}) | }) | ||||
@@ -2,14 +2,14 @@ | |||||
<view style="padding: 0 30rpx;"> | <view style="padding: 0 30rpx;"> | ||||
<view class="header"> | <view class="header"> | ||||
<view style="padding-top: 44rpx;" class="headerContent"> | <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="right"> | ||||
<view class="name"> | <view class="name"> | ||||
张云 | |||||
{{userInfo.name}} | |||||
</view> | </view> | ||||
<view class="des"> | <view class="des"> | ||||
<image src="/static/image/school.png" mode=""></image> | <image src="/static/image/school.png" mode=""></image> | ||||
山西科技大学 | 校长 | |||||
{{userInfo.orgNames}} | {{userInfo.positionName}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -20,31 +20,31 @@ | |||||
</view> | </view> | ||||
<u-cell title="账号" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false"> | <u-cell title="账号" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false"> | ||||
<view slot="value" class="valueBox disabled"> | <view slot="value" class="valueBox disabled"> | ||||
543asd25a1 | |||||
{{userInfo.account}} | |||||
</view> | </view> | ||||
</u-cell> | </u-cell> | ||||
<u-cell title="姓名" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | <u-cell title="姓名" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | ||||
@click="cellClick('修改姓名')"> | @click="cellClick('修改姓名')"> | ||||
<view slot="value" class="valueBox"> | <view slot="value" class="valueBox"> | ||||
杨云 | |||||
{{userInfo.name}} | |||||
</view> | </view> | ||||
</u-cell> | </u-cell> | ||||
<u-cell title="手机" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | <u-cell title="手机" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | ||||
@click="cellClick('修改手机号')"> | @click="cellClick('修改手机号')"> | ||||
<view slot="value" class="valueBox"> | <view slot="value" class="valueBox"> | ||||
18633460001 | |||||
{{userInfo.phone}} | |||||
</view> | </view> | ||||
</u-cell> | </u-cell> | ||||
<u-cell title="昵称" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | <u-cell title="昵称" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink | ||||
@click="cellClick('设置昵称')"> | @click="cellClick('设置昵称')"> | ||||
<view slot="value" class="valueBox"> | <view slot="value" class="valueBox"> | ||||
未设置 | |||||
{{userInfo.nickname||'未设置'}} | |||||
</view> | </view> | ||||
</u-cell> | </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> | <u-cell title="出生日期" :titleStyle="{fontSize:'28rpx',color:'#333'}" :border="false" isLink> | ||||
<view slot="value" class="valueBox"> | <view slot="value" class="valueBox"> | ||||
{{date}} | |||||
{{userInfo.birthday}} | |||||
</view> | </view> | ||||
</u-cell> | </u-cell> | ||||
</picker> | </picker> | ||||
@@ -73,16 +73,18 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import {updateUserInfo} from '@/api/user.js' | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
show: false, | show: false, | ||||
action: '', | action: '', | ||||
inputValue: '', | inputValue: '', | ||||
date: '1990-06-15', | |||||
} | } | ||||
}, | }, | ||||
mounted() {}, | |||||
mounted() { | |||||
this.$store.dispatch('getUserInfo') | |||||
}, | |||||
methods: { | methods: { | ||||
cellClick(action) { | cellClick(action) { | ||||
this.action = action | this.action = action | ||||
@@ -96,6 +98,13 @@ | |||||
this.TOAST('请输入姓名') | this.TOAST('请输入姓名') | ||||
return | 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 | break | ||||
case '修改手机号': | case '修改手机号': | ||||
if (!this.inputValue) { | if (!this.inputValue) { | ||||
@@ -108,12 +117,26 @@ | |||||
this.TOAST('请输入正确的手机号') | this.TOAST('请输入正确的手机号') | ||||
return | 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 | break | ||||
case '设置昵称': | 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 | break | ||||
} | } | ||||
}, | }, | ||||
@@ -121,10 +144,17 @@ | |||||
this.show = false | this.show = false | ||||
}, | }, | ||||
dateChange(e) { | 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() { | loginOut() { | ||||
this.CONFIRM('您是否确认退出登录?').then(()=>{ | |||||
this.CONFIRM('您是否确认退出登录?').then(res=>{ | |||||
if(!res)return | |||||
this.CLEAR_STORAGE() | this.CLEAR_STORAGE() | ||||
this.JUMP_TO('/pages/login') | this.JUMP_TO('/pages/login') | ||||
}) | }) | ||||
@@ -9,8 +9,8 @@ | |||||
</uni-tr> | </uni-tr> | ||||
<!-- 表格数据行 --> | <!-- 表格数据行 --> | ||||
<uni-tr v-for="(item,index) in list" :key="index"> | <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-tr> | ||||
</uni-table> | </uni-table> | ||||
</view> | </view> | ||||
@@ -18,10 +18,24 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import { | |||||
dateFormat | |||||
} from '../../../utils/date' | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | 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: {} | methods: {} | ||||
@@ -29,19 +43,23 @@ | |||||
</script> | </script> | ||||
<style scoped lang="scss"> | <style scoped lang="scss"> | ||||
.table{ | |||||
.table { | |||||
padding: 30rpx; | 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; | color: #777777; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
} | } | ||||
td{ | |||||
td { | |||||
color: #333333; | color: #333333; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
} | } | ||||
@@ -5,28 +5,28 @@ | |||||
<u-list-item v-for="(item, index) in list" :key="index"> | <u-list-item v-for="(item, index) in list" :key="index"> | ||||
<view class="whiteCard"> | <view class="whiteCard"> | ||||
<view class="row1"> | <view class="row1"> | ||||
摄像头:教室(海康)、大厅(魔豆) | |||||
摄像头:{{item.cameraNames}} | |||||
</view> | </view> | ||||
<view class="row2"> | <view class="row2"> | ||||
查询时间:2024-08-14 08:34:59 | |||||
查询时间:{{item.queryTime}} | |||||
</view> | </view> | ||||
<view class="row3"> | <view class="row3"> | ||||
<view class=""> | <view class=""> | ||||
<text>开始时间:</text>2024-08-14 08:34:59 | |||||
<text>开始时间:</text>{{item.startTime}} | |||||
</view> | </view> | ||||
<view class=""> | <view class=""> | ||||
<text>结束时间:</text>2024-08-14 08:34:59 | |||||
<text>结束时间:</text>{{item.endTime}} | |||||
</view> | </view> | ||||
<view class="type"> | <view class="type"> | ||||
<text>分片类型:<text style="color: #333;">小时</text></text> | |||||
<text>分片类型:<text style="color: #333;">{{item.split ? "小时" : "天"}}</text></text> | |||||
<view class="peopleNum"> | <view class="peopleNum"> | ||||
<image src="@/static/image/peopleNum.png" mode="aspectFill"></image> | <image src="@/static/image/peopleNum.png" mode="aspectFill"></image> | ||||
<text>总人数:6</text> | |||||
<text>总人数:{{item.total}}</text> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="bottom"> | <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> | <image src="@/static/image/see.png" mode="aspectFill"></image> | ||||
<text>分片详情</text> | <text>分片详情</text> | ||||
</view> | </view> | ||||
@@ -38,10 +38,13 @@ | |||||
</view> | </view> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { | |||||
page | |||||
} from '@/api/work/passengerFlow.js' | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
list: [{}, {}, {}, {}, {}, {}, {}, {}, {}, ], | |||||
list: [], | |||||
isLoading: false, | isLoading: false, | ||||
status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了 | status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了 | ||||
page: { | page: { | ||||
@@ -57,17 +60,18 @@ | |||||
loadmore() { | loadmore() { | ||||
if (this.status != 'loadmore') return | if (this.status != 'loadmore') return | ||||
this.status = 'loading' | 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' | this.status = 'nomore' | ||||
} else { | } else { | ||||
this.status = 'loadmore' | this.status = 'loadmore' | ||||
} | } | ||||
}, 2000) | |||||
}) | |||||
}, | }, | ||||
refresh() { | refresh() { | ||||
this.status = 'loadmore' | this.status = 'loadmore' | ||||
@@ -4,15 +4,15 @@ | |||||
<image src="@/static/image/home.png" mode="aspectFill" | <image src="@/static/image/home.png" mode="aspectFill" | ||||
style="width: 38rpx;height: 38rpx;margin-right: 8rpx;"> | style="width: 38rpx;height: 38rpx;margin-right: 8rpx;"> | ||||
</image> | </image> | ||||
寝室104 | |||||
寝室{{info.name}} | |||||
</view> | </view> | ||||
<view class="listTitlte"> | |||||
<view class="listTitlte" v-if="list.filter(e=>e.tick).length"> | |||||
已归寝 | 已归寝 | ||||
</view> | </view> | ||||
<view class="list"> | <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"> | <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> | </image> | ||||
<view class="des"> | <view class="des"> | ||||
<view class="top"> | <view class="top"> | ||||
@@ -20,30 +20,30 @@ | |||||
已归寝 | 已归寝 | ||||
</view> | </view> | ||||
<view class="name"> | <view class="name"> | ||||
杨云 | |||||
{{item.name}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="depart"> | <view class="depart"> | ||||
系部:安环部 | |||||
系部:{{item.majorName}} | |||||
</view> | </view> | ||||
<view class="bottom"> | <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> | ||||
</view> | </view> | ||||
<view class="returnTime"> | <view class="returnTime"> | ||||
归寝时间:2024-08-15 11:59:12 | |||||
归寝时间:{{item.tick?item.tick:'-'}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="listTitlte"> | |||||
<view class="listTitlte" v-if="list.filter(e=>!e.tick).length"> | |||||
未归寝 | 未归寝 | ||||
</view> | </view> | ||||
<view class="list"> | <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"> | <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> | </image> | ||||
<view class="des"> | <view class="des"> | ||||
<view class="top"> | <view class="top"> | ||||
@@ -51,20 +51,20 @@ | |||||
未归寝 | 未归寝 | ||||
</view> | </view> | ||||
<view class="name"> | <view class="name"> | ||||
杨云 | |||||
{{item.name}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="depart"> | <view class="depart"> | ||||
系部:安环部 | |||||
系部:{{item.majorName}} | |||||
</view> | </view> | ||||
<view class="bottom"> | <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> | ||||
</view> | </view> | ||||
<view class="returnTime"> | <view class="returnTime"> | ||||
归寝时间:2024-08-15 11:59:12 | |||||
归寝时间:{{item.tick?item.tick:'-'}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -73,19 +73,32 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import { | |||||
returnInfo | |||||
} from '@/api/work/returnBed.js' | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
list: [{ | |||||
name: 1 | |||||
}, { | |||||
name: 2 | |||||
}, { | |||||
name: 3 | |||||
}], | |||||
list: [], | |||||
info:{}, | |||||
checkboxValue: [], | 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: {} | methods: {} | ||||
} | } | ||||
</script> | </script> | ||||
@@ -1,28 +1,28 @@ | |||||
<template> | <template> | ||||
<view style="height: 100%;"> | <view style="height: 100%;"> | ||||
<view class="searchBox"> | <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> | </view> | ||||
<u-empty marginTop="100rpx" :show="false" mode="list" text="暂无数据"></u-empty> | <u-empty marginTop="100rpx" :show="false" mode="list" text="暂无数据"></u-empty> | ||||
<u-list @scrolltolower="scrolltolower" style="height: calc(100% - 220rpx);"> | <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="whiteCard"> | ||||
<view class="row1"> | <view class="row1"> | ||||
<text class="room">寝室302</text> | |||||
<text class="room">寝室{{item.name}}</text> | |||||
</view> | </view> | ||||
<view class="row2"> | <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> | ||||
<view class="bottom"> | <view class="bottom"> | ||||
<view class="peopleNum"> | <view class="peopleNum"> | ||||
<image src="@/static/image/peopleNum1.png" mode="aspectFill"></image> | <image src="@/static/image/peopleNum1.png" mode="aspectFill"></image> | ||||
<text>寝室人数:6</text> | |||||
<text>寝室人数:{{item.personCount}}</text> | |||||
</view> | </view> | ||||
<view class="btn" @click="NAV_TO('./detail')"> | |||||
<view class="btn" @click="NAV_TO('./detail',{id:item.id,ReturnTime:search.ReturnTime})"> | |||||
<text>查看</text> | <text>查看</text> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -36,6 +36,10 @@ | |||||
<script> | <script> | ||||
import selectRadio from "@/components/selectRadio.vue" | import selectRadio from "@/components/selectRadio.vue" | ||||
import selectSearch from "@/components/selectSearch.vue" | import selectSearch from "@/components/selectSearch.vue" | ||||
import { | |||||
returnPageList | |||||
} from '@/api/work/returnBed.js' | |||||
import {dateFormat} from '@/utils/date.js' | |||||
export default { | export default { | ||||
components: { | components: { | ||||
selectRadio, | selectRadio, | ||||
@@ -43,52 +47,59 @@ | |||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
list: [{}, {}, {}, {}, {}, {}, {}, {}, {}, ], | |||||
list: [], | |||||
isLoading: false, | isLoading: false, | ||||
status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了 | status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了 | ||||
search: { | search: { | ||||
loudong: 1, | |||||
qinshi: '' | |||||
buildId: '', | |||||
ReturnTime:'', | |||||
}, | }, | ||||
room:'', | |||||
page: { | page: { | ||||
pageNum: 1, | pageNum: 1, | ||||
pageSize: 10, | |||||
pageSize: 1000, | |||||
}, | }, | ||||
} | } | ||||
}, | }, | ||||
mounted() { | |||||
}, | |||||
methods: { | methods: { | ||||
scrolltolower() { | scrolltolower() { | ||||
this.loadmore() | this.loadmore() | ||||
}, | }, | ||||
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 | if (this.status != 'loadmore') return | ||||
this.status = 'loading' | 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' | this.status = 'nomore' | ||||
} else { | } else { | ||||
this.status = 'loadmore' | this.status = 'loadmore' | ||||
} | } | ||||
}, 2000) | |||||
}) | |||||
}, | }, | ||||
refresh(){ | |||||
refresh() { | |||||
this.status = 'loadmore' | this.status = 'loadmore' | ||||
this.list = [] | this.list = [] | ||||
this.page.page = 1 | this.page.page = 1 | ||||
this.loadmore() | this.loadmore() | ||||
}, | }, | ||||
pullDownRefresh(){ | |||||
pullDownRefresh() { | |||||
this.refresh() | this.refresh() | ||||
} | } | ||||
}, | }, | ||||
onLoad() { | onLoad() { | ||||
this.loadmore() | this.loadmore() | ||||
}, | }, | ||||
onPullDownRefresh(){ | |||||
onPullDownRefresh() { | |||||
uni.stopPullDownRefresh() | uni.stopPullDownRefresh() | ||||
this.refresh() | this.refresh() | ||||
} | } | ||||
@@ -143,8 +154,10 @@ | |||||
margin-top: 24rpx; | margin-top: 24rpx; | ||||
padding-top: 30rpx; | padding-top: 30rpx; | ||||
position: relative; | position: relative; | ||||
.peopleNum { | .peopleNum { | ||||
padding-top: 4rpx; | padding-top: 4rpx; | ||||
uni-image { | uni-image { | ||||
width: 34rpx; | width: 34rpx; | ||||
height: 34rpx; | height: 34rpx; | ||||
@@ -157,6 +170,7 @@ | |||||
font-size: 26rpx; | font-size: 26rpx; | ||||
} | } | ||||
} | } | ||||
.btn { | .btn { | ||||
text-align: center; | text-align: center; | ||||
line-height: 60rpx; | line-height: 60rpx; | ||||
@@ -165,6 +179,7 @@ | |||||
color: #fff; | color: #fff; | ||||
border-radius: 30rpx; | border-radius: 30rpx; | ||||
font-size: 26rpx; | font-size: 26rpx; | ||||
uni-image { | uni-image { | ||||
width: 34rpx; | width: 34rpx; | ||||
height: 34rpx; | height: 34rpx; | ||||
@@ -18,7 +18,7 @@ | |||||
<template v-for="(item, index) in list"> | <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="item" @click="popupShow(item)" :key="index" v-show="cateList.length&&cateList[cate].show(item)"> | ||||
<view class="right"> | <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> | style="width: 160rpx;height: 160rpx;border-radius:10rpx"></image> | ||||
<view class="des"> | <view class="des"> | ||||
<view class="top"> | <view class="top"> | ||||
@@ -45,7 +45,7 @@ | |||||
</view> | </view> | ||||
<u-popup :show="show" mode="center" :round="10"> | <u-popup :show="show" mode="center" :round="10"> | ||||
<view class="popupInfo"> | <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> | </image> | ||||
<view class="top"> | <view class="top"> | ||||
<view class="status" :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }"> | <view class="status" :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }"> | ||||
@@ -114,7 +114,7 @@ | |||||
if (res.code != 200) return | if (res.code != 200) return | ||||
this.alarmList = res.data.list | this.alarmList = res.data.list | ||||
this.list = this.list.map(e => { | 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 点名(实到) | // alarmType:lie_on_table 趴桌子 class_room_call 点名(实到) | ||||
let arr = this.alarmList.filter(e1 => e1.personId == e.personId) | let arr = this.alarmList.filter(e1 => e1.personId == e.personId) | ||||
e.alarmTypes = arr.map(e=>e.alarmType) | e.alarmTypes = arr.map(e=>e.alarmType) | ||||
@@ -71,7 +71,8 @@ | |||||
this.status = 'loading' | this.status = 'loading' | ||||
taskPage({ | taskPage({ | ||||
...this.page, | ...this.page, | ||||
...this.search | |||||
...this.search, | |||||
}).then(res => { | }).then(res => { | ||||
if(res.code != 200)return | if(res.code != 200)return | ||||
res.data.list.forEach(e=>{ | res.data.list.forEach(e=>{ | ||||
@@ -37,10 +37,11 @@ const saveLifeData = function(key, value) { | |||||
uni.setStorageSync('lifeData', tmp); | uni.setStorageSync('lifeData', tmp); | ||||
} | } | ||||
if (key == 'refreshToken') { | 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({ | const store = new Vuex.Store({ | ||||
@@ -51,7 +52,7 @@ const store = new Vuex.Store({ | |||||
refreshToken: lifeData.refreshToken || '', | refreshToken: lifeData.refreshToken || '', | ||||
allOptions: lifeData.allOptions || { | allOptions: lifeData.allOptions || { | ||||
monitorList: [], //摄像头列表 | monitorList: [], //摄像头列表 | ||||
monitorList:[], //楼栋列表 | |||||
buildingList:[], //楼栋列表 | |||||
}, | }, | ||||
}, | }, | ||||
actions: { | 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 | 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 | return e | ||||
}) | }) | ||||
}) | }) | ||||