Commit d8838aa6 authored by 冯超鹏's avatar 冯超鹏

no message

parent f2148618
...@@ -74,9 +74,9 @@ ...@@ -74,9 +74,9 @@
"androidStyle" : "default", "androidStyle" : "default",
"iosStyle" : "common", "iosStyle" : "common",
"android" : { "android" : {
"xhdpi" : "unpackage/status/720 × 1242.png", "xhdpi" : "unpackage/status/泽宏启动页/728.1242.png",
"hdpi" : "unpackage/status/480 × 762.png", "hdpi" : "unpackage/status/泽宏启动页/480.762.png",
"xxhdpi" : "unpackage/status/1080 × 1882.png" "xxhdpi" : "unpackage/status/泽宏启动页/1080.1882.png"
} }
}, },
"icons" : { "icons" : {
......
...@@ -40,6 +40,11 @@ ...@@ -40,6 +40,11 @@
"style": { "style": {
"navigationBarTitleText": "经纬度" "navigationBarTitleText": "经纬度"
} }
}, {
"path": "pages/wifiisin/home",
"style": {
"navigationBarTitleText": "无网络状态"
}
}, { }, {
"path": "pages/adddevice/mpnaddlink", "path": "pages/adddevice/mpnaddlink",
"style": {} "style": {}
......
...@@ -182,23 +182,36 @@ ...@@ -182,23 +182,36 @@
devicemonad: this.danweiid, devicemonad: this.danweiid,
uid: this.addUserDeviceid, uid: this.addUserDeviceid,
} }
if (this.isdatadevice(data)) { uni.showLoading({
title: '加载中'
});
// if (this.isdatadevice(data)) {
let opts = { let opts = {
url: 'devices/adddevice', url: 'devices/adddevice',
method: 'post' method: 'post'
}; };
http.httpRequest(opts, data).then(res => { http.httpRequest(opts, data).then(res => {
console.log(res);
if (res.data.code === 200) { if (res.data.code === 200) {
uni.hideLoading();
uni.removeStorageSync('longitislongir'); uni.removeStorageSync('longitislongir');
uni.navigateTo({ uni.navigateTo({
url: '/pages/main/main', url: '/pages/main/main',
}); });
} else {
uni.hideLoading();
if (uni.getSystemInfoSync().platform == "Android" || uni.getSystemInfoSync().platform == "iOS") {
plus.nativeUI.toast(this.errorsshow(res.data.errors));
} else {
uni.showToast({
title: this.errorsshow(res.data.errors),
duration: 2000
});
}
} }
}, error => { }, error => {
console.log(error); console.log(error);
}) })
} // }
}, },
// 更新地址并关闭地图 // 更新地址并关闭地图
updateAddress(addressObj) { updateAddress(addressObj) {
...@@ -301,19 +314,45 @@ ...@@ -301,19 +314,45 @@
return true; return true;
} }
}, },
errorsshow(value) {
if ('devicecoord' in value) {
return value["devicecoord"][0];
} else if ('deviceinfo' in value) {
return value["deviceinfo"][0];
} else if ('devicelinkman' in value) {
return value["devicelinkman"][0];
} else if ('devicemonad' in value) {
return value["devicemonad"][0];
} else if ('devicenum' in value) {
return value["devicenum"][0];
} else if ('devicephone' in value) {
return value["devicephone"][0];
} else if ('deviceremark' in value) {
return value["deviceremark"][0];
} else if ('dtype' in value) {
return value["dtype"][0];
} else if ('status' in value) {
return value["status"][0];
} else if ('username' in value) {
return value["username"][0];
}
},
//显示提示信息 //显示提示信息
onshowToast(data) { onshowToast(data) {
uni.showToast({ uni.showToast({
title: data, title: data,
duration: 2000 duration: 2000
}); });
} },
//将手机竖屏回来
starye(){
plus.screen.lockOrientation('portrait-primary');
},
}, },
created() { created() {
this.issetinfo(); this.issetinfo();
this.devicetypes(); this.devicetypes();
this.addUserDevices(); this.addUserDevices();
plus.screen.lockOrientation('portrait-primary');
}, },
} }
</script> </script>
......
...@@ -17,9 +17,18 @@ ...@@ -17,9 +17,18 @@
}, },
methods: {}, methods: {},
mounted() { mounted() {
plus.screen.lockOrientation('landscape-secondary'); plus.screen.lockOrientation('landscape-primary')
plus.screen.lockOrientation('landscape-primary'); },
//监听安卓返回键
onBackPress() {
const that = this;
var pages = getCurrentPages(); //当前页面栈
if (pages.length > 1) {
var beforePage = pages[pages.length - 2]; //获取上一个页面实例对象
console.log(beforePage);
// beforePage.$vm.(); //触发父页面中的方法change()
} }
},
} }
</script> </script>
......
...@@ -318,13 +318,28 @@ ...@@ -318,13 +318,28 @@
this.infutvalue = ''; //使用input为空 this.infutvalue = ''; //使用input为空
this.iscode = false; this.iscode = false;
this.reset = false; this.reset = false;
},
//监测网络状态
ifwifi() {
let that = this;
uni.getNetworkType({
success: function(res) {
if (res.networkType === "none") {
uni.navigateTo({
url: '../wifiisin/home'
});
}else{
// 监测登入
that.showislogin();
}
}
});
} }
}, },
mounted() {}, mounted() {},
onLoad() { onLoad() {
let that = this; let that = this;
// 监测登入 that.ifwifi();
that.showislogin();
} }
} }
</script> </script>
......
...@@ -39,7 +39,22 @@ ...@@ -39,7 +39,22 @@
}, },
methods: { methods: {
NavChange: function(e) { NavChange: function(e) {
this.PageCur = e.currentTarget.dataset.cur this.iswifi(e);
},
//监测网络状态
iswifi(e) {
let that = this;
uni.getNetworkType({
success: function(res) {
if (res.networkType === "none") {
uni.navigateTo({
url: '../wifiisin/home'
});
} else {
that.PageCur = e.currentTarget.dataset.cur;
}
}
});
} }
} }
} }
......
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius"> <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
<view class="cu-item arrow"> <view class="cu-item arrow">
<navigator class="content" hover-class="none" @click="ligoin" url='/pages/userme/userpolice'> <navigator class="content" hover-class="none" @click="ligoin" url='/pages/userme/userpolice'>
<text class="cuIcon-moneybagfill text-red"></text> <text class="cuIcon-notice text-red"></text>
<text class="text-grey">报警记录</text> <text class="text-grey">报警记录</text>
</navigator> </navigator>
</view> </view>
<view class="cu-item arrow"> <view class="cu-item arrow">
<navigator class="content" hover-class="none" @click="ligoin" :url="isurl? '': url"> <navigator class="content" hover-class="none" @click="ligoin" :url="isurl? '': url">
<text class="cuIcon-locationfill text-grey"></text> <text class="cuIcon-sort text-grey"></text>
<text class="text-grey">用户列表</text> <text class="text-grey">用户列表</text>
</navigator> </navigator>
</view> </view>
......
<template>
<view style="margin-left: 10%;vertical-align: middle;position: absolute;top: 10%;">
<image src="/static/togif/iswifinone.gif"></image>
<view style="margin-top: 450upx;">
<button @click="iswifi" class="cu-btn block bg-blue margin-tb-sm lg">刷新</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {
//监测网络状态
iswifi() {
let that = this;
uni.getNetworkType({
success: function(res) {
if (res.networkType != "none") {
uni.navigateBack({
delta: 1,
});
}
}
});
}
}
}
</script>
<style>
page {
background-color: #FFFFFF;
}
.imgtogif {}
</style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment