123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <template>
- <view class="details">
- <z-paging ref="paging" v-model="list" @query="queryList">
- <view class="details-tabs" slot="top">
- <u-tabs :list="tabList" @click="tabClick" lineWidth="40"></u-tabs>
- </view>
- <view class="details-total" slot="top">
- <view>已停车位:{{ 30 }}个;空余车位:{{ 36 }}个</view>
- </view>
- <view class="details-list">
- <view class="details-list-item" v-for="(item, index) in list" :key="index" @click="jumpPage('pages/index/deviceDetails/deviceDetails', { type: 3 })">
- <view class="details-list-item-header">
- <view>{{ item.roadNo }}</view>
- <view>{{ item.signal }}</view>
- </view>
- <view class="details-list-item-img">
- <u--image v-if="item.type === 1" src="../../../static/icons/daozhakongzhi.svg" width="174rpx" height="174rpx"></u--image>
- <u--image v-else-if="item.type === 2" src="../../../static/icons/shipinjiankongyemian.svg" width="174rpx" height="174rpx"></u--image>
- <u--image v-else-if="item.type === 3" src="../../../static/icons/chengguan-wu-bujian-gonggongsheshi-daoluxinxixianshiping.svg" width="174rpx" height="174rpx"></u--image>
- </view>
- <view class="details-list-item-bottom">
- <view>设备号{{ item.deviceNo }}</view>
- </view>
- </view>
- </view>
- </z-paging>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- roadInfo: {
- roadName: ''
- },
- tabList: [{
- name: '全部',
- value: ''
- },
- {
- name: '异常',
- value: 1
- },
- {
- name: '离线',
- value: 2
- }
- ],
- list: []
- }
- },
- onLoad(page) {
- if (page.roadName) {
- this.roadInfo.roadName = page.roadName
- uni.setNavigationBarTitle({
- title: page.roadName
- })
- }
- },
- methods: {
- queryList(pageNo, pageSize) {
- this.$refs.paging.complete([{
- roadNo: '入口道闸',
- signal: '降板',
- type: 1,
- deviceNo: '202103051265',
- electric: 9.9
- }, {
- roadNo: '入口车牌识别',
- signal: '在线',
- type: 2,
- deviceNo: '202103051265',
- electric: 10
- }, {
- roadNo: '入口显示屏',
- signal: '在线',
- type: 3,
- deviceNo: '202103051265',
- electric: 10
- }])
- },
- tabClick(val) {
- console.log(val)
- },
- getTimeLong(date) {
- const nowDate = (new Date()).valueOf()
- const curDate = (new Date(date)).valueOf()
- const timeLen = (nowDate - curDate) / 1000
- const day = parseInt(timeLen / (24 * 3600));
- const hour = parseInt((timeLen - day * 24 * 3600) / 3600);
- const minutes = parseInt((timeLen - day * 24 * 3600 - hour * 3600) / 60)
- const second = parseInt(timeLen % 60)
- return `${day}天${hour}时${minutes}分${second}秒`
- },
- jumpPage(url, params) {
- uni.$u.route({
- url, params
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- min-height: calc(100vh - 88rpx);
- background-color: #F6F6FF;
- }
- .details {
- font-family: 'PingFangSC-regular';
- &-tabs {
- background-color: #fff;
- }
- &-total {
- display: flex;
- justify-content: flex-end;
- margin-top: 32rpx;
- font-size: 26rpx;
- color: #000;
- padding-right: 20rpx;
- }
- &-list {
- padding: 40rpx 20rpx;
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- &-item {
- width: calc(50% - 52rpx);
- background-color: #fff;
- border-radius: 16rpx;
- padding: 20rpx;
- margin-bottom: 20rpx;
- &-header {
- display: flex;
- justify-content: space-between;
- color: #101010;
- font-size: 26rpx;
- }
- &-img {
- width: 152rpx;
- height: 152rpx;
- margin: 16rpx auto 46rpx;
- }
- &-bottom {
- text-align: center;
- font-size: 24rpx;
- color: #101010;
- }
- }
- }
- }
- </style>
|