--
2.39.5
From 146bfcaf46e2dd6c4547855ef3133a22bf40ff41 Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Mon, 19 Oct 2020 17:17:55 +0800
Subject: [PATCH 2/8] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/index.ts | 51 +++++++++++++++++++
src/views/login/Sign.vue | 107 ++++++++++++++++++++++++++++++++-------
2 files changed, 141 insertions(+), 17 deletions(-)
diff --git a/src/api/index.ts b/src/api/index.ts
index 86ff7a8..b4c6f49 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -446,6 +446,9 @@ export async function getarchives(): Promise<[Countries[],Willsay[]]>{
return [(await get
("countries")).data, (await get("willsay")).data];
}
+export async function getwillsay(): Promise{
+ return (await get("willsay")).data;
+}
/**
* 客户端语言
@@ -569,4 +572,52 @@ export async function cancellive(id: number, status: number){
message.error(res.msg);
return false;
}
+}
+
+
+
+
+/**
+ * 验证验证码
+ */
+
+export async function checksmscode(phone: string, smscode: string){
+ const res = await get("checkSmscode",{phone, smscode});
+ if(res.code == 0){
+ return true;
+ }else{
+ message.error(res.msg);
+ return false;
+ }
+}
+
+
+
+export async function register(data: any){
+ const res = await post("register",{
+ mobile: data.phone,
+ code: data.quhao,
+ password: data.pass,
+ topassword: data.passtow,
+ name: data.name,
+ email: data.emil,
+ mtongue: data.muyu,
+ tlanguage: data.jiaoshou
+ })
+ if(res.code == 0){
+ message.success(res.msg)
+ if(!saveValue("token", res.data.api_token) && !saveValue("memberid", res.data.memberid) ){
+ message.error("存储错误, 请允许网页使用本地存储!")
+ return false;
+ }else{
+ setToken();
+ store.commit("login", true);
+ store.dispatch("setUserInfo");
+ // router.push("/mine/archives")
+ }
+ return true;
+ }else{
+ message.error(res.msg)
+ return false;
+ }
}
\ No newline at end of file
diff --git a/src/views/login/Sign.vue b/src/views/login/Sign.vue
index 11f9036..94cc676 100644
--- a/src/views/login/Sign.vue
+++ b/src/views/login/Sign.vue
@@ -66,6 +66,7 @@
class="shuru"
placeholder="请输入您的密码"
type="password"
+ v-model:value="userinfo.pass"
/>
@@ -73,23 +74,23 @@
class="shuru"
placeholder="请再次输入您的密码"
type="password"
+ v-model:value="userinfo.passtow"
/>
-
+
-
+
-
+
-
-
- 中国+0086
+
+
+ {{ item.name }}
- Jiangsu
@@ -136,9 +137,10 @@
\ No newline at end of file
--
2.39.5
From d6a25692559c65cc1ef96e25e7b995c711a92f0a Mon Sep 17 00:00:00 2001
From: luyuan <1162963624@qq.com>
Date: Tue, 20 Oct 2020 17:08:18 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=8A=A0?=
=?UTF-8?q?=E8=BD=BD=E4=B8=AD=20=E6=97=A5=E5=8E=86=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=E4=B8=80=E8=88=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/base.ts | 8 ++++++
src/utils/date.ts | 24 +++++++++++++++-
src/views/regime/week.vue | 59 ++++++++++++++++++++++++++++-----------
3 files changed, 74 insertions(+), 17 deletions(-)
diff --git a/src/api/base.ts b/src/api/base.ts
index b259a4f..1994fcf 100644
--- a/src/api/base.ts
+++ b/src/api/base.ts
@@ -4,14 +4,22 @@ import { AxiosRequestConfig, CustomSuccessData } from 'axios';
import { getValue } from '@/utils/common';
import { message } from 'ant-design-vue';
import router from '@/router';
+import { MessageType } from 'ant-design-vue/types/message';
// 泛型接口
export interface Get {
(url: string, params?: unknown, config?: AxiosRequestConfig): Promise>;
}
+const login:MessageType[] = []
+axios.interceptors.request.use((config)=>{
+ login.push(message.loading('加载中..', 0))
+ return config;
+})
axios.interceptors.response.use((response)=>{
// console.log(response)
+ login[0]();
+ login.splice(0,1);
if(response.data.code == 1001){
router.push("/")
}
diff --git a/src/utils/date.ts b/src/utils/date.ts
index 9da443c..deb83a2 100644
--- a/src/utils/date.ts
+++ b/src/utils/date.ts
@@ -89,7 +89,9 @@ export function getweek(zhou?: number){
for(let j = 0;j < 24; j++){
date[i].list?.push({
start:"",
- num:""
+ num:"",
+ title: "",
+ time:""
})
}
}
@@ -103,4 +105,24 @@ export function getDay(date: string){
const now = dayjs(date)
console.log(now.date())
return now.date();
+}
+
+export function gethour(date: string){
+ const now = dayjs(date)
+ console.log(now.hour(), now.date(), now.minute())
+ return now.hour();
+}
+
+export function getminute(date: string){
+ const now = dayjs(date)
+ // console.log(now.hour(), now.date(), now.minute())
+ return now.minute();
+}
+
+export function gettime(date: string, num: number){
+ let now = dayjs(date)
+ const start = `${now.hour() > 9 ? now.hour() : '0' + now.hour()}:${now.minute() > 9 ? now.minute() : '0' + now.minute()}`
+ now = now.minute(now.minute() + num);
+ const end = `${now.hour() > 9 ? now.hour() : '0' + now.hour()}:${now.minute() > 9 ? now.minute() : '0' + now.minute()}`
+ return start + "-" + end;
}
\ No newline at end of file
diff --git a/src/views/regime/week.vue b/src/views/regime/week.vue
index 72a8657..25f9073 100644
--- a/src/views/regime/week.vue
+++ b/src/views/regime/week.vue
@@ -39,21 +39,21 @@
-
- {{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{
- item > 9 ? item : "0" + item
- }}:00
-
-
-
-
-
- one-line-hideon
+
+ {{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{
+ item > 9 ? item : "0" + item
+ }}:00
+
+
+
+
+
+ {{week.date[i -1].list[item - 1].title}}
+
+
{{week.date[i -1].list[item - 1].time}}
+
-
11:00-11:00
-
-
@@ -176,7 +176,8 @@
align-items: center;
justify-content: center;
font-size: 11px;
-
+ border-radius: 6px;
+ overflow: hidden;
> div:last-child {
font-size: 11px;
margin-top: 8px;
@@ -185,6 +186,7 @@
.old {
background-color: #f7f7f7;
color: #111;
+
}
.ing {
background-color: #0dbba4;
@@ -206,17 +208,42 @@