@didaoktv/didaoui-uniapp 1.0.0 → 1.2.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 (114) hide show
  1. package/README.md +16 -7
  2. package/components/dd-action-sheet/dd-action-sheet.vue +3 -3
  3. package/components/dd-album/album.js +19 -0
  4. package/components/dd-album/dd-album.vue +345 -0
  5. package/components/dd-album/props.js +89 -0
  6. package/components/dd-avatar/avatar.js +19 -0
  7. package/components/dd-avatar/dd-avatar.vue +172 -160
  8. package/components/dd-avatar/props.js +84 -0
  9. package/components/dd-avatar-group/avatarGroup.js +14 -0
  10. package/components/dd-avatar-group/dd-avatar-group.vue +110 -0
  11. package/components/dd-avatar-group/props.js +57 -0
  12. package/components/dd-badge/dd-badge.vue +2 -2
  13. package/components/dd-barcode/dd-barcode.vue +1030 -0
  14. package/components/dd-bill-detail/dd-bill-detail.vue +265 -0
  15. package/components/dd-button/dd-button.vue +17 -17
  16. package/components/dd-calendar/dd-calendar.vue +357 -0
  17. package/components/dd-canvas/dd-canvas.vue +1088 -0
  18. package/components/dd-capsule-button/dd-capsule-button.vue +6 -6
  19. package/components/dd-car-keyboard/carKeyboard.js +6 -0
  20. package/components/dd-car-keyboard/dd-car-keyboard.vue +315 -0
  21. package/components/dd-car-keyboard/props.js +19 -0
  22. package/components/dd-cascader/dd-cascader.vue +405 -0
  23. package/components/dd-cell/dd-cell.vue +50 -23
  24. package/components/dd-cell-group/dd-cell-group.vue +32 -25
  25. package/components/dd-champion-card/dd-champion-card.vue +4 -4
  26. package/components/dd-checkbox/dd-checkbox.vue +30 -39
  27. package/components/dd-checkbox-group/dd-checkbox-group.vue +67 -0
  28. package/components/dd-copy/dd-copy.vue +74 -0
  29. package/components/dd-coupon/dd-coupon.vue +368 -0
  30. package/components/dd-cropper/dd-cropper.vue +1297 -0
  31. package/components/dd-dialog/dd-dialog.vue +1 -1
  32. package/components/dd-divider/dd-divider.vue +3 -3
  33. package/components/dd-dropdown-item/dd-dropdown-item.vue +5 -5
  34. package/components/dd-empty-state/dd-empty-state.vue +1 -1
  35. package/components/dd-field/dd-field.vue +531 -106
  36. package/components/dd-form/dd-form.vue +116 -0
  37. package/components/dd-form/rules.ts +84 -0
  38. package/components/dd-goods-sku/dd-goods-sku.vue +434 -0
  39. package/components/dd-icon/dd-icon.vue +2 -2
  40. package/components/dd-image/dd-image.vue +4 -4
  41. package/components/dd-input/dd-input.vue +5 -5
  42. package/components/dd-keyboard/dd-keyboard.vue +178 -0
  43. package/components/dd-keyboard/keyboard.js +22 -0
  44. package/components/dd-keyboard/props.js +89 -0
  45. package/components/dd-link/dd-link.vue +87 -0
  46. package/components/dd-link/link.js +18 -0
  47. package/components/dd-link/props.js +44 -0
  48. package/components/dd-list-cell/dd-list-cell.vue +4 -4
  49. package/components/dd-loading/dd-loading.vue +1 -1
  50. package/components/dd-loadmore/dd-loadmore.vue +2 -2
  51. package/components/dd-markdown/dd-markdown.vue +344 -0
  52. package/components/dd-markdown/marked.esm.mjs +7 -0
  53. package/components/dd-mini-program-navbar/dd-mini-program-navbar.vue +9 -9
  54. package/components/dd-navigation/dd-navigation.vue +5 -5
  55. package/components/dd-number-keyboard/dd-number-keyboard.vue +200 -0
  56. package/components/dd-number-keyboard/numberKeyboard.js +8 -0
  57. package/components/dd-number-keyboard/props.js +24 -0
  58. package/components/dd-parse/dd-parse.vue +534 -0
  59. package/components/dd-parse/node/handler.wxs +26 -0
  60. package/components/dd-parse/node/node.vue +603 -0
  61. package/components/dd-parse/parse.js +13 -0
  62. package/components/dd-parse/parser.js +1400 -0
  63. package/components/dd-parse/props.js +57 -0
  64. package/components/dd-popover/dd-popover.vue +10 -10
  65. package/components/dd-popover-item/dd-popover-item.vue +3 -3
  66. package/components/dd-popup/dd-popup.vue +5 -5
  67. package/components/dd-poster/dd-poster.vue +695 -0
  68. package/components/dd-progress/dd-progress.vue +3 -3
  69. package/components/dd-pull-refresh/dd-pull-refresh.vue +3 -3
  70. package/components/dd-qrcode/dd-qrcode.vue +509 -0
  71. package/components/dd-qrcode/qrcode.js +1283 -0
  72. package/components/dd-radio/dd-radio.vue +19 -20
  73. package/components/dd-radio-group/dd-radio-group.vue +53 -0
  74. package/components/dd-rate/dd-rate.vue +1 -1
  75. package/components/dd-room-card/dd-room-card.vue +3 -3
  76. package/components/dd-search-bar/dd-search-bar.vue +8 -8
  77. package/components/dd-segmented-tab/dd-segmented-tab.vue +6 -6
  78. package/components/dd-signature/dd-signature.vue +513 -0
  79. package/components/dd-skeleton/dd-skeleton.vue +1 -1
  80. package/components/dd-slider/dd-slider.vue +4 -4
  81. package/components/dd-stat-card/dd-stat-card.vue +5 -5
  82. package/components/dd-step/dd-step.vue +11 -11
  83. package/components/dd-stepper/dd-stepper.vue +6 -6
  84. package/components/dd-swipe-action/dd-swipe-action.vue +1 -1
  85. package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -1
  86. package/components/dd-tabbar-item/dd-tabbar-item.vue +8 -8
  87. package/components/dd-tag/dd-tag.vue +17 -1
  88. package/components/dd-text/dd-text.vue +250 -0
  89. package/components/dd-text/props.js +120 -0
  90. package/components/dd-text/text.js +30 -0
  91. package/components/dd-text/value.js +87 -0
  92. package/components/dd-toast/dd-toast.vue +2 -2
  93. package/components/dd-upload/dd-upload.vue +4 -4
  94. package/components/dd-workorder-card/dd-workorder-card.vue +237 -0
  95. package/index.ts +50 -9
  96. package/libs/config/color.js +16 -0
  97. package/libs/config/config.js +25 -0
  98. package/libs/config/props.js +185 -0
  99. package/libs/config/zIndex.js +20 -0
  100. package/libs/function/digit.js +167 -0
  101. package/libs/function/index.js +932 -0
  102. package/libs/function/test.js +327 -0
  103. package/libs/i18n/index.d.ts +2 -0
  104. package/libs/i18n/index.js +89 -0
  105. package/libs/i18n/locales/zh-Hans.js +86 -0
  106. package/libs/mixin/button.js +18 -0
  107. package/libs/mixin/mixin.js +44 -0
  108. package/libs/mixin/mpMixin.js +13 -0
  109. package/libs/mixin/openType.js +27 -0
  110. package/libs/utils.ts +462 -0
  111. package/libs/vue.js +3 -0
  112. package/package.json +1 -1
  113. package/scss/_dd-shared.scss +40 -0
  114. package/scss/_variables.scss +4 -1
@@ -6,7 +6,7 @@
6
6
  {
7
7
  'dd-checkbox--checked': isChecked,
8
8
  'dd-checkbox--indeterminate': indeterminate,
9
- 'dd-checkbox--disabled': disabled,
9
+ 'dd-checkbox--disabled': isDisabled,
10
10
  },
11
11
  ]"
12
12
  @click="onToggle"
@@ -22,51 +22,42 @@
22
22
  </template>
23
23
 
24
24
  <script setup lang="ts">
25
- import { computed } from 'vue'
25
+ import { computed, inject } from 'vue'
26
26
  import DdIcon from '../dd-icon/dd-icon.vue'
27
27
 
28
28
  interface Props {
29
- modelValue?: boolean | any[]
30
- value?: any
31
- indeterminate?: boolean
29
+ /** 选项值,dd-checkbox-group 的 modelValue 数组成员 */
30
+ value: any
32
31
  disabled?: boolean
33
32
  size?: 'md' | 'sm'
34
33
  label?: string
34
+ /** 半选态(受控展示,不参与 group 数组逻辑) */
35
+ indeterminate?: boolean
35
36
  }
36
37
 
37
38
  const props = withDefaults(defineProps<Props>(), {
38
- modelValue: false,
39
39
  value: null,
40
- indeterminate: false,
41
40
  disabled: false,
42
41
  size: 'md',
43
42
  label: '',
43
+ indeterminate: false,
44
44
  })
45
45
 
46
- const emit = defineEmits<{
47
- (e: 'update:modelValue', val: boolean | any[]): void
48
- (e: 'change', val: boolean | any[]): void
49
- }>()
46
+ // 必须配合 dd-checkbox-group 使用(vant/uview 同款约定)
47
+ const group = inject<{
48
+ props: { modelValue: any[]; disabled: boolean }
49
+ isMaxed: { value: boolean }
50
+ toggle: (value: any) => void
51
+ } | null>('dd-checkbox-group', null)
50
52
 
51
- const isChecked = computed(() => {
52
- if (Array.isArray(props.modelValue)) return props.modelValue.includes(props.value)
53
- return !!props.modelValue
54
- })
53
+ const isChecked = computed(() => !!group?.props.modelValue?.includes(props.value))
54
+ const isDisabled = computed(
55
+ () => props.disabled || !!group?.props.disabled || (!!group?.isMaxed.value && !isChecked.value)
56
+ )
55
57
 
56
58
  function onToggle() {
57
- if (props.disabled) return
58
- if (Array.isArray(props.modelValue)) {
59
- const arr = props.modelValue.slice()
60
- const idx = arr.indexOf(props.value)
61
- if (idx >= 0) arr.splice(idx, 1)
62
- else arr.push(props.value)
63
- emit('update:modelValue', arr)
64
- emit('change', arr)
65
- } else {
66
- const next = !props.modelValue
67
- emit('update:modelValue', next)
68
- emit('change', next)
69
- }
59
+ if (isDisabled.value || !group) return
60
+ group.toggle(props.value)
70
61
  }
71
62
  </script>
72
63
 
