From d330112c2f4081dd9a78c3564b3b2584de710d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B0=8F=E6=9C=AF?= Date: Tue, 11 May 2021 11:47:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20=E6=96=B0=E5=A2=9E=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=BA=93=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 12 +------ ldcake-ui/libs/utils/cache.js | 4 ++- main.js | 2 ++ mixins/index.js | 13 ++++++++ pages.json | 21 ++++++++++++ pages/index/index.vue | 20 +++++++++++ pages/tools/cache/cache.vue | 51 ++++++++++++++++++++++++++++ pages/tools/copy/copy.vue | 27 +++++++++++++++ pages/tools/storage/storage.vue | 51 ++++++++++++++++++++++++++++ styles/demo.scss | 48 +++++++++++++-------------- utils/common.js | 59 +++++++++++++++++++++++++++++++++ utils/config.js | 23 +++++++++++++ 12 files changed, 295 insertions(+), 36 deletions(-) create mode 100644 mixins/index.js create mode 100644 pages/tools/cache/cache.vue create mode 100644 pages/tools/copy/copy.vue create mode 100644 pages/tools/storage/storage.vue create mode 100644 utils/common.js create mode 100644 utils/config.js diff --git a/App.vue b/App.vue index 92f22dd..2868475 100644 --- a/App.vue +++ b/App.vue @@ -1,15 +1,5 @@ diff --git a/pages/tools/copy/copy.vue b/pages/tools/copy/copy.vue new file mode 100644 index 0000000..8fd6e3a --- /dev/null +++ b/pages/tools/copy/copy.vue @@ -0,0 +1,27 @@ + + + + + + diff --git a/pages/tools/storage/storage.vue b/pages/tools/storage/storage.vue new file mode 100644 index 0000000..676c51c --- /dev/null +++ b/pages/tools/storage/storage.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/styles/demo.scss b/styles/demo.scss index 3000d51..c16c944 100644 --- a/styles/demo.scss +++ b/styles/demo.scss @@ -7,16 +7,16 @@ text { /* start--演示页面使用的统一样式--start */ .c-demo { - padding: 25px 20px; + padding: 50rpx 40rpx; } .c-demo-wrap { - border-width: 1px; + border-width: 1rpx; border-color: #ddd; border-style: dashed; background-color: rgb(250, 250, 250); - padding: 20px 10px; - border-radius: 3px; + padding: 40rpx 20rpx; + border-radius: 6rpx; } .c-demo-area { @@ -25,19 +25,19 @@ text { .c-no-demo-here { color: $c-tips-color; - font-size: 13px; + font-size: 26rpx; } .c-demo-result-line { border-width: 1px; border-color: #ddd; border-style: dashed; - padding: 5px 20px; - margin-top: 30px; - border-radius: 5px; + padding: 10rpx 40rpx; + margin-top: 60rpx; + border-radius: 10rpx; background-color: rgb(240, 240, 240); color: $c-content-color; - font-size: 16px; + font-size: 30rpx; /* #ifndef APP-NVUE */ word-break: break-word; display: inline-block; @@ -49,45 +49,45 @@ text { .c-demo-title, .c-config-title { text-align: center; - font-size: 16px; + font-size: 32rpx; font-weight: bold; - margin-bottom: 20px; + margin-bottom: 40rpx; } .c-config-item { - margin-top: 25px; + margin-top: 50rpx; } .c-config-title { - margin-top: 20px; - padding-bottom: 5px; + margin-top: 40rpx; + padding-bottom: 10rpx; } .c-item-title { position: relative; - font-size: 15px; - padding-left: 8px; + font-size: 30rpx; + padding-left: 16rpx; line-height: 1; - margin-bottom: 11px; + margin-bottom: 22rpx; } .c-item-title:after { position: absolute; - width: 4px; - top: -1px; - height: 16px; + width: 8rpx; + top: -2rpx; + height: 32rpx; /* #ifndef APP-NVUE */ content: ''; /* #endif */ left: 0; - border-radius: 10px; + border-radius: 20rpx; background-color: $c-content-color; } .c-subsection{ - height: 25px; + height: 50rpx; background-color: rgb(238, 238, 239); - padding: 3px; - border-radius: 5px; + padding: 6rpx; + border-radius: 10rpx; } /* end--演示页面使用的统一样式--end */ \ No newline at end of file diff --git a/utils/common.js b/utils/common.js new file mode 100644 index 0000000..590b1e8 --- /dev/null +++ b/utils/common.js @@ -0,0 +1,59 @@ +const config = require('./config') + +export const $showToast = (title, _callback) => { + uni.showToast({ + title, + icon: 'none', + mask: true, + duration: 2000, + success: () => { + if (isFunction(_callback)) { + _callback() + } + } + }) +} + +export const $hideToast = () => { + uni.hideToast() +} + +export const $showModal = ({ + title = '提示', + content = '', + showCancel = true, + cancelText = '取消', + cancelColor = '#000000', + confirmText = '确定', + confirmColor = config['main_color'] +}, _callback) => { + uni.showModal({ + title, + content, + showCancel, + cancelText, + cancelColor, + confirmText, + confirmColor, + success: (res) => { + if (isFunction(_callback)) { + _callback(res) + } + } + }) +} + +export const $showLoading = (title) => { + uni.showLoading({ + title: title ? title : '加载中...', + mask: true + }) +} + +export const $hideLoading = () => { + uni.hideLoading() +} + +const isFunction = (obj) => { + return typeof obj === 'function' +} diff --git a/utils/config.js b/utils/config.js new file mode 100644 index 0000000..41f0022 --- /dev/null +++ b/utils/config.js @@ -0,0 +1,23 @@ +module.exports = { + project_cn: '绿豆糕组件库', + project_en: 'ldcake-uniapp', + main_color: '#2979ff', + sub_color: '#2979ff', + dev_env: 'pro', + pro: { + // #ifndef H5 + url: '', + // #endif + // #ifdef H5 + url: '/api', + // #endif + }, + dev: { + // #ifndef H5 + url: '', + // #endif + // #ifdef H5 + url: '/dapi', + // #endif + } +} -- Gitee From 1255c7a5647d7927495b31d7a5cd440df1bdfb6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B0=8F=E6=9C=AF?= Date: Tue, 11 May 2021 12:10:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages.json b/pages.json index 1be98e1..70675e7 100644 --- a/pages.json +++ b/pages.json @@ -59,7 +59,7 @@ }, { "path": "pages/tools/copy/copy", "style": { - "navigationBarTitleText": "复制(copy)", + "navigationBarTitleText": "复制(setClipboardData)", "enablePullDownRefresh": false } -- Gitee From c6f6f8a6e2417739806052fbaa513af2681ae9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B0=8F=E6=9C=AF?= Date: Tue, 11 May 2021 12:16:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=BA=93=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 22a0f54..d917801 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -54,15 +54,15 @@ ], toolList: [ { - name: '数据缓存', + name: '数据缓存(storage)', url: '/pages/tools/storage/storage' }, { - name: '定时缓存', + name: '定时缓存(cache)', url: '/pages/tools/cache/cache' }, { - name: '复制', + name: '复制(setClipboardData)', url: '/pages/tools/copy/copy' }, ] -- Gitee