diff --git a/resources/assets/js/pages/manage/application.vue b/resources/assets/js/pages/manage/application.vue index 30e292ff5..9736ab858 100644 --- a/resources/assets/js/pages/manage/application.vue +++ b/resources/assets/js/pages/manage/application.vue @@ -15,8 +15,8 @@ {{ t == 'base' ? $L('常用') : $L('管理员') }} - + + + +
+ + +
+
+ @@ -254,6 +269,10 @@ export default { // appPushType: 1, appPushShow: false, + // + scanLoginShow: false, + scanLoginLoad: false, + scanLoginCode: '', } }, activated() { @@ -292,13 +311,9 @@ export default { { value: "file", label: "文件", src: $A.apiUrl('../images/application/file.svg') }, { value: "addProject", label: "创建项目", src: $A.apiUrl('../images/application/addProject.svg') }, { value: "addTask", label: "添加任务", src: $A.apiUrl('../images/application/addTask.svg') }, + { value: "scan", label: "扫一扫", src: $A.apiUrl('../images/application/scan.svg'), show: $A.isEEUiApp }, + { value: "setting", label: "设置", src: $A.apiUrl('../images/application/setting.svg') } ]; - if (this.windowOrientation == 'portrait') { - if ($A.isEEUiApp) { - appApplyList.push({ value: "scan", label: "扫一扫", src: $A.apiUrl('../images/application/scan.svg') }) - } - appApplyList.push({ value: "setting", label: "设置", src: $A.apiUrl('../images/application/setting.svg') }) - } // 管理员 let adminApplyList = !this.userIsAdmin ? [] : [ { value: "okrAnalyze", label: "OKR结果分析", src: $A.apiUrl('../images/application/okrAnalyze.svg') }, @@ -369,6 +384,9 @@ export default { this.appPushType = 1; this.appPushShow = true; break; + case 'scan': + $A.eeuiAppScan(this.scanResult); + return; } this.$emit("on-click", item.value) }, @@ -430,6 +448,50 @@ export default { break; } this.meetingShow = false; + }, + // 扫一扫 + scanResult(text) { + const arr = (text + "").match(/^https*:\/\/(.*?)\/login\?qrcode=(.*?)$/) + if (arr) { + // 扫码登录 + this.scanLoginCode = arr[2]; + this.scanLoginShow = true; + return + } + if (/^https*:\/\//i.test(text)) { + // 打开链接 + $A.eeuiAppOpenPage({ + pageType: 'app', + pageTitle: ' ', + url: 'web.js', + params: { + url: text, + browser: true, + showProgress: true, + }, + }); + } + }, + scanLoginSubmit() { + if (this.scanLoginLoad === true) { + return + } + this.scanLoginLoad = true + // + this.$store.dispatch("call", { + url: "users/login/qrcode", + data: { + type: "login", + code: this.scanLoginCode, + } + }).then(({msg}) => { + this.scanLoginShow = false + $A.messageSuccess(msg) + }).catch(({msg}) => { + $A.messageError(msg) + }).finally(_ => { + this.scanLoginLoad = false + }); } } }