lion 3 years ago
commit cdc96390af

@ -76,6 +76,9 @@
"key" : "PCBBZ-2Y4L5-V6AIY-Q2LHL-FSGLT-ZRBL6"
}
}
},
"router" : {
"base" : "/mobile/"
}
}
}

@ -17,6 +17,11 @@
"style": {
"navigationBarTitleText": "河道保洁"
}
},{
"path": "pages/location/index",
"style": {
"navigationBarTitleText": "河道保洁"
}
},{
"path": "inspect/inspect",
"style": {

@ -0,0 +1,287 @@
<template>
<view class="boxContent">
<view class="box-header">
<view class="search-wrap">
<!-- 如果使用u-search组件必须要给v-model绑定一个变量 -->
<u-search v-model="serachEntity.equipment_number" placeholder="请输入设备编号" @custom="tosearch()"
@search="tosearch()" height="56" :action-style="{color: '#fff'}">
</u-search>
</view>
</view>
<view :class="mask?'list listfixed':'list'" style="padding-top: 100rpx;">
<block v-for="(item, index) in dataList">
<u-card :title="item.equipment_number" padding="20" margin="20rpx" :border="true" :thumb="thumb"
thumb-width="36" sub-title="点击查看位置">
<view class="" slot="body" @click="todetail(item)">
<u-row gutter="16">
<u-col span="4">
<view class="demo-layout bg-purple">纬度</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{item.latitude}}</view>
</u-col>
<u-col span="4">
<view class="demo-layout bg-purple">经度</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{item.longitude}}
</view>
</u-col>
<u-col span="4">
<view class="demo-layout bg-purple">设备速度</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{item.speed/10}}km/h
</view>
</u-col>
<u-col span="4">
<view class="demo-layout bg-purple">设备告警</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{toGetWarn(item.alarm_message)}}
</view>
</u-col>
<u-col span="4">
<view class="demo-layout bg-purple">设备状态</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{toGetStatus(item.status)}}
</view>
</u-col>
<u-col span="4">
<view class="demo-layout bg-purple">上报时间</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{item.created_at}}</view>
</u-col>
<u-col span="4">
<view class="demo-layout bg-purple">更新时间</view>
</u-col>
<u-col span="8">
<view class="demo-layout bg-purple-light">{{item.updated_at}}</view>
</u-col>
</u-row>
</view>
</u-card>
</block>
<u-loadmore class="loadmore" :status="loadStatus" :load-text="loadText" />
<u-empty text="暂无数据" margin-top="200" v-if="dataList.length==0" mode="list"></u-empty>
</view>
</view>
</template>
<script>
export default {
data() {
return {
background: {
backgroundColor: '#0385e5'
},
serachEntity: {
equipment_number: ""
},
mask: false,
loadStatus: "loadmore",
loadText: {
loadmore: "加载更多",
nomore: "已经到底了"
},
dataList: [],
thumb: "/static/img/location.png",
currentPage: 0,
lastPage: 0,
customStyle: {
marginLeft: '20px',
fontSize: '30rpx'
},
value1Arr: [],
keyword: "",
title: "",
stat: [],
statusId: "",
proStatus: "",
typeId: "",
}
},
onReachBottom: function(e) {
if (this.currentPage >= this.lastPage) {
this.loadStatus = "nomore"
return;
}
this.loadPage(this.currentPage + 1);
},
onPullDownRefresh: function(e) {
this.loadPage(1);
},
onShow: function() {
var that = this;
},
onLoad(options) {
//this.loadPage(1);
},
methods: {
todetail(item) {
console.log(item)
const latitude = parseFloat(item.latitude);
const longitude = parseFloat(item.longitude);
let s_latlog = this.gcoord.transformFromWGSToGCJ(latitude, longitude);
uni.openLocation({
latitude: s_latlog.latitude,
longitude: s_latlog.longitude,
success: function() {
console.log('success');
}
});
},
toGetDirection(num) {
let name = "未知";
if (num >= 0 && num < 90) {
name = num == 0 ? "正北" : "东北"
} else if (num >= 90 && num < 180) {
name = num == 90 ? "正东" : "东南"
} else if (num >= 180 && num < 270) {
name = num == 180 ? "正南" : "西南"
} else if (num >= 270 && num < 360) {
name = num == 270 ? "正北" : "西北"
}
return name;
},
toGetWarn(str) {
if (str.indexOf(1) > -1) {
return "有";
} else {
return "无";
}
},
toGetStatus(str) {
console.log("Number(str)", Number(str))
if (Number(str) != 11) {
return "异常信号";
} else {
return "正常信号";
}
},
tosearch() {
this.$u.throttle(this.loadPage, 5000)
},
loadPage: function() {
uni.hideKeyboard()
var that = this;
this.util.request({
bindThis: that,
noauth: true,
api: '/api/mobile/gps/actual-time',
customLoading: false,
data: {
token: "57|nwepFVRKxEh87YpnjVCHTZgv3dTTHA0JjiCpSqir",
...that.serachEntity
},
utilSuccess: function(res) {
that.dataList = res;
},
utilFail: function(res) {
uni.stopPullDownRefresh();
this.util.alert(res);
}
});
}
}
}
</script>
<style>
.boxContent {
background: #f3f4f6;
min-height: 100vh;
}
.footer {
display: flex;
justify-content: flex-end;
}
.box-header {
position: fixed;
/* top: 0; */
width: 100%;
z-index: 99;
}
.u-row {
margin: 10rpx 0;
font-size: 28rpx;
}
.u-card {
z-index: 1;
}
</style>
<style scoped lang="scss">
.search-wrap {
background: #0385e5;
padding: 20rpx;
}
.overflowmask {
overflow: hidden;
}
.loadmore {
padding: 24rpx !important
}
.listfixed {
position: fixed;
width: 100%;
}
.u-config-wrap {
padding: 30rpx;
}
.bg-purple {
font-weight: bold;
}
.slot-content {
background-color: #FFFFFF;
padding: 24rpx;
.item-box {
margin-bottom: 50rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item {
border: 1px solid $u-type-primary;
color: $u-type-primary;
padding: 8rpx 40rpx;
border-radius: 100rpx;
margin-top: 30rpx;
}
.active {
color: #FFFFFF;
background-color: $u-type-primary;
}
}
}
</style>

