|
@@ -3,13 +3,14 @@
|
|
|
<view class="searchSelect shadow" v-if="flag">
|
|
|
<view class="cu-bar search bg-white">
|
|
|
<view class="search-form round">
|
|
|
- <input @focus="InputFocus" @blur="InputBlur" @input="handleInput()" v-model="searchInput" :adjust-position="false"
|
|
|
- type="text" placeholder="" confirm-type="search"></input>
|
|
|
+ <input @focus="InputFocus" @blur="InputBlur" @input="handleInput()" v-model="searchInput"
|
|
|
+ :adjust-position="false" type="text" placeholder="" confirm-type="search"></input>
|
|
|
<text class="cuIcon-search "></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="select-items">
|
|
|
- <view class="select-item" v-for="(item,index) in searchList" @click="clickSelectItem(item,index)" :key="index">{{item}}</view>
|
|
|
+ <view class="select-item" v-for="(item,index) in searchList" @click="clickSelectItem(item,index)"
|
|
|
+ :key="index">{{item}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="section1 section bg-white padding-xs">
|
|
@@ -21,10 +22,10 @@
|
|
|
</view>
|
|
|
<view class="time text-center">统计时段:{{staticData.statisticalPeriod}}
|
|
|
</view>
|
|
|
- <view style="height:570rpx" >
|
|
|
- <view v-if="Inv == 0" >
|
|
|
+ <view style="height:570rpx">
|
|
|
+ <view v-if="Inv == 0">
|
|
|
<chart :bindData="staticData" v-if="hackReset"></chart>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
<view v-if="Inv == 1">
|
|
|
|
|
@@ -58,7 +59,8 @@
|
|
|
<!-- <square :cuIconList="cuIconList"></square> -->
|
|
|
<view class="section2 section bg-white margin-top-sm margin-bottom-sm">
|
|
|
<view class="cu-list grid col-3 no-border">
|
|
|
- <view class="cu-item justify-center align-center" @tap=navItemClick(index) v-for="(item,index) in cuIconList" :key="index">
|
|
|
+ <view class="cu-item justify-center align-center" @tap=navItemClick(index)
|
|
|
+ v-for="(item,index) in cuIconList" :key="index">
|
|
|
<image :src="item.imgUrl" style="width:100rpx;height:100rpx"></image>
|
|
|
<view class="cu-tag badge" v-if="item.badge!=0">
|
|
|
<block v-if="item.badge!=0">{{item.badge>99?'99+':item.badge}}</block>
|
|
@@ -75,8 +77,8 @@
|
|
|
import chart2 from './components/chart2/chart2.vue';
|
|
|
import chart3 from './components/chart3/chart3.vue';
|
|
|
import chart4 from './components/chart4/chart4.vue';
|
|
|
- import json from '../../data/json.js';
|
|
|
-
|
|
|
+ import json from '../../data/json.js';
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -92,8 +94,8 @@
|
|
|
arr: [],
|
|
|
searchInput: '',
|
|
|
alarmCount: '',
|
|
|
- flag: false,
|
|
|
-
|
|
|
+ flag: false,
|
|
|
+
|
|
|
// 宫格列表数据
|
|
|
cuIconList: [{
|
|
|
imgUrl: '../../static/square1.png',
|
|
@@ -176,140 +178,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
- },
|
|
|
-
|
|
|
- mounted(){
|
|
|
- document.querySelector('.uni-page-head-hd').style.display = 'none'
|
|
|
- },
|
|
|
-
|
|
|
- beforeCreate: function() {
|
|
|
- let ua = navigator.userAgent.toLowerCase();
|
|
|
- if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
-
|
|
|
- var appId = "wx4eab2e3b5531d58b";
|
|
|
- var params = {};
|
|
|
-
|
|
|
- var url = location.search
|
|
|
- this.winUrl = url
|
|
|
- var theRequest = new Object()
|
|
|
- if (url.indexOf("?") != -1) {
|
|
|
- var str = url.substr(1)
|
|
|
- var strs = str.split("&")
|
|
|
- for (var i = 0; i < strs.length; i++) {
|
|
|
- theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- var CODE = theRequest;
|
|
|
- var code = CODE['code'];
|
|
|
- // alert(code)
|
|
|
- if (code) {
|
|
|
-
|
|
|
- params.code = code;
|
|
|
-
|
|
|
- // alert('code')
|
|
|
- //使用code请求服务器接口,换取用户用户openID
|
|
|
-
|
|
|
- uni.request({
|
|
|
- url: 'https://qhome.usky.cn/USKYOF/USKYOF.php/Home/Com/getPageAuthorization', //仅为示例,并非真实接口地址。
|
|
|
- // data: {
|
|
|
- // text: 'uni.request'
|
|
|
- // },
|
|
|
- method: 'POST',
|
|
|
- header: {
|
|
|
- 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- // alert(res.data.flag)
|
|
|
- if (res.data.flag == 3000) {
|
|
|
- // alert("3000授权失败,请重新登录");
|
|
|
- window.location.href = 'https://qhome.usky.cn/index.html#/';
|
|
|
- }
|
|
|
-
|
|
|
- if (res.data.flag == 3003) {
|
|
|
- // alert("3003");
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/authority/authority',
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.data.flag == 3002) {
|
|
|
- // alert("3002授权失败,请重新登录");
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/index/index'
|
|
|
- });
|
|
|
- // window.location.href = 'https://qhome.usky.cn/index.html#/';
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- var cs = {};
|
|
|
- var curl = window.location.href;
|
|
|
- cs.curl = curl;
|
|
|
-
|
|
|
- const res1 = this.$myRequest({
|
|
|
- url: 'Com/getAuthorizationUrl',
|
|
|
- data: cs
|
|
|
- })
|
|
|
-
|
|
|
- var turl = res1.data.turl;
|
|
|
- window.location.href =
|
|
|
- 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' + turl +
|
|
|
- '&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
|
|
|
- } else {
|
|
|
- // alert('不是')
|
|
|
- //不是
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/login/login',
|
|
|
- // });
|
|
|
- // setTimeout(function() {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/login/login',
|
|
|
- // });
|
|
|
- // }, 2000);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
-
|
|
|
|
|
|
- onLoad: function(option) {
|
|
|
-
|
|
|
- let ua = navigator.userAgent.toLowerCase();
|
|
|
- if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
-
|
|
|
- var init=this.init();
|
|
|
- if(init="3001"){
|
|
|
- this.getData();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //是
|
|
|
-
|
|
|
- } else {
|
|
|
- this.getData();
|
|
|
-
|
|
|
-
|
|
|
- //不是
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/login/login',
|
|
|
- // });
|
|
|
- // setTimeout(function() {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/login/login',
|
|
|
- // });
|
|
|
- // }, 2000);
|
|
|
- }
|
|
|
-
|
|
|
- this.hackReset = false;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.hackReset = true;
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
+ mounted() {
|
|
|
+ document.querySelector('.uni-page-head-hd').style.display = 'none'
|
|
|
+ },
|
|
|
+
|
|
|
+ beforeCreate: function() {
|
|
|
+ let ua = navigator.userAgent.toLowerCase();
|
|
|
+ if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
+
|
|
|
+ var appId = "wx4eab2e3b5531d58b";
|
|
|
+ var params = {};
|
|
|
+
|
|
|
+ var url = location.search
|
|
|
+ this.winUrl = url
|
|
|
+ var theRequest = new Object()
|
|
|
+ if (url.indexOf("?") != -1) {
|
|
|
+ var str = url.substr(1)
|
|
|
+ var strs = str.split("&")
|
|
|
+ for (var i = 0; i < strs.length; i++) {
|
|
|
+ theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ var CODE = theRequest;
|
|
|
+ var code = CODE['code'];
|
|
|
+ // alert(code)
|
|
|
+ if (code) {
|
|
|
+
|
|
|
+ params.code = code;
|
|
|
+
|
|
|
+ // alert('code')
|
|
|
+ //使用code请求服务器接口,换取用户用户openID
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: 'https://qhome.usky.cn/USKYOF/USKYOF.php/Home/Com/getPageAuthorization', //仅为示例,并非真实接口地址。
|
|
|
+ // data: {
|
|
|
+ // text: 'uni.request'
|
|
|
+ // },
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ // alert(res.data.flag)
|
|
|
+ if (res.data.flag == 3000) {
|
|
|
+ // alert("3000授权失败,请重新登录");
|
|
|
+ window.location.href = 'https://qhome.usky.cn/index.html#/';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.data.flag == 3003) {
|
|
|
+ // alert("3003");
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/authority/authority',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (res.data.flag == 3002) {
|
|
|
+ // alert("3002授权失败,请重新登录");
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ });
|
|
|
+ // window.location.href = 'https://qhome.usky.cn/index.html#/';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ var cs = {};
|
|
|
+ var curl = window.location.href;
|
|
|
+ cs.curl = curl;
|
|
|
+
|
|
|
+ const res1 = this.$myRequest({
|
|
|
+ url: 'Com/getAuthorizationUrl',
|
|
|
+ data: cs
|
|
|
+ })
|
|
|
+
|
|
|
+ var turl = res1.data.turl;
|
|
|
+ window.location.href =
|
|
|
+ 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' +
|
|
|
+ turl +
|
|
|
+ '&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
|
|
|
+ } else {
|
|
|
+ // alert('不是')
|
|
|
+ //不是
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '/pages/login/login',
|
|
|
+ // });
|
|
|
+ // setTimeout(function() {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '/pages/login/login',
|
|
|
+ // });
|
|
|
+ // }, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ onLoad: function(option) {
|
|
|
+
|
|
|
+ let ua = navigator.userAgent.toLowerCase();
|
|
|
+ if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
+
|
|
|
+ var init = this.init();
|
|
|
+ if (init = "3001") {
|
|
|
+ this.getData();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //是
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.getData();
|
|
|
+
|
|
|
+
|
|
|
+ //不是
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '/pages/login/login',
|
|
|
+ // });
|
|
|
+ // setTimeout(function() {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: '/pages/login/login',
|
|
|
+ // });
|
|
|
+ // }, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.hackReset = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.hackReset = true;
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
|
|
|
// start
|
|
@@ -326,15 +329,15 @@
|
|
|
}
|
|
|
return theRequest
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
async init() {
|
|
|
- var appId = "wx4eab2e3b5531d58b";
|
|
|
- // var appId = "wx8bba7ec467b61efa"; //ming测试公众号
|
|
|
-
|
|
|
- var CODE = this.getUrlCode();
|
|
|
- var code = CODE['code'];
|
|
|
-
|
|
|
-
|
|
|
+ var appId = "wx4eab2e3b5531d58b";
|
|
|
+ // var appId = "wx8bba7ec467b61efa"; //ming测试公众号
|
|
|
+
|
|
|
+ var CODE = this.getUrlCode();
|
|
|
+ var code = CODE['code'];
|
|
|
+
|
|
|
+
|
|
|
var params = {};
|
|
|
if (code) {
|
|
|
params.code = code;
|
|
@@ -342,28 +345,28 @@
|
|
|
const res = await this.$myRequest({
|
|
|
url: 'Com/getPageAuthorization',
|
|
|
data: params
|
|
|
- })
|
|
|
-
|
|
|
- if (res.data.flag == 3000) {
|
|
|
+ })
|
|
|
|
|
|
- // alert("3000授权失败,");
|
|
|
+ if (res.data.flag == 3000) {
|
|
|
+
|
|
|
+ // alert("3000授权失败,");
|
|
|
window.location.href = 'https://qhome.usky.cn/index.html#/';
|
|
|
}
|
|
|
|
|
|
- if (res.data.flag == 3003) {
|
|
|
- // alert("3003授权失败");
|
|
|
+ if (res.data.flag == 3003) {
|
|
|
+ // alert("3003授权失败");
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/authority/authority',
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return res.data.flag;
|
|
|
}
|
|
|
|
|
|
var cs = {};
|
|
|
var curl = window.location.href;
|
|
|
cs.curl = curl;
|
|
|
-
|
|
|
+
|
|
|
//
|
|
|
const res1 = await this.$myRequest({
|
|
|
url: 'Com/getAuthorizationUrl',
|
|
@@ -372,25 +375,26 @@
|
|
|
|
|
|
var turl = res1.data.turl;
|
|
|
window.location.href =
|
|
|
- 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' + turl +
|
|
|
+ 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' +
|
|
|
+ turl +
|
|
|
'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
|
|
|
},
|
|
|
// end
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
async getData() {
|
|
|
const res = await this.$myRequest({
|
|
|
url: 'Index/getDataStatistics',
|
|
|
showLoading: true
|
|
|
})
|
|
|
- this.staticData = res.data.data[0]
|
|
|
- this.alarmCount = this.staticData.alarmCount
|
|
|
- this.cuIconList[0].badge=this.staticData.unprocessedCount
|
|
|
+ this.staticData = res.data.data[0]
|
|
|
+ this.alarmCount = this.staticData.alarmCount
|
|
|
+ this.cuIconList[0].badge = this.staticData.unprocessedCount
|
|
|
},
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
handleInput() {
|
|
|
var newlist = this.searchList2.filter(item => item.indexOf(this.searchInput) > -1)
|
|
@@ -443,6 +447,15 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //解决IOS返回页面不刷新的问题
|
|
|
+ history.pushState(null, null, document.URL); //禁止网页返回上一页
|
|
|
+ window.addEventListener('popstate', function() {
|
|
|
+ // alert('点击返回按钮了!')
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|