diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 3986355e6526f199c19b0c3ac7ad1d699b3518cc..0d4f123a63f92986397f69538169d05e019105d8 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -12,8 +12,8 @@ module.exports = { { files: '*.json', options: { - trailingComma: 'none', - }, - }, - ], + trailingComma: 'none' + } + } + ] } diff --git a/.stylelintrc.cjs b/.stylelintrc.cjs index 574beef32ba7eb853ac7be74f64ad96ce0378250..03013fa491864cc5e426ddcf889586d93f3f84c7 100644 --- a/.stylelintrc.cjs +++ b/.stylelintrc.cjs @@ -9,19 +9,19 @@ module.exports = { 'stylelint-config-recommended-scss', 'stylelint-config-recommended-vue/scss', 'stylelint-config-html/vue', - 'stylelint-config-recess-order', + 'stylelint-config-recess-order' ], plugins: ['stylelint-prettier'], overrides: [ // 扫描 .vue/html 文件中的 diff --git a/src/pages/user/show.vue b/src/pages/user/show.vue new file mode 100644 index 0000000000000000000000000000000000000000..f7b5f4b017658ba959ba6ed57c8efe0f545c1edb --- /dev/null +++ b/src/pages/user/show.vue @@ -0,0 +1,20 @@ + +{ + layout: 'default', + style: { + navigationBarTitleText: '用户详情' + } +} + + + + + + + diff --git a/src/style/index.scss b/src/style/index.scss index bdb75539c39e617c3050af1d7a1259d7876d542a..70edc2202d64ed6c94e98f8cbf4a4eafc0a64082 100644 --- a/src/style/index.scss +++ b/src/style/index.scss @@ -21,4 +21,7 @@ page { // --wot-search-light-bg: #f2f3f7; --wot-search-input-radius: 5px; + + // card + --wot-card-padding: 12px; } diff --git a/src/types/auto-import.d.ts b/src/types/auto-import.d.ts index 255cb5bea51b9d225f751de2359909feda8eeb3b..b5c1bff877f014e494ae747f7294a66d162849e9 100644 --- a/src/types/auto-import.d.ts +++ b/src/types/auto-import.d.ts @@ -94,7 +94,7 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' import('vue') } // for vue template auto import @@ -156,6 +156,7 @@ declare module 'vue' { readonly onUnload: UnwrapRef readonly onUnmounted: UnwrapRef readonly onUpdated: UnwrapRef + readonly onWatcherCleanup: UnwrapRef readonly provide: UnwrapRef readonly reactive: UnwrapRef readonly readonly: UnwrapRef @@ -173,91 +174,11 @@ declare module 'vue' { readonly useAttrs: UnwrapRef readonly useCssModule: UnwrapRef readonly useCssVars: UnwrapRef + readonly useId: UnwrapRef + readonly useModel: UnwrapRef readonly useRequest: UnwrapRef readonly useSlots: UnwrapRef - readonly useUpload: UnwrapRef - readonly watch: UnwrapRef - readonly watchEffect: UnwrapRef - readonly watchPostEffect: UnwrapRef - readonly watchSyncEffect: UnwrapRef - } -} -declare module '@vue/runtime-core' { - interface GlobalComponents {} - interface ComponentCustomProperties { - readonly EffectScope: UnwrapRef - readonly computed: UnwrapRef - readonly createApp: UnwrapRef - readonly customRef: UnwrapRef - readonly defineAsyncComponent: UnwrapRef - readonly defineComponent: UnwrapRef - readonly effectScope: UnwrapRef - readonly getCurrentInstance: UnwrapRef - readonly getCurrentScope: UnwrapRef - readonly h: UnwrapRef - readonly inject: UnwrapRef - readonly isProxy: UnwrapRef - readonly isReactive: UnwrapRef - readonly isReadonly: UnwrapRef - readonly isRef: UnwrapRef - readonly markRaw: UnwrapRef - readonly nextTick: UnwrapRef - readonly onActivated: UnwrapRef - readonly onAddToFavorites: UnwrapRef - readonly onBackPress: UnwrapRef - readonly onBeforeMount: UnwrapRef - readonly onBeforeUnmount: UnwrapRef - readonly onBeforeUpdate: UnwrapRef - readonly onDeactivated: UnwrapRef - readonly onError: UnwrapRef - readonly onErrorCaptured: UnwrapRef - readonly onHide: UnwrapRef - readonly onLaunch: UnwrapRef - readonly onLoad: UnwrapRef - readonly onMounted: UnwrapRef - readonly onNavigationBarButtonTap: UnwrapRef - readonly onNavigationBarSearchInputChanged: UnwrapRef - readonly onNavigationBarSearchInputClicked: UnwrapRef - readonly onNavigationBarSearchInputConfirmed: UnwrapRef - readonly onNavigationBarSearchInputFocusChanged: UnwrapRef - readonly onPageNotFound: UnwrapRef - readonly onPageScroll: UnwrapRef - readonly onPullDownRefresh: UnwrapRef - readonly onReachBottom: UnwrapRef - readonly onReady: UnwrapRef - readonly onRenderTracked: UnwrapRef - readonly onRenderTriggered: UnwrapRef - readonly onResize: UnwrapRef - readonly onScopeDispose: UnwrapRef - readonly onServerPrefetch: UnwrapRef - readonly onShareAppMessage: UnwrapRef - readonly onShareTimeline: UnwrapRef - readonly onShow: UnwrapRef - readonly onTabItemTap: UnwrapRef - readonly onThemeChange: UnwrapRef - readonly onUnhandledRejection: UnwrapRef - readonly onUnload: UnwrapRef - readonly onUnmounted: UnwrapRef - readonly onUpdated: UnwrapRef - readonly provide: UnwrapRef - readonly reactive: UnwrapRef - readonly readonly: UnwrapRef - readonly ref: UnwrapRef - readonly resolveComponent: UnwrapRef - readonly shallowReactive: UnwrapRef - readonly shallowReadonly: UnwrapRef - readonly shallowRef: UnwrapRef - readonly toRaw: UnwrapRef - readonly toRef: UnwrapRef - readonly toRefs: UnwrapRef - readonly toValue: UnwrapRef - readonly triggerRef: UnwrapRef - readonly unref: UnwrapRef - readonly useAttrs: UnwrapRef - readonly useCssModule: UnwrapRef - readonly useCssVars: UnwrapRef - readonly useRequest: UnwrapRef - readonly useSlots: UnwrapRef + readonly useTemplateRef: UnwrapRef readonly useUpload: UnwrapRef readonly watch: UnwrapRef readonly watchEffect: UnwrapRef diff --git a/src/types/enums.ts b/src/types/enums.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3ac8f2e8d497984532d13820cdeca0a9d154b25 --- /dev/null +++ b/src/types/enums.ts @@ -0,0 +1,5 @@ +export enum LoadMoreState { + loading = 'loading', + finished = 'finished', + error = 'error' +} diff --git a/src/types/uni-pages.d.ts b/src/types/uni-pages.d.ts index 08b9b57a4a79d673bf5744452525706973e8ad98..e8bce39991e2683c103fbf4d1f451a5638663661 100644 --- a/src/types/uni-pages.d.ts +++ b/src/types/uni-pages.d.ts @@ -20,6 +20,7 @@ interface NavigateToOptions { "/pages/role/index" | "/pages/role/show" | "/pages/user/index" | + "/pages/user/show" | "/pages/colab/detail/index" | "/pages/my/contact-service/index" | "/pages/my/helper/index" | diff --git a/src/utils/index.ts b/src/utils/index.ts index dca155660ad5638219e3456b8a7dbba40f15d7c7..7f6f8079a4792703dcc8a54da4c7d3f90bf7c16d 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,6 @@ import { pages, subPackages, tabBar } from '@/pages.json' import { isMp } from './platform' -import { debug } from '@uni-helper/vite-plugin-uni-pages' +import { isEmpty } from '@/utils/is' const getLastPage = () => { // getCurrentPages() 至少有1个元素,所以不再额外判断 @@ -82,11 +82,7 @@ export const getAllPages = (key = 'needLogin') => { // 这里处理主包 const mainPages = [ ...pages - .filter((page) => { - // TODO @xiaohong:为啥这里要特殊判断呀。 - if (page.path.includes('login')) return false - return !!key || page[key] - }) + .filter((page) => (isEmpty(page[key]) ? !!key : page[key])) .map((page) => ({ ...page, path: `/${page.path}` @@ -99,11 +95,7 @@ export const getAllPages = (key = 'needLogin') => { const { root } = subPageObj subPageObj.pages - .filter((page) => { - // TODO @xiaohong:为啥这里要特殊判断呀。 - if (page.path.includes('login')) return false - return !!key || page[key] - }) + .filter((page) => (isEmpty(page[key]) ? !!key : page[key])) .forEach((page: { path: string } & Record) => { subPages.push({ ...page,