@didaoktv/didaoui-uniapp 1.4.2 → 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 (44) hide show
  1. package/README.md +2 -2
  2. package/components/dd-action-sheet/dd-action-sheet.vue +4 -3
  3. package/components/dd-alert/dd-alert.vue +4 -3
  4. package/components/dd-backtop/dd-backtop.vue +3 -2
  5. package/components/dd-badge/dd-badge.vue +3 -1
  6. package/components/dd-barcode/dd-barcode.vue +5 -1
  7. package/components/dd-car-keyboard/dd-car-keyboard.vue +0 -2
  8. package/components/dd-cascader/dd-cascader.vue +0 -6
  9. package/components/dd-coupon/dd-coupon.vue +8 -6
  10. package/components/dd-cropper/dd-cropper.vue +19 -8
  11. package/components/dd-date-picker/dd-date-picker.vue +4 -4
  12. package/components/dd-drawer/dd-drawer.vue +4 -3
  13. package/components/dd-dropdown-item/dd-dropdown-item.vue +4 -4
  14. package/components/dd-dropdown-menu/dd-dropdown-menu.vue +9 -10
  15. package/components/dd-goods-card/dd-goods-card.vue +261 -0
  16. package/components/dd-keyboard/dd-keyboard.vue +0 -2
  17. package/components/dd-keyboard/keyboard.js +0 -1
  18. package/components/dd-keyboard/props.js +0 -5
  19. package/components/dd-loading/dd-loading.vue +4 -3
  20. package/components/dd-mini-program-navbar/dd-mini-program-navbar.vue +4 -2
  21. package/components/dd-modal/dd-modal.vue +5 -4
  22. package/components/dd-navigation/dd-navigation.vue +3 -1
  23. package/components/dd-overlay/dd-overlay.vue +3 -3
  24. package/components/dd-picker/dd-picker.vue +4 -4
  25. package/components/dd-popover/dd-popover.vue +4 -5
  26. package/components/dd-popup/dd-popup.vue +6 -7
  27. package/components/dd-poster/dd-poster.vue +10 -8
  28. package/components/dd-pull-refresh/dd-pull-refresh.vue +4 -4
  29. package/components/dd-qrcode/dd-qrcode.vue +1 -8
  30. package/components/dd-room-card/dd-room-card.vue +3 -2
  31. package/components/dd-segmented-tab/dd-segmented-tab.vue +3 -1
  32. package/components/dd-step/dd-step.vue +6 -2
  33. package/components/dd-sticky/dd-sticky.vue +3 -1
  34. package/components/dd-submit-bar/dd-submit-bar.vue +3 -2
  35. package/components/dd-swipe/dd-swipe.vue +3 -2
  36. package/components/dd-swipe-action/dd-swipe-action.vue +5 -5
  37. package/components/dd-tabbar/dd-tabbar.vue +3 -1
  38. package/components/dd-toast/dd-toast.vue +4 -2
  39. package/components/dd-top-navbar/dd-top-navbar.vue +3 -1
  40. package/index.ts +4 -3
  41. package/libs/config/zIndex.d.ts +7 -7
  42. package/libs/config/zIndex.js +13 -20
  43. package/package.json +1 -1
  44. package/scss/_variables.scss +0 -12
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  - **帝王级配色** — 帝王金 `#F5A623` + 皇家蓝 `#2D4BA0` 双主色,暗色主题默认
8
8
  - **玻璃拟态设计** — 多层级玻璃拟态效果,打造高端夜店沉浸感
9
- - **95 个精心打磨的组件** — 覆盖表单、导航、布局卡片、数据展示、浮层反馈、交互、画布七大类,含 KTV 业务组件(房态卡、账单明细、工单卡、日历、二维码)
9
+ - **96 个精心打磨的组件** — 覆盖表单、导航、布局卡片、数据展示、浮层反馈、交互、画布七大类,含 KTV 业务组件(房态卡、账单明细、工单卡、日历、二维码)
10
10
  - **Vue3 + TypeScript** — 完整类型定义,Composition API
11
11
  - **多端兼容** — H5 / 微信小程序 / 抖音小程序 / Android / iOS
12
12
 
@@ -52,7 +52,7 @@ import { DdButton, DdInput } from '@didaoktv/didaoui-uniapp'
52
52
  | ----- | -- | --------------------------------------------------------------------------------------------------------------------------------------------- |
