diff --git a/src/apis/incentive/incentive-interfaces.ts b/src/apis/incentive/incentive-interfaces.ts new file mode 100644 index 00000000..4803c64c --- /dev/null +++ b/src/apis/incentive/incentive-interfaces.ts @@ -0,0 +1,16 @@ +export interface UserCheckInResp { + getFish: boolean; + getFishNum: number; + getFishTimes: number; +} + +export interface getMissionResp { + SignInTime: number; + LikeTime: number; + CommentTime: number; + ContentTime: number; + SignInFishes: number[]; + LikeFishes: number[]; + CommentFishes: number[]; + ContentFishes: number[]; +} diff --git a/src/apis/incentive/incentive.ts b/src/apis/incentive/incentive.ts new file mode 100644 index 00000000..29c00c73 --- /dev/null +++ b/src/apis/incentive/incentive.ts @@ -0,0 +1,36 @@ +import { + UserCheckInResp, + getMissionResp +} from "@/apis/incentive/incentive-interfaces"; + +export async function userCheckIn() { + return await new Promise((resolve, reject) => { + uni.request({ + url: "/incentive/check_in", + method: "GET", + success(res: UniNamespace.RequestSuccessCallbackResult) { + if (res.statusCode !== 200) { + reject(res); + } + const data = res.data as UserCheckInResp; + resolve(data); + } + }); + }); +} + +export async function getUserMission() { + return await new Promise((resolve, reject) => { + uni.request({ + url: "/incentive/get_mission", + method: "GET", + success(res: UniNamespace.RequestSuccessCallbackResult) { + if (res.statusCode !== 200) { + reject(res); + } + const data = res.data as getMissionResp; + resolve(data); + } + }); + }); +} diff --git a/src/apis/schemas.ts b/src/apis/schemas.ts index 58cc743a..1ec4e196 100644 --- a/src/apis/schemas.ts +++ b/src/apis/schemas.ts @@ -142,10 +142,10 @@ export interface Moment { } export const enum PlanType { - TypeOther = 0, TypeCastrate = 1, TypeHeal = 2, - TypeFeed = 3 + TypeFeed = 3, + TypeSupply } export const enum PlanState { diff --git a/src/apis/user/user-interfaces.ts b/src/apis/user/user-interfaces.ts index 7778421b..61131d64 100644 --- a/src/apis/user/user-interfaces.ts +++ b/src/apis/user/user-interfaces.ts @@ -20,8 +20,3 @@ export interface UpdateUserInfoResp { code: number; msg: string; } - -export interface UserCheckInResp { - getFish: boolean; - getFishNum: number; -} diff --git a/src/apis/user/user.ts b/src/apis/user/user.ts index 3628d289..2c48a099 100644 --- a/src/apis/user/user.ts +++ b/src/apis/user/user.ts @@ -2,8 +2,7 @@ import { GetUserInfoReq, GetUserInfoResp, UpdateUserInfoReq, - UpdateUserInfoResp, - UserCheckInResp + UpdateUserInfoResp } from "./user-interfaces"; import { PictureStyle } from "@/apis/cos/cos-interface"; import { getPrefetchData } from "@/apis/prefetch"; @@ -51,19 +50,3 @@ export async function updateUserInfo(req: UpdateUserInfoReq) { }); }); } - -export async function userCheckIn() { - return await new Promise((resolve, reject) => { - uni.request({ - url: "/user/check_in", - method: "GET", - success(res: UniNamespace.RequestSuccessCallbackResult) { - if (res.statusCode !== 200) { - reject(res); - } - const data = res.data as UserCheckInResp; - resolve(data); - } - }); - }); -} diff --git a/src/pages/community/community.vue b/src/pages/community/community.vue index d3183fb8..63d22a34 100644 --- a/src/pages/community/community.vue +++ b/src/pages/community/community.vue @@ -43,7 +43,7 @@ + + diff --git a/src/pages/plan/FishAmount.vue b/src/pages/plan/FishAmount.vue index b2f1f7e0..c3b3c8c0 100644 --- a/src/pages/plan/FishAmount.vue +++ b/src/pages/plan/FishAmount.vue @@ -2,8 +2,10 @@ 剩余{{ fishNum }}小鱼干剩余{{ fishNum }} @@ -23,25 +25,28 @@ getFishNum(); diff --git a/src/pages/plan/GoToMyPlans.vue b/src/pages/plan/GoToMyPlans.vue index 7a4ddfff..c3191e46 100644 --- a/src/pages/plan/GoToMyPlans.vue +++ b/src/pages/plan/GoToMyPlans.vue @@ -1,61 +1,29 @@ diff --git a/src/pages/plan/LikeTask.vue b/src/pages/plan/LikeTask.vue new file mode 100644 index 00000000..f316d36a --- /dev/null +++ b/src/pages/plan/LikeTask.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/pages/plan/MomentTask.vue b/src/pages/plan/MomentTask.vue new file mode 100644 index 00000000..8ceb0cef --- /dev/null +++ b/src/pages/plan/MomentTask.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/src/pages/plan/PlanEntry.vue b/src/pages/plan/PlanEntry.vue index cd09bcad..1ffcc289 100644 --- a/src/pages/plan/PlanEntry.vue +++ b/src/pages/plan/PlanEntry.vue @@ -5,50 +5,62 @@ @click="onClickPlan(props.plan.id)" > - + {{ planTypeMap(props.plan.planType) }} - - {{ props.plan.summary }} - - + 帮助 - {{ - props.plan?.cat?.name || "全体猫猫" - }} + {{ props.plan?.cat?.name || "全体猫猫" }} {{ props.plan.name }} - - + 已获得{{ props.plan.nowFish }}小鱼干助力,还需要{{ props.plan.maxFish - props.plan.nowFish }}小鱼干 - 去助力 + + 去助力 + - diff --git a/src/pages/plan/helped-plans/HelpedCard.vue b/src/pages/plan/helped-plans/HelpedCard.vue index e9677b92..2d3ebc9c 100644 --- a/src/pages/plan/helped-plans/HelpedCard.vue +++ b/src/pages/plan/helped-plans/HelpedCard.vue @@ -1,42 +1,100 @@ diff --git a/src/pages/plan/utils.ts b/src/pages/plan/utils.ts index cd4fb2c2..af497783 100644 --- a/src/pages/plan/utils.ts +++ b/src/pages/plan/utils.ts @@ -3,8 +3,9 @@ import { Plan, PlanState, PlanType } from "@/apis/schemas"; export const planTypeMap = (type: PlanType) => { if (type === PlanType.TypeFeed) return "零食奖励"; - else if (type === PlanType.TypeCastrate) return "生理健康"; - else if (type === PlanType.TypeHeal) return "治愈"; + else if (type === PlanType.TypeCastrate) return "绝育计划"; + else if (type === PlanType.TypeHeal) return "生理健康"; + else if (type === PlanType.TypeSupply) return "物资补给"; return "其它"; }; diff --git a/src/static/images/plan/GoToPath_heart_tag.png b/src/static/images/plan/GoToPath_heart_tag.png deleted file mode 100644 index 1bd2808c..00000000 Binary files a/src/static/images/plan/GoToPath_heart_tag.png and /dev/null differ diff --git a/src/static/images/plan/checked_in.png b/src/static/images/plan/checked_in.png new file mode 100644 index 00000000..32e3ab52 Binary files /dev/null and b/src/static/images/plan/checked_in.png differ diff --git a/src/static/images/plan/finished.png b/src/static/images/plan/finished.png new file mode 100644 index 00000000..d8218c09 Binary files /dev/null and b/src/static/images/plan/finished.png differ diff --git a/src/static/images/plan/finished_icon.png b/src/static/images/plan/finished_icon.png new file mode 100644 index 00000000..43ea7227 Binary files /dev/null and b/src/static/images/plan/finished_icon.png differ diff --git a/src/static/images/plan/plan_logo.png b/src/static/images/plan/plan_logo.png deleted file mode 100644 index 72562b6c..00000000 Binary files a/src/static/images/plan/plan_logo.png and /dev/null differ diff --git a/src/static/images/plan/plan_tag.png b/src/static/images/plan/plan_tag.png deleted file mode 100644 index 3fef3be4..00000000 Binary files a/src/static/images/plan/plan_tag.png and /dev/null differ diff --git a/src/static/images/plan/toast.png b/src/static/images/plan/toast.png deleted file mode 100644 index 5c323c50..00000000 Binary files a/src/static/images/plan/toast.png and /dev/null differ diff --git a/src/static/images/plan/unfinished.png b/src/static/images/plan/unfinished.png new file mode 100644 index 00000000..e3f1a447 Binary files /dev/null and b/src/static/images/plan/unfinished.png differ diff --git a/src/utils/time.ts b/src/utils/time.ts index ff73b373..6d01a16b 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -21,7 +21,15 @@ export function displayTime(timestamp: number) { return time.format("MM-DD"); } } - +export function displayTimeTotal(timestamp: number) { + timestamp = adaptTime(timestamp); + const now = new Date().getTime(); + if (now < timestamp) { + timestamp = now; + } + const time = moment(timestamp); + return time.format("YYYY-MM-DD"); +} export function displayDate(timestamp: number, format = "YYYY-MM-DD") { timestamp = adaptTime(timestamp); const time = moment(timestamp); diff --git a/src/utils/url.ts b/src/utils/url.ts index 742654e9..8561cf83 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -20,20 +20,27 @@ export const enum Icons { Tag = "/static/images/tag.png", Cam = "/static/images/campus_cat.png", View = "/static/images/view_the_illustration.png", - Plan_PlanTag = "/static/images/plan/plan_tag.png", - Plan_Logo = "/static/images/plan/plan_logo.png", - Plan_Toast = "/static/images/plan/toast.png", - GoToPath_Tag = "/static/images/plan/GoToPath_heart_tag.png", + Plan_PlanHealthTag = "https://static.xhpolaris.com/static/meowchat/plan_tag1.png", + Plan_PlanSnacksTag = "https://static.xhpolaris.com/static/meowchat/plan_tag2.png", + Plan_Logo = "https://static.xhpolaris.com/static/meowchat/plan_logo.png", + Plan_Toast = "https://static.xhpolaris.com/static/meowchat/toast.png", + GoToPath_Tag = "https://static.xhpolaris.com/static/meowchat/GoToPath_heart_tag.png", GoToArrow = "/static/images/plan/GoToPath_right_arrow.png", CatExample = "/static/images/cat-example.png", LittleFish = "/static/images/Little_Fish.png", + LittleFished = "/static/images/plan/checked_in.png", Frame = "/static/images/Frame.png", DialogBox = "/static/images/dialog-box.png", State_Frame = "/static/images/state-frame.png", Pic_Left = "/static/images/pic-left.png", Pic_Right = "/static/images/pic-right.png", Button_Increment = "/static/images/button-increment.png", - Button_Decrement = "/static/images/button-decrement.png" + Button_Decrement = "/static/images/button-decrement.png", + TaskLogo = "https://static.xhpolaris.com/static/meowchat/task_logo.png", + UnFinishedTask = "/static/images/plan/unfinished.png", + FinishedTask = "/static/images/plan/finished.png", + FinishedTaskIcon = "/static/images/plan/finished_icon.png", + HelpedPlanLogo = "https://static.xhpolaris.com/static/meowchat/helped_plan_logo.png" } export const enum Pages {