Commit 7caf684dbae39ec9e234cc7b12246a3b45a5ce85

Authored by fengwotao
2 parents 2c3efeea fd55c9f6

feat: mp和android app两端,首页新增下拉刷新,告警详情新增所属场景

1   -<script>
2   - import store from '@/store';
3   -
4   - export default {
5   - //设置全局变量,解绑时从这里取
6   - globalData: {
7   - openId: ''
8   - },
9   - onLaunch(e) {
10   - // #ifdef APP-PLUS
11   - uni.reLaunch({
12   - url: '/pages/index/splash'
13   - })
14   - // #endif
15   - },
16   - onShow() {},
17   - onHide() {}
18   - };
19   -</script>
20   -
21   -<style lang="scss">
22   - @import '@/uni_modules/uview-ui/index.scss';
23   - @import './style/iconfont.scss';
24   - @import './style/common.scss';
25   -
26   - page {
27   - background: #ffffff;
28   - }
29   -
30   - ::-webkit-scrollbar {
31   - display: none;
32   - width: 0 !important;
33   - height: 0 !important;
34   - -webkit-appearance: none;
35   - background: transparent;
36   - }
37   -</style>
  1 +<script>
  2 + import store from '@/store';
  3 + // import {
  4 + // scene
  5 + // } from '@/config/common';
  6 +
  7 + export default {
  8 + //设置全局变量,解绑时从这里取
  9 + globalData: {
  10 + openId: ''
  11 + },
  12 + onLaunch(e) {
  13 + //取出缓存数据
  14 + // store.commit('setCacheData');
  15 + //获取二维码信息
  16 + // scene(e);
  17 + // #ifdef APP-PLUS
  18 + uni.reLaunch({
  19 + url: '/pages/index/splash'
  20 + })
  21 + // #endif
  22 + },
  23 + onShow(e) {
  24 + // #ifdef MP
  25 + // mpUpData(); //检测小程序更新
  26 + // #endif
  27 + // #ifdef APP-PLUS
  28 + // uni.reLaunch({
  29 + // url: '/pages/index/splash'
  30 + // })
  31 + // #endif
  32 + },
  33 + onHide() {},
  34 + onUnload(){
  35 + uni.setStorageSync('getConfiguration', {
  36 + isConfiguration: false
  37 + });
  38 + },
  39 + methods:{
  40 + // 判断是否是第三方登录没有绑定账号不请求数据
  41 + getBindNot(){
  42 + // #ifndef H5
  43 + const userInfo = uni.getStorageSync('userInfo');
  44 + // #endif
  45 + // #ifdef H5
  46 + const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo'));
  47 + // #endif
  48 + return userInfo.isThirdLogin
  49 + }
  50 + }
  51 + };
  52 +</script>
  53 +
  54 +<style lang="scss">
  55 + @import '@/uni_modules/uview-ui/index.scss';
  56 + @import './style/iconfont.scss';
  57 + @import './style/common.scss';
  58 +
  59 + page {
  60 + background: #ffffff;
  61 + }
  62 +
  63 + ::-webkit-scrollbar {
  64 + display: none;
  65 + width: 0 !important;
  66 + height: 0 !important;
  67 + -webkit-appearance: none;
  68 + background: transparent;
  69 + }
  70 +</style>
... ...
... ... @@ -125,7 +125,9 @@ uni.$u.http.interceptors.response.use(
125 125 errorData = message || "";
126 126 }
127 127 // console.log('errorData', errorData);
128   - uni.$u.toast(message);
  128 + if(message != "request:ok"){
  129 + uni.$u.toast(message);
  130 + }
129 131 // if (show) uni.$u.toast(errorData);
130 132 return Promise.reject(response);
131 133 }
... ...
... ... @@ -241,6 +241,9 @@
241 241 },
242 242 onShow() {
243 243 this.page.num = 1;
  244 + if(getApp().getBindNot()){
  245 + return
  246 + }
244 247 if (this.detailStatus) {
245 248 this.loadData(1, null, null, null, null, null, null);
246 249 }
... ... @@ -256,6 +259,9 @@
256 259 onLoad(e) {
257 260 // 隐藏原生的tabbar
258 261 uni.hideTabBar();
  262 + if(getApp().getBindNot()){
  263 + return
  264 + }
259 265 if (e.type == undefined) {
260 266 this.loadData(1, null, null, null, null, null, null);
261 267 } else {
... ...
... ... @@ -211,6 +211,9 @@
211 211 async onLoad(options) {
212 212 // 隐藏原生的tabbar
213 213 uni.hideTabBar();
  214 + if(getApp().getBindNot()){
  215 + return
  216 + }
214 217 this.page.num = 1;
215 218 const {
216 219 deviceState
... ... @@ -231,6 +234,9 @@
231 234 }
232 235 },
233 236 onShow() {
  237 + if(getApp().getBindNot()){
  238 + return
  239 + }
234 240 if (this.orgId) {
235 241 this.loadData(1, {
236 242 organizationId: this.orgId
... ...
... ... @@ -129,6 +129,9 @@
129 129 onLoad() {
130 130 // 隐藏原生的tabbar
131 131 uni.hideTabBar();
  132 + if(getApp().getBindNot()){
  133 + return
  134 + }
132 135 this.getDeviceTotalData();
133 136 uni.setStorageSync('getConfiguration', {
134 137 isConfiguration: false
... ...
... ... @@ -21,6 +21,9 @@
21 21 };
22 22 },
23 23 onLoad() {
  24 + uni.setStorageSync('getConfiguration', {
  25 + isConfiguration: false
  26 + });
24 27 this.getPlateForm();
25 28 },
26 29 created() {
... ...
... ... @@ -98,14 +98,17 @@
98 98 },
99 99 });
100 100 //#endif
  101 + uni.setStorageSync('getConfiguration', {
  102 + isConfiguration: false
  103 + });
101 104 },
102 105 computed: {
103 106 ...mapState(["plateInfo"]),
104 107 },
105   - mounted() {
106   - this.getPlateForm();
107   - },
108 108 onShow() {
  109 + uni.setStorageSync('getConfiguration', {
  110 + isConfiguration: false
  111 + });
109 112 this.getPlateForm();
110 113 },
111 114 methods: {
... ...