优化:去掉不必要的loading
This commit is contained in:
@@ -220,18 +220,16 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onShow, onHide, onPullDownRefresh, onPageScroll, onLoad } from '@dcloudio/uni-app'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { onShow, onHide, onPullDownRefresh, onPageScroll } from '@dcloudio/uni-app'
|
||||
import { courseApi } from '@/api/modules/course'
|
||||
import { courseSubjectClassificationApi } from '@/api/modules/cousre_subject_classification'
|
||||
import { commonApi } from '@/api/modules/common'
|
||||
import { getNotchHeight } from '@/utils/system'
|
||||
// import { onPageJump } from '@/utils'
|
||||
import type { IMedicalTag, ICourse, INews } from '@/types/course'
|
||||
import type { ICategory, ICourse, INews } from '@/types/course'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
// 系统信息
|
||||
const scrollTop = ref<number>(0) // 滚动位置
|
||||
@@ -246,10 +244,10 @@ const handleSearch = ({ value }: { value: string }) => {
|
||||
}
|
||||
|
||||
// 分类相关
|
||||
const curseTagList = ref<IMedicalTag[]>([]) // 一级分类标签列表
|
||||
const sbuMedicalTagsList = ref<IMedicalTag[]>([]) // 二级分类标签列表
|
||||
const curseTagList = ref<ICategory[]>([]) // 一级分类标签列表
|
||||
const sbuMedicalTagsList = ref<ICategory[]>([]) // 二级分类标签列表
|
||||
const currentIndex = ref<number>(0) // 当前选中的一级分类索引
|
||||
const currentItem = ref<IMedicalTag | null>(null) // 当前选中的一级分类项
|
||||
const currentItem = ref<ICategory | null>(null) // 当前选中的一级分类项
|
||||
|
||||
// 学科数据
|
||||
const firstLevelCategories = ref<string[]>(['医学', '心理学', '国学'])
|
||||
@@ -287,7 +285,7 @@ const getMedicineMenusSuccess = (res: any) => {
|
||||
* 医学
|
||||
* 一级分类点击处理
|
||||
*/
|
||||
const curseClick = (item: IMedicalTag, index: number) => {
|
||||
const curseClick = (item: ICategory, index: number) => {
|
||||
currentItem.value = item
|
||||
currentIndex.value = index
|
||||
|
||||
@@ -350,7 +348,7 @@ const handleFirstLevelClick = (item: string) => {
|
||||
/**
|
||||
* 终极分类点击处理
|
||||
*/
|
||||
const curseClickJump = (item: IMedicalTag) => {
|
||||
const curseClickJump = (item: ICategory) => {
|
||||
getPrompt()
|
||||
if(!uni.getStorageSync('token')) return
|
||||
uni.navigateTo({
|
||||
@@ -512,7 +510,7 @@ onPullDownRefresh(() => {
|
||||
/**
|
||||
* 页面滚动
|
||||
*/
|
||||
onPageScroll((e) => {
|
||||
onPageScroll((e: any) => {
|
||||
scrollTop.value = e.scrollTop
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="title" :style="{ 'margin-top': getNotchHeight() + 'px' }">{{ $t('forget.title') }}</view>
|
||||
<!-- 自定义导航栏 -->
|
||||
<nav-bar :title="$t('forget.title')" />
|
||||
<!-- <view class="title" :style="{ 'margin-top': getNotchHeight() + 'px' }">{{ $t('forget.title') }}</view> -->
|
||||
|
||||
<!-- 邮箱输入 -->
|
||||
<view class="input-box">
|
||||
@@ -33,7 +35,7 @@
|
||||
<input
|
||||
class="input-text"
|
||||
type="password"
|
||||
maxlength="20"
|
||||
:maxlength="20"
|
||||
v-model="password"
|
||||
:placeholder="$t('forget.passwordPlaceholder')"
|
||||
@input="inputMethod(password)"
|
||||
@@ -54,8 +56,8 @@
|
||||
<input
|
||||
class="input-text"
|
||||
type="password"
|
||||
minlength="8"
|
||||
maxlength="20"
|
||||
:minlength="8"
|
||||
:maxlength="20"
|
||||
v-model="confirmPassword"
|
||||
:placeholder="$t('forget.passwordAgainPlaceholder')"
|
||||
/>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
v-model="code"
|
||||
:placeholder="$t('login.codePlaceholder')"
|
||||
placeholder-class="grey"
|
||||
maxlength="6"
|
||||
:maxlength="6"
|
||||
@confirm="onSubmit"
|
||||
/>
|
||||
<wd-button type="info" :class="['code-btn', { 'active': !readonly }]" @click="onSetCode">
|
||||
@@ -116,7 +116,7 @@
|
||||
|
||||
<!-- 游客体验 -->
|
||||
<view class="youke-l" v-if="!isAndorid">
|
||||
<view @click="onPageJump('/pages/course/index')">
|
||||
<view @click="onPageSwitch('/pages/course/index')">
|
||||
{{ $t('login.noLogin') }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -147,6 +147,7 @@ import { loginWithCode, loginWithPassword } from '@/api/modules/auth'
|
||||
import { commonApi } from '@/api/modules/common'
|
||||
import { validateEmail } from '@/utils/validator'
|
||||
import { onPageJump } from '@/utils'
|
||||
import { ILoginResponse } from '@/types/user'
|
||||
|
||||
import { t } from '@/utils/i18n'
|
||||
|
||||
@@ -303,14 +304,14 @@ const passwordLogin = async () => {
|
||||
const onSubmit = async () => {
|
||||
if(!isAgree()) return false
|
||||
|
||||
let res = null
|
||||
let res: ILoginResponse | null = null
|
||||
|
||||
switch (loginType.value) {
|
||||
case 2000:
|
||||
res = await verifyCodeLogin()
|
||||
res = await verifyCodeLogin() as ILoginResponse
|
||||
break
|
||||
case 1000:
|
||||
res = await passwordLogin()
|
||||
res = await passwordLogin() as ILoginResponse
|
||||
break
|
||||
}
|
||||
|
||||
@@ -399,7 +400,7 @@ const yszc = () => {
|
||||
/**
|
||||
* 页面跳转
|
||||
*/
|
||||
const onPageJump = (url: string) => {
|
||||
const onPageSwitch = (url: string) => {
|
||||
uni.switchTab({
|
||||
url: url,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user