-
diff --git a/src/main.js b/src/main.js
index 6b7287d..1f555b2 100644
--- a/src/main.js
+++ b/src/main.js
@@ -3,6 +3,7 @@ import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import 'normalize.css';
+import 'vant/lib/index.css';
const app = createApp(App);
diff --git a/src/router/index.js b/src/router/index.js
index b37f884..2cfe5a7 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -14,6 +14,10 @@ const routes = [
{
path: 'logon',
component: () => import('@/views/logon/index.vue')
+ },
+ {
+ path: 'upload-id-card',
+ component: () => import('@/views/upload-id-card/index.vue')
}
]
}
diff --git a/src/util/storage.js b/src/util/storage.js
new file mode 100644
index 0000000..241a62f
--- /dev/null
+++ b/src/util/storage.js
@@ -0,0 +1,43 @@
+// storage.js
+
+class StorageService {
+ constructor(storage) {
+ this.storage = storage;
+ }
+
+ setItem(key, value, expire = null) {
+ const obj = {
+ data: value,
+ };
+ if (expire) {
+ const expireTime = new Date().getTime() + expire * 1000;
+ obj.expire = expireTime;
+ }
+ this.storage.setItem(key, JSON.stringify(obj));
+ }
+
+ getItem(key) {
+ const itemStr = this.storage.getItem(key);
+ if (!itemStr) {
+ return null;
+ }
+ const item = JSON.parse(itemStr);
+ if (item.expire && new Date().getTime() > item.expire) {
+ this.storage.removeItem(key);
+ return null;
+ }
+ return item.data;
+ }
+
+ removeItem(key) {
+ this.storage.removeItem(key);
+ }
+
+ clear() {
+ this.storage.clear();
+ }
+}
+
+const localStorageService = new StorageService(window.localStorage);
+
+export default localStorageService;
diff --git a/src/views/logon/index.vue b/src/views/logon/index.vue
index bd872d5..ddfe292 100644
--- a/src/views/logon/index.vue
+++ b/src/views/logon/index.vue
@@ -3,6 +3,27 @@
const router = useRouter();
router.go(-1);*/
+import {ref,onBeforeUnmount} from "vue";
+const isCountingDown = ref(false);
+const timeLeft = ref(60);
+const countdownInterval = ref(null);
+
+const sendCode = async () => {
+ isCountingDown.value = true;
+ countdownInterval.value = setInterval(() => {
+ if (timeLeft.value > 0) {
+ timeLeft.value--;
+ } else {
+ clearInterval(countdownInterval.value);
+ isCountingDown.value = false;
+ timeLeft.value = 60;
+ }
+ }, 1000);
+};
+
+onBeforeUnmount(() => {
+ clearInterval(countdownInterval.value);
+});
@@ -19,7 +40,7 @@ router.go(-1);*/
- 发送验证码
+ {{ isCountingDown ? `(${timeLeft})重新发送` : '发送验证码' }}
@@ -45,6 +66,7 @@ router.go(-1);*/
padding-left: 16px;
padding-right: 16px;
.wrap2{
+ box-sizing: border-box;
display: flex;
padding-top: 12px;
padding-bottom: 12px;
@@ -84,6 +106,7 @@ router.go(-1);*/
}
}
.wrap1{
+ box-sizing: border-box;
padding-right: 7px;
display: flex;
padding-top: 12px;
diff --git a/src/views/signup/index.vue b/src/views/signup/index.vue
index a880058..7c28cf4 100644
--- a/src/views/signup/index.vue
+++ b/src/views/signup/index.vue
@@ -1,10 +1,17 @@