| | |
| | | import cmdProgress from "@/components/cmd-progress/cmd-progress.vue" |
| | | import { |
| | | showModal, |
| | | showToast, |
| | | showInfo, |
| | | showError, |
| | | showLoading, |
| | | hideLoading |
| | | } from "@/js/Page.js" |
| | |
| | | async check(version) { |
| | | try { |
| | | if (!this.userServer) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate("tip_no_web_server"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | |
| | | showInfo( this.translate('tip_no_web_server')); |
| | | |
| | | return; |
| | | } |
| | | // var ser = this.userServer.toLowerCase().split('/'); |
| | |
| | | |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translateSys("error"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex,this.translateSys("error")); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //下载成功,d.filename是文件在保存在本地的相对路径,使用下面的API可转为平台绝对路径 |
| | | var fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename); |
| | | plus.runtime.openFile(d.filename); //选择软件打开文件 |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: this.translate('update_success') |
| | | }); |
| | | showInfo( this.translate('update_success')); |
| | | _this.$refs.promotion.close(); |
| | | } else { |
| | | //下载失败 |
| | | plus.downloader.clear(); //清除下载任务 |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: this.translate('update_fail') |
| | | }); |
| | | showInfo( this.translate('update_fail')); |
| | | _this.showBtns = false; |
| | | } |
| | | }) |
| | |
| | | inputDialogToggle() { |
| | | // this.$refs.inputDialog.open() |
| | | const $this = this |
| | | |
| | | |
| | | uni.navigateTo({ |
| | | url: "./set", |
| | | events: { |
| | | exitSetEvent(val) { |
| | | $this.userServer = val; |
| | | $this.query(); //版本升级 |
| | | $this.largeMode = getApp().globalData.largeMode |
| | | |
| | | $this.largeMode = getApp().globalData.largeMode |
| | | |
| | | } |
| | | } |
| | | }) |
| | |
| | | async logind() { |
| | | try { |
| | | if (!this.userServer) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: this.translate('tip_no_web_server'), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate('tip_no_web_server')); |
| | | return; |
| | | } |
| | | if (!this.userName) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: this.translate('tip_no_user_account'), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate('tip_no_user_account')) |
| | | return; |
| | | } |
| | | if (!this.userPwd) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: this.translate('tip_no_user_password'), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate('tip_no_user_password')); |
| | | |
| | | return; |
| | | } |
| | | var rootUrl = 'http://' + this.userServer |
| | |
| | | |
| | | } catch (ex) { |
| | | hideLoading() |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translateSys("error"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex,this.translateSys("error")); |
| | | } |
| | | |
| | | }, |
| | |
| | | }); |
| | | |
| | | if (list.length == 0) { |
| | | uni.showModal({ |
| | | title: this.translate("get_classes_fail"), |
| | | content: this.translate("page.please_login_after_admin_add_classes"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("page.please_login_after_admin_add_classes")); |
| | | this.selectedClasses = "" |
| | | } else { |
| | | if (this.selectedClasses) { |
| | |
| | | |
| | | |
| | | } catch (ex) { |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: this.translate("get_classes_fail"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | |
| | | showError(ex,this.translateSys("error")); |
| | | |
| | | this.selectedClasses = "" |
| | | this.classesLst = [] |
| | | // { |
| | |
| | | clickSelectClass(item) { |
| | | this.selectedClasses = item.text |
| | | }, |
| | | |
| | | translate(t) { |
| | | if (typeof this.$t == "function") return this.$t(`page.${t}`) |
| | | else return t; |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | .uni-page-login.large-mode{ |
| | | |
| | | .uni-page-login.large-mode { |
| | | .logo_input { |
| | | height: 54rpx; |
| | | width: 54rpx; |
| | | } |
| | | } |
| | | |
| | | </style> |