@didaoktv/didaoui-uniapp 1.4.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/components/dd-action-sheet/dd-action-sheet.vue +4 -3
  2. package/components/dd-alert/dd-alert.vue +4 -3
  3. package/components/dd-backtop/dd-backtop.vue +3 -2
  4. package/components/dd-badge/dd-badge.vue +3 -1
  5. package/components/dd-barcode/dd-barcode.vue +5 -1
  6. package/components/dd-car-keyboard/dd-car-keyboard.vue +0 -2
  7. package/components/dd-cascader/dd-cascader.vue +0 -6
  8. package/components/dd-coupon/dd-coupon.vue +8 -6
  9. package/components/dd-cropper/dd-cropper.vue +19 -8
  10. package/components/dd-date-picker/dd-date-picker.vue +4 -4
  11. package/components/dd-drawer/dd-drawer.vue +4 -3
  12. package/components/dd-dropdown-item/dd-dropdown-item.vue +4 -4
  13. package/components/dd-dropdown-menu/dd-dropdown-menu.vue +9 -10
  14. package/components/dd-goods-card/dd-goods-card.vue +3 -2
  15. package/components/dd-keyboard/dd-keyboard.vue +0 -2
  16. package/components/dd-keyboard/keyboard.js +0 -1
  17. package/components/dd-keyboard/props.js +0 -5
  18. package/components/dd-loading/dd-loading.vue +4 -3
  19. package/components/dd-mini-program-navbar/dd-mini-program-navbar.vue +4 -2
  20. package/components/dd-modal/dd-modal.vue +5 -4
  21. package/components/dd-navigation/dd-navigation.vue +3 -1
  22. package/components/dd-overlay/dd-overlay.vue +3 -3
  23. package/components/dd-picker/dd-picker.vue +4 -4
  24. package/components/dd-popover/dd-popover.vue +4 -5
  25. package/components/dd-popup/dd-popup.vue +6 -7
  26. package/components/dd-poster/dd-poster.vue +10 -8
  27. package/components/dd-pull-refresh/dd-pull-refresh.vue +4 -4
  28. package/components/dd-qrcode/dd-qrcode.vue +1 -8
  29. package/components/dd-room-card/dd-room-card.vue +3 -2
  30. package/components/dd-segmented-tab/dd-segmented-tab.vue +3 -1
  31. package/components/dd-step/dd-step.vue +6 -2
  32. package/components/dd-sticky/dd-sticky.vue +3 -1
  33. package/components/dd-submit-bar/dd-submit-bar.vue +3 -2
  34. package/components/dd-swipe/dd-swipe.vue +3 -2
  35. package/components/dd-swipe-action/dd-swipe-action.vue +5 -5
  36. package/components/dd-tabbar/dd-tabbar.vue +3 -1
  37. package/components/dd-toast/dd-toast.vue +4 -2
  38. package/components/dd-top-navbar/dd-top-navbar.vue +3 -1
  39. package/libs/config/zIndex.d.ts +7 -7
  40. package/libs/config/zIndex.js +13 -20
  41. package/package.json +1 -1
  42. package/scss/_variables.scss +0 -12
@@ -10,6 +10,7 @@ let activeModalClose: (() => void) | null = null
10
10
  v-if="visible"
11
11
  class="dd-modal__mask"
12
12
  :class="{ 'dd-modal__mask--show': showClass }"
13
+ :style="{ zIndex: zIndexConfig.dialogMask }"
13
14
  @click="onMaskClick"
14
15
  ></view>
15
16
 
@@ -18,7 +19,7 @@ let activeModalClose: (() => void) | null = null
18
19
  v-if="visible && type === 'dialog'"
19
20
  class="dd-modal__dialog"
20
21
  :class="{ 'dd-modal__dialog--show': showClass }"
21
- :style="{ width: widthValue }"
22
+ :style="{ width: widthValue, zIndex: zIndexConfig.dialog }"
22
23
  >
23
24
  <view v-if="$slots.header || title" class="dd-modal__header">
24
25
  <slot name="header">
@@ -41,6 +42,7 @@ let activeModalClose: (() => void) | null = null
41
42
  v-else-if="visible"
42
43
  class="dd-modal__sheet"
43
44
  :class="{ 'dd-modal__sheet--show': showClass }"
45
+ :style="{ zIndex: zIndexConfig.dialog }"
44
46
  >
45
47
  <view class="dd-modal__handle"></view>
46
48
  <view v-if="$slots.header || title" class="dd-modal__header">
