Files
medical-mall/unpackage/cache/.app-android/sourcemap/pages/user/forgot-password.kt.map

1 line
14 KiB
Plaintext

{"version":3,"sources":["pages/user/forgot-password.uvue","pages/user/login.uvue","uni_modules/ak-req/ak-req.uts"],"sourcesContent":["<template>\r\n <!-- Single scrollable container for tablet optimization -->\r\n <scroll-view class=\"forgot-password-container\" scroll-y=\"true\" show-scrollbar=\"false\">\r\n <!-- Language switch positioned absolutely -->\r\n <view class=\"language-switch\">\r\n <button class=\"language-btn\" @click=\"toggleLanguage\">\r\n {{ currentLocale === 'zh-CN' ? 'EN' : '中' }}\r\n </button>\r\n </view>\r\n \r\n <!-- Main content wrapper -->\r\n <view class=\"content-wrapper\">\r\n <!-- Logo and title section -->\r\n <view class=\"logo-section\">\r\n <text class=\"app-title\">Akmon</text>\r\n <text class=\"page-title\">{{ $t('user.forgot_password.title') }}</text>\r\n <text class=\"page-subtitle\">{{ $t('user.forgot_password.subtitle') }}</text>\r\n </view>\r\n \r\n <!-- Form container with content inside -->\r\n <view class=\"form-container\">\r\n <view v-if=\"!resetEmailSent\">\r\n <form @submit=\"onSubmit\">\r\n <!-- Email input -->\r\n <view class=\"input-group\" :class=\"{ 'input-error': emailError }\">\r\n <text class=\"input-label\">{{ $t('user.forgot_password.email') }}</text>\r\n <input \r\n class=\"input-field\" \r\n name=\"email\"\r\n type=\"text\" \r\n v-model=\"email\" \r\n :placeholder=\"$t('user.forgot_password.email_placeholder')\" \r\n @blur=\"validateEmail\"\r\n />\r\n <text v-if=\"emailError\" class=\"error-text\">{{ emailError }}</text>\r\n </view>\r\n \r\n <!-- Submit button -->\r\n <button form-type=\"submit\" class=\"submit-button\" :disabled=\"isLoading\" :loading=\"isLoading\">\r\n {{ $t('user.forgot_password.submit_button') }}\r\n </button>\r\n \r\n <!-- General error message -->\r\n <text v-if=\"generalError\" class=\"general-error\">{{ generalError }}</text>\r\n </form>\r\n \r\n <!-- Login option -->\r\n <view class=\"login-option\">\r\n <text class=\"login-text\">{{ $t('user.forgot_password.remember_password') }}</text>\r\n <text class=\"login-link\" @click=\"navigateToLogin\">{{ $t('user.forgot_password.login') }}</text>\r\n </view>\r\n </view>\r\n \r\n <!-- Success message -->\r\n <view v-else class=\"success-container\">\r\n <view class=\"success-icon\">✓</view>\r\n <text class=\"success-title\">{{ $t('user.forgot_password.email_sent_title') }}</text>\r\n <text class=\"success-message\">{{ $t('user.forgot_password.email_sent_message') }}</text>\r\n <button class=\"back-button\" @click=\"navigateToLogin\">\r\n {{ $t('user.forgot_password.back_to_login') }}\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n </scroll-view>\r\n</template>\r\n\r\n<script lang=\"uts\">\r\nimport supa from '@/components/supadb/aksupainstance.uts';\r\nimport { switchLocale, getCurrentLocale } from '@/utils/utils.uts';\r\n\r\nexport default {\r\n data() {\r\n return {\r\n email: \"\",\r\n emailError: \"\",\r\n generalError: \"\",\r\n isLoading: false,\r\n resetEmailSent: false,\r\n currentLocale: getCurrentLocale()\r\n };\r\n }, methods: {\r\n toggleLanguage() {\r\n const newLocale = this.currentLocale === 'zh-CN' ? 'en-US' : 'zh-CN';\r\n switchLocale(newLocale);\r\n this.currentLocale = newLocale;\r\n \r\n uni.showToast({\r\n title: this.$t('user.forgot_password.language_switched'),\r\n icon: 'success'\r\n });\r\n },\r\n onSubmit(e: UniFormSubmitEvent) {\r\n this.handleResetRequest();\r\n },\r\n validateEmail() {\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n if (this.email == null || this.email === \"\") {\r\n this.emailError = this.$t('user.forgot_password.email_required');\r\n return false;\r\n } else if (!emailRegex.test(this.email)) {\r\n this.emailError = this.$t('user.forgot_password.email_invalid');\r\n return false;\r\n } else {\r\n this.emailError = '';\r\n return true;\r\n }\r\n },\r\n async handleResetRequest() {\r\n this.generalError = '';\r\n if (!this.validateEmail()) {\r\n return;\r\n }\r\n \r\n this.isLoading = true;\r\n try {\r\n // Call Supabase password reset method\r\n const result = await supa.resetPassword(this.email);\r\n \r\n // Show success view\r\n this.resetEmailSent = true;\r\n \r\n } catch (err) {\r\n console.error(\"Password reset error:\", err);\r\n\r\n // Format error message\r\n if (typeof err === 'object' && err !== null) {\r\n const errObj = err as UniError;\r\n if (typeof errObj.message === 'string') {\r\n // If we have a specific error message from Supabase\r\n this.generalError = errObj.message;\r\n } else {\r\n this.generalError = this.$t('user.forgot_password.unknown_error');\r\n }\r\n } else {\r\n this.generalError = this.$t('user.forgot_password.unknown_error');\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n },\r\n navigateToLogin() {\r\n uni.navigateTo({\r\n url: '/pages/user/login'\r\n });\r\n }\r\n }\r\n};\r\n</script>\r\n\r\n<style>\r\n/* Single scrollable container for tablet optimization */\r\n.forgot-password-container {\r\n height: 100%;\r\n\r\n\r\n\r\n\r\n padding: 40rpx;\r\n\r\n background-color: #f8f9fa;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* Content wrapper for centered layout */\r\n.content-wrapper {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: flex-start;\r\n padding-bottom: 40rpx;\r\n /* 确保内容足够高以触发滚动 */\r\n\r\n\r\n\r\n\r\n min-height: 1000rpx;\r\n\r\n}\r\n\r\n/* Language switch button - positioned absolutely */\r\n.language-switch {\r\n position: absolute;\r\n\r\n\r\n\r\n\r\n\r\n top: 40rpx;\r\n right: 40rpx;\r\n\r\n z-index: 10;\r\n}\r\n\r\n.language-btn {\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n width: 80rpx;\r\n height: 80rpx;\r\n border-radius: 40rpx;\r\n font-size: 28rpx;\r\n background-color: rgba(33, 150, 243, 0.8); color: #fff;\r\n font-weight: normal;\r\n border: 2rpx solid rgba(255, 255, 255, 0.3);\r\n text-align: center;\r\n box-shadow: 0 4rpx 12rpx rgba(33, 150, 243, 0.3);\r\n}\r\n\r\n/* Logo and title section */\r\n.logo-section {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n\r\n\r\n\r\n\r\n\r\n margin-top: 80rpx;\r\n margin-bottom: 40rpx;\r\n\r\n}\r\n\r\n.app-title {\r\n\r\n\r\n\r\n\r\n font-size: 36rpx;\r\n\r\n font-weight: bold;\r\n color: #2196f3;\r\n}\r\n\r\n.page-title {\r\n\r\n\r\n\r\n\r\n\r\n font-size: 48rpx;\r\n margin-top: 20rpx;\r\n\r\n font-weight: bold;\r\n color: #333;\r\n}\r\n\r\n.page-subtitle {\r\n\r\n\r\n\r\n\r\n\r\n font-size: 28rpx;\r\n margin-top: 10rpx;\r\n\r\n color: #666;\r\n}\r\n\r\n/* Form container */\r\n.form-container {\r\n width: 100%;\r\n\r\n\r\n\r\n\r\n\r\n max-width: 680rpx;\r\n padding: 40rpx;\r\n\r\n background-color: #ffffff;\r\n border-radius: 20rpx;\r\n box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1);\r\n box-sizing: border-box;\r\n}\r\n\r\n/* Input groups */\r\n.input-group {\r\n\r\n\r\n\r\n\r\n margin-bottom: 30rpx;\r\n\r\n}\r\n\r\n.input-label {\r\n\r\n\r\n\r\n\r\n font-size: 28rpx;\r\n margin-bottom: 10rpx;\r\n\r\n font-weight: normal;\r\n color: #333;\r\n display: flex;\r\n}\r\n\r\n.input-field {\r\n width: 100%;\r\n\r\n\r\n\r\n\r\n\r\n\r\n height: 90rpx;\r\n padding: 0 30rpx;\r\n font-size: 28rpx;\r\n\r\n border-radius: 10rpx;\r\n border: 2rpx solid #ddd;\r\n background-color: #f9f9f9;\r\n box-sizing: border-box;\r\n}\r\n\r\n.input-error .input-field {\r\n border-color: #f44336;\r\n}\r\n\r\n.error-text {\r\n\r\n\r\n\r\n\r\n\r\n font-size: 24rpx;\r\n margin-top: 6rpx;\r\n\r\n color: #f44336;\r\n}\r\n\r\n/* Submit button */\r\n.submit-button {\r\n width: 100%;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n height: 90rpx;\r\n font-size: 32rpx;\r\n margin: 20rpx 0; border-radius: 45rpx;\r\n\r\n background-image: linear-gradient(to right, #2196f3, #03a9f4); color: #fff;\r\n font-weight: normal;\r\n text-align: center;\r\n box-shadow: 0 10rpx 20rpx rgba(3, 169, 244, 0.2);\r\n}\r\n\r\n.submit-button:disabled {\r\n background: #ccc;\r\n box-shadow: none;\r\n}\r\n\r\n/* General error */\r\n.general-error {\r\n width: 100%;\r\n text-align: center;\r\n color: #f44336;\r\n\r\n\r\n\r\n\r\n\r\n font-size: 28rpx;\r\n margin-top: 20rpx;\r\n\r\n}\r\n\r\n/* Login option */\r\n.login-option {\r\n display: flex;\r\n justify-content: center;\r\n\r\n\r\n\r\n\r\n margin-top: 40rpx;\r\n\r\n}\r\n\r\n.login-text {\r\n\r\n\r\n\r\n\r\n\r\n font-size: 28rpx;\r\n margin-right: 8rpx;\r\n\r\n color: #666;\r\n}\r\n\r\n.login-link {\r\n\r\n\r\n\r\n\r\n font-size: 28rpx;\r\n color: #2196f3;\r\n font-weight: normal;\r\n}\r\n\r\n/* Success container */\r\n.success-container {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n\r\n\r\n\r\n\r\n padding: 20rpx 0;\r\n\r\n}\r\n\r\n.success-icon {\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n width: 120rpx;\r\n height: 120rpx;\r\n font-size: 60rpx;\r\n margin-bottom: 30rpx;\r\n\r\n background-color: #4caf50;\r\n color: white;\r\n\r\n\r\n\r\n\r\n border-radius: 120rpx;\r\n\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.success-title {\r\n\r\n\r\n\r\n\r\n\r\n font-size: 36rpx;\r\n margin-bottom: 20rpx;\r\n\r\n font-weight: bold;\r\n color: #333;\r\n}\r\n\r\n.success-message {\r\n\r\n\r\n\r\n\r\n\r\n font-size: 28rpx;\r\n margin-bottom: 40rpx;\r\n\r\n color: #666;\r\n text-align: center;\r\n}\r\n\r\n.back-button {\r\n width: 100%;\r\n\r\n\r\n\r\n\r\n\r\n\r\n height: 90rpx;\r\n font-size: 32rpx;\r\n border-radius: 45rpx;\r\n\r\n background-color: #f0f0f0; color: #333;\r\n font-weight: normal;\r\n text-align: center;\r\n}\r\n</style>",null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuEK;;;;;;;eArEH,IA8Dc,eAAA,IA9DD,WAAM,6BAA4B,cAAS,QAAO,oBAAe;YAE5E,IAIO,QAAA,IAJD,WAAM,oBAAiB;gBAC3B,IAES,UAAA,IAFD,WAAM,gBAAgB,aAAO,KAAA,cAAc,OAC9C,IAAA,KAAA,aAAa,CAAA,GAAA,CAAA,SAAA;oBAAA;gBAAA,EAAA,IAAA,CAAA;oBAAA;gBAAA;gBAAA,GAAA,CAAA,EAAA;oBAAA;iBAAA;;YAKpB,IAoDO,QAAA,IApDD,WAAM,oBAAiB;gBAE3B,IAIO,QAAA,IAJD,WAAM,iBAAc;oBACxB,IAAoC,QAAA,IAA9B,WAAM,cAAY;oBACxB,IAAsE,QAAA,IAAhE,WAAM,eAAY,IAAI,KAAA,IAAE,CAAA,gCAAA,CAAA;oBAC9B,IAA4E,QAAA,IAAtE,WAAM,kBAAe,IAAI,KAAA,IAAE,CAAA,mCAAA,CAAA;;gBAInC,IA0CO,QAAA,IA1CD,WAAM,mBAAgB;gCACb,KAAA,cAAc,GAA3B;wBAAA,IA8BO,QAAA,IAAA,SAAA,CAAA,GAAA;4BA7BL,IAsBO,iBAAA,IAtBA,cAAQ,KAAA,QAAQ,GAAA,6BAErB,gBAWO,GAAA;uCAAA;oCAXP,IAWO,QAAA,IAXD,WAAK,IAAA;wCAAC;wCAAsB,IAAA,iBAAA,KAAA,UAAA;qCAA6B;wCAC7D,IAAuE,QAAA,IAAjE,WAAM,gBAAa,IAAI,KAAA,IAAE,CAAA,gCAAA,CAAA;wCAC/B,IAOE,SAAA,IANA,WAAM,eACN,UAAK,SACL,UAAK,wBACI,KAAA,KAAK;4CAAL,KAAA,KAAK,GAAA,SAAA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