From 4f27f78409b18328f07270d7a897223b99e2a4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Fri, 10 Feb 2023 02:01:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=86=E7=B1=BB=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 +- src/components/cate/cate.vue | 22 ++++-- src/components/cate/template/list.vue | 73 ++++++++++++------ src/components/layout/layout.vue | 45 +++++++----- src/components/mini/add.vue | 76 +++++++++++++++++++ src/core/libs/utils.js | 16 +++- src/pages/service/cate.vue | 7 +- src/pages/service/list.vue | 102 +++++++++++++++++++++++++- src/store/index.js | 4 +- src/store/modules/system.js | 34 +++++++++ 10 files changed, 326 insertions(+), 57 deletions(-) create mode 100644 src/components/mini/add.vue create mode 100644 src/store/modules/system.js diff --git a/src/App.vue b/src/App.vue index 32967bb..10b9e45 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,8 @@ + + \ No newline at end of file diff --git a/src/core/libs/utils.js b/src/core/libs/utils.js index c763718..9550eab 100644 --- a/src/core/libs/utils.js +++ b/src/core/libs/utils.js @@ -1,3 +1,5 @@ +import Vue from 'vue' + function time() { return parseInt(Math.round(new Date() / 1000)); }; @@ -142,7 +144,17 @@ function debounce(func, wait = 500, immediate = false) { } } -export { +function px2rpx(px) { + const { windowWidth } = uni.getStorageSync('system_config'); + return 750 * (px / windowWidth); +} + +function rpx2px(rpx) { + const { windowWidth } = uni.getStorageSync('system_config'); + return (rpx / 750) * windowWidth; +} + +export default { time, datetime, timeDifference, @@ -150,4 +162,6 @@ export { randomString, throttle, debounce, + px2rpx, + rpx2px, } diff --git a/src/pages/service/cate.vue b/src/pages/service/cate.vue index aa3c93d..d29a69c 100644 --- a/src/pages/service/cate.vue +++ b/src/pages/service/cate.vue @@ -1,5 +1,5 @@