From 4871095b0d731a155149d87b9b6b61e4d115da48 Mon Sep 17 00:00:00 2001 From: taohebin Date: Fri, 10 Nov 2023 18:09:25 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=8E=BB=E9=99=A4=E8=BF=87=E6=97=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/download-file/download-file.uvue | 23 +- .../get-network-type/get-network-type.uvue | 145 +++--- pages/API/request/request.uvue | 35 +- pages/API/upload-file/upload-file.uvue | 218 ++++----- .../websocket-global/websocket-global.uvue | 268 +++++------ .../websocket-socketTask.uvue | 380 +++++++-------- pages/template/list-news/list-news.uvue | 448 +++++++++--------- 7 files changed, 718 insertions(+), 799 deletions(-) diff --git a/pages/API/download-file/download-file.uvue b/pages/API/download-file/download-file.uvue index 9f1b3629..fa231bf6 100644 --- a/pages/API/download-file/download-file.uvue +++ b/pages/API/download-file/download-file.uvue @@ -27,17 +27,14 @@ title: 'downloadFile', imageSrc: '', task: null as DownloadTask | null, - pageVisible: false, //自动化测试例专用 jest_result: false } }, onLoad() { - this.pageVisible = true; }, onUnload() { this.imageSrc = ''; - this.pageVisible = false; uni.hideLoading(); this.task?.abort(); }, @@ -50,23 +47,17 @@ this.task = uni.downloadFile({ url: "https://web-assets.dcloud.net.cn/unidoc/zh/uni-app.png", success: (res) => { - if (this.pageVisible) { - console.log('downloadFile success, res is', res) - self.imageSrc = res.tempFilePath; - uni.hideLoading(); - } + console.log('downloadFile success, res is', res) + self.imageSrc = res.tempFilePath; + uni.hideLoading(); }, fail: (err) => { - if (this.pageVisible) { - console.log('downloadFile fail, err is:', err) - uni.hideLoading(); - } + console.log('downloadFile fail, err is:', err) + uni.hideLoading(); } }); this.task?.onProgressUpdate((update) => { - if (this.pageVisible) { - console.log("progress : ", update.progress); - } + console.log("progress : ", update.progress); }) }, //自动化测试例专用 @@ -97,4 +88,4 @@ justify-content: center; align-items: center; } - + \ No newline at end of file diff --git a/pages/API/get-network-type/get-network-type.uvue b/pages/API/get-network-type/get-network-type.uvue index dcae67e5..ed6c657b 100644 --- a/pages/API/get-network-type/get-network-type.uvue +++ b/pages/API/get-network-type/get-network-type.uvue @@ -1,83 +1,78 @@ + \ No newline at end of file diff --git a/pages/API/request/request.uvue b/pages/API/request/request.uvue index 3028c1f2..b56dcc13 100644 --- a/pages/API/request/request.uvue +++ b/pages/API/request/request.uvue @@ -87,7 +87,6 @@ title: 'request', res: '', task: null as RequestTask | null, - pageVisible: false, host: "http://request.dcloud.net.cn", url: "/api/http/method/get", method: "GET" as RequestMethod | null, @@ -135,10 +134,8 @@ } }, onLoad() { - this.pageVisible = true; }, onUnload() { - this.pageVisible = false; uni.hideLoading(); this.task?.abort(); }, @@ -191,25 +188,21 @@ withCredentials: false, firstIpv4: false, success: (res) => { - if (this.pageVisible) { - console.log('request success', JSON.stringify(res.data)) - uni.showToast({ - title: '请求成功', - icon: 'success', - mask: true, - duration: duration - }); - this.res = '请求结果 : ' + JSON.stringify(res); - } + console.log('request success', JSON.stringify(res.data)) + uni.showToast({ + title: '请求成功', + icon: 'success', + mask: true, + duration: duration + }); + this.res = '请求结果 : ' + JSON.stringify(res); }, fail: (err) => { - if (this.pageVisible) { - console.log('request fail', err); - uni.showModal({ - content: err.errMsg, - showCancel: false - }); - } + console.log('request fail', err); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); }, complete: () => { uni.hideLoading() @@ -239,4 +232,4 @@ } } } - + \ No newline at end of file diff --git a/pages/API/upload-file/upload-file.uvue b/pages/API/upload-file/upload-file.uvue index d239c138..5355dbef 100644 --- a/pages/API/upload-file/upload-file.uvue +++ b/pages/API/upload-file/upload-file.uvue @@ -1,136 +1,122 @@ + .uni-hello-addfile { + text-align: center; + background: #fff; + padding: 50rpx; + margin-top: 10px; + font-size: 38rpx; + color: #808080; + } + \ No newline at end of file diff --git a/pages/API/websocket-global/websocket-global.uvue b/pages/API/websocket-global/websocket-global.uvue index 014889a9..d2593ab3 100644 --- a/pages/API/websocket-global/websocket-global.uvue +++ b/pages/API/websocket-global/websocket-global.uvue @@ -7,94 +7,83 @@ - - 发送消息后会收到一条服务器返回的消息(与发送的消息内容一致) + 发送消息后会收到一条服务器返回的消息(与发送的消息内容一致) + .websocket-tips { + padding: 40px 0px; + text-align: center; + font-size: 14px; + line-height: 24px; + color: #666666; + } + \ No newline at end of file diff --git a/pages/API/websocket-socketTask/websocket-socketTask.uvue b/pages/API/websocket-socketTask/websocket-socketTask.uvue index 7f0b9fc5..fb3f40fb 100644 --- a/pages/API/websocket-socketTask/websocket-socketTask.uvue +++ b/pages/API/websocket-socketTask/websocket-socketTask.uvue @@ -1,105 +1,94 @@ - - - - - + } + + + \ No newline at end of file diff --git a/pages/template/list-news/list-news.uvue b/pages/template/list-news/list-news.uvue index b3e0804f..d74cda1c 100644 --- a/pages/template/list-news/list-news.uvue +++ b/pages/template/list-news/list-news.uvue @@ -1,229 +1,219 @@ - - - - - + + + + + \ No newline at end of file -- GitLab