From fd437705da3bee1301b4165045f63a19a73f49ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Mon, 17 Oct 2022 16:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 6 +- api/request.js | 5 ++ main.js | 5 +- package-lock.json | 17 ++--- package.json | 10 ++- pages.json | 66 ++++++++-------- pages/home/home.vue | 45 +++++++---- pages/index/index.vue | 2 +- pages/phone/phone.vue | 172 ++++++++++++++++++++++++++---------------- 9 files changed, 190 insertions(+), 138 deletions(-) diff --git a/App.vue b/App.vue index 8c2b732..9bb63c7 100644 --- a/App.vue +++ b/App.vue @@ -11,7 +11,7 @@ } } - - diff --git a/api/request.js b/api/request.js index 736da5c..b3c84f3 100644 --- a/api/request.js +++ b/api/request.js @@ -2,6 +2,9 @@ import baseurl from './baseurl.js' var request = function(config) { return new Promise((resolve, rejected) => { + uni.showLoading({ + title: '' + }); uni.request({ url: baseurl + config.url, data: config.data, @@ -11,6 +14,7 @@ var request = function(config) { // token: uni.getStorageSync('token') }, success(res) { + uni.hideLoading(); resolve(res.data) // if (res.data.code == 20002) { // uni.showModal({ @@ -38,6 +42,7 @@ var request = function(config) { }, fail(err) { + uni.hideLoading(); rejected(err) } }) diff --git a/main.js b/main.js index e8724bb..9bd5159 100644 --- a/main.js +++ b/main.js @@ -3,9 +3,8 @@ import App from './App' // #ifndef VUE3 import Vue from 'vue' -import uView from 'uview-ui' -Vue.use(uView) - +import uView from "uview-ui"; +Vue.use(uView); Vue.config.productionTip = false App.mpType = 'app' diff --git a/package-lock.json b/package-lock.json index 4b7af95..f65ebd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,23 +9,20 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "uview-ui": "^2.0.31" + "uview-ui": "^1.8.4" } }, "node_modules/uview-ui": { - "version": "2.0.31", - "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz", - "integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw==", - "engines": { - "HBuilderX": "^3.1.0" - } + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.4.tgz", + "integrity": "sha512-Zr+D5dFdNy6CdHQLBEXeGq/w0LkjxzBtsgaaDwLl0P58g67H7fBBDvy6AzWK/k0c7dwPYMBiK7I4Tr9p92+0DA==" } }, "dependencies": { "uview-ui": { - "version": "2.0.31", - "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz", - "integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw==" + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.4.tgz", + "integrity": "sha512-Zr+D5dFdNy6CdHQLBEXeGq/w0LkjxzBtsgaaDwLl0P58g67H7fBBDvy6AzWK/k0c7dwPYMBiK7I4Tr9p92+0DA==" } } } diff --git a/package.json b/package.json index 8ef4615..4a5727e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "yer", "version": "1.0.0", - "description": "", "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -10,6 +9,11 @@ "author": "", "license": "ISC", "dependencies": { - "uview-ui": "^2.0.31" - } + "uview-ui": "^1.8.4" + }, + "repository": { + "type": "git", + "url": "http://192.168.16.64:3000/jihan/KindergartenAppletUI.git" + }, + "description": "" } diff --git a/pages.json b/pages.json index a4a2d1d..9fa5e8e 100644 --- a/pages.json +++ b/pages.json @@ -1,49 +1,37 @@ -{ - "easycom": { - // uview-ui - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" - - }, +{ + "easycom": { + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" + }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - // { - // "path" : "pages/login/login", - // "style" : - // { - // "navigationBarTitleText": "", - // "enablePullDownRefresh": false - // } - - // }, + // { + // "path" : "pages/login/login", + // "style" : + // { + // "navigationBarTitleText": "", + // "enablePullDownRefresh": false + // } + + // }, { "path": "pages/index/index", "style": { "navigationBarTitleText": "" } - - }, - { - "path" : "pages/phone/phone", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - }, - - - { + }, { + "path": "pages/phone/phone", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { "path": "pages/home/home", "style": { "navigationBarTitleText": "" } } - - ], - - + ], // "tabBar": { - + // }, "globalStyle": { "navigationBarTextStyle": "black", @@ -51,5 +39,13 @@ "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, - "uniIdRouter": {} + "uniIdRouter": {}, + "condition": { //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [{ + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }] + } } diff --git a/pages/home/home.vue b/pages/home/home.vue index 6fbe704..ad8fda5 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -1,7 +1,10 @@ @@ -33,7 +35,6 @@ data() { return { show: false, - loading: false, yonghuwx: [], studentId: '', StudentScore: [], @@ -52,15 +53,18 @@ this.getStudentScore() }, methods: { - showToast(params) { + showToast() { this.$refs.uToast.show({ - ...params + title: '暂无报告', + type: 'error' }) }, lookbook(item) { console.log(item) - this.loading = true + uni.showLoading({ + title: '获取报告中' + }); var that = this uni.downloadFile({ url: baseurl + item.downloadAddress, @@ -70,10 +74,10 @@ filePath: filePath, showMenu: true, success: function(res) { - that.loading = false + uni.hideLoading(); }, fail: function(err) { - that.loading = false + uni.hideLoading(); } }); } @@ -119,6 +123,14 @@