53
53
  | 表单输入 | 24 | Button, CodeButton, Input, Form, Field, Switch, Checkbox, CheckboxGroup, Radio, RadioGroup, Stepper, SearchBar, Slider, DatePicker, Picker, Rate, Upload, Icon, Keyboard, NumberKeyboard, CarKeyboard, Cascader, GoodsSku, TreeSelect |
54
54
  | 导航 | 14 | Navigation, TopNavbar, SegmentedTab, SwipeableTab, Drawer, Tabbar, TabbarItem, Backtop, Collapse, CollapseItem, DropdownMenu, DropdownItem, Sidebar, SidebarItem | |
55
- | 布局/卡片 | 9 | Card, RoomCard, FeatureGrid, Sticky, BillDetail, WorkorderCard, Calendar, Qrcode, SubmitBar |
55
+ | 布局/卡片 | 10 | Card, RoomCard, GoodsCard, FeatureGrid, Sticky, BillDetail, WorkorderCard, Calendar, Qrcode, SubmitBar |
56
56
  | 数据展示 | 25 | Tag, StatCard, ChampionCard, Avatar, AvatarGroup, Badge, ListCell, Cell, CellGroup, CountDown, Divider, Image, Progress, Skeleton, EmptyState, Step, Steps, Text, Link, Copy, Album, Coupon, Parse, Markdown, Price |
57
57
  | 浮层反馈 | 11 | Modal, ActionSheet, Toast, Alert, Loading, Dialog, Overlay, Popup, Popover, PopoverItem, Portal |
58
58
  | 交互 | 5 | SwipeAction, Swipe, SwipeItem, PullRefresh, Loadmore |
@@ -4,9 +4,10 @@
4
4
  <view
5
5
  class="dd-action-sheet__mask"
6
6
  :class="{ 'dd-action-sheet__mask--show': modelValue }"
7
+ :style="{ zIndex: zIndexConfig.dialogMask }"
7
8
  @click="onMaskClick"
8
9
  ></view>
9
- <view class="dd-action-sheet__panel" :class="{ 'dd-action-sheet__panel--show': modelValue }">
10
+ <view class="dd-action-sheet__panel" :class="{ 'dd-action-sheet__panel--show': modelValue }" :style="{ zIndex: zIndexConfig.dialog }">
10
11
  <view class="dd-action-sheet__handle"></view>
11
12
  <view v-if="title" class="dd-action-sheet__title">
12
13
  <text class="dd-action-sheet__title-text">{{ title }}</text>
@@ -40,6 +41,8 @@
40
41
  <script setup lang="ts">
41
42
  import DdPortal from '../dd-portal/dd-portal.vue'
42
43
  import DdIcon from '../dd-icon/dd-icon.vue'
44
+ // z-index 统一取 libs/config/zIndex.js(对话框族与 dd-dialog 同档:dialogMask/dialog)
45
+ import zIndexConfig from '../../libs/config/zIndex.js'
43
46
 
44
47
  interface ActionItem {
45
48
  name: string
@@ -104,7 +107,6 @@ function onClose() {
104
107
  background: var(--dd-color-overlay-strong, #{$dd-color-overlay-strong});
105
108
  opacity: 0;
106
109
  visibility: hidden;
107
- z-index: 1000;
108
110
  @include dd-transition(opacity 0.3s, visibility 0.3s);
109
111
 
110
112
  &--show {
@@ -120,7 +122,6 @@ function onClose() {
120
122
  right: 0;
121
123
  bottom: 0;
122
124
  transform: translateY(100%);
123
- z-index: 1001;
124
125
  @include dd-glass;
125
126
  border-radius: $dd-radius-2xl $dd-radius-2xl 0 0;
126
127
  padding: $dd-space-3 $dd-space-4 $dd-space-4;
@@ -4,9 +4,10 @@
4
4
  <view
5
5
  class="dd-alert__mask"
6
6
  :class="{ 'dd-alert__mask--show': modelValue }"
7
+ :style="{ zIndex: zIndexConfig.dialogMask }"
7
8
  @click="onMaskClick"
8
9
  ></view>
9
- <view class="dd-alert__card" :class="{ 'dd-alert__card--show': modelValue }">
10
+ <view class="dd-alert__card" :class="{ 'dd-alert__card--show': modelValue }" :style="{ zIndex: zIndexConfig.dialog }">
10
11
  <view class="dd-alert__icon" :class="[`dd-alert__icon--${type}`]">
11
12
  <dd-icon :name="iconName" class="dd-alert__icon-text" />
12
13
  </view>
@@ -29,6 +30,8 @@
29
30
  import { computed } from 'vue'
30
31
  import DdPortal from '../dd-portal/dd-portal.vue'
31
32
  import DdIcon from '../dd-icon/dd-icon.vue'
33
+ // z-index 统一取 libs/config/zIndex.js(对话框族与 dd-dialog 同档:dialogMask/dialog)
34
+ import zIndexConfig from '../../libs/config/zIndex.js'
32
35
 
33
36
  type AlertType = 'info' | 'success' | 'warning' | 'error' | 'confirm'
34
37
 
@@ -103,7 +106,6 @@ function onMaskClick() {
103
106
  background: var(--dd-color-overlay-strong, #{$dd-color-overlay-strong});
104
107
  opacity: 0;
105
108
  visibility: hidden;
106
- z-index: 1000;
107
109
  @include dd-transition(opacity 0.25s, visibility 0.25s);
108
110
 
109
111
  &--show {
@@ -119,7 +121,6 @@ function onMaskClick() {
119
121
  transform: translate(-50%, -50%) scale(0.9);
120
122
  opacity: 0;
121
123
  visibility: hidden;
122
- z-index: 1001;
123
124
  width: 560rpx;
124
125
  background: var(--dd-bg-elevated, #{$dd-bg-elevated});
125
126
  border: 1px solid var(--dd-border-default, #{$dd-border-default});
@@ -2,7 +2,7 @@
2
2
  <view
3
3
  class="dd-backtop"
4
4
  :class="{ 'dd-backtop--show': visible }"
5
- :style="{ right: right + 'rpx', bottom: bottom + 'rpx' }"
5
+ :style="{ right: right + 'rpx', bottom: bottom + 'rpx', zIndex: zIndexConfig.sticky + 1 }"
6
6
  @click="onClick"
7
7
  >
8
8
  <slot name="icon">
@@ -14,6 +14,8 @@
14
14
  <script setup lang="ts">
15
15
  import { computed } from 'vue'
16
16
  import DdIcon from '../dd-icon/dd-icon.vue'
17
+ // z-index 统一取 libs/config/zIndex.js:sticky 档 + 1,浮钮须盖住吸顶元素
18
+ import zIndexConfig from '../../libs/config/zIndex.js'
17
19
 
18
20
  interface Props {
19
21
  scrollTop?: number
@@ -47,7 +49,6 @@ function onClick() {
47
49
 
48
50
  .dd-backtop {
49
51
  position: fixed;
50
- z-index: $dd-z-index-fixed;
51
52
  width: 80rpx;
52
53
  height: 80rpx;
53
54
  border-radius: $dd-radius-full;
@@ -5,6 +5,7 @@
5
5
  v-if="visible"
6
6
  class="dd-badge__sup"
7
7
  :class="[`dd-badge__sup--${type}`, `dd-badge__sup--${variant}`]"
8
+ :style="{ zIndex: zIndexConfig.base }"
8
9
  >
9
10
  <text v-if="type === 'number'" class="dd-badge__num">{{ displayContent }}</text>
10
11
  <text v-else-if="type === 'text'" class="dd-badge__txt">{{ content }}</text>
@@ -14,6 +15,8 @@
14
15
 
15
16
  <script setup lang="ts">
16
17
  import { computed } from 'vue'
18
+ // z-index 统一取 libs/config/zIndex.js(角标抬到宿主内容之上取 base 档)
19
+ import zIndexConfig from '../../libs/config/zIndex.js'
17
20
 
18
21
  interface Props {
19
22
  type?: 'dot' | 'number' | 'text'
@@ -72,7 +75,6 @@ const visible = computed(() => {
72
75
  top: 0;
73
76
  right: 0;
74
77
  transform: translate(25%, -25%);
75
- z-index: 1;
76
78
  box-sizing: border-box;
77
79
  display: flex;
78
80
  align-items: center;
@@ -26,6 +26,7 @@
26
26
  v-if="!useCanvas && calcSizeDone"
27
27
  ref="barcodeImageCanvas"
28
28
  class="dd-barcode__hidden-canvas"
29
+ :style="{ zIndex: zcBase }"
29
30
  :canvas-id="tempCanvasId"
30
31
  :width="canvasWidth"
31
32
  :height="canvasHeight"
@@ -36,6 +37,8 @@
36
37
 
37
38
  <script>
38
39
  import { nextTick } from 'vue'
40
+ // z-index 统一取 libs/config/zIndex.js(离屏隐藏画布归 base 档)
41
+ import zIndexConfig from '../../libs/config/zIndex.js'
39
42
 
40
43
  export default {
41
44
  name: 'dd-barcode',
@@ -156,6 +159,8 @@ export default {
156
159
  },
157
160
  data() {
158
161
  return {
162
+ // 离屏隐藏画布层级(base 档,Options API 经 data 暴露给模板)
163
+ zcBase: zIndexConfig.base,
159
164
  canvasId: 'barcode-' + Math.random().toString(36).substr(2, 9),
160
165
  tempCanvasId: 'barcode-temp-' + Math.random().toString(36).substr(2, 9),
161
166
  barcodeImage: '',
@@ -1012,7 +1017,6 @@ export default {
1012
1017
  position: fixed;
1013
1018
  top: -10000px;
1014
1019
  left: -10000px;
1015
- z-index: -1;
1016
1020
  }
1017
1021
 
1018
1022
  .error-container {
@@ -30,7 +30,6 @@
30
30
  <dd-popup
31
31
  v-model="popupShow"
32
32
  position="bottom"
33
- :z-index="zIndexConfig.popup"
34
33
  >
35
34
  <view class="dd-car-keyboard__panel">
36
35
  <view class="dd-car-keyboard__tooltip">
@@ -83,7 +82,6 @@
83
82
 
84
83
  <script setup lang="ts">
85
84
  import { computed, ref, watch } from 'vue'
86
- import zIndexConfig from '../../libs/config/zIndex.js'
87
85
  import DdIcon from '../dd-icon/dd-icon.vue'
88
86
  import DdPopup from '../dd-popup/dd-popup.vue'
89
87
  import { MAX_LEN, getKeyRows, nextPos, type KeyItem } from './carPlate'
@@ -5,7 +5,6 @@
5
5
  :closeable="closeable"
6
6
  :safe-area-inset-bottom="true"
7
7
  :close-on-click-overlay="maskCloseAble"
8
- :z-index="uZIndex"
9
8
  @close="close"
10
9
  >
11
10
  <!-- column 头部:垂直步骤(ponytail: dd-steps 无 dot 模式,用默认数字圆点步骤) -->
@@ -111,8 +110,6 @@ interface Props {
111
110
  childrenKey?: string
112
111
  /** 是否允许通过点击遮罩关闭Picker */
113
112
  maskCloseAble?: boolean
114
- /** 弹出的z-index值 */
115
- zIndex?: string | number
116
113
  /** 是否在选择最后一级时自动关闭并触发confirm */
117
114
  autoClose?: boolean
118
115
  /** 选中项目的展示方向:column 垂直方向适合文字长度过长 */
@@ -131,7 +128,6 @@ const props = withDefaults(defineProps<Props>(), {
131
128
  labelKey: 'label',
132
129
  childrenKey: 'children',
133
130
  maskCloseAble: true,
134
- zIndex: 0,
135
131
  autoClose: false,
136
132
  headerDirection: 'row',
137
133
  optionsCols: 2,
@@ -207,8 +203,6 @@ const genTabsList = computed(() => {
207
203
  return tabsList
208
204
  })
209
205
 
210
- const uZIndex = computed(() => (props.zIndex ? Number(props.zIndex) : 2000))
211
-
212
206
  function getSelectedValues(): Array<string | number> {
213
207
  const result: Array<string | number> = []
214
208
  for (let i = 0; i < selectedValueIndexs.value.length; i++) {
@@ -9,7 +9,7 @@
9
9
  :style="couponStyle"
10
10
  @click="handleClick"
11
11
  >
12
- <view class="dd-coupon__content">
12
+ <view class="dd-coupon__content" :style="{ zIndex: zIndexConfig.base + 1 }">
13
13
  <!-- 左侧金额区域:unit + amount 基线对齐,limit 换行在下 -->
14
14
  <view class="dd-coupon__amount">
15
15
  <view class="dd-coupon__amount-main">
@@ -50,7 +50,7 @@
50
50
  </view>
51
51
 
52
52
  <!-- 红包顶部金条纹 -->
53
- <view v-if="shape === 'envelope'" class="dd-coupon__stripe"></view>
53
+ <view v-if="shape === 'envelope'" class="dd-coupon__stripe" :style="{ zIndex: zIndexConfig.base }"></view>
54
54
 
55
55
  <!-- 默认插槽,可用于添加额外内容 -->
56
56
  <slot></slot>
@@ -59,6 +59,8 @@
59
59
 
60
60
  <script setup lang="ts">
61
61
  import { computed } from 'vue'
62
+ // z-index 统一取 libs/config/zIndex.js(内容层 base 档内 +1,打孔伪元素经 CSS 变量透传 base 档)
63
+ import zIndexConfig from '../../libs/config/zIndex.js'
62
64
 
63
65
  interface Props {
64
66
  /** 金额 */
@@ -114,6 +116,8 @@ const couponStyle = computed(() => {
114
116
  const style: Record<string, string> = {}
115
117
  if (props.bgColor) style.background = props.bgColor
116
118
  if (props.color) style.color = props.color
119
+ // 伪元素(::before/::after 打孔圆)无法 :style 注入,经 CSS 变量透传档位值
120
+ style['--dd-coupon-notch-z'] = String(zIndexConfig.base)
117
121
  return style
118
122
  })
119
123
 
@@ -148,7 +152,7 @@ function handleClick() {
148
152
  height: 48rpx;
149
153
  background: var(--dd-bg, #{$dd-bg});
150
154
  border-radius: 50%;
151
- z-index: 1;
155
+ z-index: var(--dd-coupon-notch-z);
152
156
  }
153
157
 
154
158
  &::after {
@@ -161,7 +165,7 @@ function handleClick() {
161
165
  height: 48rpx;
162
166
  background: var(--dd-bg, #{$dd-bg});
163
167
  border-radius: 50%;
164
- z-index: 1;
168
+ z-index: var(--dd-coupon-notch-z);
165
169
  }
166
170
  }
167
171
 
@@ -201,7 +205,6 @@ function handleClick() {
201
205
  justify-content: space-between;
202
206
  padding: 0 $dd-space-4;
203
207
  position: relative;
204
- z-index: 2;
205
208
  box-sizing: border-box;
206
209
  }
207
210
 
@@ -312,7 +315,6 @@ function handleClick() {
312
315
  var(--dd-primary, #{$dd-primary}) 10rpx,
313
316
  var(--dd-primary, #{$dd-primary}) 20rpx
314
317
  );
315
- z-index: 1;
316
318
  }
317
319
 
318
320
  &--envelope .dd-coupon__content {
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <view class="dd-cropper">
3
- <dd-canvas ref="avatarCanvas" :canvas-id="'avatar-canvas-' + instanceId" class="my-canvas" :width="windowWidth || 0" :height="windowHeight || 0" :style="{ top: styleTop, height: cvsStyleHeight }" bg-color="transparent"></dd-canvas>
4
- <dd-canvas ref="operCanvas" :canvas-id="'oper-canvas-' + instanceId" class="oper-canvas" :width="windowWidth || 0" :height="windowHeight || 0" :style="{ top: styleTop, height: cvsStyleHeight }" bg-color="transparent" @touchstart="start" @touchmove="move" @touchend="end"></dd-canvas>
5
- <dd-canvas ref="prvCanvas" :canvas-id="'prv-canvas-' + instanceId" class="prv-canvas" :width="windowWidth || 0" :height="windowHeight || 0" bg-color="transparent" @touchstart="hideImg" :style="{ height: cvsStyleHeight, top: prvTop }"></dd-canvas>
6
- <view class="oper-wrapper" :style="{ display: styleDisplay }">
3
+ <dd-canvas ref="avatarCanvas" :canvas-id="'avatar-canvas-' + instanceId" class="my-canvas" :width="windowWidth || 0" :height="windowHeight || 0" :style="{ top: styleTop, height: cvsStyleHeight, zIndex: zc }" bg-color="transparent"></dd-canvas>
4
+ <dd-canvas ref="operCanvas" :canvas-id="'oper-canvas-' + instanceId" class="oper-canvas" :width="windowWidth || 0" :height="windowHeight || 0" :style="{ top: styleTop, height: cvsStyleHeight, zIndex: zcOper }" bg-color="transparent" @touchstart="start" @touchmove="move" @touchend="end"></dd-canvas>
5
+ <dd-canvas ref="prvCanvas" :canvas-id="'prv-canvas-' + instanceId" class="prv-canvas" :width="windowWidth || 0" :height="windowHeight || 0" bg-color="transparent" @touchstart="hideImg" :style="{ height: cvsStyleHeight, top: prvTop, zIndex: zcPrv }"></dd-canvas>
6
+ <view class="oper-wrapper" :style="{ display: styleDisplay, zIndex: zcBar }">
7
7
  <view class="oper">
8
8
  <view class="btn-wrapper" v-if="showOper">
9
9
  <view @click="select" hover-class="hover" :style="{ width: btnWidth }">
@@ -37,12 +37,21 @@
37
37
  </template>
38
38
 
39
39
  <script>
40
+ import zIndexConfig from '../../libs/config/zIndex.js'
41
+
40
42
  // 画布系组件(dd-canvas / dd-signature / dd-qrcode 同族)统一采用 Options API,
41
43
  // 命令式 canvas 状态挂在 this 上不走响应式,避免触摸高频重绘的代理开销。
42
44
 
43
45
  // 底部操作条高度(px),与样式 .oper-wrapper 的 height 保持一致
44
46
  const tabHeight = 50;
45
47
 
48
+ // z-index 统一取 libs/config/zIndex.js(cropper 档 + 显式偏移;Options API 经 data 暴露给模板)。
49
+ // ×2 原语义:预览层须盖过工作画布与操作条。
50
+ const Z_CROPPER = zIndexConfig.cropper
51
+ const Z_CROPPER_OPER = Z_CROPPER + 1
52
+ const Z_CROPPER_PRV = Z_CROPPER * 2
53
+ const Z_CROPPER_BAR = Z_CROPPER + 9
54
+
46
55
  export default {
47
56
  name: "dd-cropper",
48
57
  emits: ['avtinit', 'confirm', 'cancel'],
@@ -160,6 +169,11 @@
160
169
  letChangeSize: false,
161
170
  // 底部安全区大小
162
171
  safeAreaInsetsBottom: 0,
172
+ // z-index 档位(libs/config/zIndex.js cropper 档派生,见 script 头部常量)
173
+ zc: Z_CROPPER,
174
+ zcOper: Z_CROPPER_OPER,
175
+ zcPrv: Z_CROPPER_PRV,
176
+ zcBar: Z_CROPPER_BAR,
163
177
  };
164
178
  },
165
179
  created() {
@@ -1211,7 +1225,7 @@
1211
1225
  position: fixed !important;
1212
1226
  background: $dd-color-black;
1213
1227
  left: 0;
1214
- z-index: $dd-z-index-cropper;
1228
+ /* z-index 由模板注入(libs/config/zIndex.js cropper 档) */
1215
1229
  width: 100%;
1216
1230
  }
1217
1231
 
@@ -1219,7 +1233,6 @@
1219
1233
  display: flex;
1220
1234
  position: fixed !important;
1221
1235
  left: 0;
1222
- z-index: $dd-z-index-cropper + 1;
1223
1236
  width: 100%;
1224
1237
  }
1225
1238
 
@@ -1228,7 +1241,6 @@
1228
1241
  position: fixed !important;
1229
1242
  background: $dd-color-black;
1230
1243
  left: 0;
1231
- z-index: $dd-z-index-cropper * 2;
1232
1244
  width: 100%;
1233
1245
  }
1234
1246
 
@@ -1241,7 +1253,6 @@
1241
1253
  width: 100%;
1242
1254
  left: 0;
1243
1255
  bottom: 0;
1244
- z-index: $dd-z-index-cropper + 9;
1245
1256
  flex-direction: row;
1246
1257
  }
1247
1258
 
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <dd-portal>
3
3
  <view class="dd-dp" :class="{ 'dd-dp--open': show }">
4
- <view class="dd-dp__mask" @click="onMaskClick"></view>
5
- <view class="dd-dp__sheet">
4
+ <view class="dd-dp__mask" :style="{ zIndex: zIndexConfig.overlay }" @click="onMaskClick"></view>
5
+ <view class="dd-dp__sheet" :style="{ zIndex: zIndexConfig.popup }">
6
6
  <view class="dd-dp__toolbar">
7
7
  <text class="dd-dp__cancel" @click="onCancel">取消</text>
8
8
  <text class="dd-dp__title">{{ title }}</text>
@@ -28,6 +28,8 @@
28
28
  <script setup lang="ts">
29
29
  import { computed, ref, watch } from 'vue'
30
30
  import DdPortal from '../dd-portal/dd-portal.vue'
31
+ // z-index 统一取 libs/config/zIndex.js(picker 底部面板:overlay/popup 档)
32
+ import zIndexConfig from '../../libs/config/zIndex.js'
31
33
 
32
34
  interface Props {
33
35
  show?: boolean
@@ -189,7 +191,6 @@ function onConfirm() {
189
191
  &__mask {
190
192
  position: fixed;
191
193
  inset: 0;
192
- z-index: $dd-z-index-overlay;
193
194
  background: var(--dd-color-overlay-strong, #{$dd-color-overlay-strong});
194
195
  opacity: 0;
195
196
  pointer-events: none;
@@ -201,7 +202,6 @@ function onConfirm() {
201
202
  left: 0;
202
203
  right: 0;
203
204
  bottom: 0;
204
- z-index: $dd-z-index-popup;
205
205
  background: var(--dd-bg-popup, #{$dd-bg-popup});
206
206
  border-radius: $dd-radius-2xl $dd-radius-2xl 0 0;
207
207
  transform: translateY(100%);
@@ -4,12 +4,13 @@
4
4
  <view
5
5
  class="dd-drawer__mask"
6
6
  :class="{ 'dd-drawer__mask--show': modelValue }"
7
+ :style="{ zIndex: zIndexConfig.dialogMask }"
7
8
  @click="onMaskClick"
8
9
  ></view>
9
10
  <view
10
11
  class="dd-drawer__panel"
11
12
  :class="[`dd-drawer__panel--${position}`, { 'dd-drawer__panel--show': modelValue }]"
12
- :style="{ width: width }"
13
+ :style="{ width: width, zIndex: zIndexConfig.dialog }"
13
14
  >
14
15
  <view v-if="$slots.header" class="dd-drawer__header">
15
16
  <slot name="header"></slot>
@@ -43,6 +44,8 @@
43
44
  <script setup lang="ts">
44
45
  import { watch } from 'vue'
45
46
  import DdPortal from '../dd-portal/dd-portal.vue'
47
+ // z-index 统一取 libs/config/zIndex.js(对话框族与 dd-dialog 同档:dialogMask/dialog)
48
+ import zIndexConfig from '../../libs/config/zIndex.js'
46
49
 
47
50
  interface Props {
48
51
  modelValue?: boolean
@@ -106,7 +109,6 @@ function onMaskClick() {
106
109
  -webkit-backdrop-filter: blur(8px);
107
110
  opacity: 0;
108
111
  visibility: hidden;
109
- z-index: 1000;
110
112
  @include dd-transition(opacity 0.3s ease, visibility 0.3s ease);
111
113
 
112
114
  &--show {
@@ -123,7 +125,6 @@ function onMaskClick() {
123
125
  flex-direction: column;
124
126
  background: var(--dd-surface, #{$dd-surface});
125
127
  overflow: hidden;
126
- z-index: 1001;
127
128
  // ponytail: cubic-bezier 取 iOS 标准滑出曲线,遮罩淡入同期 0.3s,合上略快收尾
128
129
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
129
130
  will-change: transform;
@@ -50,6 +50,8 @@
50
50
  import { computed, inject, ref } from 'vue'
51
51
  import DdPortal from '../dd-portal/dd-portal.vue'
52
52
  import DdIcon from '../dd-icon/dd-icon.vue'
53
+ // z-index 统一取 libs/config/zIndex.js(下拉面板取 base 档内 +1,盖住 bar 与遮罩)
54
+ import zIndexConfig from '../../libs/config/zIndex.js'
53
55
 
54
56
  interface DropdownOption {
55
57
  text: string
@@ -93,9 +95,9 @@ const panelStyle = computed(() => {
93
95
  if (!ctx) return {}
94
96
  const winH = uni.getWindowInfo?.().windowHeight || 667
95
97
  if (direction.value === 'down') {
96
- return { top: ctx.barRect.bottom + 'px', left: '0', right: '0' }
98
+ return { top: ctx.barRect.bottom + 'px', left: '0', right: '0', zIndex: zIndexConfig.base + 1 }
97
99
  }
98
- return { bottom: winH - ctx.barRect.top + 'px', left: '0', right: '0' }
100
+ return { bottom: winH - ctx.barRect.top + 'px', left: '0', right: '0', zIndex: zIndexConfig.base + 1 }
99
101
  })
100
102
 
101
103
  function onTrigger() {
@@ -149,7 +151,6 @@ function onSelect(opt: DropdownOption) {
149
151
 
150
152
  &__panel {
151
153
  position: fixed;
152
- z-index: 10;
153
154
  background: var(--dd-surface, #{$dd-surface});
154
155
  max-height: 50vh;
155
156
  overflow: hidden;
@@ -170,7 +171,6 @@ function onSelect(opt: DropdownOption) {
170
171
  transform: translateY(0);
171
172
  opacity: 1;
172
173
  visibility: visible;
173
- z-index: 11;
174
174
  pointer-events: auto;
175
175
  }
176
176
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <view class="dd-dropdown" :class="{ 'dd-dropdown--active': activeId !== null }" ref="rootRef">
3
- <view class="dd-dropdown__bar">
2
+ <view class="dd-dropdown" :class="{ 'dd-dropdown--active': activeId !== null }" :style="rootStyle" ref="rootRef">
3
+ <view class="dd-dropdown__bar" :style="{ zIndex: zIndexConfig.base + 1 }">
4
4
  <slot></slot>
5
5
  </view>
6
6
  <dd-portal>
@@ -22,8 +22,10 @@ let activeMenuClose: (() => void) | null = null
22
22
  </script>
23
23
 
24
24
  <script setup lang="ts">
25
- import { getCurrentInstance, onMounted, onUnmounted, provide, reactive, ref } from 'vue'
25
+ import { computed, getCurrentInstance, onMounted, onUnmounted, provide, reactive, ref } from 'vue'
26
26
  import DdPortal from '../dd-portal/dd-portal.vue'
27
+ // z-index 统一取 libs/config/zIndex.js(激活时整档抬到 sticky,遮罩 base,bar 档内 +1)
28
+ import zIndexConfig from '../../libs/config/zIndex.js'
27
29
 
28
30
  interface Props {
29
31
  activeColor?: string
@@ -44,6 +46,8 @@ const props = withDefaults(defineProps<Props>(), {
44
46
  const emit = defineEmits<{ (e: 'change', id: number): void }>()
45
47
 
46
48
  const activeId = ref<number | null>(null)
49
+ // 激活时整体抬到 sticky 档,避免被同页其他菜单的 bar 盖住 panel
50
+ const rootStyle = computed(() => (activeId.value !== null ? { zIndex: zIndexConfig.sticky } : {}))
47
51
  const counter = ref(0)
48
52
  const barRect = reactive({ top: 0, bottom: 0, height: 0 })
49
53
  const overlayStyle = ref({})
@@ -71,11 +75,13 @@ function measureBar() {
71
75
  overlayStyle.value = {
72
76
  top: barRect.bottom + 'px',
73
77
  bottom: '0',
78
+ zIndex: zIndexConfig.base,
74
79
  }
75
80
  } else {
76
81
  overlayStyle.value = {
77
82
  top: '0',
78
83
  bottom: winH - barRect.top + 'px',
84
+ zIndex: zIndexConfig.base,
79
85
  }
80
86
  }
81
87
  })
@@ -142,16 +148,10 @@ onUnmounted(() => {
142
148
  .dd-dropdown {
143
149
  position: relative;
144
150
  width: 100%;
145
-
146
- // 激活时整体抬高层级,避免被同页其他菜单的 bar 盖住 panel
147
- &--active {
148
- z-index: 100;
149
- }
150
151
  }
151
152
 
152
153
  .dd-dropdown__bar {
153
154
  position: relative;
154
- z-index: 11;
155
155
  display: flex;
156
156
  flex-direction: row;
157
157
  align-items: center;
@@ -167,7 +167,6 @@ onUnmounted(() => {
167
167
  background: var(--dd-glass-bg, #{$dd-glass-bg});
168
168
  backdrop-filter: blur(8px);
169
169
  -webkit-backdrop-filter: blur(8px);
170
- z-index: 9;
171
170
  opacity: 0;
172
171
  visibility: hidden;
173
172
  @include dd-transition(opacity 0.3s, visibility 0.3s);