diff --git a/src/apis/auth/auth-interfaces.ts b/src/apis/auth/auth-interfaces.ts index 2ab09a4e..dfaf832d 100644 --- a/src/apis/auth/auth-interfaces.ts +++ b/src/apis/auth/auth-interfaces.ts @@ -32,3 +32,8 @@ export interface SetPasswordResp { code: number; msg: string; } + +export interface CheckIn { + isFirst: true; + getFishNum: 0; +} diff --git a/src/apis/auth/auth.ts b/src/apis/auth/auth.ts index 3b885104..208df729 100644 --- a/src/apis/auth/auth.ts +++ b/src/apis/auth/auth.ts @@ -1,12 +1,14 @@ import { + GignInResp, SendVerifyCodeReq, SendVerifyCodeResp, SetPasswordReq, SetPasswordResp, - SignInReq, - GignInResp + SignInReq } from "./auth-interfaces"; import { getPrefetchData } from "@/apis/prefetch"; +import { StorageKeys } from "@/utils/const"; +import { UserCheckInResp } from "@/apis/user/user-interfaces"; /** * @description @@ -38,6 +40,22 @@ export function signIn(req: SignInReq) { }); } +/*const signInRes= await signIn({ + authType: "wechat", + authId: appId, + verifyCode: res.code, + appId: AppId +}); +uni.setStorageSync(StorageKeys.AccessToken, { + token: signInRes.accessToken, + expireTime: signInRes.accessExpire +}); +uni.setStorageSync(StorageKeys.UserId,signInRes.userId); +if(signInRes.accessToken) { + const checkInRes = await checkIn(); + uni.setStorageSync('checkInInfo',JSON.stringify(checkInRes)); +}*/ + /** * @description * @param req @@ -79,3 +97,19 @@ export async function sendVerifyCode(req: SendVerifyCodeReq) { }); }); } + +/*async function checkIn(): Promise { + try { + const response = await uni.request({ + url: "/api/check_in", + data: { + token: signInRes.accessToken + }, + method: "GET", + }); + const data: string | AnyObject | ArrayBuffer = response.data; + return response.data; + } catch (error) { + throw error; + } +}*/ diff --git a/src/apis/community/community.ts b/src/apis/community/community.ts index e881dd5f..7e7b8e8f 100644 --- a/src/apis/community/community.ts +++ b/src/apis/community/community.ts @@ -56,3 +56,18 @@ export async function listCommunity(req: ListCommunityReq) { export function clearCache() { cache = null; } + +/*export function onLoad() { + const checkInInfoStr = uni.getStorageSync('checkInInfo'); + + if (checkInInfoStr) { + const checkInInfo = JSON.parse(checkInInfoStr); + + if (checkInInfo.isFirst) { + this.showToastBox = true; + this.gotFishNum += 30; + checkInInfo.isFirst = false; + checkInInfo.getFishNum += 30; + uni.setStorageSync('checkInInfo', JSON.stringify(checkInInfo)); + } + }*/ diff --git a/src/apis/user/user-interfaces.ts b/src/apis/user/user-interfaces.ts index d93babfa..1a8c76a1 100644 --- a/src/apis/user/user-interfaces.ts +++ b/src/apis/user/user-interfaces.ts @@ -23,5 +23,6 @@ export interface UpdateUserInfoResp { export interface UserCheckInResp { isFirst: boolean; + getFirst: boolean; getFishNum: number; } diff --git a/src/pages/community/community.vue b/src/pages/community/community.vue index 57790b01..86b6d8a8 100644 --- a/src/pages/community/community.vue +++ b/src/pages/community/community.vue @@ -97,7 +97,7 @@ onReady(() => { const checkIn = async () => { const resp = await userCheckIn(); console.log(resp); - if (resp.isFirst) { + if (resp.getFish) { gottenFishAmount.value = resp.getFishNum; showToastBox.value = true; } diff --git a/src/pages/plan/plan-details/Cards.vue b/src/pages/plan/plan-details/Cards.vue index 02def08a..cdf831d1 100644 --- a/src/pages/plan/plan-details/Cards.vue +++ b/src/pages/plan/plan-details/Cards.vue @@ -30,8 +30,8 @@ 募集时间: {{ displayDate(props.plan.startTime) }} ~ - {{ displayDate(props.plan.endTime) }}募集时间: {{ displayDate(props.plan.startTime, "YYYY/MM/DD") }} - + {{ displayDate(props.plan.endTime, "YYYY/MM/DD") }}
@@ -308,7 +308,7 @@ const nowPicIndex = ref(0); .progress { width: 60vw; height: 2vw; - background: linear-gradient(to right, #191970, #0000ff, #1e90ff); + background: linear-gradient(to right, #0000ff, #1e90ff); border-radius: 1vw; } } diff --git a/src/pages/plan/plan-details/DonatePanel.vue b/src/pages/plan/plan-details/DonatePanel.vue index 82f1d46b..e970d900 100644 --- a/src/pages/plan/plan-details/DonatePanel.vue +++ b/src/pages/plan/plan-details/DonatePanel.vue @@ -160,7 +160,8 @@ const decrement = () => { flex-direction: column; justify-content: center; margin-bottom: 20px; - border: 1vw solid skyblue; + border: 0.5vw solid dodgerblue; + box-shadow: 0 0 2vw rgba(28, 140, 248, 0.5); border-radius: 5vw; height: 20vh; width: 80vw;