fix: comply with F2E Spec — filename naming, any types, JSDoc

- Rename PascalCase component files to kebab-case (AnnouncementModal →
  announcement-modal, McGlass → mc-glass)
- Replace any types with proper uni-app/WeChat callback types
  (RequestSuccessCallbackResult, LoginRes, ShowModalRes, etc.)
- Add JSDoc documentation comments to all exported/important functions

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-06-26 14:45:49 +08:00
co-authored by Claude Haiku 4.5
parent 77c177bfa9
commit f10a1896e7
10 changed files with 66 additions and 26 deletions
+8 -4
View File
@@ -80,19 +80,23 @@ onMounted(() => {
}, 80)
})
/** 取消登录,返回上一页或首页 */
function handleCancel() {
uni.navigateBack({ fail: () => uni.switchTab({ url: '/pages/index/index' }) })
}
/** 打开服务条款 */
function openAgreement() {
uni.navigateTo({ url: '/pages/login/agreement' })
}
/** 打开隐私政策 */
function openPrivacy() {
uni.navigateTo({ url: '/pages/login/privacy' })
}
async function handleLogin(e: any) {
/** 微信一键登录(获取手机号后调后端登录接口) */
async function handleLogin(e: { detail: { errMsg: string; code?: string } }) {
if (e.detail.errMsg !== 'getPhoneNumber:ok') {
return
}
@@ -105,7 +109,7 @@ async function handleLogin(e: any) {
return
}
const loginRes: any = await new Promise((resolve, reject) => {
const loginRes = await new Promise<UniNamespace.LoginRes>((resolve, reject) => {
uni.login({ provider: 'weixin', success: resolve, fail: reject })
})
@@ -123,8 +127,8 @@ async function handleLogin(e: any) {
setTimeout(() => {
uni.switchTab({ url: '/pages/index/index' })
}, 1000)
} catch (err: any) {
showToast(err.message || '登录失败')
} catch (err: unknown) {
showToast(err instanceof Error ? err.message : '登录失败')
} finally {
loading.value = false
}