Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions miniapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"react-native-linear-gradient": "^2.8.3",
"react-native-safe-area-context": "^5.9.1",
"react-native-screens": "^4.27.0",
"xlsx": "0.18.5",
"zustand": "^5.0.15"
},
"devDependencies": {
Expand Down
72 changes: 72 additions & 0 deletions miniapp/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 46 additions & 22 deletions miniapp/project.config.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,49 @@
{
"miniprogramRoot": "dist/",
"projectname": "miniapp",
"description": "miniapp",
"appid": "wxed6ad84ef3fe585b",
"setting": {
"urlCheck": false,
"es6": false,
"miniprogramRoot": "dist/",
"projectname": "miniapp",
"description": "miniapp",
"appid": "wxed6ad84ef3fe585b",
"setting": {
"urlCheck": false,
"es6": false,
"enhance": false,
"compileHotReLoad": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": true,
"autoAudits": false,
"coverView": true,
"showShadowRootInWxmlPanel": false,
"scopeDataCheck": false,
"useCompilerModule": false
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": true,
"autoAudits": false,
"coverView": true,
"showShadowRootInWxmlPanel": false,
"scopeDataCheck": false,
"useCompilerModule": false,
"compileWorklet": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"minifyWXML": true,
"localPlugins": false,
"disableUseStrict": false,
"useCompilerPlugins": false,
"condition": false,
"swc": false,
"disableSWC": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {},
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {},
"libVersion": "3.17.3"
}
6 changes: 6 additions & 0 deletions miniapp/src/api/announcements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { get, post } from '../utils/request'
import type { ApiResponse } from '../types/api'
export type Announcement = { id: string | number; title: string; content: string; status?: string; publishedAt?: string; priority?: number; read?: boolean; createdAt?: string }
export function listAnnouncements(params?: { page?: number; pageSize?: number }): Promise<ApiResponse<{ list: Announcement[]; total: number }>> { return get('/announcements', { page: params?.page ?? 1, pageSize: params?.pageSize ?? 20 } as any) }
export function getPendingAnnouncementPopup(): Promise<ApiResponse<{ announcements?: Announcement[]; announcement: Announcement | null }>> { return get('/announcements/pending-popup') }
export function markAnnouncementRead(id: string | number): Promise<ApiResponse<null>> { return post(`/announcements/${id}/read`) }
11 changes: 10 additions & 1 deletion miniapp/src/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface CaptchaResponse {

export interface User {
id?: string | number
ID?: number
email: string
account?: string
displayName?: string
Expand All @@ -31,17 +32,25 @@ export interface User {
gender?: string
city?: string
region?: string
extra?: string
timezone: string
avatar?: string
role?: 'user' | 'admin'
createdAt: string
updatedAt: string
lastLogin: string
loginCount?: number
lastPasswordChange?: string
profileComplete?: number
streakDays?: number
hasFilledDetails: boolean
emailNotifications: boolean
emailVerified?: boolean
pushNotifications?: boolean
systemNotifications?: boolean
autoCleanUnreadEmails?: boolean
reviewCurvePreset?: 'times3' | 'times5' | 'times7' | 'times10' | 'standard' | 'interval3' | 'interval5' | 'interval10'
twoFactorEnabled?: boolean
emailVerified?: boolean
}

export interface LoginResponseData {
Expand Down
40 changes: 40 additions & 0 deletions miniapp/src/api/checkin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { get, post } from '../utils/request'
import type { ApiResponse } from '../types/api'

export type CheckInRewardTier = { days: number; minutes: number }

export type CheckInStatus = {
checkedInToday: boolean
currentStreak: number
longestStreak: number
yearCheckIns: number
dailyReward: number
nextStreakBonusDays?: number | null
nextStreakBonusMinutes?: number | null
poolRemainingMinutes: number
monthMask: boolean[]
monthStartWeekday: number
recentMask: boolean[]
recentStartWeekday: number
recentDays: number
recentStartDate: string
rewardPreview?: CheckInRewardTier[]
}

export type CheckInResult = {
alreadyCheckedIn: boolean
grantedMinutes: number
dailyMinutes: number
bonusMinutes: number
currentStreak: number
longestStreak: number
poolRemainingMinutes: number
}

export function getCheckInStatus(): Promise<ApiResponse<CheckInStatus>> {
return get<CheckInStatus>('/teacher/checkin')
}

export function postCheckIn(): Promise<ApiResponse<CheckInResult>> {
return post<CheckInResult>('/teacher/checkin')
}
Loading
Loading