@tplc/wot 0.1.62 → 0.1.63

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.76...v0.1.63) (2025-03-10)
6
+
5
7
  ### [0.1.62](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.57...v0.1.62) (2025-02-24)
6
8
 
7
9
 
@@ -3,13 +3,13 @@
3
3
  <image
4
4
  v-if="status !== 'success'"
5
5
  :class="`wd-img__image coverImg ${customImage}`"
6
- :src="wrapPhoto({ photo: src, width: lazyPlaceWidth })"
6
+ :src="wrapPhoto({ photo: src, width: lazyPlaceWidth, type: 2 })"
7
7
  :mode="mode"
8
8
  :lazy-load="lazyLoad"
9
9
  />
10
10
  <image
11
11
  :class="`wd-img__image coverImg ${customImage}`"
12
- :src="wrapPhoto({ photo: src, width, type: 2 })"
12
+ :src="wrapPhoto({ photo: src, width, type: 1 })"
13
13
  :mode="mode"
14
14
  :lazy-load="lazyLoad"
15
15
  @load="handleLoad"
@@ -35,7 +35,7 @@ export default {
35
35
  </script>
36
36
 
37
37
  <script lang="ts" setup>
38
- import { computed, ref } from 'vue'
38
+ import { computed, ref, watch } from 'vue'
39
39
  import { addUnit, isDef, objToStyle } from '../common/util'
40
40
  import { imgProps } from './types'
41
41
 
@@ -80,15 +80,41 @@ function handleLoad(event: Event) {
80
80
  emit('load', event)
81
81
  }
82
82
 
83
- function wrapPhoto({ photo, width = 200, type = 1 }: any) {
83
+ function wrapPhoto({ photo, width = 100, type = 1 }: any) {
84
+ let finalWidth = width
85
+ if (type === 1) {
86
+ if (typeof width === 'string') {
87
+ const imgWidth = parseInt(width.replace('rpx', ''))
88
+ if (width.includes('rpx')) {
89
+ finalWidth = imgWidth * 6
90
+ } else if (width.includes('px')) {
91
+ finalWidth = imgWidth * 3
92
+ } else if (width.includes('%')) {
93
+ finalWidth = 1500
94
+ }
95
+ } else {
96
+ finalWidth = width * 3
97
+ }
98
+ if (finalWidth > 1500) {
99
+ finalWidth = 1500
100
+ }
101
+ }
102
+
84
103
  const isctyun = photo?.indexOf('.ctyun') >= 0
85
104
  const sym = photo?.indexOf('?') > 0 ? '&' : '?'
86
105
  const suffix = isctyun
87
- ? `${sym}x-amz-process=image/resize,w_${width},m_lfit`
88
- : `${sym}x-oss-process=image/resize,m_mfit,w_${width}&imageView2/2/w/${width}`
89
- const url = `${photo}${width > 0 ? suffix : ''}`
106
+ ? `${sym}x-amz-process=image/resize,w_${finalWidth},m_lfit`
107
+ : `${sym}x-oss-process=image/resize,m_mfit,w_${finalWidth}&imageView2/2/w/${finalWidth}`
108
+ const url = `${photo}${suffix}`
90
109
  return url
91
110
  }
111
+
112
+ watch(
113
+ () => props.src,
114
+ () => {
115
+ status.value = 'loading'
116
+ },
117
+ )
92
118
  </script>
93
119
 
94
120
  <style lang="scss" scoped>
@@ -215,6 +215,8 @@ export const swiperProps = {
215
215
  radius: makeStringProp(''),
216
216
 
217
217
  action: makeBooleanProp(false),
218
+
219
+ indicatorCustomStyle: makeStringProp(''),
218
220
  }
219
221
 
220
222
  export type SwiperProps = ExtractPropTypes<typeof swiperProps>
@@ -67,6 +67,7 @@
67
67
  :min-show-num="swiperIndicator.minShowNum"
68
68
  :show-controls="swiperIndicator.showControls"
69
69
  @change="handleIndicatorChange"
70
+ :customStyle="indicatorCustomStyle"
70
71
  />
71
72
  </template>
72
73
  </view>
@@ -37,6 +37,14 @@ export const swiperNavprops = {
37
37
  * 指示器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等
38
38
  */
39
39
  type: makeStringProp<SwiperIndicatorType>('dots'),
40
+ /**
41
+ * 指示器活动颜色
42
+ */
43
+ activityColor: makeStringProp('var(--wot-color-theme)'),
44
+ /**
45
+ * 指示器非活动颜色
46
+ */
47
+ inactiveColor: makeStringProp('#e7e7e7'),
40
48
  }
41
49
 
42
50
  export type SwiperNavProps = ExtractPropTypes<typeof swiperNavprops>
@@ -13,6 +13,9 @@
13
13
  v-for="(item, index) in total"
14
14
  :key="index"
15
15
  :class="`wd-swiper-nav__item--${type} ${current === index ? 'is-active' : ''} is-${direction}`"
16
+ :style="{
17
+ backgroundColor: current === index ? activityColor : inactiveColor,
18
+ }"
16
19
  ></view>
17
20
  </block>
18
21
  <block v-if="type === 'fraction'">{{ current + 1 }}/{{ total }}</block>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "@tplc/wot",
3
3
  "name": "@tplc/wot",
4
- "version": "0.1.62",
4
+ "version": "0.1.63",
5
5
  "keywords": [
6
6
  "wot-design-uni",
7
7
  "国际化",
@@ -250,6 +250,10 @@ export declare const swiperProps: {
250
250
  type: BooleanConstructor
251
251
  default: boolean
252
252
  }
253
+ indicatorCustomStyle: {
254
+ type: PropType<string>
255
+ default: string
256
+ }
253
257
  customStyle: {
254
258
  type: PropType<string>
255
259
  default: string
@@ -127,6 +127,10 @@ declare const __VLS_component: import('vue').DefineComponent<
127
127
  type: BooleanConstructor
128
128
  default: boolean
129
129
  }
130
+ indicatorCustomStyle: {
131
+ type: import('vue').PropType<string>
132
+ default: string
133
+ }
130
134
  customStyle: {
131
135
  type: import('vue').PropType<string>
132
136
  default: string
@@ -274,6 +278,10 @@ declare const __VLS_component: import('vue').DefineComponent<
274
278
  type: BooleanConstructor
275
279
  default: boolean
276
280
  }
281
+ indicatorCustomStyle: {
282
+ type: import('vue').PropType<string>
283
+ default: string
284
+ }
277
285
  customStyle: {
278
286
  type: import('vue').PropType<string>
279
287
  default: string
@@ -321,6 +329,7 @@ declare const __VLS_component: import('vue').DefineComponent<
321
329
  customNextImageClass: string
322
330
  itemPadding: string
323
331
  imageRadius: string
332
+ indicatorCustomStyle: string
324
333
  },
325
334
  {}
326
335
  >
@@ -54,6 +54,20 @@ export declare const swiperNavprops: {
54
54
  type: import('vue').PropType<SwiperIndicatorType>
55
55
  default: SwiperIndicatorType
56
56
  }
57
+ /**
58
+ * 指示器活动颜色
59
+ */
60
+ activityColor: {
61
+ type: import('vue').PropType<string>
62
+ default: string
63
+ }
64
+ /**
65
+ * 指示器非活动颜色
66
+ */
67
+ inactiveColor: {
68
+ type: import('vue').PropType<string>
69
+ default: string
70
+ }
57
71
  customStyle: {
58
72
  type: import('vue').PropType<string>
59
73
  default: string
@@ -28,6 +28,14 @@ declare const _default: import('vue').DefineComponent<
28
28
  type: import('vue').PropType<import('./types').SwiperIndicatorType>
29
29
  default: import('./types').SwiperIndicatorType
30
30
  }
31
+ activityColor: {
32
+ type: import('vue').PropType<string>
33
+ default: string
34
+ }
35
+ inactiveColor: {
36
+ type: import('vue').PropType<string>
37
+ default: string
38
+ }
31
39
  customStyle: {
32
40
  type: import('vue').PropType<string>
33
41
  default: string
@@ -78,6 +86,14 @@ declare const _default: import('vue').DefineComponent<
78
86
  type: import('vue').PropType<import('./types').SwiperIndicatorType>
79
87
  default: import('./types').SwiperIndicatorType
80
88
  }
89
+ activityColor: {
90
+ type: import('vue').PropType<string>
91
+ default: string
92
+ }
93
+ inactiveColor: {
94
+ type: import('vue').PropType<string>
95
+ default: string
96
+ }
81
97
  customStyle: {
82
98
  type: import('vue').PropType<string>
83
99
  default: string
@@ -97,9 +113,11 @@ declare const _default: import('vue').DefineComponent<
97
113
  current: number
98
114
  direction: import('../wd-swiper/types').DirectionType
99
115
  total: number
116
+ inactiveColor: string
100
117
  minShowNum: number
101
118
  indicatorPosition: import('../wd-swiper/types').IndicatorPositionType
102
119
  showControls: boolean
120
+ activityColor: string
103
121
  },
104
122
  {}
105
123
  >