From 9cf91f44e11607f27ec39b19ec3af6eebea63c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A8=81=E8=83=BD=E7=BD=91=E7=BB=9C?= <11387206+wina-network@user.noreply.gitee.com> Date: Mon, 25 Jul 2022 05:39:57 +0000 Subject: [PATCH] update main.js. --- main.js | 79 ++++++++++++++------------------------------------------- 1 file changed, 19 insertions(+), 60 deletions(-) diff --git a/main.js b/main.js index 62f14dd..eecc9a4 100644 --- a/main.js +++ b/main.js @@ -1,61 +1,20 @@ -import Vue from 'vue'; -import App from './App'; -import GoEasy from './lib/goeasy-2.4.7.min'; + + + +动态罗盘时钟 + + + + + + + + + -Vue.config.productionTip = false; -App.mpType = 'app'; -const app = new Vue({ - ...App -}); -app.$mount(); -const goEasy = GoEasy.getInstance({ - host:'hangzhou.goeasy.io',//应用所在的区域地址: 【hangzhou.goeasy.io |singapore.goeasy.io】 - appkey:'BC-xxxx', // common key, - modules:['im'], - // true表示支持通知栏提醒,false则表示不需要通知栏提醒 - allowNotification: true //仅有效于app,小程序和H5将会被自动忽略 -}); - -goEasy.onClickNotification((message) => { - let currentUrl; - const routes = getCurrentPages(); - - if ( routes && routes.length ) { - const curRoute = routes[routes.length - 1].route; - const curParam = routes[routes.length - 1].options; - currentUrl = '/' + curRoute + `?to=${curParam.to}`; - } - - let newUrl; - switch(message.toType) { - case GoEasy.IM_SCENE.PRIVATE: - newUrl = '/pages/chat/privateChat/privateChat?to=' + message.senderId; - break; - case GoEasy.IM_SCENE.GROUP: - newUrl = '/pages/chat/groupChat/groupChat?to=' + message.groupId; - break; - } - - if (currentUrl !== newUrl) { - uni.navigateTo({ - url: newUrl, - }); - } - -}); - -Vue.prototype.GoEasy = GoEasy; -Vue.prototype.goEasy = goEasy; - -Vue.prototype.formatDate = function (t) { - t = t || Date.now(); - let time = new Date(t); - let str = time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1); - str += '-'; - str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate(); - str += ' '; - str += time.getHours(); - str += ':'; - str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes(); - return str; -}; -- Gitee