12 changed files with 2916 additions and 288 deletions
@ -0,0 +1,330 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
<view> |
||||
|
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)"> |
||||
|
|
||||
|
<view class="item-top"> |
||||
|
<view class="drop" v-show="item.ostate=='0'"></view> |
||||
|
<view class="item-top-text">{{item.messageName}}</view> |
||||
|
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image> |
||||
|
</view> |
||||
|
|
||||
|
<view class="item-con"> |
||||
|
<view> |
||||
|
<text class="item-con-text">提交人:</text> |
||||
|
<text class="item-con-text">{{item.name}}</text> |
||||
|
</view> |
||||
|
<view style="margin-top: 8px;"> |
||||
|
<text class="item-con-text">提交时间:</text> |
||||
|
<text class="item-con-text">{{item.date}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<!-- <uni-load-more :status="loadingType"></uni-load-more> --> |
||||
|
|
||||
|
</view> |
||||
|
<!-- 加载....没有更多 --> |
||||
|
<view style="line-height: 60rpx;margin-bottom: 50rpx;"> |
||||
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
triggered: true, |
||||
|
status: 'loadmore', |
||||
|
iconType: 'flower', |
||||
|
loadText: { |
||||
|
loadmore: '轻轻上拉', |
||||
|
loading: '努力加载中', |
||||
|
nomore: '拉也没用,没有了' |
||||
|
}, |
||||
|
listQuery: { |
||||
|
current: 1, |
||||
|
size: 10, |
||||
|
params: { |
||||
|
userSid: "", |
||||
|
messageName: "", |
||||
|
state: "2", //0未读 1 已读 2全部 |
||||
|
} |
||||
|
}, |
||||
|
loadingType: 'more', //加载更多状态 |
||||
|
dataList: [ |
||||
|
|
||||
|
], |
||||
|
}; |
||||
|
}, |
||||
|
onPullDownRefresh() { |
||||
|
this.listQuery.current = 1 |
||||
|
this.loadData('refresh'); |
||||
|
setTimeout(function() { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
}, 2000); |
||||
|
}, |
||||
|
//加载更多 |
||||
|
onReachBottom() { |
||||
|
this.listQuery.current = this.listQuery.current + 1 |
||||
|
this.loadData(); |
||||
|
}, |
||||
|
onLoad() { |
||||
|
|
||||
|
let token = uni.getStorageSync("Global-Auth-Token") |
||||
|
if (token != null && token.length != 0) { |
||||
|
getApp().globalData.token = token |
||||
|
} |
||||
|
let isLogin = uni.getStorageSync("isLogin") |
||||
|
if (isLogin != null && isLogin == 1) { |
||||
|
getApp().globalData.isLogin = isLogin |
||||
|
} |
||||
|
let sid = uni.getStorageSync("sid") |
||||
|
if (sid != null && sid.length != 0) { |
||||
|
getApp().globalData.sid = sid |
||||
|
} |
||||
|
|
||||
|
console.log('用户Sid', getApp().globalData.sid) |
||||
|
console.log('token', getApp().globalData.token) |
||||
|
console.log('是否登陆', getApp().globalData.isLogin) |
||||
|
|
||||
|
// setTimeout(() => { |
||||
|
if (getApp().globalData.isLogin) { |
||||
|
var userSid = getApp().globalData.sid |
||||
|
console.log(">>>>>", userSid) |
||||
|
|
||||
|
this.listQuery.params.userSid = userSid |
||||
|
|
||||
|
this.loadData(); |
||||
|
// uni.setTabBarBadge({ //显示数字 |
||||
|
// index: 0, //tabbar下标 |
||||
|
// text: '100' //数字 |
||||
|
// }) |
||||
|
} else { |
||||
|
|
||||
|
/* #ifdef MP-WEIXIN */ |
||||
|
this.WxSilentLogin() |
||||
|
/* #endif */ |
||||
|
|
||||
|
/* #ifdef APP-PLUS */ |
||||
|
uni.redirectTo({ |
||||
|
url: '../login/login' |
||||
|
}) |
||||
|
/* #endif */ |
||||
|
} |
||||
|
}, |
||||
|
onShow() { |
||||
|
console.log('onShow', getApp().globalData.isLogin) |
||||
|
|
||||
|
if (this.dataList.length > 0) { |
||||
|
var num = 0 |
||||
|
for (var i = 0; i < this.dataList.length; i++) { |
||||
|
var item = this.dataList[i] |
||||
|
if (item.ostate == '0') { |
||||
|
num++; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
console.log('num', num) |
||||
|
if (num != 0) { |
||||
|
uni.setTabBarBadge({ //显示数字 |
||||
|
index: 1, //tabbar下标 |
||||
|
text: num > 100 ? "99+" : num + "" //数字 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
itemClick(item) { |
||||
|
console.log('item', item.pagepath) |
||||
|
uni.navigateTo({ |
||||
|
url: "/" + item.pagepath |
||||
|
}) |
||||
|
|
||||
|
item.ostate = "2" |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
//加载商品 ,带下拉刷新和上滑加载 |
||||
|
async loadData(type = 'add', loading) { |
||||
|
//没有更多直接返回 |
||||
|
if (type === 'add') { |
||||
|
if (this.loadingType === 'nomore') { |
||||
|
return; |
||||
|
} |
||||
|
this.loadingType = 'loading'; |
||||
|
} else { |
||||
|
this.loadingType = 'more'; |
||||
|
} |
||||
|
|
||||
|
var list = [] |
||||
|
|
||||
|
this.$api.messageListPage(this.listQuery).then((resp) => { |
||||
|
// if (resp.success) { |
||||
|
console.log('1111', resp) |
||||
|
|
||||
|
// list = resp.records |
||||
|
|
||||
|
for (var i = 0; i < resp.records.length; i++) { |
||||
|
var item = resp.records[i] |
||||
|
var title = item.map.thing2 |
||||
|
console.log("title", title) |
||||
|
|
||||
|
list.push({ |
||||
|
messageName: title, |
||||
|
name: item.map.thing3, |
||||
|
date: item.map.time1, |
||||
|
pagepath: item.pagepath, |
||||
|
ostate: item.ostate |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
console.log("消息列表", list) |
||||
|
if (type === 'refresh') { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
|
||||
|
this.dataList = this.dataList.concat(list); |
||||
|
console.log("消息列表>>>>>", this.dataList.length) |
||||
|
|
||||
|
if (this.dataList.length > 0) { |
||||
|
var num = 0 |
||||
|
for (var i = 0; i < this.dataList.length; i++) { |
||||
|
var item = this.dataList[i] |
||||
|
if (item.ostate == '0') { |
||||
|
num++; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
if (num != 0) { |
||||
|
|
||||
|
uni.setTabBarBadge({ //显示数字 |
||||
|
index: 1, //tabbar下标 |
||||
|
text: num > 100 ? "99+" : num + "" //数字 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) |
||||
|
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more'; |
||||
|
if (type === 'refresh') { |
||||
|
if (loading == 1) { |
||||
|
uni.hideLoading(); |
||||
|
} else { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
|
||||
|
.newslist { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
background: #fff; |
||||
|
border-radius: 12px; |
||||
|
margin-left: 12px; |
||||
|
margin-right: 12px; |
||||
|
margin-top: 12px; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.item-top { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
padding-bottom: 12px; |
||||
|
padding-left: 5px; |
||||
|
padding-right: 5px; |
||||
|
border-bottom: 1px solid #F1F3F5; |
||||
|
|
||||
|
.drop { |
||||
|
width: 6px; |
||||
|
height: 6px; |
||||
|
background: #f00; |
||||
|
border-radius: 50%; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.item-top-img { |
||||
|
width: 18px; |
||||
|
height: 18px; |
||||
|
} |
||||
|
|
||||
|
.item-top-text { |
||||
|
flex: 1; |
||||
|
|
||||
|
margin-right: 10px; |
||||
|
font-size: 16px; |
||||
|
color: #101010; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
|
||||
|
.item-top-text2 { |
||||
|
font-size: 14px; |
||||
|
color: #0A59F7; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-con { |
||||
|
margin-top: 12px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item-con-text { |
||||
|
font-size: 15px; |
||||
|
color: #666666; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-bom { |
||||
|
width: 100%; |
||||
|
margin-top: 12px; |
||||
|
padding-top: 10px; |
||||
|
border-top: 1px solid #F1F3F5; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: end; |
||||
|
|
||||
|
.item-bom-img { |
||||
|
width: 14px; |
||||
|
height: 14px; |
||||
|
} |
||||
|
|
||||
|
.item-bom-text { |
||||
|
margin-left: 5px; |
||||
|
font-size: 14px; |
||||
|
color: #999; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,268 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
|
||||
|
<view class="top"> |
||||
|
|
||||
|
<view class="top-item"> |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">仓库名称:</text> |
||||
|
<text class="top-item-text2">{{info.warehouseName}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">异常时间:</text> |
||||
|
<text class="top-item-text2">{{info.exceptionTime}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
|
||||
|
<view class="top-item-bom"> |
||||
|
<text class="top-item-bom-text1" @click="textClick('1')">库房详情</text> |
||||
|
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" |
||||
|
@scrolltolower="lower" @scroll="scroll"> |
||||
|
|
||||
|
<view style="padding-bottom: 50px;"> |
||||
|
|
||||
|
<view v-for="(item,index) in info.linkers" class="newslist"> |
||||
|
|
||||
|
|
||||
|
<view class="item" :class="{'item2':index+1== info.linkers.length}"> |
||||
|
<view class="item-lift"> |
||||
|
<text class="item-lift-text">联系人:{{item.name}}</text> |
||||
|
<text class="item-lift-text">联系电话:{{item.mobile}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<image class="item-img" src="https://supervise.yxtsoft.com/img/base/lxkf.png" |
||||
|
@click="makeCall(item.mobile)"></image> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
scrollTop: 0, |
||||
|
old: { |
||||
|
scrollTop: 0 |
||||
|
}, |
||||
|
info: { |
||||
|
warehouseSid: "", |
||||
|
warehouseName: "", |
||||
|
exceptionTime: "", |
||||
|
linkers: [], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
console.log("option", option) |
||||
|
|
||||
|
console.log("info", option.info) |
||||
|
console.log("info22", JSON.parse(option.info)) |
||||
|
|
||||
|
var data = JSON.parse(option.info) |
||||
|
|
||||
|
this.info = { |
||||
|
|
||||
|
warehouseSid: data.warehouseSid, |
||||
|
warehouseName: data.warehouseName, |
||||
|
exceptionTime: data.exceptionTime, |
||||
|
linkers: data.linkers, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 禁止滑动 |
||||
|
preventHandler() { |
||||
|
return |
||||
|
}, |
||||
|
upper: function(e) { |
||||
|
console.log(e) |
||||
|
}, |
||||
|
lower: function(e) { |
||||
|
console.log(e) |
||||
|
}, |
||||
|
scroll: function(e) { |
||||
|
console.log(e) |
||||
|
this.old.scrollTop = e.detail.scrollTop |
||||
|
}, |
||||
|
textClick(index) { |
||||
|
switch (index) { |
||||
|
case "1": |
||||
|
// 库房详情 |
||||
|
uni.navigateTo({ |
||||
|
url: 'WarehouseDetaile?sid='+this.info.warehouseSid |
||||
|
}); |
||||
|
break; |
||||
|
case "2": |
||||
|
// 工作派单 |
||||
|
uni.showToast({ |
||||
|
icon: "none", |
||||
|
title: '工作派单', |
||||
|
duration: 2000, |
||||
|
}); |
||||
|
// uni.navigateTo({ |
||||
|
// url: '../index/ReadWork' |
||||
|
// }); |
||||
|
break; |
||||
|
default: |
||||
|
break; |
||||
|
} |
||||
|
}, |
||||
|
makeCall(mobile) { |
||||
|
wx.makePhoneCall({ |
||||
|
//仅为示例,并非真实的电话号码 |
||||
|
phoneNumber: mobile |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
position: fixed; |
||||
|
overflow: auto; |
||||
|
|
||||
|
.top { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.top-item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-drop { |
||||
|
background: #1684FC; |
||||
|
border-radius: 50%; |
||||
|
width: 8px; |
||||
|
height: 8px; |
||||
|
} |
||||
|
|
||||
|
.top-item-text { |
||||
|
margin-left: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-text1 { |
||||
|
font-size: 15px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.top-item-text2 { |
||||
|
font-size: 18px; |
||||
|
color: #000; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-item-bom { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
width: 100%; |
||||
|
margin-left: 30px; |
||||
|
margin-right: 30px; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.top-item-bom-text1 { |
||||
|
padding: 5px 20px; |
||||
|
color: #2F96E1; |
||||
|
font-size: 14px; |
||||
|
border: 1px solid #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.top-item-bom-text2 { |
||||
|
padding: 5px 20px; |
||||
|
color: #fff; |
||||
|
font-size: 14px; |
||||
|
background: #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.scroll-Y { |
||||
|
overflow-y: hidden; |
||||
|
height: 90vh; |
||||
|
background: #fff; |
||||
|
|
||||
|
.newslist { |
||||
|
margin-top: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding-left: 10px; |
||||
|
padding-right: 10px; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
padding: 10px; |
||||
|
align-items: center; |
||||
|
|
||||
|
.item-lift { |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item-lift-text { |
||||
|
margin-top: 10px; |
||||
|
font-size: 14px; |
||||
|
color: #777777; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-img { |
||||
|
margin-left: 20px; |
||||
|
width: 35px; |
||||
|
height: 35px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item2 { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
padding: 10px; |
||||
|
align-items: center; |
||||
|
border-bottom: none; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
@ -0,0 +1,481 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
|
||||
|
<view class="top"> |
||||
|
|
||||
|
<view class="top-item"> |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">仓库名称:</text> |
||||
|
<text class="top-item-text2">{{info.warehouseName}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">异常时间:</text> |
||||
|
<text class="top-item-text2">{{info.exceptionTime}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
|
||||
|
<view class="top-item-bom"> |
||||
|
<text class="top-item-bom-text1" @click="textClick('1')">联系库房</text> |
||||
|
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" |
||||
|
@scrolltolower="lower" @scroll="scroll"> |
||||
|
|
||||
|
<view style="padding-bottom: 50px;"> |
||||
|
|
||||
|
<view v-for="(item,index) in info.dataList" class="newslist"> |
||||
|
|
||||
|
<view class="list-item"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<!-- <view class="list-item-text"> |
||||
|
<text class="list-item-text1">名称:</text> |
||||
|
<text class="list-item-text2">{{item.name}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="list-item-text"> |
||||
|
<text class="list-item-text1">序列号:</text> |
||||
|
<text class="list-item-text2">{{item.code}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="list-item-text"> |
||||
|
<text class="list-item-text1">状态:</text> |
||||
|
<text class="list-item-text2">{{item.state}}</text> |
||||
|
</view> --> |
||||
|
<view class="item-lift"> |
||||
|
<image class="item-img" src="https://supervise.yxtsoft.com/img/base/sbyc.png"></image> |
||||
|
<text class="item-state">{{item.state}}</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<view class="item-text"> |
||||
|
<view class="item-text-lay"> |
||||
|
<text class="item-lay-text1">名称:</text> |
||||
|
<text class="item-lay-text2">{{item.name}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="item-text-lay" style="margin-top: 10px;"> |
||||
|
<text class="item-lay-text1">序列号:</text> |
||||
|
<text class="item-lay-text2">{{item.code}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
scrollTop: 0, |
||||
|
old: { |
||||
|
scrollTop: 0 |
||||
|
}, |
||||
|
params: { |
||||
|
sid: "", |
||||
|
// sid: "", |
||||
|
wxCode: "", |
||||
|
}, |
||||
|
|
||||
|
info: { |
||||
|
warehouseSid: "", |
||||
|
warehouseName: "", |
||||
|
exceptionTime: "", |
||||
|
linkers: [], |
||||
|
dataList: [ |
||||
|
// { |
||||
|
// name: "摄像头1", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头2", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头3", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头4", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头5", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头6", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头7", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头8", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头9", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// }, |
||||
|
// { |
||||
|
// name: "摄像头10", |
||||
|
// code: "sak-545-an-5464", |
||||
|
// state: "断网" |
||||
|
// } |
||||
|
|
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
|
||||
|
// this.sid = option.sid |
||||
|
|
||||
|
this.params = { |
||||
|
sid: option.sid |
||||
|
} |
||||
|
console.log("sid", this.params.sid) |
||||
|
|
||||
|
wx.hideHomeButton() |
||||
|
this.init() |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
// 禁止滑动 |
||||
|
preventHandler() { |
||||
|
return |
||||
|
}, |
||||
|
upper: function(e) { |
||||
|
console.log(e) |
||||
|
}, |
||||
|
lower: function(e) { |
||||
|
console.log(e) |
||||
|
}, |
||||
|
scroll: function(e) { |
||||
|
console.log(e) |
||||
|
this.old.scrollTop = e.detail.scrollTop |
||||
|
}, |
||||
|
init() { |
||||
|
let that = this |
||||
|
wx.login({ |
||||
|
success: function(res) { |
||||
|
if (res.code) { |
||||
|
console.log('Http网络请求信息', { |
||||
|
"wxCode": res.code |
||||
|
}) |
||||
|
|
||||
|
that.params.wxCode = res.code |
||||
|
that.getData(that.params) |
||||
|
} |
||||
|
}, |
||||
|
fail: function(res) { |
||||
|
uni.showToast({ |
||||
|
title: "网络错误,请退出后重新进入。", |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
getData(data) { |
||||
|
console.log("data", data) |
||||
|
this.$api.getDeviceExceptionInfo(data).then((resp) => { |
||||
|
// if (resp.success) { |
||||
|
console.log('1111', resp) |
||||
|
|
||||
|
this.info.warehouseSid = resp.shSid |
||||
|
this.info.warehouseName = resp.shName |
||||
|
this.info.exceptionTime = resp.messageTime |
||||
|
this.info.linkers = resp.linkers |
||||
|
|
||||
|
var str = resp.text.substring(1, (resp.text.length - 1)) |
||||
|
|
||||
|
console.log('1111', str) |
||||
|
|
||||
|
var str2 = str.split("Device") |
||||
|
console.log('222', str2) |
||||
|
|
||||
|
for (var i = 0; i < str2.length; i++) { |
||||
|
|
||||
|
var item = str2[i] |
||||
|
|
||||
|
if (item) { |
||||
|
|
||||
|
var str3 = item.split(", ") |
||||
|
console.log('3333', str3) |
||||
|
|
||||
|
|
||||
|
var name = str3[0].substring(6) |
||||
|
console.log('name', name) |
||||
|
|
||||
|
var code = str3[1].substring(13) |
||||
|
console.log('code', code) |
||||
|
|
||||
|
var state = str3[2].substring(7, str3[2].length - 1) |
||||
|
console.log('state', state) |
||||
|
|
||||
|
this.info.dataList.push({ |
||||
|
name: name, |
||||
|
code: code, |
||||
|
state: state, |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
}) |
||||
|
}, |
||||
|
textClick(index) { |
||||
|
switch (index) { |
||||
|
case "1": |
||||
|
// 联系库房 |
||||
|
// uni.showToast({ |
||||
|
// icon: "none", |
||||
|
// title: '联系库房', |
||||
|
// duration: 2000, |
||||
|
// }); |
||||
|
uni.navigateTo({ |
||||
|
url: '../index/ContactWarehouse?info=' + JSON.stringify(this.info), |
||||
|
}); |
||||
|
break; |
||||
|
case "2": |
||||
|
// 工作派单 |
||||
|
uni.showToast({ |
||||
|
icon: "none", |
||||
|
title: '工作派单', |
||||
|
duration: 2000, |
||||
|
}); |
||||
|
// uni.navigateTo({ |
||||
|
// url: '../index/ReadWork' |
||||
|
// }); |
||||
|
break; |
||||
|
default: |
||||
|
break; |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
position: fixed; |
||||
|
overflow: auto; |
||||
|
|
||||
|
.top { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.top-item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-drop { |
||||
|
background: #1684FC; |
||||
|
border-radius: 50%; |
||||
|
width: 8px; |
||||
|
height: 8px; |
||||
|
} |
||||
|
|
||||
|
.top-item-text { |
||||
|
margin-left: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-text1 { |
||||
|
font-size: 15px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.top-item-text2 { |
||||
|
font-size: 18px; |
||||
|
color: #000; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-item-bom { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
width: 100%; |
||||
|
margin-left: 30px; |
||||
|
margin-right: 30px; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.top-item-bom-text1 { |
||||
|
padding: 5px 20px; |
||||
|
color: #2F96E1; |
||||
|
font-size: 14px; |
||||
|
border: 1px solid #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.top-item-bom-text2 { |
||||
|
padding: 5px 20px; |
||||
|
color: #fff; |
||||
|
font-size: 14px; |
||||
|
background: #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.scroll-Y { |
||||
|
overflow-y: hidden; |
||||
|
height: 90vh; |
||||
|
|
||||
|
.newslist { |
||||
|
margin-top: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding-left: 10px; |
||||
|
padding-right: 10px; |
||||
|
|
||||
|
.list-item { |
||||
|
margin-top: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
background: #fff; |
||||
|
border-radius: 5px; |
||||
|
align-items: center; |
||||
|
padding: 20px 25px; |
||||
|
|
||||
|
|
||||
|
.item-lift { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
|
||||
|
.item-img { |
||||
|
width: 30px; |
||||
|
height: 30px; |
||||
|
} |
||||
|
|
||||
|
.item-state { |
||||
|
font-size: 12px; |
||||
|
color: #fff; |
||||
|
margin-top: 5px; |
||||
|
background: #41CAC0; |
||||
|
border-radius: 15px; |
||||
|
padding: 2px 15px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-text { |
||||
|
margin-left: 20px; |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item-text-lay { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.item-lay-text1 { |
||||
|
font-size: 14px; |
||||
|
color: #9F9F9F; |
||||
|
} |
||||
|
|
||||
|
.item-lay-text2 { |
||||
|
flex: 1; |
||||
|
font-size: 16px; |
||||
|
color: #000; |
||||
|
// font-weight: 600; |
||||
|
// font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
// .list-item-text { |
||||
|
// margin-top: 5px; |
||||
|
// display: flex; |
||||
|
// flex-direction: row; |
||||
|
// align-items: center; |
||||
|
|
||||
|
// .list-item-text1 { |
||||
|
// font-size: 15px; |
||||
|
// color: #666; |
||||
|
// } |
||||
|
|
||||
|
// .list-item-text2 { |
||||
|
// font-size: 18px; |
||||
|
// color: #000; |
||||
|
// font-weight: 600; |
||||
|
// font-family: sans-serif; |
||||
|
// overflow: hidden; |
||||
|
// text-overflow: ellipsis; |
||||
|
// display: -webkit-box; |
||||
|
// -webkit-line-clamp: 1; |
||||
|
// -webkit-box-orient: vertical; |
||||
|
// } |
||||
|
// } |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,220 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
<view> |
||||
|
<view v-for="(item,index) in dataList" class="newslist"> |
||||
|
|
||||
|
<view class="item" @click="itemClick(item)" :class="{'item2':index+1 == dataList.length}"> |
||||
|
|
||||
|
<view class="item-lift" > |
||||
|
<text class="item-lift-top">{{item.time}} [{{item.type}}]</text> |
||||
|
<text class="item-lift-bom">{{item.name}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<image class="imge" src="../../static/baseIcon/zy.png"></image> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- 加载....没有更多 --> |
||||
|
<view style="line-height: 60rpx;margin-bottom: 50px;"> |
||||
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
status: 'loadmore', |
||||
|
iconType: 'flower', |
||||
|
loadText: { |
||||
|
loadmore: '轻轻上拉', |
||||
|
loading: '努力加载中', |
||||
|
nomore: '拉也没用,没有了' |
||||
|
}, |
||||
|
listQuery: { |
||||
|
current: 1, |
||||
|
size: 10, |
||||
|
params: { |
||||
|
userSid: "", |
||||
|
} |
||||
|
}, |
||||
|
loadingType: 'more', //加载更多状态 |
||||
|
dataList: [ |
||||
|
|
||||
|
] |
||||
|
} |
||||
|
},onPullDownRefresh() { |
||||
|
this.listQuery.current = 1 |
||||
|
this.loadData('refresh'); |
||||
|
setTimeout(function() { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
}, 2000); |
||||
|
}, |
||||
|
//加载更多 |
||||
|
onReachBottom() { |
||||
|
this.listQuery.current = this.listQuery.current + 1 |
||||
|
this.loadData(); |
||||
|
}, |
||||
|
onLoad() { |
||||
|
|
||||
|
var userSid = getApp().globalData.sid |
||||
|
console.log(">>>>>", userSid) |
||||
|
this.listQuery.params.userSid = userSid |
||||
|
|
||||
|
this.loadData(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
//加载商品 ,带下拉刷新和上滑加载 |
||||
|
async loadData(type = 'add', loading) { |
||||
|
//没有更多直接返回 |
||||
|
if (type === 'add') { |
||||
|
if (this.loadingType === 'nomore') { |
||||
|
return; |
||||
|
} |
||||
|
this.loadingType = 'loading'; |
||||
|
} else { |
||||
|
this.loadingType = 'more'; |
||||
|
} |
||||
|
|
||||
|
var list = [] |
||||
|
|
||||
|
console.log('listQuery', this.listQuery) |
||||
|
|
||||
|
this.$api.deviceListPage(this.listQuery).then((resp) => { |
||||
|
// if (resp.success) { |
||||
|
console.log('1111', resp) |
||||
|
|
||||
|
|
||||
|
for (var i = 0; i < resp.records.length; i++) { |
||||
|
var item = resp.records[i] |
||||
|
var data = item.templateMessageVo |
||||
|
console.log("data", data) |
||||
|
list.push({ |
||||
|
sid:item.riskSid, |
||||
|
time: data.time, |
||||
|
name: data.shName, |
||||
|
type: item.type, |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
console.log("消息列表", list) |
||||
|
if (type === 'refresh') { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
|
||||
|
this.dataList = this.dataList.concat(list); |
||||
|
console.log("消息列表>>>>>", this.dataList.length) |
||||
|
|
||||
|
|
||||
|
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) |
||||
|
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more'; |
||||
|
if (type === 'refresh') { |
||||
|
if (loading == 1) { |
||||
|
uni.hideLoading(); |
||||
|
} else { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
itemClick(item) { |
||||
|
console.log('item', item) |
||||
|
var type = item.type |
||||
|
var sid = item.sid |
||||
|
var date = item.time |
||||
|
|
||||
|
if('设备离线'==type){ |
||||
|
// 设备离线 |
||||
|
uni.navigateTo({ |
||||
|
url: "/pages/index/DeviceException?sid="+sid |
||||
|
}) |
||||
|
}else if('系统异常'==type){ |
||||
|
// 系统故障 |
||||
|
uni.navigateTo({ |
||||
|
url: "/pages/index/SystemFailure?date="+date |
||||
|
}) |
||||
|
} else{ |
||||
|
uni.showToast({ |
||||
|
icon: "none", |
||||
|
title: '暂不支持', |
||||
|
duration: 2000, |
||||
|
}); |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
padding-top: 10px; |
||||
|
|
||||
|
.newslist { |
||||
|
|
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item { |
||||
|
background: #fff; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.item-lift { |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item-lift-top { |
||||
|
color: #101010; |
||||
|
font-size: 16px; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif |
||||
|
} |
||||
|
|
||||
|
.item-lift-bom { |
||||
|
margin-top: 5px; |
||||
|
color: #707070; |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.imge { |
||||
|
width: 20px; |
||||
|
height: 20px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item2{ |
||||
|
background: #fff; |
||||
|
border-bottom: none; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,330 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
<view> |
||||
|
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)"> |
||||
|
|
||||
|
<view class="item-top"> |
||||
|
<view class="drop" v-show="item.ostate=='0'"></view> |
||||
|
<view class="item-top-text">{{item.messageName}}</view> |
||||
|
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image> |
||||
|
</view> |
||||
|
|
||||
|
<view class="item-con"> |
||||
|
<view> |
||||
|
<text class="item-con-text">提交人:</text> |
||||
|
<text class="item-con-text">{{item.name}}</text> |
||||
|
</view> |
||||
|
<view style="margin-top: 8px;"> |
||||
|
<text class="item-con-text">提交时间:</text> |
||||
|
<text class="item-con-text">{{item.date}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<!-- <uni-load-more :status="loadingType"></uni-load-more> --> |
||||
|
|
||||
|
</view> |
||||
|
<!-- 加载....没有更多 --> |
||||
|
<view style="line-height: 60rpx;margin-bottom: 50rpx;"> |
||||
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
triggered: true, |
||||
|
status: 'loadmore', |
||||
|
iconType: 'flower', |
||||
|
loadText: { |
||||
|
loadmore: '轻轻上拉', |
||||
|
loading: '努力加载中', |
||||
|
nomore: '拉也没用,没有了' |
||||
|
}, |
||||
|
listQuery: { |
||||
|
current: 1, |
||||
|
size: 10, |
||||
|
params: { |
||||
|
userSid: "", |
||||
|
messageName: "", |
||||
|
state: "2", //0未读 1 已读 2全部 |
||||
|
} |
||||
|
}, |
||||
|
loadingType: 'more', //加载更多状态 |
||||
|
dataList: [ |
||||
|
|
||||
|
], |
||||
|
}; |
||||
|
}, |
||||
|
onPullDownRefresh() { |
||||
|
this.listQuery.current = 1 |
||||
|
this.loadData('refresh'); |
||||
|
setTimeout(function() { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
}, 2000); |
||||
|
}, |
||||
|
//加载更多 |
||||
|
onReachBottom() { |
||||
|
this.listQuery.current = this.listQuery.current + 1 |
||||
|
this.loadData(); |
||||
|
}, |
||||
|
onLoad() { |
||||
|
|
||||
|
let token = uni.getStorageSync("Global-Auth-Token") |
||||
|
if (token != null && token.length != 0) { |
||||
|
getApp().globalData.token = token |
||||
|
} |
||||
|
let isLogin = uni.getStorageSync("isLogin") |
||||
|
if (isLogin != null && isLogin == 1) { |
||||
|
getApp().globalData.isLogin = isLogin |
||||
|
} |
||||
|
let sid = uni.getStorageSync("sid") |
||||
|
if (sid != null && sid.length != 0) { |
||||
|
getApp().globalData.sid = sid |
||||
|
} |
||||
|
|
||||
|
console.log('用户Sid', getApp().globalData.sid) |
||||
|
console.log('token', getApp().globalData.token) |
||||
|
console.log('是否登陆', getApp().globalData.isLogin) |
||||
|
|
||||
|
// setTimeout(() => { |
||||
|
if (getApp().globalData.isLogin) { |
||||
|
var userSid = getApp().globalData.sid |
||||
|
console.log(">>>>>", userSid) |
||||
|
|
||||
|
this.listQuery.params.userSid = userSid |
||||
|
|
||||
|
this.loadData(); |
||||
|
// uni.setTabBarBadge({ //显示数字 |
||||
|
// index: 0, //tabbar下标 |
||||
|
// text: '100' //数字 |
||||
|
// }) |
||||
|
} else { |
||||
|
|
||||
|
/* #ifdef MP-WEIXIN */ |
||||
|
this.WxSilentLogin() |
||||
|
/* #endif */ |
||||
|
|
||||
|
/* #ifdef APP-PLUS */ |
||||
|
uni.redirectTo({ |
||||
|
url: '../login/login' |
||||
|
}) |
||||
|
/* #endif */ |
||||
|
} |
||||
|
}, |
||||
|
onShow() { |
||||
|
console.log('onShow', getApp().globalData.isLogin) |
||||
|
|
||||
|
if (this.dataList.length > 0) { |
||||
|
var num = 0 |
||||
|
for (var i = 0; i < this.dataList.length; i++) { |
||||
|
var item = this.dataList[i] |
||||
|
if (item.ostate == '0') { |
||||
|
num++; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
console.log('num', num) |
||||
|
if (num != 0) { |
||||
|
uni.setTabBarBadge({ //显示数字 |
||||
|
index: 1, //tabbar下标 |
||||
|
text: num > 100 ? "99+" : num + "" //数字 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
itemClick(item) { |
||||
|
console.log('item', item.pagepath) |
||||
|
uni.navigateTo({ |
||||
|
url: "/" + item.pagepath |
||||
|
}) |
||||
|
|
||||
|
item.ostate = "2" |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
//加载商品 ,带下拉刷新和上滑加载 |
||||
|
async loadData(type = 'add', loading) { |
||||
|
//没有更多直接返回 |
||||
|
if (type === 'add') { |
||||
|
if (this.loadingType === 'nomore') { |
||||
|
return; |
||||
|
} |
||||
|
this.loadingType = 'loading'; |
||||
|
} else { |
||||
|
this.loadingType = 'more'; |
||||
|
} |
||||
|
|
||||
|
var list = [] |
||||
|
|
||||
|
this.$api.messageListPage(this.listQuery).then((resp) => { |
||||
|
// if (resp.success) { |
||||
|
console.log('1111', resp) |
||||
|
|
||||
|
// list = resp.records |
||||
|
|
||||
|
for (var i = 0; i < resp.records.length; i++) { |
||||
|
var item = resp.records[i] |
||||
|
var title = item.map.thing2 |
||||
|
console.log("title", title) |
||||
|
|
||||
|
list.push({ |
||||
|
messageName: title, |
||||
|
name: item.map.thing3, |
||||
|
date: item.map.time1, |
||||
|
pagepath: item.pagepath, |
||||
|
ostate: item.ostate |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
console.log("消息列表", list) |
||||
|
if (type === 'refresh') { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
|
||||
|
this.dataList = this.dataList.concat(list); |
||||
|
console.log("消息列表>>>>>", this.dataList.length) |
||||
|
|
||||
|
if (this.dataList.length > 0) { |
||||
|
var num = 0 |
||||
|
for (var i = 0; i < this.dataList.length; i++) { |
||||
|
var item = this.dataList[i] |
||||
|
if (item.ostate == '0') { |
||||
|
num++; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
if (num != 0) { |
||||
|
|
||||
|
uni.setTabBarBadge({ //显示数字 |
||||
|
index: 1, //tabbar下标 |
||||
|
text: num > 100 ? "99+" : num + "" //数字 |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) |
||||
|
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more'; |
||||
|
if (type === 'refresh') { |
||||
|
if (loading == 1) { |
||||
|
uni.hideLoading(); |
||||
|
} else { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
|
||||
|
.newslist { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
background: #fff; |
||||
|
border-radius: 12px; |
||||
|
margin-left: 12px; |
||||
|
margin-right: 12px; |
||||
|
margin-top: 12px; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.item-top { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
padding-bottom: 12px; |
||||
|
padding-left: 5px; |
||||
|
padding-right: 5px; |
||||
|
border-bottom: 1px solid #F1F3F5; |
||||
|
|
||||
|
.drop { |
||||
|
width: 6px; |
||||
|
height: 6px; |
||||
|
background: #f00; |
||||
|
border-radius: 50%; |
||||
|
margin-right: 5px; |
||||
|
} |
||||
|
|
||||
|
.item-top-img { |
||||
|
width: 18px; |
||||
|
height: 18px; |
||||
|
} |
||||
|
|
||||
|
.item-top-text { |
||||
|
flex: 1; |
||||
|
|
||||
|
margin-right: 10px; |
||||
|
font-size: 16px; |
||||
|
color: #101010; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
|
||||
|
.item-top-text2 { |
||||
|
font-size: 14px; |
||||
|
color: #0A59F7; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-con { |
||||
|
margin-top: 12px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item-con-text { |
||||
|
font-size: 15px; |
||||
|
color: #666666; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-bom { |
||||
|
width: 100%; |
||||
|
margin-top: 12px; |
||||
|
padding-top: 10px; |
||||
|
border-top: 1px solid #F1F3F5; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: end; |
||||
|
|
||||
|
.item-bom-img { |
||||
|
width: 14px; |
||||
|
height: 14px; |
||||
|
} |
||||
|
|
||||
|
.item-bom-text { |
||||
|
margin-left: 5px; |
||||
|
font-size: 14px; |
||||
|
color: #999; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,600 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
|
||||
|
<view class="top"> |
||||
|
|
||||
|
<view class="top-item"> |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">仓库名称:</text> |
||||
|
<text class="top-item-text2">{{info.warehouseName}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">异常时间:</text> |
||||
|
<text class="top-item-text2">{{info.exceptionTime}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
|
||||
|
<view class="top-item-bom"> |
||||
|
<text class="top-item-bom-text1" @click="textClick('1')">联系库房</text> |
||||
|
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" |
||||
|
@scrolltolower="lower" @scroll="scroll"> |
||||
|
|
||||
|
<view style="padding-bottom: 50px;"> |
||||
|
|
||||
|
<view v-for="(item,index) in info.dataList" class="newslist"> |
||||
|
|
||||
|
<view class="list-item"> |
||||
|
<view class="list-item-top"> |
||||
|
<text class="list-item-top-text1">摄像头:</text> |
||||
|
<text class="list-item-top-text2">{{item.name}}</text> |
||||
|
<text class="list-item-top-text3" @click="openApplet(item.name)">查看设备</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="list-item-bom"> |
||||
|
|
||||
|
<view class="list-item-image"> |
||||
|
<image class="img" :src="item.startImage" mode="aspectFill" |
||||
|
@click="amplifyImage(item.startImage)"></image> |
||||
|
<text class="time">{{item.startTime}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="content"> |
||||
|
<text class="content-text1">{{item.similarity}}</text> |
||||
|
<text class="content-text2"> 相似度 </text> |
||||
|
</view> |
||||
|
|
||||
|
<view class="list-item-image"> |
||||
|
<image class="img" :src="item.endImage" mode="aspectFill" |
||||
|
@click="amplifyImage(item.endImage)"></image> |
||||
|
<text class="time">{{item.endTime}}</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
tokenValue: '', |
||||
|
scrollTop: 0, |
||||
|
old: { |
||||
|
scrollTop: 0 |
||||
|
}, |
||||
|
params: { |
||||
|
sid: "", |
||||
|
// sid: "", |
||||
|
wxCode: "", |
||||
|
}, |
||||
|
|
||||
|
info: { |
||||
|
warehouseSid: "", |
||||
|
warehouseName: "", |
||||
|
exceptionTime: "", |
||||
|
linkers:[], |
||||
|
dataList: [ |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头1", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头2", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头3", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头4", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头5", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头6", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头7", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
// { |
||||
|
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time1: "2023-04-06 16:00", |
||||
|
// ratio: "80%", |
||||
|
// name: "摄像头8", |
||||
|
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg", |
||||
|
// time2: "2023-04-06 16:00", |
||||
|
// }, |
||||
|
|
||||
|
|
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
|
||||
|
this.params = { |
||||
|
sid: option.sid |
||||
|
} |
||||
|
console.log("sid", this.params.sid) |
||||
|
|
||||
|
wx.hideHomeButton() |
||||
|
this.init() |
||||
|
|
||||
|
uni.request({ |
||||
|
// 组装请求地址 |
||||
|
url: "https://supervise.yxtsoft.com/monitorapi/device/getToken", |
||||
|
// 请求方式 GET POST |
||||
|
method: "GET", |
||||
|
header: { |
||||
|
// 传参方式 |
||||
|
'content-type': "application/x-www-form-urlencoded" |
||||
|
}, |
||||
|
// 具体参数 |
||||
|
data: {}, |
||||
|
success: res => { |
||||
|
|
||||
|
this.tokenValue = res.data.data |
||||
|
console.log("tokenValueres", this.tokenValue) |
||||
|
}, |
||||
|
fail: (err) => {}, |
||||
|
complete: () => {} |
||||
|
}); |
||||
|
}, |
||||
|
methods: { |
||||
|
// 禁止滑动 |
||||
|
preventHandler() { |
||||
|
return |
||||
|
}, |
||||
|
upper: function(e) { |
||||
|
console.log(e) |
||||
|
}, |
||||
|
lower: function(e) { |
||||
|
console.log(e) |
||||
|
}, |
||||
|
scroll: function(e) { |
||||
|
console.log(e) |
||||
|
this.old.scrollTop = e.detail.scrollTop |
||||
|
}, |
||||
|
|
||||
|
init() { |
||||
|
let that = this |
||||
|
wx.login({ |
||||
|
success: function(res) { |
||||
|
if (res.code) { |
||||
|
console.log('Http网络请求信息', { |
||||
|
"wxCode": res.code |
||||
|
}) |
||||
|
|
||||
|
that.params.wxCode = res.code |
||||
|
that.getData(that.params) |
||||
|
} |
||||
|
}, |
||||
|
fail: function(res) { |
||||
|
uni.showToast({ |
||||
|
title: "网络错误,请退出后重新进入。", |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
getData(data) { |
||||
|
console.log("data", data) |
||||
|
this.$api.getGoodsExceptionInfo(data).then((resp) => { |
||||
|
// if (resp.success) { |
||||
|
console.log('1111', resp) |
||||
|
|
||||
|
this.info.warehouseSid = resp.shSid |
||||
|
this.info.warehouseName = resp.shName |
||||
|
this.info.exceptionTime = resp.messageTime |
||||
|
this.info.linkers = resp.linkers |
||||
|
|
||||
|
var str = resp.text.substring(1, (resp.text.length - 1)) |
||||
|
|
||||
|
console.log('1111', str) |
||||
|
|
||||
|
var str2 = str.split("DeviceImages") |
||||
|
console.log('222', str2) |
||||
|
|
||||
|
for (var i = 0; i < str2.length; i++) { |
||||
|
|
||||
|
var item = str2[i] |
||||
|
|
||||
|
if (item) { |
||||
|
|
||||
|
var str3 = item.split(", ") |
||||
|
console.log('3333', str3) |
||||
|
|
||||
|
|
||||
|
var endImage = str3[0].substring(10) |
||||
|
console.log('endImage', endImage) |
||||
|
|
||||
|
var endTime = str3[1].substring(8) |
||||
|
console.log('endTime', endTime) |
||||
|
|
||||
|
var name = str3[2].substring(5) |
||||
|
console.log('name', name) |
||||
|
|
||||
|
var similarity = str3[3].substring(11) |
||||
|
console.log('similarity', similarity) |
||||
|
|
||||
|
var startImage = str3[4].substring(11) |
||||
|
console.log('startImage', startImage) |
||||
|
|
||||
|
var startTime = str3[5].substring(10, str3[5].length - 1) |
||||
|
console.log('startTime', startTime) |
||||
|
|
||||
|
this.info.dataList.push({ |
||||
|
endImage: endImage, |
||||
|
endTime: endTime, |
||||
|
name: name, |
||||
|
similarity: similarity, |
||||
|
startImage: startImage, |
||||
|
startTime: startTime, |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
}) |
||||
|
}, |
||||
|
textClick(index) { |
||||
|
switch (index) { |
||||
|
case "1": |
||||
|
// 联系库房 |
||||
|
// uni.showToast({ |
||||
|
// icon: "none", |
||||
|
// title: '联系库房', |
||||
|
// duration: 2000, |
||||
|
// }); |
||||
|
uni.navigateTo({ |
||||
|
url: '../index/ContactWarehouse?info='+JSON.stringify( this.info), |
||||
|
}); |
||||
|
break; |
||||
|
case "2": |
||||
|
// 工作派单 |
||||
|
uni.showToast({ |
||||
|
icon: "none", |
||||
|
title: '工作派单', |
||||
|
duration: 2000, |
||||
|
}); |
||||
|
// uni.navigateTo({ |
||||
|
// url: '../index/ReadWork' |
||||
|
// }); |
||||
|
break; |
||||
|
default: |
||||
|
break; |
||||
|
} |
||||
|
}, |
||||
|
amplifyImage(imgUrl) { |
||||
|
wx.previewImage({ |
||||
|
current: '', |
||||
|
urls: [imgUrl] |
||||
|
|
||||
|
}) |
||||
|
}, |
||||
|
openApplet(name) { |
||||
|
|
||||
|
var _this = this |
||||
|
|
||||
|
// var deviceValue = "" // 设备序列号 |
||||
|
// var channelNoValue = "" // 通道号,若为直连IPC通道号填写1 |
||||
|
var modelTypeValue = "" // 直播模板,全量full,极简simple,语音voiceType,安防security,默认全量 |
||||
|
var backModelTypeValue = "" // 回放模板,全量full,极简simple,默认全量 |
||||
|
var startTimeValue = Date.parse(new Date()) - 24 * 60 * 60 * |
||||
|
1000 // 回放开始时间,开始时间必须<结束时间<当前时间,否则报错时间参数错误并且关闭半屏小程序或者回到上一级页面 时间为13位时间戳:2022-09-14 20:52:05 == 1663159925000 |
||||
|
var endTimeValue = Date.parse(new Date()) // 回放结束时间 时间为13位时间戳:2022-09-14 20:52:05 == 1663159925000 |
||||
|
var playbackSourceValue = "" // 指定回放源,cloud云存储,local本地,默认使用者可自由切换回放源 |
||||
|
// var envVersion = "release" // 要打开的小程序版本,默认release即正式版 |
||||
|
|
||||
|
uni.request({ |
||||
|
// 组装请求地址 |
||||
|
url: "https://supervise.yxtsoft.com/monitorapi/device/getDeviceListBySid", |
||||
|
// 请求方式 GET POST |
||||
|
method: "GET", |
||||
|
header: { |
||||
|
// 传参方式 |
||||
|
'content-type': "application/x-www-form-urlencoded" |
||||
|
}, |
||||
|
// 具体参数 |
||||
|
data: { |
||||
|
"sid": _this.info.warehouseSid, |
||||
|
"deviceName": name |
||||
|
}, |
||||
|
success: res => { |
||||
|
console.log("请求res", res) |
||||
|
|
||||
|
// deviceValue = res.data.nvrSerial |
||||
|
// channelNoValue = res.data.channelNo |
||||
|
|
||||
|
console.log("tokenValue", _this.tokenValue) |
||||
|
console.log("deviceValue", res.data.data.nvrSerial) |
||||
|
console.log("channelNoValue", res.data.data.channelNo) |
||||
|
console.log("startTimeValue", startTimeValue) |
||||
|
console.log("endTimeValue", endTimeValue) |
||||
|
|
||||
|
wx.openEmbeddedMiniProgram({ |
||||
|
|
||||
|
appId: 'wxf2b3a0262975d8c2', |
||||
|
|
||||
|
path: '/pages/live/live?accessToken=' + _this.tokenValue + '&deviceSerial=' + |
||||
|
res.data.data.nvrSerial + '&channelNo=' + res.data.data.channelNo + '&modelType=' + |
||||
|
modelTypeValue + '&backModelType=' + backModelTypeValue + |
||||
|
'&startTime=' + |
||||
|
startTimeValue + '&endTime=' + endTimeValue + '&playbackSource=' + |
||||
|
playbackSourceValue, |
||||
|
|
||||
|
envVersion: 'release' |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
fail: (err) => {}, |
||||
|
complete: () => {} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
position: fixed; |
||||
|
overflow: auto; |
||||
|
|
||||
|
.top { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.top-item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-drop { |
||||
|
background: #1684FC; |
||||
|
border-radius: 50%; |
||||
|
width: 8px; |
||||
|
height: 8px; |
||||
|
} |
||||
|
|
||||
|
.top-item-text { |
||||
|
margin-left: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-text1 { |
||||
|
font-size: 15px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.top-item-text2 { |
||||
|
font-size: 18px; |
||||
|
color: #000; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-item-bom { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
width: 100%; |
||||
|
margin-left: 30px; |
||||
|
margin-right: 30px; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.top-item-bom-text1 { |
||||
|
padding: 5px 20px; |
||||
|
color: #2F96E1; |
||||
|
font-size: 14px; |
||||
|
border: 1px solid #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.top-item-bom-text2 { |
||||
|
padding: 5px 20px; |
||||
|
color: #fff; |
||||
|
font-size: 14px; |
||||
|
background: #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.scroll-Y { |
||||
|
overflow-y: hidden; |
||||
|
height: 90vh; |
||||
|
|
||||
|
.newslist { |
||||
|
margin-top: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding-left: 10px; |
||||
|
padding-right: 10px; |
||||
|
|
||||
|
.list-item { |
||||
|
margin-top: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
background: #fff; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
.list-item-top { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
border-bottom: 1px solid #ECECEC; |
||||
|
padding-bottom: 10px; |
||||
|
margin-top: 10px; |
||||
|
padding-left: 10px; |
||||
|
|
||||
|
.list-item-top-text1 { |
||||
|
font-size: 15px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.list-item-top-text2 { |
||||
|
font-size: 18px; |
||||
|
flex: 1; |
||||
|
margin-right: 10px; |
||||
|
color: #000; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
|
||||
|
.list-item-top-text3 { |
||||
|
margin-right: 10px; |
||||
|
font-size: 12px; |
||||
|
color: #2F96E1; |
||||
|
border: 1px solid #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
padding: 5px 10px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.list-item-bom { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
margin-bottom: 15px; |
||||
|
margin-top: 10px; |
||||
|
margin-left: 15px; |
||||
|
margin-right: 15px; |
||||
|
|
||||
|
.list-item-image { |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
|
||||
|
.img { |
||||
|
border-radius: 8px; |
||||
|
width: 100%; |
||||
|
height: 70px; |
||||
|
} |
||||
|
|
||||
|
.time { |
||||
|
margin-top: 8px; |
||||
|
color: #1684FC; |
||||
|
font-size: 10px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.content { |
||||
|
margin-top: 5px; |
||||
|
height: 65px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
border: 1px solid #FC8C05; |
||||
|
border-radius: 50%; |
||||
|
padding-left: 13px; |
||||
|
padding-right: 13px; |
||||
|
|
||||
|
.content-text1 { |
||||
|
font-size: 18px; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
color: #ff5500; |
||||
|
} |
||||
|
|
||||
|
.content-text2 { |
||||
|
font-size: 12px; |
||||
|
color: #000; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
@ -0,0 +1,190 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
<view> |
||||
|
|
||||
|
<view v-for="(item,index) in dataList" class="newslist"> |
||||
|
|
||||
|
<view class="item" @click="itemClick(item.sid)"> |
||||
|
|
||||
|
<view class="item-lift"> |
||||
|
<text class="item-lift-top">{{item.time}} [二级风险]</text> |
||||
|
<text class="item-lift-bom">{{item.name}}-{{item.cont}}</text> |
||||
|
</view> |
||||
|
|
||||
|
<image class="imge" src="../../static/baseIcon/zy.png"></image> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<!-- 加载....没有更多 --> |
||||
|
<view style="line-height: 60rpx;margin-bottom: 50px;"> |
||||
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
status: 'loadmore', |
||||
|
iconType: 'flower', |
||||
|
loadText: { |
||||
|
loadmore: '轻轻上拉', |
||||
|
loading: '努力加载中', |
||||
|
nomore: '拉也没用,没有了' |
||||
|
}, |
||||
|
listQuery: { |
||||
|
current: 1, |
||||
|
size: 10, |
||||
|
params: { |
||||
|
userSid: "", |
||||
|
} |
||||
|
}, |
||||
|
loadingType: 'more', //加载更多状态 |
||||
|
dataList: [ |
||||
|
|
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
onPullDownRefresh() { |
||||
|
this.listQuery.current = 1 |
||||
|
this.loadData('refresh'); |
||||
|
setTimeout(function() { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
}, 2000); |
||||
|
}, |
||||
|
//加载更多 |
||||
|
onReachBottom() { |
||||
|
this.listQuery.current = this.listQuery.current + 1 |
||||
|
this.loadData(); |
||||
|
}, |
||||
|
onLoad() { |
||||
|
|
||||
|
var userSid = getApp().globalData.sid |
||||
|
console.log(">>>>>", userSid) |
||||
|
this.listQuery.params.userSid = userSid |
||||
|
|
||||
|
this.loadData(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
//加载商品 ,带下拉刷新和上滑加载 |
||||
|
async loadData(type = 'add', loading) { |
||||
|
//没有更多直接返回 |
||||
|
if (type === 'add') { |
||||
|
if (this.loadingType === 'nomore') { |
||||
|
return; |
||||
|
} |
||||
|
this.loadingType = 'loading'; |
||||
|
} else { |
||||
|
this.loadingType = 'more'; |
||||
|
} |
||||
|
|
||||
|
var list = [] |
||||
|
|
||||
|
console.log('listQuery', this.listQuery) |
||||
|
|
||||
|
this.$api.riskListPage(this.listQuery).then((resp) => { |
||||
|
// if (resp.success) { |
||||
|
console.log('1111', resp) |
||||
|
|
||||
|
|
||||
|
for (var i = 0; i < resp.records.length; i++) { |
||||
|
var item = resp.records[i] |
||||
|
var data = item.map |
||||
|
console.log("data", data) |
||||
|
list.push({ |
||||
|
sid:item.riskSid, |
||||
|
time: data.time5, |
||||
|
name: data.thing3, |
||||
|
cont: data.thing4, |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
console.log("消息列表", list) |
||||
|
if (type === 'refresh') { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
|
||||
|
this.dataList = this.dataList.concat(list); |
||||
|
console.log("消息列表>>>>>", this.dataList.length) |
||||
|
|
||||
|
|
||||
|
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) |
||||
|
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more'; |
||||
|
if (type === 'refresh') { |
||||
|
if (loading == 1) { |
||||
|
uni.hideLoading(); |
||||
|
} else { |
||||
|
uni.stopPullDownRefresh(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
itemClick(sid) { |
||||
|
console.log('sid', sid) |
||||
|
uni.navigateTo({ |
||||
|
url: "/pages/index/GoodsException?sid=" + sid |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
padding-top: 10px; |
||||
|
|
||||
|
.newslist { |
||||
|
|
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item { |
||||
|
background: #fff; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.item-lift { |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.item-lift-top { |
||||
|
color: #101010; |
||||
|
font-size: 16px; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif |
||||
|
} |
||||
|
|
||||
|
.item-lift-bom { |
||||
|
margin-top: 5px; |
||||
|
color: #707070; |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.imge { |
||||
|
width: 20px; |
||||
|
height: 20px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,196 @@ |
|||||
|
<template> |
||||
|
<view class="pages"> |
||||
|
|
||||
|
<view class="top"> |
||||
|
|
||||
|
<view class="top-item" > |
||||
|
<view class="top-item-drop"></view> |
||||
|
<view class="top-item-text"> |
||||
|
<text class="top-item-text1">异常时间:</text> |
||||
|
<text class="top-item-text2">{{info.exceptionTime}}</text> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
<view class="top-item" style="margin-top: 20px;"> |
||||
|
|
||||
|
<view class="top-item-bom"> |
||||
|
<text class="top-item-bom-text1" @click="textClick('1')">联系技术人员</text> |
||||
|
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<view class="bom"> |
||||
|
<image class="img" src="https://supervise.yxtsoft.com/img/base/xtgz.png"></image> |
||||
|
<text class="text" >提示:监控中心未收到报警系统的消息,请联系技术人员!</text> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
info: { |
||||
|
warehouseSid: "", |
||||
|
exceptionTime: "", |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
|
||||
|
// this.sid = option.sid |
||||
|
|
||||
|
this.info = { |
||||
|
warehouseSid: option.shSid, |
||||
|
exceptionTime: option.date, |
||||
|
} |
||||
|
console.log("sid", this.info.warehouseSid) |
||||
|
|
||||
|
wx.hideHomeButton() |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
textClick(index) { |
||||
|
switch (index) { |
||||
|
case "1": |
||||
|
// 联系技术人员 |
||||
|
|
||||
|
uni.showToast({ |
||||
|
icon: "none", |
||||
|
title: '联系技术人员', |
||||
|
duration: 2000, |
||||
|
}); |
||||
|
// wx.makePhoneCall({ |
||||
|
// //仅为示例,并非真实的电话号码 |
||||
|
// phoneNumber: "" |
||||
|
// }) |
||||
|
break; |
||||
|
case "2": |
||||
|
// 工作派单 |
||||
|
uni.showToast({ |
||||
|
icon: "none", |
||||
|
title: '工作派单', |
||||
|
duration: 2000, |
||||
|
}); |
||||
|
// uni.navigateTo({ |
||||
|
// url: '../index/ReadWork' |
||||
|
// }); |
||||
|
break; |
||||
|
default: |
||||
|
break; |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.pages { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
position: fixed; |
||||
|
overflow: auto; |
||||
|
|
||||
|
.top { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding: 15px 20px; |
||||
|
|
||||
|
.top-item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-drop { |
||||
|
background: #1684FC; |
||||
|
border-radius: 50%; |
||||
|
width: 8px; |
||||
|
height: 8px; |
||||
|
} |
||||
|
|
||||
|
.top-item-text { |
||||
|
margin-left: 10px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
.top-item-text1 { |
||||
|
font-size: 15px; |
||||
|
color: #666; |
||||
|
} |
||||
|
|
||||
|
.top-item-text2 { |
||||
|
font-size: 18px; |
||||
|
color: #000; |
||||
|
font-weight: 600; |
||||
|
font-family: sans-serif; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 1; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-item-bom { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
width: 100%; |
||||
|
margin-left: 30px; |
||||
|
margin-right: 30px; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.top-item-bom-text1 { |
||||
|
padding: 5px 20px; |
||||
|
color: #2F96E1; |
||||
|
font-size: 14px; |
||||
|
border: 1px solid #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.top-item-bom-text2 { |
||||
|
padding: 5px 20px; |
||||
|
color: #fff; |
||||
|
font-size: 14px; |
||||
|
background: #2F96E1; |
||||
|
border-radius: 5px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.bom { |
||||
|
display: flex; |
||||
|
padding: 20px; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
|
||||
|
.img { |
||||
|
|
||||
|
width: 180px; |
||||
|
height: 180px; |
||||
|
} |
||||
|
.text{ |
||||
|
width: 60%; |
||||
|
line-height: 25px; |
||||
|
color: #6C6C6C; |
||||
|
margin-top: 10px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue