@didaoktv/didaoui-uniapp 2.7.0 → 2.9.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.
@@ -33,7 +33,7 @@ import DdIcon from '../dd-icon/dd-icon.vue'
33
33
 
34
34
  interface Props {
35
35
  type?: 'default' | 'primary' | 'secondary' | 'ghost' | 'text' | 'success' | 'warning' | 'danger'
36
- size?: 'sm' | 'md' | 'lg'
36
+ size?: 'xs' | 'sm' | 'md' | 'lg'
37
37
  block?: boolean
38
38
  round?: boolean
39
39
  plain?: boolean
@@ -126,6 +126,20 @@ function onClick(e: Event) {
126
126
  }
127
127
  }
128
128
 
129
+ .dd-btn--xs {
130
+ height: $dd-size-control-xs;
131
+ padding: 0 $dd-space-2;
132
+ font-size: $dd-font-size-caption;
133
+ &.dd-btn--icon-only {
134
+ width: $dd-size-control-xs;
135
+ }
136
+ .dd-btn__loading {
137
+ width: 18rpx;
138
+ height: 18rpx; // size-exempt: loading 圈内部件,非控件高度
139
+ border-width: 2rpx;
140
+ }
141
+ }
142
+
129
143
  .dd-btn--sm {
130
144
  height: $dd-size-control-sm;
131
145
  padding: 0 $dd-space-3;
@@ -3,6 +3,7 @@
3
3
  class="dd-card"
4
4
  :class="[
5
5
  `dd-card--${variant}`,
6
+ padClass,
6
7
  {
7
8
  'dd-card--border': border,
8
9
  'dd-card--active': active,
@@ -13,20 +14,30 @@
13
14
  :hover-stay-time="120"
14
15
  @click="onClick"
15
16
  >
16
- <view v-if="$slots.header || $slots.extra" class="dd-card__header">
17
+ <view
18
+ v-if="$slots.header || $slots.extra"
19
+ class="dd-card__header"
20
+ :style="padStyle"
21
+ >
17
22
  <view class="dd-card__header-inner"><slot name="header"></slot></view>
18
23
  <view v-if="$slots.extra" class="dd-card__extra"><slot name="extra"></slot></view>
19
24
  </view>
20
- <view class="dd-card__body"><slot></slot></view>
21
- <view v-if="$slots.footer" class="dd-card__footer"><slot name="footer"></slot></view>
25
+ <view class="dd-card__body" :style="padStyle"><slot></slot></view>
26
+ <view v-if="$slots.footer" class="dd-card__footer" :style="padStyle"><slot name="footer"></slot></view>
22
27
  </view>
23
28
  </template>
24
29
 
25
30
  <script setup lang="ts">
26
- import { useSlots } from 'vue'
31
+ import { computed, useSlots } from 'vue'
27
32
 
28
33
  interface Props {
29
34
  variant?: 'vertical' | 'horizontal' | 'compact'
35
+ /**
36
+ * 内边距(与 variant 正交,统一作用于 header/body/footer):
37
+ * 档位 none 贴边 / sm 12px / md 16px / lg 24px;也可直接给数字(按 px,如 `padding="24"` 或 `:padding="24"`)
38
+ * 不传=沿用 variant 默认档
39
+ */
40
+ padding?: '' | 'none' | 'sm' | 'md' | 'lg' | number | `${number}`
30
41
  border?: boolean
31
42
  active?: boolean
32
43
  hover?: boolean
@@ -35,12 +46,33 @@ interface Props {
35
46
 
36
47
  const props = withDefaults(defineProps<Props>(), {
37
48
  variant: 'vertical',
49
+ padding: '',
38
50
  border: true,
39
51
  active: false,
40
52
  hover: false,
41
53
  hoverable: false,
42
54
  })
43
55
 
56
+ /** 数字入参(或数字字符串)解析为 px;档位键/空值返回 null */
57
+ const customPadPx = computed<number | null>(() => {
58
+ const v = props.padding
59
+ if (typeof v === 'number') return v
60
+ if (typeof v === 'string' && /^\d+(\.\d+)?$/.test(v)) return Number(v)
61
+ return null
62
+ })
63
+
64
+ /** 档位键拼对应类名;数字入参走行内 style(见 padStyle);空值不覆盖 variant 默认档 */
65
+ const padClass = computed(() => {
66
+ const v = props.padding
67
+ if (!v || customPadPx.value !== null) return ''
68
+ return `dd-card--padding-${v}`
69
+ })
70
+
71
+ /** 自定义 px 用行内 style 直接落到三区(不依赖 CSS 变量,兼容各端) */
72
+ const padStyle = computed(() =>
73
+ customPadPx.value === null ? '' : { padding: `${customPadPx.value}px` },
74
+ )
75
+
44
76
  const emit = defineEmits<{ (e: 'click', val: Event): void }>()
45
77
 
46
78
  const slots = useSlots()
@@ -149,6 +181,17 @@ function onClick(e: Event) {
149
181
  }
150
182
  }
151
183
 
184
+ // 内边距档:与 variant 正交,显式覆盖头/体/尾三区(不传=沿用 variant 默认档;同权重靠后声明覆盖上面的 variant 规则)
185
+ @each $size, $pad in ('none': 0, 'sm': $dd-space-3, 'md': $dd-space-4, 'lg': $dd-space-5) {
186
+ .dd-card--padding-#{$size} {
187
+ .dd-card__header,
188
+ .dd-card__body,
189
+ .dd-card__footer {
190
+ padding: $pad;
191
+ }
192
+ }
193
+ }
194
+
152
195
  .dd-card--horizontal.dd-card--active {
153
196
  border: 2px solid var(--dd-primary, #{$dd-primary});
154
197
  }
@@ -68,7 +68,7 @@
68
68
  scroll-y
69
69
  :style="{ maxHeight: maxListHeight }"
70
70
  >
71
- <!-- 商品行复用 dd-goods-card 小号横卡(96rpx 紧凑图、不渲染描述、价格小一号);规格随卡 desc 传入(sm 档不显示),数量步进器走 price-right 插槽 -->
71
+ <!-- 商品行复用 dd-goods-card 小号横卡(96rpx 紧凑图、不渲染描述、价格小一号);规格随卡 desc 传入(sm 档不显示);数量步进器走 price-right 插槽 -->
72
72
  <dd-goods-card
73
73
  v-for="item in items"
74
74
  :key="item.id"
@@ -288,9 +288,12 @@ function onSubmit() {
288
288
  }
289
289
  }
290
290
 
291
+ // 占位块高度必须与固定栏实际高度一致:栏高由「操作钮 88rpx + 上下内边距」决定(min-height 不生效),
292
+ // 原占位块固定 100rpx 比真实栏矮约 16px,页面底部内容会被栏遮住
291
293
  .dd-cart-bar__placeholder {
292
294
  width: 100%;
293
- height: 100rpx;
295
+ height: $dd-size-control-md;
296
+ padding: $dd-space-2 0;
294
297
  box-sizing: content-box;
295
298
 
296
299
  &--safe {
@@ -301,6 +304,9 @@ function onSubmit() {
301
304
  .dd-cart-bar__bar {
302
305
  display: flex;
303
306
  align-items: center;
307
+ // 显式 border-box:栏高 = 88rpx + 上下内边距,与占位块的 content-box 镜像计算一致,
308
+ // 不受消费端是否引入 _reset.scss(全局 border-box)影响
309
+ box-sizing: border-box;
304
310
  min-height: 100rpx;
305
311
  padding: $dd-space-2 $dd-space-3;
306
312
  }
@@ -373,8 +379,8 @@ function onSubmit() {
373
379
 
374
380
  .dd-cart-bar__panel {
375
381
  // 底部留出栏高 + 安全区:弹层面板(popup 档)压在栏下方,内容不被栏遮挡
376
- padding: $dd-space-3 $dd-space-3 calc(100rpx + $dd-space-2*2 + constant(safe-area-inset-bottom));
377
- padding: $dd-space-3 $dd-space-3 calc(100rpx + $dd-space-2*2 + env(safe-area-inset-bottom));
382
+ padding: $dd-space-3 $dd-space-3 calc(100rpx + $dd-space-2*3 + constant(safe-area-inset-bottom));
383
+ padding: $dd-space-3 $dd-space-3 calc(100rpx + $dd-space-2*3 + env(safe-area-inset-bottom));
378
384
  box-sizing: border-box;
379
385
  }
380
386
 
@@ -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" :style="{ zIndex: zIndexConfig.overlay }" @click="onMaskClick"></view>
5
- <view class="dd-dp__sheet" :style="{ zIndex: zIndexConfig.popup }">
4
+ <view class="dd-dp__mask" :style="{ zIndex: maskZIndex }" @click="onMaskClick"></view>
5
+ <view class="dd-dp__sheet" :style="{ zIndex: sheetZIndex }">
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>
@@ -61,6 +61,10 @@ const indicatorStyle =
61
61
  'height:80rpx;background:rgba(255,193,7,0.08);border-top:1px solid rgba(255,193,7,0.3);border-bottom:1px solid rgba(255,193,7,0.3);box-shadow:0 0 20rpx rgba(255,193,7,0.15);'
62
62
 
63
63
  const indexes = ref<number[]>([])
64
+ // 与 dd-picker 同理:常从 dd-popup 面板内打开,遮罩需压过父面板(popup 档 2001)才能点击关闭
65
+ // ponytail: 上限低于 dialog 档(2010),若要在 dd-dialog 内打开需再抬一档
66
+ const maskZIndex = zIndexConfig.popup + 1
67
+ const sheetZIndex = zIndexConfig.popup + 1
64
68
 
65
69
  const yearList = computed(() => {
66
70
  const arr: string[] = []
@@ -139,7 +143,8 @@ watch(() => props.show, (v) => {
139
143
 
140
144
  function onPickerChange(e: any) {
141
145
  const val = (e?.detail?.value ?? []).slice()
142
- const dayIdx = props.type === 'date' || props.type === 'range' ? 2 : props.type === 'datetime' ? 3 : -1
146
+ // 列序:date/range = [年,月,日] → 日=2;datetime = [年,月,日,时,分] → 日=2;time 无日列
147
+ const dayIdx = props.type === 'date' || props.type === 'range' || props.type === 'datetime' ? 2 : -1
143
148
  if (dayIdx >= 0) {
144
149
  const y = startYear + (val[0] ?? 0)
145
150
  const m = (val[1] ?? 0) + 1
@@ -28,24 +28,32 @@
28
28
  <!-- 信息区 -->
29
29
  <view class="dd-goods-card__body">
30
30
  <slot name="default">
31
- <text v-if="title" class="dd-goods-card__title">{{ title }}</text>
31
+ <!-- 名称行:有 title-suffix 插槽时与名称同排(名称占满并省略,后缀贴右),否则等同原单行名称 -->
32
+ <view v-if="title || $slots['title-suffix']" class="dd-goods-card__title-row">
33
+ <text v-if="title" class="dd-goods-card__title">{{ title }}</text>
34
+ <slot name="title-suffix"></slot>
35
+ </view>
32
36
  <text v-if="desc" class="dd-goods-card__desc">{{ desc }}</text>
33
37
 
34
38
  <view class="dd-goods-card__price-row">
35
39
  <view class="dd-goods-card__price">
36
- <dd-price
37
- v-if="price !== undefined && price !== null && price !== ''"
38
- :rate="price"
39
- :currency="currency"
40
- :decimal-length="decimalLength"
41
- :size="size"
42
- ></dd-price>
43
- <text v-if="originPrice" class="dd-goods-card__price-origin">
44
- {{ currency }}{{ originPrice }}
45
- </text>
40
+ <!-- 价格位插槽:默认渲染 dd-price(+划线原价);使用方自定义(如赠品改「赠送」标签)时整块替换,
41
+ 此时 price / originPrice / currency 均不生效(插槽内容自负责展示) -->
42
+ <slot name="price">
43
+ <dd-price
44
+ v-if="price !== undefined && price !== null && price !== ''"
45
+ :rate="price"
46
+ :currency="currency"
47
+ :decimal-length="decimalLength"
48
+ :size="size"
49
+ ></dd-price>
50
+ <text v-if="originPrice" class="dd-goods-card__price-origin">
51
+ {{ currency }}{{ originPrice }}
52
+ </text>
53
+ </slot>
46
54
  </view>
47
55
  <!-- 价格行右侧扩展位(步进器/加购等与价格同排贴底);未用时回退已选数量 -->
48
- <view class="dd-goods-card__price-right">
56
+ <view class="dd-goods-card__price-right flex_m">
49
57
  <slot name="price-right">
50
58
  <text v-if="num" class="dd-goods-card__num">×{{ num }}</text>
51
59
  </slot>
@@ -86,8 +94,8 @@ interface Props {
86
94
  tag?: string
87
95
  /** 布局:horizontal 横向(左图右文)/ vertical 竖向(上图下文) */
88
96
  layout?: 'horizontal' | 'vertical'
89
- /** 尺寸:md 常规 / sm 小号(横向用于购物车列表行且不渲染描述,竖向用于一行三列宫格) */
90
- size?: 'sm' | 'md'
97
+ /** 尺寸:md 常规 / sm 小号(横向用于购物车列表行且不渲染描述,竖向用于一行三列宫格) / xs 超小号(竖向一行四列缩略图,订单卡商品行) */
98
+ size?: 'sm' | 'md' | 'xs'
91
99
  /** 已选数量(右下角,不传不渲染) */
92
100
  num?: string | number
93
101
  /** 置灰(售罄等不可点场景) */
@@ -200,7 +208,16 @@ function onClick(e: Event) {
200
208
  flex-direction: column;
201
209
  }
202
210
 
211
+ // 名称行:名称占满剩余宽度(自身省略),title-suffix 贴右不被压缩
212
+ &__title-row {
213
+ display: flex;
214
+ align-items: center;
215
+ min-width: 0;
216
+ }
217
+
203
218
  &__title {
219
+ flex: 1;
220
+ min-width: 0;
204
221
  color: var(--dd-text-primary, #{$dd-text-primary});
205
222
  font-size: 28rpx;
206
223
  font-weight: 600;
@@ -340,4 +357,45 @@ function onClick(e: Event) {
340
357
  font-size: 20rpx;
341
358
  }
342
359
  }
360
+
361
+ // 超小号竖向(一行四列缩略图,订单卡商品行):去掉卡片底色/阴影,只留圆角方图 + 两行内名称
362
+ .dd-goods-card--vertical.dd-goods-card--xs {
363
+ background: transparent;
364
+ box-shadow: none;
365
+
366
+ .dd-goods-card__thumb {
367
+ border-radius: $dd-radius-md;
368
+ }
369
+
370
+ .dd-goods-card__thumb-text {
371
+ font-size: 28rpx;
372
+ }
373
+
374
+ .dd-goods-card__body {
375
+ padding: $dd-space-1 0 0;
376
+ }
377
+
378
+ .dd-goods-card__title {
379
+ font-size: 22rpx;
380
+ font-weight: 400;
381
+ @include dd-ellipsis(2);
382
+ }
383
+
384
+ // 四列宽度下描述无处安放,超小号不渲染
385
+ .dd-goods-card__desc {
386
+ display: none;
387
+ }
388
+
389
+ .dd-goods-card__price-row {
390
+ height: 40rpx;
391
+ }
392
+ // 一条窄卡里价格占满剩余宽度,过长时自身裁切,避免把右侧数量挤出
393
+ .dd-goods-card__price {
394
+ overflow: hidden;
395
+ }
396
+
397
+ .dd-goods-card__num {
398
+ font-size: 20rpx;
399
+ }
400
+ }
343
401
  </style>
@@ -0,0 +1,285 @@
1
+ <template>
2
+ <view class="dd-order-list" :class="customClass" :style="customStyle">
3
+ <view
4
+ v-for="item in orders"
5
+ :key="item.id"
6
+ class="dd-order-list__card"
7
+ :class="{ 'dd-order-list__card--on': isPicked(item.id) }"
8
+ @click="onCardTap(item)"
9
+ >
10
+ <!-- 选择器:卡片最左侧,垂直居中(不占内容行) -->
11
+ <view
12
+ v-if="checkable"
13
+ class="dd-order-list__check"
14
+ :class="{ 'dd-order-list__check--on': isPicked(item.id) }"
15
+ >
16
+ <dd-icon :name="isPicked(item.id) ? 'success' : 'circle'" />
17
+ </view>
18
+
19
+ <view class="dd-order-list__body">
20
+ <!-- 第一行:订单号 + 收款状态 -->
21
+ <view class="dd-order-list__header">
22
+ <text class="dd-order-list__title">{{ item.title }}</text>
23
+ <text v-if="item.statusText" class="dd-order-list__status">{{ item.statusText }}</text>
24
+ </view>
25
+
26
+ <!-- 第二行:商品卡片横向滚动(竖向超小号)+ 右侧总价与件数(渐变蒙版压在最右侧) -->
27
+ <view class="dd-order-list__goods">
28
+ <scroll-view scroll-x :show-scrollbar="false" class="dd-order-list__goods-scroll">
29
+ <view class="dd-order-list__goods-track">
30
+ <view v-for="line in item.lines" :key="line.id" class="dd-order-list__goods-cell">
31
+ <dd-goods-card
32
+ layout="vertical"
33
+ size="xs"
34
+ :thumb="line.thumb || ''"
35
+ :title="line.name"
36
+ :price="line.priceFen / 100"
37
+ :num="lineQty(line)"
38
+ :hoverable="false"
39
+ />
40
+ </view>
41
+ </view>
42
+ </scroll-view>
43
+ <view class="dd-order-list__amount">
44
+ <dd-price :rate="item.totalFen / 100" />
45
+ <text class="dd-order-list__amount-count">共 {{ totalCount(item) }} 件</text>
46
+ </view>
47
+ </view>
48
+
49
+ <view class="dd-order-list__bill-container">
50
+ <!-- 第三行:账单信息(账单号/备注等,由消费方拼好文案) -->
51
+ <view v-if="item.remark" class="dd-order-list__bill">
52
+ <dd-icon name="notes-o" class="dd-order-list__bill-icon" />
53
+ <text class="dd-order-list__bill-text">{{ item.remark }}</text>
54
+ </view>
55
+
56
+ <!-- 第四行:时间 -->
57
+ <text v-if="item.timeText" class="dd-order-list__time">{{ item.timeText }}</text>
58
+ </view>
59
+ </view>
60
+ </view>
61
+
62
+ <slot v-if="orders.length === 0" name="empty"></slot>
63
+ </view>
64
+ </template>
65
+
66
+ <script setup lang="ts">
67
+ import DdIcon from '../dd-icon/dd-icon.vue'
68
+ import DdPrice from '../dd-price/dd-price.vue'
69
+ import DdGoodsCard from '../dd-goods-card/dd-goods-card.vue'
70
+ import type { DdOrderItem, DdOrderLine } from './order-list'
71
+
72
+ interface Props {
73
+ /** 订单列表(受控数据) */
74
+ orders: DdOrderItem[]
75
+ /** 已选订单 id 集合(v-model:selected,checkable 时生效) */
76
+ selected?: (string | number)[]
77
+ /** 是否显示多选(点卡片切换选中) */
78
+ checkable?: boolean
79
+ customStyle?: string
80
+ customClass?: string
81
+ }
82
+
83
+ const props = withDefaults(defineProps<Props>(), {
84
+ selected: () => [],
85
+ checkable: true,
86
+ customStyle: '',
87
+ customClass: '',
88
+ })
89
+
90
+ const emit = defineEmits<{
91
+ (e: 'update:selected', ids: (string | number)[]): void
92
+ (e: 'item-click', item: DdOrderItem): void
93
+ }>()
94
+
95
+ function isPicked(id: string | number): boolean {
96
+ return props.selected.includes(id)
97
+ }
98
+
99
+ function totalCount(item: DdOrderItem): number {
100
+ return item.lines.reduce((sum, l) => sum + l.qty, 0)
101
+ }
102
+
103
+ /** 单件不用标数量(×1 是噪音),与外卖订单卡一致 */
104
+ function lineQty(line: DdOrderLine): number | string {
105
+ return line.qty > 1 ? line.qty : ''
106
+ }
107
+
108
+ function onCardTap(item: DdOrderItem): void {
109
+ emit('item-click', item)
110
+ if (!props.checkable) return
111
+ const next = isPicked(item.id)
112
+ ? props.selected.filter((id) => id !== item.id)
113
+ : [...props.selected, item.id]
114
+ emit('update:selected', next)
115
+ }
116
+ </script>
117
+
118
+ <style lang="scss" scoped>
119
+ @import '../../scss/variables';
120
+ @import '../../scss/mixins';
121
+
122
+ .dd-order-list__card {
123
+ display: flex;
124
+ align-items: center;
125
+ padding: $dd-space-3;
126
+ margin-bottom: $dd-space-2;
127
+ background: var(--dd-bg-card, #{$dd-bg-card});
128
+ border: 2rpx solid transparent;
129
+ border-radius: $dd-radius-lg;
130
+
131
+ // 选中态:主色描边(多选反馈与底部合计联动)
132
+ &--on {
133
+ border-color: var(--dd-primary, #{$dd-primary});
134
+ }
135
+ }
136
+
137
+ // 内容列:撑满选择器右侧剩余宽度
138
+ .dd-order-list__body {
139
+ flex: 1;
140
+ min-width: 0;
141
+ }
142
+
143
+ .dd-order-list__header {
144
+ display: flex;
145
+ align-items: center;
146
+ }
147
+
148
+ .dd-order-list__check {
149
+ display: flex;
150
+ flex-shrink: 0;
151
+ align-items: center;
152
+ justify-content: center;
153
+ width: 40rpx;
154
+ height: 40rpx;
155
+ margin-right: $dd-space-3;
156
+ color: var(--dd-text-tertiary, #{$dd-text-tertiary});
157
+ font-size: 40rpx;
158
+
159
+ &--on {
160
+ overflow: hidden;
161
+ background: var(--dd-primary, #{$dd-primary});
162
+ border-radius: 50%;
163
+ color: $dd-color-white;
164
+ font-size: 28rpx;
165
+ }
166
+ }
167
+
168
+ .dd-order-list__title {
169
+ flex: 1;
170
+ overflow: hidden;
171
+ min-width: 0;
172
+ font-weight: 600;
173
+ color: var(--dd-text-primary, #{$dd-text-primary});
174
+ font-size: $dd-font-size-body;
175
+ text-overflow: ellipsis;
176
+ white-space: nowrap;
177
+ }
178
+
179
+ .dd-order-list__status {
180
+ flex-shrink: 0;
181
+ margin-left: $dd-space-2;
182
+ color: var(--dd-warning, #{$dd-warning});
183
+ font-size: $dd-font-size-caption;
184
+ font-weight: 600;
185
+ }
186
+
187
+ // 商品行:横向滚动(不换行),总价块绝对定位压在最右侧、与商品卡等高,左侧渐变蒙版让卡片从下方滑过
188
+ .dd-order-list__goods {
189
+ position: relative;
190
+ margin-top: $dd-space-3;
191
+ }
192
+
193
+ .dd-order-list__goods-scroll {
194
+ width: 100%;
195
+ white-space: nowrap;
196
+ // 隐藏滚动条、保留横向滚动:H5/App-vue 走 CSS,小程序默认不显,App-nvue 由 show-scrollbar=false 兜底
197
+ scrollbar-width: none;
198
+
199
+ &::-webkit-scrollbar {
200
+ display: none;
201
+ width: 0;
202
+ height: 0;
203
+ }
204
+ }
205
+
206
+ .dd-order-list__goods-track {
207
+ display: inline-flex;
208
+ align-items: flex-start;
209
+ // ponytail: 尾部留白 = 蒙版宽度,保证最后一张卡能滚出蒙版;蒙版改宽这里要同步
210
+ padding-right: 200rpx;
211
+ gap: $dd-space-2;
212
+ }
213
+
214
+ .dd-order-list__goods-cell {
215
+ flex-shrink: 0;
216
+ width: 140rpx;
217
+ min-width: 0;
218
+ }
219
+
220
+ .dd-order-list__amount {
221
+ position: absolute;
222
+ top: 0;
223
+ right: 0;
224
+ bottom: 0;
225
+ display: flex;
226
+ flex-direction: column;
227
+ align-items: center;
228
+ justify-content: center;
229
+ padding-left: $dd-space-5;
230
+ // 蒙版底色必须与卡片底色一致,否则滚动时穿帮
231
+ background: linear-gradient(
232
+ to right,
233
+ transparent,
234
+ var(--dd-bg-card, #{$dd-bg-card}) 45%
235
+ );
236
+ // 不拦横向滑动
237
+ pointer-events: none;
238
+ color: var(--dd-text-primary, #{$dd-text-primary});
239
+ }
240
+
241
+ .dd-order-list__amount-count {
242
+ margin-top: $dd-space-1;
243
+ color: var(--dd-text-tertiary, #{$dd-text-tertiary});
244
+ font-size: $dd-font-size-caption;
245
+ }
246
+
247
+ .dd-order-list__bill-container {
248
+ display: flex;
249
+ align-items: center;
250
+ justify-content: space-between;
251
+ margin-top: $dd-space-2;
252
+ padding-top: $dd-space-2;
253
+ border-top: 1rpx solid var(--dd-border-subtle, #{$dd-border-subtle});
254
+ }
255
+
256
+ // 账单信息占剩余宽度,时间贴右
257
+ .dd-order-list__bill {
258
+ display: flex;
259
+ flex: 1;
260
+ align-items: center;
261
+ min-width: 0;
262
+ }
263
+
264
+ .dd-order-list__bill-icon {
265
+ flex-shrink: 0;
266
+ margin-right: $dd-space-1;
267
+ color: var(--dd-text-tertiary, #{$dd-text-tertiary});
268
+ font-size: 24rpx;
269
+ }
270
+
271
+ .dd-order-list__bill-text {
272
+ overflow: hidden;
273
+ color: var(--dd-text-secondary, #{$dd-text-secondary});
274
+ font-size: $dd-font-size-caption;
275
+ text-overflow: ellipsis;
276
+ white-space: nowrap;
277
+ }
278
+
279
+ .dd-order-list__time {
280
+ flex-shrink: 0;
281
+ margin-left: $dd-space-2;
282
+ color: var(--dd-text-tertiary, #{$dd-text-tertiary});
283
+ font-size: $dd-font-size-caption;
284
+ }
285
+ </style>
@@ -0,0 +1,31 @@
1
+ /** 订单行(dd-order-list 配套;金额单位与全库一致为「分」) */
2
+ export interface DdOrderLine {
3
+ /** 唯一标识 */
4
+ id: string | number
5
+ /** 品项名 */
6
+ name: string
7
+ /** 数量 */
8
+ qty: number
9
+ /** 小计,单位:分 */
10
+ priceFen: number
11
+ /** 商品图(不传则商品卡渲染主题底色 + 名称前 2 字占位) */
12
+ thumb?: string
13
+ }
14
+
15
+ /** 订单卡片(多选列表;checkable 时点卡片切换选中并回传 id 数组) */
16
+ export interface DdOrderItem {
17
+ /** 唯一标识 */
18
+ id: string | number
19
+ /** 订单标题(如单号、来源) */
20
+ title: string
21
+ /** 状态文案(如「待结算」,不传不渲染状态角标) */
22
+ statusText?: string
23
+ /** 品项行 */
24
+ lines: DdOrderLine[]
25
+ /** 合计,单位:分 */
26
+ totalFen: number
27
+ /** 下单时间文案(组件只做展示,格式由消费方定) */
28
+ timeText?: string
29
+ /** 备注文案(不传不渲染) */
30
+ remark?: string
31
+ }
@@ -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" :style="{ zIndex: zIndexConfig.overlay }" @click="onMaskClick"></view>
5
- <view class="dd-picker__sheet" :style="{ zIndex: zIndexConfig.popup }">
4
+ <view class="dd-picker__mask" :style="{ zIndex: maskZIndex }" @click="onMaskClick"></view>
5
+ <view class="dd-picker__sheet" :style="{ zIndex: sheetZIndex }">
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>
@@ -76,6 +76,12 @@ const normalizedColumns = computed<PickerItem[][]>(() => {
76
76
 
77
77
  const indexes = ref<number[]>([])
78
78
 
79
+ // picker 常从 dd-popup 内打开(父面板同属 popup 档 2001):遮罩必须高于父面板,否则被面板盖住、
80
+ // 点到面板无法关闭;取 popup+1 派生,sheet 与 mask 同档但 DOM 在后,仍压在遮罩之上。
81
+ // ponytail: 上限低于 dialog 档(2010),若将来 picker 要从 dd-dialog 内打开需再抬一档。
82
+ const maskZIndex = zIndexConfig.popup + 1
83
+ const sheetZIndex = zIndexConfig.popup + 1
84
+
79
85
  watch(
80
86
  () => normalizedColumns.value,
81
87
  (cols) => {
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <view v-if="pricePair" class="dd-price" :class="'dd-price--' + size">
2
+ <view
3
+ v-if="pricePair"
4
+ class="dd-price"
5
+ :class="['dd-price--' + size, { 'dd-price--custom-color': color }]"
6
+ :style="color ? { color } : undefined"
7
+ >
3
8
  <text v-if="prefix" class="dd-price__prefix">{{ prefix }}</text>
4
9
  <text class="dd-price__currency">{{ currency }}</text>
5
10
  <text class="dd-price__integer">{{ pricePair[0] }}</text>
@@ -24,8 +29,10 @@ interface Props {
24
29
  prefix?: string
25
30
  /** 额外后缀文案(如「起」) */
26
31
  suffix?: string
27
- /** 尺寸:sm 小号(购物车行/小卡)/ md 常规 / lg 大号(结算条/合计) */
28
- size?: 'sm' | 'md' | 'lg'
32
+ /** 尺寸:xxs 紧凑行最小号(房态卡片等 22rpx 正文旁)/ xs 最小号(一行四列小卡)/ sm 小号(购物车行/小卡)/ md 常规 / lg 大号(结算条/合计) */
33
+ size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg'
34
+ /** 主色(CSS 颜色/变量):整数、货币符、小数一起变色;不传则 inherit 跟随上下文(货币符/小数保持次级灰) */
35
+ color?: string
29
36
  }
30
37
 
31
38
  const props = withDefaults(defineProps<Props>(), {
@@ -36,6 +43,7 @@ const props = withDefaults(defineProps<Props>(), {
36
43
  prefix: '',
37
44
  suffix: '',
38
45
  size: 'md',
46
+ color: '',
39
47
  })
40
48
 
41
49
  const pricePair = computed<string[] | null>(() => {
@@ -80,6 +88,14 @@ const pricePair = computed<string[] | null>(() => {
80
88
  font-size: 24rpx;
81
89
  }
82
90
 
91
+ // 自定义主色:货币符/小数默认是次级灰,传 color 时统一跟随主色
92
+ &--custom-color {
93
+ .dd-price__currency,
94
+ .dd-price__decimal {
95
+ color: inherit;
96
+ }
97
+ }
98
+
83
99
  &__integer {
84
100
  font-size: 36rpx;
85
101
  }
@@ -98,6 +114,34 @@ const pricePair = computed<string[] | null>(() => {
98
114
  }
99
115
  }
100
116
 
117
+ // xs:超小号商品卡(一行四列),字号再压一档
118
+ &--xs {
119
+ .dd-price__prefix,
120
+ .dd-price__suffix,
121
+ .dd-price__currency,
122
+ .dd-price__decimal {
123
+ font-size: 18rpx;
124
+ }
125
+
126
+ .dd-price__integer {
127
+ font-size: 24rpx;
128
+ }
129
+ }
130
+
131
+ // xxs:紧凑行最小号(房态卡片等 22rpx 正文旁,整数对齐正文、符号再压一档)
132
+ &--xxs {
133
+ .dd-price__prefix,
134
+ .dd-price__suffix,
135
+ .dd-price__currency,
136
+ .dd-price__decimal {
137
+ font-size: 16rpx;
138
+ }
139
+
140
+ .dd-price__integer {
141
+ font-size: 22rpx;
142
+ }
143
+ }
144
+
101
145
  // lg:结算条 / 合计
102
146
  &--lg {
103
147
  .dd-price__prefix,
@@ -137,9 +137,12 @@ function onSubmit() {
137
137
  }
138
138
  }
139
139
 
140
+ // 占位块高度必须与固定条实际高度一致:条高由「按钮高度 + 上下内边距」决定(min-height 反而不生效),
141
+ // 原占位块固定 100rpx,在真机上是 100rpx + 安全区,比真实条矮约 16px,底部内容被遮住
140
142
  .dd-submit-bar__placeholder {
141
143
  width: 100%;
142
- height: 100rpx;
144
+ height: $dd-size-control-md;
145
+ padding: $dd-space-2 0;
143
146
  box-sizing: content-box;
144
147
 
145
148
  &--safe {
@@ -165,6 +168,9 @@ function onSubmit() {
165
168
  .dd-submit-bar__bar {
166
169
  display: flex;
167
170
  align-items: center;
171
+ // 显式 border-box:条高 = 按钮 88rpx + 上下内边距,与占位块的 content-box 镜像计算一致,
172
+ // 不受消费端是否引入 _reset.scss(全局 border-box)影响
173
+ box-sizing: border-box;
168
174
  min-height: 100rpx;
169
175
  padding: $dd-space-2 $dd-space-3;
170
176
  }
package/index.ts CHANGED
@@ -51,6 +51,7 @@ import DdFeatureGrid from './components/dd-feature-grid/dd-feature-grid.vue'
51
51
  import DdSticky from './components/dd-sticky/dd-sticky.vue'
52
52
  import DdBillDetail from './components/dd-bill-detail/dd-bill-detail.vue'
53
53
  import DdWorkorderCard from './components/dd-workorder-card/dd-workorder-card.vue'
54
+ import DdOrderList from './components/dd-order-list/dd-order-list.vue'
54
55
  import DdCalendar from './components/dd-calendar/dd-calendar.vue'
55
56
  import DdQrcode from './components/dd-qrcode/dd-qrcode.vue'
56
57
  import DdSubmitBar from './components/dd-submit-bar/dd-submit-bar.vue'
@@ -123,7 +124,7 @@ const components = {
123
124
  DdDrawer, DdTabbar, DdTabbarItem, DdBacktop,
124
125
  DdCollapse, DdCollapseItem, DdDropdownMenu, DdDropdownItem,
125
126
  DdSidebar, DdSidebarItem,
126
- DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdCalendar, DdQrcode,
127
+ DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdOrderList, DdCalendar, DdQrcode,
127
128
  DdSubmitBar,
128
129
  DdCartBar,
129
130
  DdTag, DdStatCard, DdChampionCard, DdAvatar, DdAvatarGroup, DdBadge,
@@ -156,7 +157,7 @@ export {
156
157
  DdDrawer, DdTabbar, DdTabbarItem, DdBacktop,
157
158
  DdCollapse, DdCollapseItem, DdDropdownMenu, DdDropdownItem,
158
159
  DdSidebar, DdSidebarItem,
159
- DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdCalendar, DdQrcode,
160
+ DdCard, DdRoomCard, DdGoodsCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdOrderList, DdCalendar, DdQrcode,
160
161
  DdSubmitBar,
161
162
  DdCartBar,
162
163
  DdTag, DdStatCard, DdChampionCard, DdAvatar, DdAvatarGroup, DdBadge,
@@ -190,5 +191,8 @@ export type {
190
191
  // 购物车条目类型(dd-cart-bar 配套)
191
192
  export type { DdCartItem } from './components/dd-cart-bar/cart-bar'
192
193
 
194
+ // 订单列表条目类型(dd-order-list 配套)
195
+ export type { DdOrderItem, DdOrderLine } from './components/dd-order-list/order-list'
196
+
193
197
  // 图标元数据(供 demo/文档消费,与 dd-icon.vue 内 SCSS &-- 规则保持一致)
194
198
  export { iconNames, iconGroups, iconLabels } from './components/dd-icon/dd-icon.vue'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didaoktv/didaoui-uniapp",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "帝到KTV UniApp 组件库",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -269,6 +269,7 @@ $dd-size-icon-lg: 24px !default;
269
269
  $dd-size-icon-xl: 32px !default;
270
270
 
271
271
  // 控件高度档位真源(ADR 0019):输入类与按钮类同档消费同一变量;值 = css.json size × 2(1px=2rpx)
272
+ $dd-size-control-xs: 52rpx !default;
272
273
  $dd-size-control-sm: 64rpx !default;
273
274
  $dd-size-control-compact: 72rpx !default;
274
275
  $dd-size-control-md: 88rpx !default;