From 8bb9abbeae394764261e5087899688f9e4e4bcaa Mon Sep 17 00:00:00 2001 From: zhoulei Date: Fri, 21 Jan 2022 13:39:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=85=A8=E5=B1=80=E6=B3=A8=E5=85=A5plus,c?= =?UTF-8?q?ustomToast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + package.json | 2 ++ src/main.ts | 6 ++++-- src/pages/login/login/index.vue | 5 ----- tsconfig.json | 3 ++- types/vue-prototype.d.ts | 3 ++- yarn.lock | 17 +++++++++++++++++ 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 44c85c1..e651868 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ module.exports = { extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/typescript/recommended', '@vue/prettier', '@vue/prettier/@typescript-eslint'], globals: { uni: true, + plus: true, }, parserOptions: { ecmaVersion: 2020, diff --git a/package.json b/package.json index d7d3445..5456d09 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,9 @@ "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-29820201110001", "@dcloudio/webpack-uni-mp-loader": "^2.0.0-29820201110001", "@dcloudio/webpack-uni-pages-loader": "^2.0.0-29820201110001", + "@types/html5plus": "^1.0.2", "@types/lodash": "^4.14.165", + "@types/uni-app": "^1.4.4", "@typescript-eslint/eslint-plugin": "^4.9.0", "@typescript-eslint/parser": "^4.9.0", "@vue/cli-plugin-babel": "~4.5.0", diff --git a/src/main.ts b/src/main.ts index 9800895..df47f03 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,9 @@ /* * @Author: zhou lei * @Date: 2021-11-08 12:10:26 - * @LastEditTime: 2022-01-21 09:16:58 + * @LastEditTime: 2022-01-21 13:37:04 * @LastEditors: zhou lei - * @Description: + * @Description: * @FilePath: /wms_haiwai_app/src/main.ts * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 */ @@ -17,6 +17,7 @@ import { Alerts } from '@/components/alert/alert'; import filters from '@/utils/filter'; import plugins from '@/plugins'; import wybTable from '@/plugins/wyb-table/wyb-table.vue'; +import MyMixins from './utils/mixin'; Vue.config.productionTip = false; @@ -28,6 +29,7 @@ Vue.use(Alerts); Vue.use(filters); // 引入插件组件 Vue.use(plugins); +Vue.mixin(MyMixins); Vue.component('wyb-table', wybTable); export default new App({ diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 4e7ac45..968e305 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -87,12 +87,10 @@ import { BasePage } from '@/components/base/page'; import { VForm } from 'vue/types/form'; import { Lang } from '@/i18n'; // mixin 引入示例目前用于弹窗自定义 -import MyMixins from '@/utils/mixin'; // import { any } from 'lodash/fp'; @Component({ components: { Alerts }, - mixins: [MyMixins], }) export default class LoginPage extends BasePage { /** @@ -170,10 +168,8 @@ export default class LoginPage extends BasePage { //uni.hideLoading(); if (downloadResult.statusCode == 200) { //安装更新 - // eslint-disable-next-line no-undef plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { //uni.showToast('更新成功,重启'); - // eslint-disable-next-line no-undef plus.runtime.restart(); }); // uni.showModal({ @@ -236,7 +232,6 @@ export default class LoginPage extends BasePage { {}, function () { console.log('安装文件成功!'); - plus.runtime.restart(); }, function (e) { diff --git a/tsconfig.json b/tsconfig.json index 846cd51..d4dc543 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ "webpack-env", "@dcloudio/types", "miniprogram-api-typings", - "mini-types" + "mini-types", + "@types/html5plus" ], "paths": { "@/*": [ diff --git a/types/vue-prototype.d.ts b/types/vue-prototype.d.ts index f05aa7f..638147a 100644 --- a/types/vue-prototype.d.ts +++ b/types/vue-prototype.d.ts @@ -2,7 +2,7 @@ /* * @Author: zhou lei * @Date: 2022-01-21 09:23:56 - * @LastEditTime: 2022-01-21 09:34:15 + * @LastEditTime: 2022-01-21 11:47:17 * @LastEditors: zhou lei * @Description: * @FilePath: /wms_haiwai_app/types/vue-prototype.d.ts @@ -10,6 +10,7 @@ */ import Vue from 'vue'; // 在 types/vue.d.ts 里 Vue 有构造函数类型 + declare module 'vue/types/vue' { interface Vue { // $myProperty: string; diff --git a/yarn.lock b/yarn.lock index e77c22e..6289b39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1611,6 +1611,11 @@ dependencies: "@types/node" "*" +"@types/html5plus@^1.0.2": + version "1.0.2" + resolved "https://registry.npmmirror.com/@types/html5plus/download/@types/html5plus-1.0.2.tgz#43e1aaca4584e7e2cf0db082389f42fbba98062c" + integrity sha1-Q+GqykWE5+LPDbCCOJ9C+7qYBiw= + "@types/http-proxy-middleware@*": version "0.19.3" resolved "https://registry.npm.taobao.org/@types/http-proxy-middleware/download/@types/http-proxy-middleware-0.19.3.tgz?cache=0&sync_timestamp=1605053627891&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fhttp-proxy-middleware%2Fdownload%2F%40types%2Fhttp-proxy-middleware-0.19.3.tgz#b2eb96fbc0f9ac7250b5d9c4c53aade049497d03" @@ -1737,6 +1742,13 @@ dependencies: source-map "^0.6.1" +"@types/uni-app@^1.4.4": + version "1.4.4" + resolved "https://registry.npmmirror.com/@types/uni-app/download/@types/uni-app-1.4.4.tgz#fe73d0e7c89d5e750605e088ff6695846e019c36" + integrity sha1-/nPQ58idXnUGBeCI/2aVhG4BnDY= + dependencies: + vue "^2.6.8" + "@types/webpack-dev-server@^3.11.0": version "3.11.1" resolved "https://registry.npm.taobao.org/@types/webpack-dev-server/download/@types/webpack-dev-server-3.11.1.tgz?cache=0&sync_timestamp=1605057456418&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fwebpack-dev-server%2Fdownload%2F%40types%2Fwebpack-dev-server-3.11.1.tgz#f8f4dac1da226d530bd15a1d5dc34b23ba766ccb" @@ -11562,6 +11574,11 @@ vue@^2.6.11: resolved "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz?cache=0&sync_timestamp=1606321041576&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123" integrity sha1-9evU+mvShpQD4pqJau1JBEVskSM= +vue@^2.6.8: + version "2.6.14" + resolved "https://registry.npmmirror.com/vue/download/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235" + integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ== + vuex-class@^0.3.2: version "0.3.2" resolved "https://registry.npm.taobao.org/vuex-class/download/vuex-class-0.3.2.tgz#c7e96a076c1682137d4d23a8dcfdc63f220e17a8"