| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <view>
- <view class="status_bar"></view>
- <view class="" style="position: relative;top: 64px;">
- <view style="position: fixed;z-index: 100;">
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="防治系统" right-icon="search" @clickRight="clickRight"
- size="16"></uni-nav-bar>
- </view>
- <image :src="'http://static.yfpyx.com/bigdata_app'+'/image/prevention/1.png'" mode="" class="image"></image>
- <view class="prevents">
- <view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
- <image :src="item.is_online==1?'http://static.yfpyx.com/bigdata_app/image/prevention/6.png':'http://static.yfpyx.com/bigdata_app/image/prevention/7.png'"
- mode="" class="prevents_item_img"></image>
- <view class="prevents_item_top">
- <p>设备 ID:{{item.imei}}</p>
- <p :class="item.is_online==1?'green':'red'" v-text="item.is_online==1?'在线':'离线'"></p>
- </view>
- <view class="prevents_item_bot">
- 最新上报时间:{{item.addtime|timeFormat()}}
- </view>
- </view>
- </view>
- </view>
- <view class="top" v-if="isTop" @click="top">
- <image :src="'http://static.yfpyx.com/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'" mode=""></image>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- page: 1,
- size: 10,
- eqlistdata: [],
- isTop:false
- }
- },
- methods: {
- async eqlist() { //设备列表
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
- data: {
- device_type_id: 2,
- page: this.page,
- size: this.size,
- }
- })
- this.eqlistdata = this.eqlistdata.concat(res.data)
- console.log(this.eqlistdata)
- },
- clickLeft() {
- uni.switchTab({
- url: "../index/index"
- })
- },
- clickRight() {
- uni.navigateTo({
- url: "./search"
- })
- },
- eqdetails(data) {
- uni.navigateTo({
- url: "./equipmentdetails?shebei=" + JSON.stringify(data)
- })
- },
- top() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 500
- })
- }
- },
- onLoad() {
- this.eqlist()
- },
- onReachBottom() {
- this.page++
- this.eqlist()
- },
- onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
- if (e.scrollTop > 200) { //距离大于200时显示
- this.isTop = true
- } else { //距离小于200时隐藏
- this.isTop = false
- }
- },
- }
- </script>
- <style lang="scss">
- /deep/.uni-icons {
- font-size: 40rpx !important;
- }
- .image {
- position: fixed;
- top: 108px;
- width: 100%;
- height: 160rpx;
- z-index: 555;
- }
- .prevents {
- width: 100%;
- position: absolute;
- top: 140px;
- .prevents_item {
- width: 95%;
- margin: 0 auto 30rpx;
- border-radius: 10rpx;
- box-shadow: 0 0 10rpx #bcb9ca;
- padding: 20rpx 40rpx 20rpx 80rpx;
- position: relative;
- box-sizing: border-box;
- .prevents_item_img {
- width: 30rpx;
- height: 50rpx;
- position: absolute;
- top: -4rpx;
- left: 30rpx;
- }
- .prevents_item_top {
- display: flex;
- justify-content: space-between;
- height: 60rpx;
- border-bottom: 2rpx solid #F4F4F4;
- line-height: 60rpx;
- font-size: 26rpx;
- .red {
- color: #ff0000;
- }
- .green {
- color: #7DBB91;
- }
- }
- .prevents_item_bot {
- margin-top: 20rpx;
- font-size: 26rpx;
- color: #BDBDBD;
- }
- }
- }
- .top {
- position: fixed;
- right: 30px;
- bottom: 100px;
- z-index: 100;
- image{
- width: 100rpx;
- height: 100rpx;
- }
- }
- </style>
|