@tplc/wot 0.1.13 → 0.1.14

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.14](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.28...v0.1.14) (2024-10-19)
6
+
5
7
  ### [0.1.13](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.27...v0.1.13) (2024-10-10)
6
8
 
7
9
  ### [0.1.12](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.11...v0.1.12) (2024-09-27)
@@ -43,7 +43,7 @@ $-color-aid: var(--wot-color-aid,
43
43
  $-color-tip: var(--wot-color-tip, #bfbfbf) !default; // 失效、默认提示文字 bfbfbf
44
44
  $-color-border: var(--wot-color-border, #d9d9d9) !default; // 控件边框线 d9d9d9
45
45
  $-color-border-light: var(--wot-color-border-light, #e8e8e8) !default; // 分割线颜色 e8e8e8
46
- $-color-bg: var(--wot-color-bg, #f5f5f5) !default; // 背景色、禁用填充色 f5f5f5
46
+ $-color-bg: var(--wot-color-bg, #F4F5F7) !default; // 背景色、禁用填充色 f5f5f5
47
47
  /* 暗黑模式 */
48
48
  $-dark-background: var(--wot-dark-background, #131313) !default;
49
49
  $-dark-background2: var(--wot-dark-background2, #1b1b1b) !default;
@@ -58,7 +58,7 @@ $-dark-color3: var(--wot-dark-color3, rgba(232, 230, 227, 0.8)) !default;
58
58
  $-dark-color-gray: var(--wot-dark-color-gray, $-color-secondary) !default;
59
59
  $-dark-border-color: var(--wot-dark-border-color, #3a3a3c) !default;
60
60
  /* 图形颜色 */
61
- $-color-icon: var(--wot-color-icon, #d9d9d9) !default; // icon颜色
61
+ $-color-icon: var(--wot-color-icon, #969696) !default; // icon颜色
62
62
  $-color-icon-active: var(--wot-color-icon-active, #eee) !default; // icon颜色hover
63
63
  $-color-icon-disabled: var(--wot-color-icon-disabled, #a7a7a7) !default; // icon颜色disabled
64
64
  /*----------------------------------------- Theme color. end -------------------------------------------*/
@@ -618,7 +618,7 @@ $-search-icon-color: var(--wot-search-icon-color, $-color-icon) !default; // 图
618
618
  $-search-icon-size: var(--wot-search-icon-size, 18px) !default; // 图标大小
619
619
  $-search-clear-icon-size: var(--wot-search-clear-icon-size, $-fs-title) !default; // 清除图标大小
620
620
  $-search-placeholder-color: var(--wot-search-placeholder-color,
621
- #bfbfbf) !default; // placeholder 颜色
621
+ #969696) !default; // placeholder 颜色
622
622
  $-search-cancel-padding: var(--wot-search-cancel-padding,
623
623
  0 $-search-side-padding 0 10px) !default; // 取消按钮间距
624
624
  $-search-cancel-fs: var(--wot-search-cancel-fs, $-fs-title) !default; // 取消按钮字号
@@ -1,9 +1,18 @@
1
1
  <template>
2
2
  <view :class="rootClass" @click="handleClick" :style="rootStyle">
3
- <image :class="`wd-img__image coverImg ${customImage}`" :src="wrapPhoto({ photo: src, width, type: 2 })"
4
- :mode="mode" :style="status != 'success' && {
5
- ...wrapPhoto({ photo: src, width: lazyPlaceWidth })
6
- }" :lazy-load="lazyLoad" @load="handleLoad" @error="handleError" />
3
+ <image
4
+ :class="`wd-img__image coverImg ${customImage}`"
5
+ :src="wrapPhoto({ photo: src, width, type: 2 })"
6
+ :mode="mode"
7
+ :style="
8
+ status != 'success' && {
9
+ ...wrapPhoto({ photo: src, width: lazyPlaceWidth }),
10
+ }
11
+ "
12
+ :lazy-load="lazyLoad"
13
+ @load="handleLoad"
14
+ @error="handleError"
15
+ />
7
16
  <slot v-if="status === 'loading'" name="loading"></slot>
8
17
  <slot v-if="status === 'error'" name="error"></slot>
9
18
  </view>
@@ -17,7 +26,7 @@ export default {
17
26
  styleIsolation: 'shared',
18
27
  },
19
28
  }
20
- //:style="`${status !== 'success' ? 'width: 0;height: 0;' : ''}`"
29
+ // :style="`${status !== 'success' ? 'width: 0;height: 0;' : ''}`"
21
30
  </script>
22
31
 
23
32
  <script lang="ts" setup>
@@ -66,19 +75,19 @@ function handleLoad(event: Event) {
66
75
  emit('load', event)
67
76
  }
68
77
 
69
- function wrapPhoto({
70
- photo,
71
- width = 200,
72
- otherParams = {},
73
- type = 1,
74
- }: any) {
75
- const isctyun = photo?.indexOf('.ctyun') >= 0;
76
- const sym = photo?.indexOf('?') > 0 ? '&' : '?';
77
- const suffix = isctyun ? `${sym}x-amz-process=image/resize,w_${width},m_lfit` : `${sym}x-oss-process=image/resize,m_mfit,w_${width}&imageView2/2/w/${width}`;
78
- const url = `${photo}${width > 0 ? suffix : ''}`;
79
- return type == 2 ? url : photo ? { backgroundImage: `url('${url}')`, ...otherParams } : otherParams;
78
+ function wrapPhoto({ photo, width = 200, otherParams = {}, type = 1 }: any) {
79
+ const isctyun = photo?.indexOf('.ctyun') >= 0
80
+ const sym = photo?.indexOf('?') > 0 ? '&' : '?'
81
+ const suffix = isctyun
82
+ ? `${sym}x-amz-process=image/resize,w_${width},m_lfit`
83
+ : `${sym}x-oss-process=image/resize,m_mfit,w_${width}&imageView2/2/w/${width}`
84
+ const url = `${photo}${width > 0 ? suffix : ''}`
85
+ return type === 2
86
+ ? url
87
+ : photo
88
+ ? { backgroundImage: `url('${url}')`, ...otherParams }
89
+ : otherParams
80
90
  }
81
-
82
91
  </script>
83
92
 
84
93
  <style lang="scss" scoped>
@@ -4,7 +4,6 @@ import { baseProps, makeRequiredProp, makeStringProp } from '../common/props'
4
4
  export const indexAnchorProps = {
5
5
  ...baseProps,
6
6
  index: makeRequiredProp([String, Number]),
7
- hint: makeStringProp(''),
8
7
  }
9
8
 
10
9
  export type IndexAnchorProps = ExtractPropTypes<typeof indexAnchorProps>
@@ -8,7 +8,7 @@
8
8
  :id="indexAnchorId"
9
9
  >
10
10
  <slot>
11
- {{ hint || index }}
11
+ {{ index }}
12
12
  </slot>
13
13
  </view>
14
14
  <!-- #ifdef MP-DINGTALK -->
@@ -46,7 +46,9 @@ function getInfo() {
46
46
  }
47
47
 
48
48
  onMounted(() => {
49
- getInfo()
49
+ setTimeout(() => {
50
+ getInfo()
51
+ }, 200)
50
52
  })
51
53
 
52
54
  defineExpose({
@@ -28,9 +28,9 @@
28
28
 
29
29
  @include e(index) {
30
30
  padding: 4px 6px;
31
- font-size: 12px;
31
+ font-size: 20rpx;
32
32
  font-weight: $-fw-medium;
33
- color: $-color-title;
33
+ color: $-color-theme;
34
34
 
35
35
  @include when(active) {
36
36
  color: $-color-theme;
@@ -19,7 +19,7 @@
19
19
  @touchcancel.stop.prevent="handleTouchEnd"
20
20
  >
21
21
  <view
22
- class="wd-index-bar__index"
22
+ class="wd-index-bar__index text-center"
23
23
  :class="{ 'is-active': item.index === state.activeIndex }"
24
24
  v-for="item in children"
25
25
  :key="item.index"
@@ -30,6 +30,7 @@
30
30
  <!-- #ifdef MP-DINGTALK -->
31
31
  </view>
32
32
  <!-- #endif -->
33
+ <wd-toast />
33
34
  </view>
34
35
  </template>
35
36
 
@@ -39,7 +40,8 @@ import { indexBarInjectionKey, indexBarProps } from './type'
39
40
  import { ref, getCurrentInstance, onMounted, reactive, nextTick, watch } from 'vue'
40
41
  import { getRect, isDef, uuid, requestAnimationFrame } from '../common/util'
41
42
  import { useChildren } from '../composables/useChildren'
42
-
43
+ import { useToast } from '../wd-toast'
44
+ const toast = useToast()
43
45
  const props = defineProps(indexBarProps)
44
46
 
45
47
  const indexBarId = ref<string>(`indexBar${uuid()}`)
@@ -96,7 +98,7 @@ function init() {
96
98
  sidebarInfo.offsetTop = sidebar.top!
97
99
  sidebarInfo.indexHeight = index.height!
98
100
  })
99
- }, 100)
101
+ }, 200)
100
102
  }
101
103
 
102
104
  onMounted(() => {
@@ -144,10 +146,18 @@ function handleTouchMove(e: TouchEvent) {
144
146
  state.activeIndex = getAnchorByPageY(clientY).index
145
147
  setScrollTop(getAnchorByPageY(clientY).$.exposed!.top.value - offsetTop)
146
148
  }
149
+ function showToast() {
150
+ if (state.activeIndex)
151
+ toast.show({
152
+ msg: `${state.activeIndex}`,
153
+ duration: 1500,
154
+ })
155
+ }
147
156
 
148
157
  function handleTouchEnd(e: TouchEvent) {
149
158
  const clientY = e.changedTouches[0].pageY
150
159
  state.activeIndex = getAnchorByPageY(clientY).index
160
+ showToast()
151
161
  setScrollTop(getAnchorByPageY(clientY).$.exposed!.top.value - offsetTop)
152
162
  requestAnimationFrame(() => {
153
163
  scrollState.touching = false
@@ -164,6 +174,17 @@ function setScrollTop(top: number) {
164
174
  scrollState.scrollTop = top
165
175
  }
166
176
  }
177
+ function scrollToIndex(index: AnchorIndex) {
178
+ const anchor = children.find((item) => item.index === index)
179
+ state.activeIndex = index
180
+ showToast()
181
+ if (anchor) {
182
+ setScrollTop(anchor.$.exposed!.top.value - offsetTop)
183
+ }
184
+ }
185
+ defineExpose({
186
+ scrollToIndex,
187
+ })
167
188
  </script>
168
189
 
169
190
  <style lang="scss" scoped>
@@ -44,25 +44,25 @@ const imgUrl = computed(() => {
44
44
  let img: string = ''
45
45
  switch (props.image) {
46
46
  case 'collect':
47
- img = 'https://img.wot-design-uni.cn/wdu/collect.png'
47
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/collect.png'
48
48
  break
49
49
  case 'comment':
50
- img = 'https://img.wot-design-uni.cn/wdu/comment.png'
50
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/comment.png'
51
51
  break
52
52
  case 'content':
53
- img = 'https://img.wot-design-uni.cn/wdu/content.png'
53
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/content.png'
54
54
  break
55
55
  case 'halo':
56
- img = 'https://img.wot-design-uni.cn/wdu/halo.png'
56
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/halo.png'
57
57
  break
58
58
  case 'message':
59
- img = 'https://img.wot-design-uni.cn/wdu/message.png'
59
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/message.png'
60
60
  break
61
61
  case 'network':
62
- img = 'https://img.wot-design-uni.cn/wdu/network.png'
62
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/network.png'
63
63
  break
64
64
  case 'search':
65
- img = 'https://img.wot-design-uni.cn/wdu/search.png'
65
+ img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/search.png'
66
66
  break
67
67
  default:
68
68
  img = props.image
@@ -49,7 +49,7 @@
49
49
  transform: translate3d(0, -40vh, 0);
50
50
  }
51
51
  @include m(middle) {
52
- transform: translate3d(0%, -18.8vh, 0);
52
+ transform: translate3d(0%, -4vh, 0);
53
53
  }
54
54
  @include m(bottom) {
55
55
  transform: translate3d(0, 40vh, 0);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "@tplc/wot",
3
3
  "name": "@tplc/wot",
4
- "version": "0.1.13",
4
+ "version": "0.1.14",
5
5
  "keywords": [
6
6
  "wot-design-uni",
7
7
  "国际化",
@@ -4,10 +4,6 @@ export declare const indexAnchorProps: {
4
4
  type: (NumberConstructor | StringConstructor)[]
5
5
  required: true
6
6
  }
7
- hint: {
8
- type: import('vue').PropType<string>
9
- default: string
10
- }
11
7
  customStyle: {
12
8
  type: import('vue').PropType<string>
13
9
  default: string
@@ -7,10 +7,6 @@ declare const __VLS_component: import('vue').DefineComponent<
7
7
  type: (NumberConstructor | StringConstructor)[]
8
8
  required: true
9
9
  }
10
- hint: {
11
- type: import('vue').PropType<string>
12
- default: string
13
- }
14
10
  customStyle: {
15
11
  type: import('vue').PropType<string>
16
12
  default: string
@@ -37,10 +33,6 @@ declare const __VLS_component: import('vue').DefineComponent<
37
33
  type: (NumberConstructor | StringConstructor)[]
38
34
  required: true
39
35
  }
40
- hint: {
41
- type: import('vue').PropType<string>
42
- default: string
43
- }
44
36
  customStyle: {
45
37
  type: import('vue').PropType<string>
46
38
  default: string
@@ -54,7 +46,6 @@ declare const __VLS_component: import('vue').DefineComponent<
54
46
  {
55
47
  customStyle: string
56
48
  customClass: string
57
- hint: string
58
49
  },
59
50
  {}
60
51
  >
@@ -1,3 +1,5 @@
1
+ import type { AnchorIndex } from './type'
2
+ declare function scrollToIndex(index: AnchorIndex): void
1
3
  declare function __VLS_template(): {
2
4
  default?(_: {}): any
3
5
  }
@@ -8,7 +10,9 @@ declare const __VLS_component: import('vue').DefineComponent<
8
10
  default: boolean
9
11
  }
10
12
  },
11
- {},
13
+ {
14
+ scrollToIndex: typeof scrollToIndex
15
+ },
12
16
  unknown,
13
17
  {},
14
18
  {},