@ -2,7 +2,7 @@
<view class="loginPage">
<view class="loginHeader">
<view class="loginHeaderTitle">欢迎使用巡查管理系统</view>
<view class="loginHeaderTitle">欢迎使用河道保洁系统</view>
<view class="back" @click="back"></view>
</view>
<view class="loginBox">

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>patrol-gamble-mobile</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/mobile/static/index.b0707a6a.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/mobile/static/js/chunk-vendors.f2f18815.js></script><script src=/mobile/static/js/index.4e484d44.js></script></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["solve-index"],{"2bd4":function(n,t,e){"use strict";e.r(t);var r=e("d27c"),u=e("4e2e");for(var c in u)"default"!==c&&function(n){e.d(t,n,(function(){return u[n]}))}(c);var f,i=e("f0c5"),a=Object(i["a"])(u["default"],r["b"],r["c"],!1,null,"6594b765",null,!1,r["a"],f);t["default"]=a.exports},"4e2e":function(n,t,e){"use strict";e.r(t);var r=e("7f71"),u=e.n(r);for(var c in r)"default"!==c&&function(n){e.d(t,n,(function(){return r[n]}))}(c);t["default"]=u.a},"7f71":function(n,t){},d27c:function(n,t,e){"use strict";var r;e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return c})),e.d(t,"a",(function(){return r}));var u=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div")},c=[]}}]);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -3,8 +3,8 @@ import gcoord from "./gcoord.js";
import {jsonp} from 'vue-jsonp'
const HOSTARR = {
// 'development': 'http://192.168.60.100:9001',
'development': 'http://hedaobaojie.115.langye.net',
'development': 'http://192.168.60.89',
//'development': 'http://hedaobaojie.115.langye.net',
'production': 'http://192.168.60.89'
}; // 审核状态
@ -167,12 +167,14 @@ const request = options => {
//'content-type': 'application/json'
}; // 如果已登录,请求中拼openId
var access_token = uni.getStorageSync(user_info_key).access_token;
if(isNull(access_token)){
uni.clearStorageSync();
uni.navigateTo({
url:'/pages/login/login'
});
var access_token = uni.getStorageSync(user_info_key).access_token;
if(!options.noauth){
if(isNull(access_token)){
uni.clearStorageSync();
uni.navigateTo({
url:'/pages/login/login'
});
}
}
if (isLogin()) {
options.data = {

Loading…
Cancel
Save