功能:完善门店能力与用户安全配置
This commit is contained in:
@@ -45,6 +45,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* BottomNav page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import { computed, inject, onMounted, ref } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { HomeOutlined, ShoppingOutlined, ShoppingCartOutlined, UserOutlined } from '@ant-design/icons-vue'
|
||||
@@ -59,9 +63,11 @@ const cartCount = inject('cartCount', ref(0))
|
||||
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
|
||||
|
||||
// 是否有未读通知
|
||||
/** hasNotification is a reactive state variable used by the template and event handlers. */
|
||||
const hasNotification = computed(() => true)
|
||||
|
||||
// 加载购物车数量
|
||||
/** loadCartCount is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const loadCartCount = async () => {
|
||||
// 这里我们不需要做任何事情,因为全局状态会自动更新
|
||||
// 但我们仍然需要这个方法,因为 App.vue 会调用它
|
||||
@@ -83,6 +89,7 @@ defineExpose({
|
||||
})
|
||||
|
||||
// 根据当前路由判断激活的导航项
|
||||
/** currentRoute is a reactive state variable used by the template and event handlers. */
|
||||
const currentRoute = computed(() => {
|
||||
if (!route || !route.path) return 'home'
|
||||
const path = route.path
|
||||
@@ -96,6 +103,7 @@ const currentRoute = computed(() => {
|
||||
})
|
||||
|
||||
// 处理导航点击事件
|
||||
/** handleNavClick is a local helper used by this page script. */
|
||||
const handleNavClick = (tab: string) => {
|
||||
if (tab === 'home') {
|
||||
router.push('/home')
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* DraftActions page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
@@ -35,6 +39,7 @@ defineEmits<{
|
||||
(event: 'clear'): void
|
||||
}>()
|
||||
|
||||
/** formattedSavedAt is a reactive state variable used by the template and event handlers. */
|
||||
const formattedSavedAt = computed(() => {
|
||||
if (!props.savedAt) {
|
||||
return ''
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* TableEllipsisText page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
@@ -19,6 +23,7 @@ const props = withDefaults(defineProps<{
|
||||
emptyText: '--'
|
||||
})
|
||||
|
||||
/** displayText is a reactive state variable used by the template and event handlers. */
|
||||
const displayText = computed(() => {
|
||||
if (props.text === undefined || props.text === null) {
|
||||
return ''
|
||||
@@ -27,6 +32,7 @@ const displayText = computed(() => {
|
||||
return value
|
||||
})
|
||||
|
||||
/** lineClass is a reactive state variable used by the template and event handlers. */
|
||||
const lineClass = computed(() => {
|
||||
return props.lines > 1 ? `lines-${props.lines}` : ''
|
||||
})
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* AdminMobileCardList page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
const props = withDefaults(defineProps<{
|
||||
items?: any[]
|
||||
emptyDescription?: string
|
||||
@@ -24,6 +28,7 @@ const props = withDefaults(defineProps<{
|
||||
itemKey: 'id'
|
||||
})
|
||||
|
||||
/** resolveItemKey is a local helper used by this page script. */
|
||||
const resolveItemKey = (item: Record<string, any> | undefined, index: number) => {
|
||||
if (item && props.itemKey in item && item[props.itemKey] !== undefined) {
|
||||
return item[props.itemKey]
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* AdminMobileFab page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import { PlusOutlined } from '@ant-design/icons-vue'
|
||||
|
||||
withDefaults(defineProps<{
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* AdminResponsiveModal page script.
|
||||
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
||||
*/
|
||||
import type { CSSProperties } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useAdminViewport } from '@/composables/useAdminViewport'
|
||||
@@ -43,7 +47,9 @@ const emit = defineEmits<{
|
||||
|
||||
const { isMobile } = useAdminViewport()
|
||||
|
||||
/** mergedWidth is a reactive state variable used by the template and event handlers. */
|
||||
const mergedWidth = computed(() => (isMobile.value ? '100vw' : props.desktopWidth))
|
||||
/** mergedStyle is a reactive state variable used by the template and event handlers. */
|
||||
const mergedStyle = computed(() => (
|
||||
isMobile.value
|
||||
? {
|
||||
@@ -53,6 +59,7 @@ const mergedStyle = computed(() => (
|
||||
}
|
||||
: undefined
|
||||
))
|
||||
/** mergedBodyStyle is a reactive state variable used by the template and event handlers. */
|
||||
const mergedBodyStyle = computed(() => (
|
||||
isMobile.value
|
||||
? ({
|
||||
@@ -63,15 +70,18 @@ const mergedBodyStyle = computed(() => (
|
||||
: undefined
|
||||
))
|
||||
|
||||
/** handleOpenChange is a local helper used by this page script. */
|
||||
const handleOpenChange = (value: boolean) => {
|
||||
emit('update:open', value)
|
||||
}
|
||||
|
||||
/** handleCancel is a local helper used by this page script. */
|
||||
const handleCancel = (event?: unknown) => {
|
||||
emit('update:open', false)
|
||||
emit('cancel', event)
|
||||
}
|
||||
|
||||
/** handleOk is a local helper used by this page script. */
|
||||
const handleOk = (event?: unknown) => {
|
||||
emit('ok', event)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user