@tplc/wot 0.1.81 β†’ 0.1.83

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,24 @@
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.83](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.75...v0.1.83) (2025-04-25)
6
+
7
+ ### [0.1.82](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.69...v0.1.82) (2025-04-15)
8
+
9
+
10
+ ### πŸš€ Chore | ζž„ε»Ί/ε·₯程依衖/ε·₯ε…·
11
+
12
+ * **release:** 0.1.81 ([2eefeaa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2eefeaa58ed163bf48b072cf66c56768d33e5b34))
13
+ * **release:** 0.4.70 ([5c937e7](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5c937e7cf7f8f6c7331a746f854548cfb331bd3d))
14
+ * **release:** 0.4.71 ([5994b47](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5994b473a5182bfef6741625020e0a50a235af69))
15
+ * **release:** 0.4.72 ([b60babe](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b60babefcbb146371d3b79b46905f286cbf56b75))
16
+
17
+
18
+ ### ✨ Features | ζ–°εŠŸθƒ½
19
+
20
+ * θ°ƒζ•΄ζ΅‹θ―• ([987ae45](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/987ae45c379759df9b48f925e29f1f3be06a5de1))
21
+ * θ°ƒζ•΄ηΌ“ε­˜η­–η•₯ ([45900e3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/45900e3c2619ed2c5dadcfa49da3a98aa73d79f6))
22
+
5
23
  ### [0.1.81](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.68...v0.1.81) (2025-04-12)
6
24
 
7
25
 
@@ -7,7 +7,6 @@
7
7
  :mode="mode"
8
8
  :lazy-load="lazyLoad"
9
9
  />
10
-
11
10
  <image
12
11
  :class="`wd-img__image coverImg ${customImage}`"
13
12
  :src="wrapPhoto({ photo: src, width, type: 1 })"
