From 568e137c3f2ae17f62b3b9ec9ebea37cb136bec0 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Tue, 22 Feb 2022 15:21:28 +0800
Subject: [PATCH] 新增区域加载中公共组件

---
 layout/loading/CLoading.vue  |   44 ++++++++++++++++++++++
 layout/loading/cLoading.scss |   27 +++++++++++++
 layout/loading/index.js      |   10 +++++
 3 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/layout/loading/CLoading.vue b/layout/loading/CLoading.vue
new file mode 100644
index 0000000..53263da
--- /dev/null
+++ b/layout/loading/CLoading.vue
@@ -0,0 +1,44 @@
+/**
+ * CLoading - 加载中状态
+ * @author Tevin
+ */
+
+<template>
+    <view
+        class="c-loading"
+        @tap="evt => handleGoTo()"
+    >
+        <AtActivityIndicator
+            :isOpened="show"
+            mode="center"
+        ></AtActivityIndicator>
+        <view
+            class="c-loading-content"
+            :class="show?'off':''"
+        >
+            <slot />
+        </view>
+    </view>
+</template>
+
+<script>
+import Taro from '@tarojs/taro';
+import { AtActivityIndicator } from 'taro-ui-vue';
+import './cLoading.scss';
+
+export default {
+    name: 'CLoading',
+    components: {
+        AtActivityIndicator,
+    },
+    props: {
+        show: {
+            type: Boolean,
+            default: false,
+        },
+    },
+    data() {
+        return {};
+    },
+};
+</script>
diff --git a/layout/loading/cLoading.scss b/layout/loading/cLoading.scss
new file mode 100644
index 0000000..a465779
--- /dev/null
+++ b/layout/loading/cLoading.scss
@@ -0,0 +1,27 @@
+/**
+ * CLoading
+ * @author Tevin
+ */
+
+@import "../../common/sassMixin";
+
+.c-loading {
+    position: relative;
+    .at-loading {
+        width: 60px;
+        height: 60px;
+        .at-loading__ring {
+            width: 60px;
+            height: 60px;
+            border-width: 2PX;
+        }
+    }
+    .c-loading-content {
+        opacity: 1;
+        transition: opacity 0.1s;
+        &.off {
+            opacity: 0.35;
+            transition: opacity 0.5s 0.1s;
+        }
+    }
+}
\ No newline at end of file
diff --git a/layout/loading/index.js b/layout/loading/index.js
new file mode 100644
index 0000000..9cbd211
--- /dev/null
+++ b/layout/loading/index.js
@@ -0,0 +1,10 @@
+/**
+ * CLoading
+ * @author Tevin
+ */
+
+import CLoading from '@components/layout/loading/CLoading.vue';
+
+export {
+    CLoading,
+}
\ No newline at end of file

--
Gitblit v1.9.1