@@ -77,7 +68,7 @@ function onToggle() {
77
68
  .dd-checkbox {
78
69
  display: inline-flex;
79
70
  align-items: center;
80
- gap: 16rpx;
71
+ gap: $dd-space-2;
81
72
  user-select: none;
82
73
 
83
74
  &__box {
@@ -91,21 +82,21 @@ function onToggle() {
91
82
  }
92
83
 
93
84
  &__check {
94
- color: #ffffff;
95
- font-size: 24rpx;
85
+ color: $dd-color-white;
86
+ font-size: $dd-font-size-caption;
96
87
  font-weight: 700;
97
88
  line-height: 1;
98
89
  }
99
90
 
100
91
  &__dash {
101
92
  width: 60%;
102
- height: 4rpx;
93
+ height: $dd-space-1;
103
94
  background: $dd-primary-500;
104
95
  border-radius: $dd-radius-full;
105
96
  }
106
97
 
107
98
  &__label {
108
- font-size: 28rpx;
99
+ font-size: $dd-font-size-body;
109
100
  color: $dd-text-primary;
110
101
  }
111
102
 
@@ -127,19 +118,19 @@ function onToggle() {
127
118
  }
128
119
 
129
120
  .dd-checkbox--md .dd-checkbox__box {
130
- width: 40rpx;
131
- height: 40rpx;
121
+ width: $dd-size-icon-md;
122
+ height: $dd-size-icon-md;
132
123
  }
133
124
  .dd-checkbox--sm {
134
125
  .dd-checkbox__box {
135
- width: 32rpx;
136
- height: 32rpx;
126
+ width: $dd-size-icon-sm;
127
+ height: $dd-size-icon-sm;
137
128
  }
138
129
  .dd-checkbox__check {
139
- font-size: 20rpx;
130
+ font-size: $dd-font-size-caption;
140
131
  }
141
132
  .dd-checkbox__label {
142
- font-size: 28rpx;
133
+ font-size: $dd-font-size-body;
143
134
  }
144
135
  }
145
136
  </style>
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <view
3
+ class="dd-checkbox-group"
4
+ :class="{ 'dd-checkbox-group--vertical': direction === 'vertical' }"
5
+ >
6
+ <slot></slot>
7
+ </view>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { computed, provide } from 'vue'
12
+
13
+ interface Props {
14
+ modelValue?: any[]
15
+ disabled?: boolean
16
+ direction?: 'horizontal' | 'vertical'
17
+ /** 选中数达到 max 后禁止再选(已选项仍可取消) */
18
+ max?: number
19
+ }
20
+
21
+ const props = withDefaults(defineProps<Props>(), {
22
+ modelValue: () => [],
23
+ disabled: false,
24
+ direction: 'horizontal',
25
+ max: 0,
26
+ })
27
+
28
+ const emit = defineEmits<{
29
+ (e: 'update:modelValue', val: any[]): void
30
+ (e: 'change', val: any[]): void
31
+ }>()
32
+
33
+ const isMaxed = computed(() => props.max > 0 && props.modelValue.length >= props.max)
34
+
35
+ provide('dd-checkbox-group', {
36
+ props,
37
+ isMaxed,
38
+ toggle(value: any) {
39
+ const arr = props.modelValue.slice()
40
+ const idx = arr.indexOf(value)
41
+ if (idx >= 0) {
42
+ arr.splice(idx, 1)
43
+ } else {
44
+ if (isMaxed.value) return
45
+ arr.push(value)
46
+ }
47
+ emit('update:modelValue', arr)
48
+ emit('change', arr)
49
+ },
50
+ })
51
+ </script>
52
+
53
+ <style lang="scss" scoped>
54
+ .dd-checkbox-group {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ align-items: center;
58
+ gap: 32rpx;
59
+ width: 100%;
60
+
61
+ &--vertical {
62
+ flex-direction: column;
63
+ align-items: flex-start;
64
+ gap: 24rpx;
65
+ }
66
+ }
67
+ </style>
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <view @click="handleClick">
3
+ <slot>{{ t("dd.common.copy") }}</slot>
4
+ </view>
5
+ </template>
6
+ <script>
7
+ import { t } from '../../libs/i18n'
8
+ export default {
9
+ name: "up-copy",
10
+ props: {
11
+ content: {
12
+ type: String,
13
+ default: ''
14
+ },
15
+ alertStyle: {
16
+ type: String,
17
+ default: 'toast'
18
+ },
19
+ notice: {
20
+ type: String,
21
+ default: t("dd.common.copy") + t("dd.common.success")
22
+ }
23
+ },
24
+ emits: ['success'],
25
+ methods: {
26
+ t,
27
+ handleClick() {
28
+ let content = this.content;
29
+ if (!content) {
30
+ uni.showToast({
31
+ title: t("dd.common.none"),
32
+ icon: 'none',
33
+ duration: 2000,
34
+ });
35
+ return false;
36
+ }
37
+ content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
38
+ /**
39
+ * 复制逻辑
40
+ */
41
+ let that = this;
42
+ uni.setClipboardData({
43
+ data: content,
44
+ success: function() {
45
+ if (that.alertStyle == 'modal') {
46
+ uni.showModal({
47
+ title: t("dd.common.tip"),
48
+ content: that.notice
49
+ });
50
+ } else {
51
+ uni.showToast({
52
+ title: that.notice,
53
+ icon: 'none'
54
+ });
55
+ }
56
+ that.$emit('success');
57
+ },
58
+ fail:function(){
59
+ uni.showToast({
60
+ title: t("dd.common.copy") + t("dd.common.fail"),
61
+ icon: 'none',
62
+ duration:3000,
63
+ });
64
+ }
65
+ });
66
+ }
67
+ }
68
+ }
69
+ </script>
70
+
71
+ <style lang="scss" scoped>
72
+ @import '../../scss/variables';
73
+ @import '../../scss/dd-shared';
74
+ </style>
@@ -0,0 +1,368 @@
1
+ <template>
2
+ <view
3
+ class="dd-coupon"
4
+ :class="[
5
+ `dd-coupon--${shape}`,
6
+ `dd-coupon--${size}`,
7
+ { 'dd-coupon--disabled': disabled, [`dd-coupon--${type}`]: type },
8
+ ]"
9
+ :style="couponStyle"
10
+ @click="handleClick"
11
+ >
12
+ <view class="dd-coupon__content">
13
+ <!-- 左侧金额区域 -->
14
+ <view class="dd-coupon__amount">
15
+ <slot name="unit" :unit="unit" :unitPosition="unitPosition">
16
+ <text v-if="unitPosition === 'left'" class="dd-coupon__amount-unit">{{ unit }}</text>
17
+ </slot>
18
+ <slot name="amount" :amount="amount">
19
+ <text class="dd-coupon__amount-value">{{ amount }}</text>
20
+ </slot>
21
+ <slot name="unit" :unit="unit" :unitPosition="unitPosition">
22
+ <text v-if="unitPosition === 'right'" class="dd-coupon__amount-unit">{{ unit }}</text>
23
+ </slot>
24
+ <slot name="limit" :limit="limit">
25
+ <text v-if="limit" class="dd-coupon__amount-limit">{{ limit }}</text>
26
+ </slot>
27
+ </view>
28
+
29
+ <!-- 中间描述区域 -->
30
+ <view class="dd-coupon__info">
31
+ <slot name="title" :title="title">
32
+ <text class="dd-coupon__info-title">{{ title }}</text>
33
+ </slot>
34
+ <slot name="desc" :desc="desc">
35
+ <text v-if="desc" class="dd-coupon__info-desc">{{ desc }}</text>
36
+ </slot>
37
+ <slot name="time" :time="time">
38
+ <text v-if="time" class="dd-coupon__info-time">{{ time }}</text>
39
+ </slot>
40
+ </view>
41
+
42
+ <!-- 右侧操作区域 -->
43
+ <view class="dd-coupon__action">
44
+ <slot name="action" :actionText="actionText" :circle="circle">
45
+ <!-- ponytail: 原版 :shape="circle ? 'circle': 'circle'" 恒为圆形,故 round 恒 true -->
46
+ <dd-tag
47
+ variant="error"
48
+ :type="type ? 'outlined' : 'filled'"
49
+ round
50
+ size="sm"
51
+ class="dd-coupon__action-btn"
52
+ >{{ actionText }}</dd-tag>
53
+ </slot>
54
+ </view>
55
+ </view>
56
+
57
+ <!-- 红包绳子效果 -->
58
+ <view v-if="shape === 'envelope'" class="dd-coupon__rope"></view>
59
+
60
+ <!-- 默认插槽,可用于添加额外内容 -->
61
+ <slot></slot>
62
+ </view>
63
+ </template>
64
+
65
+ <script setup lang="ts">
66
+ import { computed } from 'vue'
67
+ import DdTag from '../dd-tag/dd-tag.vue'
68
+
69
+ interface Props {
70
+ /** 金额 */
71
+ amount?: string | number
72
+ /** 金额单位 */
73
+ unit?: string
74
+ /** 单位位置 */
75
+ unitPosition?: 'left' | 'right'
76
+ /** 使用限制 */
77
+ limit?: string
78
+ /** 标题 */
79
+ title?: string
80
+ /** 描述 */
81
+ desc?: string
82
+ /** 有效期 */
83
+ time?: string
84
+ /** 操作按钮文字 */
85
+ actionText?: string
86
+ /** 形状:coupon-优惠券, envelope-红包, card-卡片 */
87
+ shape?: 'coupon' | 'envelope' | 'card'
88
+ /** 尺寸:small, medium, large */
89
+ size?: 'small' | 'medium' | 'large'
90
+ /** 是否圆形按钮(保留 API;原实现恒为圆形) */
91
+ circle?: boolean
92
+ /** 是否禁用 */
93
+ disabled?: boolean
94
+ /** 背景颜色 */
95
+ bgColor?: string
96
+ /** 文字颜色 */
97
+ color?: string
98
+ /** 内置背景主题:primary/success/warning/error */
99
+ type?: string
100
+ }
101
+
102
+ const props = withDefaults(defineProps<Props>(), {
103
+ amount: '',
104
+ unit: '¥',
105
+ unitPosition: 'left',
106
+ limit: '',
107
+ title: '优惠券',
108
+ desc: '',
109
+ time: '',
110
+ actionText: '使用',
111
+ shape: 'coupon',
112
+ size: 'medium',
113
+ circle: false,
114
+ disabled: false,
115
+ bgColor: '',
116
+ color: '',
117
+ type: '',
118
+ })
119
+
120
+ const emit = defineEmits<{ (e: 'click'): void }>()
121
+
122
+ const couponStyle = computed(() => {
123
+ const style: Record<string, string> = {}
124
+ if (props.bgColor) style.background = props.bgColor
125
+ if (props.color) style.color = props.color
126
+ return style
127
+ })
128
+
129
+ function handleClick() {
130
+ if (props.disabled) return
131
+ emit('click')
132
+ }
133
+ </script>
134
+
135
+ <style lang="scss" scoped>
136
+ @import '../../scss/variables';
137
+ @import '../../scss/mixins';
138
+
139
+ .dd-coupon {
140
+ position: relative;
141
+ overflow: hidden;
142
+ border-radius: $dd-radius-md;
143
+ background: #ffebf0;
144
+ color: $dd-text-primary;
145
+ width: 100%;
146
+
147
+ &--coupon {
148
+ border-radius: $dd-radius-lg;
149
+ overflow: hidden;
150
+
151
+ &::before {
152
+ content: '';
153
+ position: absolute;
154
+ left: -24rpx;
155
+ top: 50%;
156
+ transform: translateY(-50%);
157
+ width: 48rpx;
158
+ height: 48rpx;
159
+ background-color: $dd-bg;
160
+ border-radius: 50%;
161
+ }
162
+
163
+ &::after {
164
+ content: '';
165
+ position: absolute;
166
+ right: -24rpx;
167
+ top: 50%;
168
+ transform: translateY(-50%);
169
+ width: 48rpx;
170
+ height: 48rpx;
171
+ background-color: $dd-bg;
172
+ border-radius: 50%;
173
+ }
174
+ }
175
+
176
+ &--envelope {
177
+ border-radius: $dd-radius-lg;
178
+
179
+ &::before {
180
+ content: '';
181
+ position: absolute;
182
+ left: 0;
183
+ top: 0;
184
+ right: 0;
185
+ height: 20rpx;
186
+ background: repeating-linear-gradient(-45deg, #ffd000, #ffd000 10rpx, #ffa000 10rpx, #ffa000 20rpx);
187
+ }
188
+ }
189
+
190
+ &--card {
191
+ border-radius: $dd-radius-lg;
192
+ }
193
+
194
+ &--small {
195
+ height: 160rpx;
196
+ }
197
+
198
+ &--medium {
199
+ height: 180rpx;
200
+ }
201
+
202
+ &--large {
203
+ height: 220rpx;
204
+ }
205
+
206
+ &--disabled {
207
+ opacity: 0.5;
208
+ }
209
+
210
+ &__content {
211
+ display: flex;
212
+ flex-direction: row;
213
+ align-items: center;
214
+ justify-content: space-between;
215
+ height: 100%;
216
+ padding: 0 30rpx;
217
+ position: relative;
218
+ z-index: 2;
219
+ }
220
+
221
+ &__amount {
222
+ display: flex;
223
+ flex-direction: column;
224
+ align-items: flex-start;
225
+ padding-left: 10rpx;
226
+ padding-right: 30rpx;
227
+ border-right: 1px dashed $dd-border-default;
228
+
229
+ &-unit {
230
+ font-size: $dd-font-size-caption;
231
+ font-weight: normal;
232
+ }
233
+
234
+ &-value {
235
+ font-size: 56rpx;
236
+ font-weight: bold;
237
+ color: $dd-error-400;
238
+ line-height: 1;
239
+ margin: 10rpx 0;
240
+ }
241
+
242
+ &-limit {
243
+ font-size: $dd-font-size-caption;
244
+ opacity: 0.9;
245
+ }
246
+ }
247
+
248
+ &__info {
249
+ flex: 1;
250
+ display: flex;
251
+ flex-direction: column;
252
+ align-items: flex-start;
253
+ padding-left: 30rpx;
254
+
255
+ &-title {
256
+ font-size: $dd-font-size-h4;
257
+ font-weight: bold;
258
+ margin-bottom: 10rpx;
259
+ }
260
+
261
+ &-desc {
262
+ font-size: $dd-font-size-caption;
263
+ opacity: 0.9;
264
+ margin-bottom: 10rpx;
265
+ }
266
+
267
+ &-time {
268
+ font-size: $dd-font-size-caption;
269
+ opacity: 0.8;
270
+ }
271
+ }
272
+
273
+ &__action {
274
+ display: flex;
275
+ flex-direction: row;
276
+ align-items: center;
277
+ justify-content: center;
278
+ padding-right: 20rpx;
279
+ }
280
+
281
+ &__rope {
282
+ position: absolute;
283
+ top: -40rpx;
284
+ left: 50%;
285
+ transform: translateX(-50%);
286
+ width: 80rpx;
287
+ height: 80rpx;
288
+ background: linear-gradient(to right, #ffd000, #ffa000);
289
+ border-radius: 40rpx 40rpx 0 0;
290
+ z-index: 1;
291
+
292
+ &::before {
293
+ content: '';
294
+ position: absolute;
295
+ top: 0;
296
+ left: -20rpx;
297
+ width: 20rpx;
298
+ height: 40rpx;
299
+ background: linear-gradient(to bottom, #ffd000, #ffa000);
300
+ border-radius: 10rpx 0 0 10rpx;
301
+ }
302
+
303
+ &::after {
304
+ content: '';
305
+ position: absolute;
306
+ top: 0;
307
+ right: -20rpx;
308
+ width: 20rpx;
309
+ height: 40rpx;
310
+ background: linear-gradient(to bottom, #ffd000, #ffa000);
311
+ border-radius: 0 10rpx 10rpx 0;
312
+ }
313
+ }
314
+
315
+ // 内置主题样式(保留原版券面渐变视觉)
316
+ &--primary {
317
+ background: linear-gradient(90deg, #43afff, #3b8cff);
318
+ color: $dd-color-white;
319
+
320
+ .dd-coupon__amount {
321
+ border-right: 1px dashed #eee;
322
+ }
323
+
324
+ .dd-coupon__amount-value {
325
+ color: $dd-color-white;
326
+ }
327
+ }
328
+
329
+ &--success {
330
+ background: linear-gradient(90deg, #67dda9, #19be6b);
331
+ color: $dd-color-white !important;
332
+
333
+ .dd-coupon__amount {
334
+ border-right: 1px dashed #eee;
335
+ }
336
+
337
+ .dd-coupon__amount-value {
338
+ color: $dd-color-white;
339
+ }
340
+ }
341
+
342
+ &--warning {
343
+ background: linear-gradient(90deg, #ff9739, #ff6a39);
344
+ color: $dd-color-white;
345
+
346
+ .dd-coupon__amount {
347
+ border-right: 1px dashed #eee;
348
+ }
349
+
350
+ .dd-coupon__amount-value {
351
+ color: $dd-color-white;
352
+ }
353
+ }
354
+
355
+ &--error {
356
+ background: linear-gradient(90deg, #ff7070, #ff4747);
357
+ color: $dd-color-white;
358
+
359
+ .dd-coupon__amount {
360
+ border-right: 1px dashed #eee;
361
+ }
362
+
363
+ .dd-coupon__amount-value {
364
+ color: $dd-color-white;
365
+ }
366
+ }
367
+ }
368
+ </style>