@@ -35,7 +34,7 @@ export default {
35
34
 
36
35
  <script lang="ts" setup>
37
36
  import { computed, ref, watch } from 'vue'
38
- import { addUnit, isDef, objToStyle } from '../common/util'
37
+ import { addUnit, isDef, isVideoUrl, objToStyle } from '../common/util'
39
38
  import { imgProps } from './types'
40
39
 
41
40
  const props = defineProps(imgProps)
@@ -101,6 +100,14 @@ function wrapPhoto({ photo, width = 100, type = 1 }: any) {
101
100
 
102
101
  const isctyun = photo?.indexOf('.ctyun') >= 0
103
102
  const sym = photo?.indexOf('?') > 0 ? '&' : '?'
103
+ if (isVideoUrl(photo)) {
104
+ const suffix = isctyun
105
+ ? `${sym}x-amz-process=video/snapshot,t_2000,w_${finalWidth},m_lfit`
106
+ : `${sym}x-oss-process=video/snapshot,t_2000,w_${finalWidth}&imageView2/2/w/${finalWidth}`
107
+ const url = `${photo}${suffix}`
108
+ console.log(url, 'url')
109
+ return url
110
+ }
104
111
  const suffix = isctyun
105
112
  ? `${sym}x-amz-process=image/resize,w_${finalWidth},m_lfit`
106
113
  : `${sym}x-oss-process=image/resize,m_mfit,w_${finalWidth}&imageView2/2/w/${finalWidth}`
@@ -18,40 +18,39 @@
18
18
  @animationfinish="handleAnimationfinish"
19
19
  >
20
20
  <swiper-item
21
- v-for="(item, index) in list"
21
+ v-for="(item, index) in innerList"
22
22
  :key="index"
23
23
  class="wd-swiper__item"
24
24
  :style="{ paddingRight: itemPadding, paddingLeft: itemPadding }"
25
25
  @click="handleClick(index, item)"
26
26
  >
27
27
  <view
28
- :class="`wd-swiper__image overflow-hidden ${customImageClass} ${getCustomImageClass(navCurrent, index, list)}`"
28
+ :class="`wd-swiper__image relative overflow-hidden ${customImageClass} ${getCustomImageClass(navCurrent, index, list)}`"
29
29
  :style="{
30
30
  borderRadius: imageRadius,
31
31
  height: getCustomImageHeight(navCurrent, index, list),
32
-
33
32
  width: imgWidth ? addUnit(imgWidth) : undefined,
34
33
  }"
35
34
  >
36
- <lcb-action-view
37
- v-if="action && typeof item === 'object'"
38
- v-bind="item.link"
39
- customClass="w-full h-full"
40
- >
41
- <wd-img
42
- :src="isObj(item) ? item[valueKey] : item"
43
- height="100%"
44
- width="100%"
45
- :mode="imageMode"
46
- />
47
- </lcb-action-view>
48
- <wd-img
49
- v-else
50
- :src="isObj(item) ? item[valueKey] : item"
51
- height="100%"
52
- width="100%"
53
- :mode="imageMode"
54
- />
35
+ <template v-if="item.videoUrl">
36
+ <wd-img :src="item.url" height="100%" width="100%" :mode="imageMode" />
37
+ <view
38
+ class="absolute top-0 left-0 w-full h-full flex items-center justify-center bg-black/50"
39
+ @click.stop="handlePreviewVieo(item.videoUrl)"
40
+ >
41
+ <wd-icon name="play-circle-filled" size="90rpx" color="#fff"></wd-icon>
42
+ </view>
43
+ </template>
44
+ <template v-else>
45
+ <lcb-action-view
46
+ v-if="action && typeof item === 'object'"
47
+ v-bind="item.link"
48
+ customClass="w-full h-full"
49
+ >
50
+ <wd-img :src="item.url" height="100%" width="100%" :mode="imageMode" />
51
+ </lcb-action-view>
52
+ <wd-img v-else :src="item.url" height="100%" width="100%" :mode="imageMode" />
53
+ </template>
55
54
  </view>
56
55
  </swiper-item>
57
56
  </swiper>
@@ -72,20 +71,21 @@
72
71
  :customStyle="indicatorCustomStyle"
73
72
  />
74
73
  </template>
74
+ <wd-video-preview ref="videoPreview"></wd-video-preview>
75
75
  </view>
76
76
  </template>
77
77
 
78
78
  <script lang="ts" setup>
79
- import { computed, watch, ref, useSlots } from 'vue'
80
- import { addUnit, isObj } from '../common/util'
79
+ import { computed, watch, ref } from 'vue'
80
+ import { addUnit, isObj, isVideoUrl } from '../common/util'
81
81
  import { swiperProps, type SwiperList } from './types'
82
82
  import type { SwiperNavProps } from '../wd-swiper-nav/types'
83
+ import { VideoPreviewInstance } from '../wd-video-preview/types'
83
84
 
84
85
  const props = defineProps(swiperProps)
85
86
  const emit = defineEmits(['click', 'change', 'animationfinish', 'update:current'])
86
87
  const navCurrent = ref<number>(0) // 当前滑块
87
- const slots = useSlots()
88
-
88
+ const videoPreview = ref<VideoPreviewInstance>()
89
89
  watch(
90
90
  () => props.current,
91
91
  (val) => {
@@ -117,6 +117,43 @@ const swiperIndicator = computed(() => {
117
117
  return swiperIndicator
118
118
  })
119
119
 
120
+ const innerList = computed(() => {
121
+ return props.list.map((item) => {
122
+ const url = isObj(item) ? item[props.valueKey] : item
123
+ return {
124
+ url,
125
+ videoUrl: isVideoUrl(url) ? url : '',
126
+ ...(isObj(item) ? item : {}),
127
+ }
128
+ }) as SwiperList[]
129
+ })
130
+
131
+ /**
132
+ * ι’„θ§ˆθ§†ι’‘
133
+ * @param index
134
+ * @param lists
135
+ */
136
+ function handlePreviewVieo(url: string) {
137
+ // #ifdef MP-WEIXIN
138
+ uni.previewMedia({
139
+ sources: [
140
+ {
141
+ url,
142
+ type: 'video',
143
+ poster: '',
144
+ },
145
+ ],
146
+ })
147
+ // #endif
148
+
149
+ // #ifndef MP-WEIXIN
150
+ videoPreview.value?.open({
151
+ url,
152
+ poster: '',
153
+ })
154
+ // #endif
155
+ }
156
+
120
157
  function go(index: number) {
121
158
  navCurrent.value = index
122
159
  }
@@ -72,6 +72,10 @@ export const tabsProps = {
72
72
  * 字体倧小
73
73
  */
74
74
  itemFontSize: makeStringProp(28),
75
+ /**
76
+ * 字体粗细
77
+ */
78
+ itemFontWeight: makeStringProp('normal'),
75
79
  }
76
80
 
77
81
  export type TabsProps = ExtractPropTypes<typeof tabsProps>
@@ -21,7 +21,7 @@
21
21
  v-for="(item, index) in items"
22
22
  :key="index"
23
23
  :class="`wd-tabs__nav-item ${state.activeIndex === index ? 'is-active' : ''} ${item.disabled ? 'is-disabled' : ''}`"
24
- :style="`color:${state.activeIndex === index ? color : inactiveColor};font-size:${itemFontSize}rpx`"
24
+ :style="`color:${state.activeIndex === index ? color : inactiveColor};font-size:${itemFontSize}rpx;font-weight:${itemFontWeight}`"
25
25
  >
26
26
  {{ item.title }}
27
27
  </view>
@@ -58,7 +58,7 @@
58
58
  >
59
59
  <view
60
60
  :class="`wd-tabs__map-nav-btn ${state.activeIndex === index ? 'is-active' : ''} ${item.disabled ? 'is-disabled' : ''}`"
61
- :style="`color:${state.activeIndex === index ? color : inactiveColor};font-size:${itemFontSize}rpx`"
61
+ :style="`color:${state.activeIndex === index ? color : inactiveColor};font-size:${itemFontSize}rpx;font-weight:${itemFontWeight}`"
62
62
  >
63
63
  {{ item.title }}
64
64
  </view>
@@ -110,7 +110,7 @@
110
110
  @click="handleSelect(index)"
111
111
  :key="index"
112
112
  :class="`wd-tabs__nav-item ${state.activeIndex === index ? 'is-active' : ''} ${item.disabled ? 'is-disabled' : ''}`"
113
- :style="`color:${state.activeIndex === index ? color : inactiveColor};font-size:${itemFontSize}rpx`"
113
+ :style="`color:${state.activeIndex === index ? color : inactiveColor};font-size:${itemFontSize}rpx;font-weight:${itemFontWeight}`"
114
114
  >
115
115
  {{ item.title }}
116
116
  </view>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "@tplc/wot",
3
3
  "name": "@tplc/wot",
4
- "version": "0.1.81",
4
+ "version": "0.1.83",
5
5
  "keywords": [
6
6
  "wot-design-uni",
7
7
  "ε›½ι™…εŒ–",
@@ -96,6 +96,13 @@ export declare const tabsProps: {
96
96
  type: import('vue').PropType<number>
97
97
  default: number
98
98
  }
99
+ /**
100
+ * 字体粗细
101
+ */
102
+ itemFontWeight: {
103
+ type: import('vue').PropType<string>
104
+ default: string
105
+ }
99
106
  customStyle: {
100
107
  type: import('vue').PropType<string>
101
108
  default: string
@@ -51,6 +51,10 @@ declare const _default: __VLS_WithTemplateSlots<
51
51
  type: import('vue').PropType<number>
52
52
  default: number
53
53
  }
54
+ itemFontWeight: {
55
+ type: import('vue').PropType<string>
56
+ default: string
57
+ }
54
58
  customStyle: {
55
59
  type: import('vue').PropType<string>
56
60
  default: string
@@ -130,6 +134,10 @@ declare const _default: __VLS_WithTemplateSlots<
130
134
  type: import('vue').PropType<number>
131
135
  default: number
132
136
  }
137
+ itemFontWeight: {
138
+ type: import('vue').PropType<string>
139
+ default: string
140
+ }
133
141
  customStyle: {
134
142
  type: import('vue').PropType<string>
135
143
  default: string
@@ -160,6 +168,7 @@ declare const _default: __VLS_WithTemplateSlots<
160
168
  swipeable: boolean
161
169
  animated: boolean
162
170
  itemFontSize: number
171
+ itemFontWeight: string
163
172
  },
164
173
  {}
165
174
  >,