@@ -64,6 +66,8 @@ let activeModalClose: (() => void) | null = null
64
66
  import { computed, ref, watch, onUnmounted, nextTick } from 'vue'
65
67
  import DdPortal from '../dd-portal/dd-portal.vue'
66
68
  import DdIcon from '../dd-icon/dd-icon.vue'
69
+ // z-index 统一取 libs/config/zIndex.js(对话框族与 dd-dialog 同档:dialogMask/dialog)
70
+ import zIndexConfig from '../../libs/config/zIndex.js'
67
71
 
68
72
  interface Props {
69
73
  modelValue?: boolean
@@ -177,7 +181,6 @@ onUnmounted(() => {
177
181
  backdrop-filter: blur(8px);
178
182
  -webkit-backdrop-filter: blur(8px);
179
183
  opacity: 0;
180
- z-index: 1000;
181
184
  transition: opacity 0.25s ease;
182
185
 
183
186
  &--show {
@@ -192,7 +195,6 @@ onUnmounted(() => {
192
195
  left: 50%;
193
196
  transform: translate(-50%, -50%) scale(0.9);
194
197
  opacity: 0;
195
- z-index: 1001;
196
198
  max-width: 720rpx; // 360px 上限
197
199
  max-height: 80vh;
198
200
  background: var(--dd-bg-popup, #{$dd-bg-popup});
@@ -217,7 +219,6 @@ onUnmounted(() => {
217
219
  right: 0;
218
220
  bottom: 0;
219
221
  transform: translateY(100%);
220
- z-index: 1001;
221
222
  max-height: 85vh;
222
223
  background: var(--dd-bg-popup, #{$dd-bg-popup});
223
224
  border: 1px solid var(--dd-border-default, #{$dd-border-default});
@@ -5,6 +5,7 @@
5
5
  'dd-nav--fixed': fixed,
6
6
  'dd-nav--border': border,
7
7
  }"
8
+ :style="{ zIndex: zIndexConfig.sticky }"
8
9
  >
9
10
  <view
10
11
  v-for="(item, index) in items"
@@ -27,6 +28,8 @@
27
28
 
28
29
  <script setup lang="ts">
29
30
  import DdIcon from '../dd-icon/dd-icon.vue'
31
+ // z-index 统一取 libs/config/zIndex.js(fixed 时吸底层级取 sticky 档;非 fixed 时为 static,z-index 天然失效)
32
+ import zIndexConfig from '../../libs/config/zIndex.js'
30
33
 
31
34
  interface NavItem {
32
35
  icon: string
@@ -83,7 +86,6 @@ function onSelect(index: number) {
83
86
  left: 0;
84
87
  right: 0;
85
88
  bottom: 0;
86
- z-index: $dd-z-index-sticky;
87
89
  @include dd-safe-area-bottom;
88
90
  }
89
91
 
@@ -3,7 +3,7 @@
3
3
  <view
4
4
  class="dd-overlay"
5
5
  :class="{ 'dd-overlay--show': modelValue }"
6
- :style="{ zIndex: zIndex, '--dd-overlay-duration': `${duration}s` }"
6
+ :style="{ zIndex: zIndexConfig.overlay, '--dd-overlay-duration': `${duration}s` }"
7
7
  @click="onClick"
8
8
  @touchmove="onTouchMove"
9
9
  @touchmove.stop.prevent="onTouchMove"
@@ -16,11 +16,12 @@
16
16
  <script setup lang="ts">
17
17
  import { watch } from 'vue'
18
18
  import DdPortal from '../dd-portal/dd-portal.vue'
19
+ // z-index 统一取 libs/config/zIndex.js(overlay 遮罩档,不对外暴露)
20
+ import zIndexConfig from '../../libs/config/zIndex.js'
19
21
 
20
22
  interface Props {
21
23
  modelValue?: boolean
22
24
  lockScroll?: boolean
23
- zIndex?: number
24
25
  duration?: number
25
26
  closeOnClickOverlay?: boolean
26
27
  }
@@ -28,7 +29,6 @@ interface Props {
28
29
  const props = withDefaults(defineProps<Props>(), {
29
30
  modelValue: false,
30
31
  lockScroll: true,
31
- zIndex: 2000,
32
32
  duration: 0.3,
33
33
  closeOnClickOverlay: true,
34
34
  })
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <dd-portal>
3
3
  <view class="dd-picker" :class="{ 'dd-picker--open': show }">
4
- <view class="dd-picker__mask" @click="onMaskClick"></view>
5
- <view class="dd-picker__sheet">
4
+ <view class="dd-picker__mask" :style="{ zIndex: zIndexConfig.overlay }" @click="onMaskClick"></view>
5
+ <view class="dd-picker__sheet" :style="{ zIndex: zIndexConfig.popup }">
6
6
  <view class="dd-picker__toolbar">
7
7
  <text class="dd-picker__cancel" @click="onCancel">取消</text>
8
8
  <text class="dd-picker__title">{{ title }}</text>
@@ -33,6 +33,8 @@
33
33
  <script setup lang="ts">
34
34
  import { computed, ref, watch } from 'vue'
35
35
  import DdPortal from '../dd-portal/dd-portal.vue'
36
+ // z-index 统一取 libs/config/zIndex.js(picker 底部面板:overlay/popup 档)
37
+ import zIndexConfig from '../../libs/config/zIndex.js'
36
38
 
37
39
  interface PickerItem {
38
40
  text: string
@@ -146,7 +148,6 @@ function onConfirm() {
146
148
  &__mask {
147
149
  position: fixed;
148
150
  inset: 0;
149
- z-index: $dd-z-index-overlay;
150
151
  background: var(--dd-color-overlay-strong, #{$dd-color-overlay-strong});
151
152
  opacity: 0;
152
153
  pointer-events: none;
@@ -158,7 +159,6 @@ function onConfirm() {
158
159
  left: 0;
159
160
  right: 0;
160
161
  bottom: 0;
161
- z-index: $dd-z-index-popup;
162
162
  background: var(--dd-bg-popup, #{$dd-bg-popup});
163
163
  border-radius: $dd-radius-lg $dd-radius-lg 0 0;
164
164
  transform: translateY(100%);
@@ -25,6 +25,8 @@
25
25
 
26
26
  <script setup lang="ts">
27
27
  import { computed, provide } from 'vue'
28
+ // z-index 统一取 libs/config/zIndex.js(透明点击遮罩 overlay 档、面板 popup 档,不对外暴露)
29
+ import zIndexConfig from '../../libs/config/zIndex.js'
28
30
 
29
31
  interface Props {
30
32
  modelValue?: boolean
@@ -33,7 +35,6 @@ interface Props {
33
35
  closeOnClickAction?: boolean
34
36
  closeOnClickOverlay?: boolean
35
37
  offset?: number
36
- zIndex?: number
37
38
  }
38
39
 
39
40
  const props = withDefaults(defineProps<Props>(), {
@@ -43,7 +44,6 @@ const props = withDefaults(defineProps<Props>(), {
43
44
  closeOnClickAction: true,
44
45
  closeOnClickOverlay: true,
45
46
  offset: 16,
46
- zIndex: 2000,
47
47
  })
48
48
 
49
49
  const emit = defineEmits<{
@@ -53,11 +53,11 @@ const emit = defineEmits<{
53
53
  (e: 'close'): void
54
54
  }>()
55
55
 
56
- const maskZIndex = computed(() => props.zIndex - 1)
56
+ const maskZIndex = zIndexConfig.overlay
57
57
 
58
58
  const panelStyle = computed(() => {
59
59
  const offsetRpx = `${props.offset}rpx`
60
- const s: Record<string, string> = { zIndex: String(props.zIndex) }
60
+ const s: Record<string, string> = { zIndex: String(zIndexConfig.popup) }
61
61
  // 偏移通过 margin 表达,避免覆盖 transform
62
62
  if (props.placement === 'top') s.marginBottom = offsetRpx
63
63
  if (props.placement === 'bottom') s.marginTop = offsetRpx
@@ -118,7 +118,6 @@ provide('ddPopover', {
118
118
  border-radius: $dd-radius-lg;
119
119
  box-shadow: var(--dd-shadow-2, #{$dd-shadow-2});
120
120
  overflow: visible;
121
- z-index: 2000;
122
121
 
123
122
  &--light {
124
123
  background: var(--dd-bg-popup, #{$dd-bg-popup});
@@ -19,7 +19,7 @@
19
19
  ]"
20
20
  :style="panelStyle"
21
21
  >
22
- <view v-if="closeable" class="dd-popup__close" :class="`dd-popup__close--${closeIconPosition}`" @click="onCloseIcon">
22
+ <view v-if="closeable" class="dd-popup__close" :class="`dd-popup__close--${closeIconPosition}`" :style="{ zIndex: zIndexConfig.base + 1 }" @click="onCloseIcon">
23
23
  <dd-icon name="cross" />
24
24
  </view>
25
25
  <view v-if="position === 'bottom' && safeAreaInsetBottom" class="dd-popup__safe-bottom"></view>
@@ -33,6 +33,8 @@
33
33
  import { computed, ref, watch, onUnmounted, nextTick } from 'vue'
34
34
  import DdIcon from '../dd-icon/dd-icon.vue'
35
35
  import DdPortal from '../dd-portal/dd-portal.vue'
36
+ // z-index 统一取 libs/config/zIndex.js(遮罩 overlay 档、面板 popup 档,不对外暴露)
37
+ import zIndexConfig from '../../libs/config/zIndex.js'
36
38
 
37
39
  interface Props {
38
40
  modelValue?: boolean
@@ -46,7 +48,6 @@ interface Props {
46
48
  width?: string
47
49
  height?: string
48
50
  closeOnClickOverlay?: boolean
49
- zIndex?: number
50
51
  }
51
52
 
52
53
  const props = withDefaults(defineProps<Props>(), {
@@ -61,7 +62,6 @@ const props = withDefaults(defineProps<Props>(), {
61
62
  width: '',
62
63
  height: '',
63
64
  closeOnClickOverlay: true,
64
- zIndex: 2000,
65
65
  })
66
66
 
67
67
  const emit = defineEmits<{
@@ -74,12 +74,12 @@ const emit = defineEmits<{
74
74
  (e: 'click-close-icon'): void
75
75
  }>()
76
76
 
77
- const overlayZIndex = computed(() => props.zIndex)
78
- const panelZIndex = computed(() => props.zIndex + 1)
77
+ const overlayZIndex = zIndexConfig.overlay
78
+ const panelZIndex = zIndexConfig.popup
79
79
 
80
80
  const panelStyle = computed(() => {
81
81
  const s: Record<string, string> = {
82
- zIndex: String(panelZIndex.value),
82
+ zIndex: String(panelZIndex),
83
83
  }
84
84
  if (props.width && (props.position === 'left' || props.position === 'right')) {
85
85
  s.width = props.width
@@ -232,7 +232,6 @@ onUnmounted(() => {
232
232
  color: var(--dd-text-tertiary, #{$dd-text-tertiary});
233
233
  font-size: 44rpx;
234
234
  @include dd-flex-center;
235
- z-index: 2;
236
235
 
237
236
  &--top-left { top: $dd-space-2; left: $dd-space-2; }
238
237
  &--top-right { top: $dd-space-2; right: $dd-space-2; }
@@ -1,10 +1,11 @@
1
1
  <template>
2
2
  <view class="dd-poster">
3
3
  <!-- canvas用于绘制海报 -->
4
- <view v-if="showCanvas" class="dd-poster__renderer">
4
+ <view v-if="showCanvas" class="dd-poster__renderer" :style="{ zIndex: zcBase }">
5
5
  <dd-canvas
6
6
  ref="posterCanvas"
7
7
  class="dd-poster__hidden-canvas"
8
+ :style="{ zIndex: zcBase }"
8
9
  :canvas-id="canvasId"
9
10
  :width="canvasWidth"
10
11
  :height="canvasHeight"
@@ -13,7 +14,7 @@
13
14
  </dd-canvas>
14
15
  </view>
15
16
  <!-- 隐藏的二维码组件,用于生成二维码图片 -->
16
- <view class="dd-poster__renderer">
17
+ <view class="dd-poster__renderer" :style="{ zIndex: zcBase }">
17
18
  <dd-qrcode
18
19
  ref="qrCode"
19
20
  :val="qrCodeValue"
@@ -24,6 +25,7 @@
24
25
  background="#ffffff"
25
26
  foreground="#000000"
26
27
  :class="['dd-poster__hidden-qrcode', qrCodeShow ? '' : 'dd-poster__hidden-qrcode--hidden']"
28
+ :style="{ zIndex: zcBase }"
27
29
  />
28
30
  </view>
29
31
  </view>
@@ -48,6 +50,8 @@
48
50
  import {
49
51
  rpx2px
50
52
  } from '../../libs/function/index.js';
53
+ // z-index 统一取 libs/config/zIndex.js(离屏隐藏容器归 base 档,Options API 经 data 暴露给模板)
54
+ import zIndexConfig from '../../libs/config/zIndex.js';
51
55
  export default {
52
56
  name: 'dd-poster',
53
57
  props: {
@@ -58,6 +62,8 @@ export default {
58
62
  },
59
63
  data() {
60
64
  return {
65
+ // 离屏隐藏容器层级(base 档)
66
+ zcBase: zIndexConfig.base,
61
67
  canvasId: 'dd-poster-canvas-' + Date.now(),
62
68
  showCanvas: false,
63
69
  canvasWidth: 0,
@@ -656,7 +662,6 @@ export default {
656
662
  width: 1px;
657
663
  height: 1px;
658
664
  overflow: hidden;
659
- z-index: -1;
660
665
  opacity: 0.01;
661
666
  pointer-events: none;
662
667
  }
@@ -670,22 +675,19 @@ export default {
670
675
  width: 1px;
671
676
  height: 1px;
672
677
  overflow: hidden;
673
- z-index: -1;
674
678
  }
675
679
 
676
680
  &__hidden-canvas {
677
681
  position: fixed;
678
682
  top: -10000px;
679
683
  left: -10000px;
680
- z-index: -1;
681
684
  }
682
-
685
+
683
686
  &__hidden-qrcode {
684
687
  position: fixed;
685
688
  top: -10000px;
686
689
  left: -10000px;
687
- z-index: -1;
688
-
690
+
689
691
  &--hidden {
690
692
  display: none;
691
693
  }
@@ -3,9 +3,9 @@
3
3
  <view
4
4
  class="dd-pull-refresh__track"
5
5
  :class="{ 'dd-pull-refresh__track--anim': !pulling }"
6
- :style="{ transform: `translateY(${distance}px)` }"
6
+ :style="{ transform: `translateY(${distance}px)`, zIndex: zIndexConfig.base + 1 }"
7
7
  >
8
- <view class="dd-pull-refresh__head" :style="{ height: headHeightPx + 'px' }">
8
+ <view class="dd-pull-refresh__head" :style="{ height: headHeightPx + 'px', zIndex: zIndexConfig.base }">
9
9
  <view class="dd-pull-refresh__head-inner">
10
10
  <view v-if="status === 'loading'" class="dd-pull-refresh__spinner"></view>
11
11
  <text class="dd-pull-refresh__text">{{ statusText }}</text>
@@ -32,6 +32,8 @@
32
32
 
33
33
  <script setup lang="ts">
34
34
  import { computed, ref, watch } from 'vue'
35
+ // z-index 统一取 libs/config/zIndex.js(内容层 base 档内 +1,下拉头垫底取 base 档)
36
+ import zIndexConfig from '../../libs/config/zIndex.js'
35
37
 
36
38
  type Status = 'pulling' | 'loosing' | 'loading' | 'success'
37
39
 
@@ -182,7 +184,6 @@ watch(
182
184
  &__track {
183
185
  position: relative;
184
186
  height: 100%;
185
- z-index: 1;
186
187
  background: var(--dd-bg, #{$dd-bg});
187
188
 
188
189
  &--anim {
@@ -197,7 +198,6 @@ watch(
197
198
  right: 0;
198
199
  overflow: hidden;
199
200
  transform: translateY(-100%);
200
- z-index: 0;
201
201
  }
202
202
 
203
203
  &__head-inner {
@@ -1,4 +1,4 @@
1
- <template>
1
+ <template>
2
2
  <view class="dd-qrcode"
3
3
  :id="rootId"
4
4
  :style="{
@@ -496,13 +496,6 @@ export default {
496
496
 
497
497
  &__content {
498
498
  position: relative;
499
-
500
- &__canvas {
501
- position: fixed;
502
- top: -99999rpx;
503
- left: -99999rpx;
504
- z-index: -99999;
505
- }
506
499
  }
507
500
  }
508
501
  </style>
@@ -9,7 +9,7 @@
9
9
  <!-- grid 模式: 方形卡 + 顶部状态栏 -->
10
10
  <template v-if="view === 'grid'">
11
11
  <view class="dd-room-card__topbar"></view>
12
- <view v-if="type === 'vip'" class="dd-room-card__vip-tag"><text>VIP</text></view>
12
+ <view v-if="type === 'vip'" class="dd-room-card__vip-tag" :style="{ zIndex: zIndexConfig.base + 1 }"><text>VIP</text></view>
13
13
  <view class="dd-room-card__grid-inner">
14
14
  <text class="dd-room-card__no">{{ roomNo }}</text>
15
15
  <view class="dd-room-card__status">
@@ -44,6 +44,8 @@
44
44
 
45
45
  <script setup lang="ts">
46
46
  import { computed } from 'vue'
47
+ // z-index 统一取 libs/config/zIndex.js(VIP 角标抬到卡片内容之上取 base 档内 +1)
48
+ import zIndexConfig from '../../libs/config/zIndex.js'
47
49
 
48
50
  interface Props {
49
51
  view?: 'grid' | 'list'
@@ -169,7 +171,6 @@ function onClick() {
169
171
  position: absolute;
170
172
  top: 12rpx;
171
173
  right: 12rpx;
172
- z-index: 2;
173
174
  padding: 2rpx 12rpx;
174
175
  background: var(--dd-gradient-primary, #{$dd-gradient-primary});
175
176
  border-radius: $dd-radius-sm;
@@ -13,6 +13,7 @@
13
13
  :key="index"
14
14
  class="dd-seg__item"
15
15
  :class="{ 'dd-seg__item--active': index === modelValue }"
16
+ :style="{ zIndex: zIndexConfig.base }"
16
17
  @click="onSelect(index)"
17
18
  >
18
19
  <text class="dd-seg__label">{{ labelOf(opt) }}</text>
@@ -44,6 +45,8 @@
44
45
  <script setup lang="ts">
45
46
  import { nextTick, onMounted, ref, watch } from 'vue'
46
47
  import { getCurrentInstance } from 'vue'
48
+ // z-index 统一取 libs/config/zIndex.js(分段项盖住滑块指示器取 base 档)
49
+ import zIndexConfig from '../../libs/config/zIndex.js'
47
50
 
48
51
  interface Props {
49
52
  modelValue?: number
@@ -128,7 +131,6 @@ watch(() => props.options, measure)
128
131
 
129
132
  .dd-seg__item {
130
133
  position: relative;
131
- z-index: 1;
132
134
  min-width: 120rpx;
133
135
  padding: 12rpx $dd-space-4;
134
136
  @include dd-flex-center;
@@ -42,6 +42,8 @@
42
42
  <script setup lang="ts">
43
43
  import { computed, inject } from 'vue'
44
44
  import DdIcon from '../dd-icon/dd-icon.vue'
45
+ // z-index 统一取 libs/config/zIndex.js(圆点/连接线的层内叠放取 base 档)
46
+ import zIndexConfig from '../../libs/config/zIndex.js'
45
47
 
46
48
  type StepStatus = 'wait' | 'process' | 'finish'
47
49
 
@@ -81,11 +83,15 @@ const isActive = computed(() => status.value === 'finish' || status.value === 'p
81
83
  const circleStyle = computed(() => ({
82
84
  background: isActive.value ? activeColor.value : '#2A2A2A',
83
85
  color: isActive.value ? '#FFFFFF' : inactiveColor.value,
86
+ // z-index 统一取 libs/config/zIndex.js(圆点 base 档内 +1,盖住连接线)
87
+ zIndex: zIndexConfig.base + 1,
84
88
  }))
85
89
 
86
90
  // ponytail: 水平连接线整段按本步骤 status 着色,current/首个 wait 左半段颜色为近似值
87
91
  const lineStyle = computed(() => ({
88
92
  background: status.value === 'finish' ? activeColor.value : inactiveColor.value,
93
+ // z-index 统一取 libs/config/zIndex.js(连接线垫底取 base 档)
94
+ zIndex: zIndexConfig.base,
89
95
  }))
90
96
  </script>
91
97
 
@@ -125,7 +131,6 @@ const lineStyle = computed(() => ({
125
131
  right: 0;
126
132
  height: 1px;
127
133
  transform: translateY(-50%);
128
- z-index: 0;
129
134
 
130
135
  &--first {
131
136
  left: 50%;
@@ -143,7 +148,6 @@ const lineStyle = computed(() => ({
143
148
 
144
149
  &__circle {
145
150
  position: relative;
146
- z-index: 1;
147
151
  width: $dd-size-icon-md;
148
152
  height: $dd-size-icon-md;
149
153
  border-radius: $dd-radius-full;
@@ -10,6 +10,8 @@
10
10
 
11
11
  <script setup lang="ts">
12
12
  import { computed, getCurrentInstance, onMounted, onUnmounted, ref } from 'vue'
13
+ // z-index 统一取 libs/config/zIndex.js:默认吸顶层级取 sticky 档(zIndex prop 保留可覆盖)
14
+ import zIndexConfig from '../../libs/config/zIndex.js'
13
15
 
14
16
  interface Props {
15
17
  offsetTop?: number // rpx
@@ -19,7 +21,7 @@ interface Props {
19
21
 
20
22
  const props = withDefaults(defineProps<Props>(), {
21
23
  offsetTop: 0,
22
- zIndex: 99,
24
+ zIndex: zIndexConfig.sticky,
23
25
  disabled: false,
24
26
  })
25
27
 
@@ -4,7 +4,7 @@
4
4
  class="dd-submit-bar__placeholder"
5
5
  :class="{ 'dd-submit-bar__placeholder--safe': safeAreaInsetBottom }"
6
6
  ></view>
7
- <view class="dd-submit-bar" :class="{ 'dd-submit-bar--safe': safeAreaInsetBottom }">
7
+ <view class="dd-submit-bar" :class="{ 'dd-submit-bar--safe': safeAreaInsetBottom }" :style="{ zIndex: zIndexConfig.sticky }">
8
8
  <slot name="top"></slot>
9
9
  <view v-if="hasTip" class="dd-submit-bar__tip">
10
10
  <dd-icon v-if="tipIcon" :name="tipIcon" class="dd-submit-bar__tip-icon" />
@@ -44,6 +44,8 @@ import type { CSSProperties } from 'vue'
44
44
  import DdButton from '../dd-button/dd-button.vue'
45
45
  import DdIcon from '../dd-icon/dd-icon.vue'
46
46
  import DdPrice from '../dd-price/dd-price.vue'
47
+ // z-index 统一取 libs/config/zIndex.js(底部固定条取 sticky 档)
48
+ import zIndexConfig from '../../libs/config/zIndex.js'
47
49
 
48
50
  interface Props {
49
51
  /** 提示文案(tip 区域,如「小计不含服务费」) */
@@ -128,7 +130,6 @@ function onSubmit() {
128
130
  left: 0;
129
131
  right: 0;
130
132
  bottom: 0;
131
- z-index: $dd-z-index-sticky;
132
133
  background: var(--dd-bg-card, #{$dd-bg-card});
133
134
 
134
135
  &--safe {
@@ -14,7 +14,7 @@
14
14
  <slot></slot>
15
15
  </swiper>
16
16
  <slot name="indicator" :active="current" :count="count">
17
- <view v-if="showIndicators && count > 1" class="dd-swipe__indicators" :class="`dd-swipe__indicators--${vertical ? 'vertical' : 'horizontal'}`">
17
+ <view v-if="showIndicators && count > 1" class="dd-swipe__indicators" :class="`dd-swipe__indicators--${vertical ? 'vertical' : 'horizontal'}`" :style="{ zIndex: zIndexConfig.base + 1 }">
18
18
  <view
19
19
  v-for="i in count"
20
20
  :key="i"
@@ -30,6 +30,8 @@
30
30
 
31
31
  <script setup lang="ts">
32
32
  import { computed, provide, ref } from 'vue'
33
+ // z-index 统一取 libs/config/zIndex.js(指示点盖住轮播内容取 base 档内 +1)
34
+ import zIndexConfig from '../../libs/config/zIndex.js'
33
35
 
34
36
  interface Props {
35
37
  width?: string
@@ -113,7 +115,6 @@ defineExpose({ jumpTo, current })
113
115
  &__indicators {
114
116
  position: absolute;
115
117
  display: flex;
116
- z-index: 2;
117
118
 
118
119
  &--horizontal {
119
120
  bottom: $dd-space-3;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <view class="dd-swipe-action" :class="{ 'dd-swipe-action--disabled': disabled }">
3
3
  <!-- 左侧操作层 (右滑露出) -->
4
- <view class="dd-swipe-action__actions dd-swipe-action__actions--left" :style="{ width: leftWidthPx + 'px' }">
4
+ <view class="dd-swipe-action__actions dd-swipe-action__actions--left" :style="{ width: leftWidthPx + 'px', zIndex: zIndexConfig.base }">
5
5
  <view
6
6
  v-for="(action, i) in leftActions"
7
7
  :key="'l' + i"
@@ -14,7 +14,7 @@
14
14
  </view>
15
15
  </view>
16
16
  <!-- 右侧操作层 (左滑露出) -->
17
- <view class="dd-swipe-action__actions dd-swipe-action__actions--right" :style="{ width: rightWidthPx + 'px' }">
17
+ <view class="dd-swipe-action__actions dd-swipe-action__actions--right" :style="{ width: rightWidthPx + 'px', zIndex: zIndexConfig.base }">
18
18
  <view
19
19
  v-for="(action, i) in rightActions"
20
20
  :key="'r' + i"
@@ -30,7 +30,7 @@
30
30
  <view
31
31
  class="dd-swipe-action__content"
32
32
  :class="{ 'dd-swipe-action__content--anim': animating }"
33
- :style="{ transform: `translateX(${translateX}px)` }"
33
+ :style="{ transform: `translateX(${translateX}px)`, zIndex: zIndexConfig.base + 1 }"
34
34
  @touchstart="onTouchStart"
35
35
  @touchmove.stop.prevent="onTouchMove"
36
36
  @touchend="onTouchEnd"
@@ -44,6 +44,8 @@
44
44
  <script setup lang="ts">
45
45
  import { computed, ref } from 'vue'
46
46
  import DdIcon from '../dd-icon/dd-icon.vue'
47
+ // z-index 统一取 libs/config/zIndex.js(操作层 base 档,内容层档内 +1 盖住操作层)
48
+ import zIndexConfig from '../../libs/config/zIndex.js'
47
49
 
48
50
  interface SwipeAction {
49
51
  text?: string
@@ -187,7 +189,6 @@ defineExpose({ close })
187
189
  top: 0;
188
190
  bottom: 0;
189
191
  display: flex;
190
- z-index: 0;
191
192
 
192
193
  &--left {
193
194
  left: 0;
@@ -234,7 +235,6 @@ defineExpose({ close })
234
235
 
235
236
  &__content {
236
237
  position: relative;
237
- z-index: 1;
238
238
  width: 100%;
239
239
  background: var(--dd-bg-elevated, #{$dd-bg-elevated});
240
240
  transform: translateX(0);
@@ -11,6 +11,7 @@
11
11
  'dd-tabbar--border': border,
12
12
  'dd-tabbar--safe': safeAreaInsetBottom,
13
13
  }"
14
+ :style="{ zIndex: zIndexConfig.sticky }"
14
15
  >
15
16
  <slot></slot>
16
17
  </view>
@@ -18,6 +19,8 @@
18
19
 
19
20
  <script setup lang="ts">
20
21
  import { computed, provide, ref } from 'vue'
22
+ // z-index 统一取 libs/config/zIndex.js(fixed 时吸底层级取 sticky 档;非 fixed 时为 static,z-index 天然失效)
23
+ import zIndexConfig from '../../libs/config/zIndex.js'
21
24
 
22
25
  interface Props {
23
26
  modelValue?: string | number
@@ -96,7 +99,6 @@ provide('ddTabbar', {
96
99
  left: 0;
97
100
  right: 0;
98
101
  bottom: 0;
99
- z-index: $dd-z-index-sticky;
100
102
  }
101
103
  }
102
104
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <dd-portal>
3
- <view class="dd-toast" :class="[`dd-toast--${toastState.position}`, { 'dd-toast--show': toastState.visible }]">
3
+ <view class="dd-toast" :class="[`dd-toast--${toastState.position}`, { 'dd-toast--show': toastState.visible }]" :style="{ zIndex: zIndexConfig.toast }">
4
4
  <view class="dd-toast__capsule">
5
5
  <view v-if="showIcon" class="dd-toast__icon">
6
6
  <view v-if="toastState.type === 'loading'" class="dd-toast__spinner"></view>
@@ -81,6 +81,8 @@ export function showError(message: string) {
81
81
  import { computed } from 'vue'
82
82
  import DdPortal from '../dd-portal/dd-portal.vue'
83
83
  import DdIcon from '../dd-icon/dd-icon.vue'
84
+ // z-index 统一取 libs/config/zIndex.js(toast 必须压过 dialog/popup/keyboard 等一切弹出层)
85
+ import zIndexConfig from '../../libs/config/zIndex.js'
84
86
 
85
87
  // text 类型强制隐藏图标
86
88
  const showIcon = computed(() => toastState.icon && toastState.type !== 'text')
@@ -105,7 +107,7 @@ const iconName = computed(() => {
105
107
  transform: translateX(-50%) scale(0.9);
106
108
  opacity: 0;
107
109
  visibility: hidden;
108
- z-index: $dd-z-index-toast;
110
+ /* z-index 由模板注入(libs/config/zIndex.js) */
109
111
  @include dd-no-touch; // pointer-events none
110
112
  @include dd-transition(opacity 0.25s ease, transform 0.25s ease, visibility 0.25s);
111
113