From e23a219e6e6056f6da5405881768a90c39097933 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@iotlink.com> Date: 星期一, 07 六月 2021 16:18:29 +0800 Subject: [PATCH] 完成页面布局 --- pages/main/main.vue | 78 ++++++--------------------------------- 1 files changed, 12 insertions(+), 66 deletions(-) diff --git a/pages/main/main.vue b/pages/main/main.vue index 37708f9..c832b76 100644 --- a/pages/main/main.vue +++ b/pages/main/main.vue @@ -8,8 +8,7 @@ <view class="chart-income">6.3</view> <view class="charts-box"> <qiun-data-charts type="line" :chartData="chartData" :errorShow="false" - :eopts="{seriesTemplate:{smooth:true}}" - background="none"/> + :eopts="{seriesTemplate:{smooth:true}}" background="none" /> </view> </view> @@ -82,10 +81,6 @@ mapMutations } from 'vuex' - import { - univerifyLogin - } from '@/common/univerify.js' - export default { data() { return { @@ -143,72 +138,23 @@ let uniIdToken = uni.getStorageSync('uni_id_token') if (uniIdToken) { this.login(uni.getStorageSync('username')) - uniCloud.callFunction({ - name: 'user-center', - data: { - action: 'checkToken', - }, - success: (e) => { - - console.log('checkToken success', e); - - if (e.result.code > 0) { - //token杩囨湡鎴杢oken涓嶅悎娉曪紝閲嶆柊鐧诲綍 - if (this.forcedLogin) { - uni.reLaunch({ - url: '../login/login' - }); - } else { - uni.navigateTo({ - url: '../login/login' - }); - } - } - }, - fail(e) { - uni.showModal({ - content: JSON.stringify(e), - showCancel: false - }) - } - }) + + // 楠岃瘉token + if (false) { + uni.reLaunch({ + url: '../login/login' + }); + } } else { - this.guideToLogin() + uni.reLaunch({ + url: '../login/login' + }); } }, methods: { ...mapMutations(['login']), handleClick(tabName) { - this.activeName = tabName; - }, - guideToLogin() { - uni.showModal({ - title: '鏈櫥褰�', - content: '鎮ㄦ湭鐧诲綍锛岄渶瑕佺櫥褰曞悗鎵嶈兘缁х画', - /** - * 濡傛灉闇�瑕佸己鍒剁櫥褰曪紝涓嶆樉绀哄彇娑堟寜閽� - */ - showCancel: !this.forcedLogin, - success: (res) => { - if (res.confirm) { - univerifyLogin().catch((err) => { - if (err === false) return; - /** - * 濡傛灉闇�瑕佸己鍒剁櫥褰曪紝浣跨敤reLaunch鏂瑰紡 - */ - if (this.forcedLogin) { - uni.reLaunch({ - url: '../login/login' - }); - } else { - uni.navigateTo({ - url: '../login/login' - }); - } - }) - } - } - }); + this.activeName = tabName; } } -- Gitblit v1.8.0