@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 +2 -0
- package/components/common/abstracts/variable.scss +3 -3
- package/components/wd-img/wd-img.vue +26 -17
- package/components/wd-index-anchor/type.ts +0 -1
- package/components/wd-index-anchor/wd-index-anchor.vue +4 -2
- package/components/wd-index-bar/index.scss +2 -2
- package/components/wd-index-bar/wd-index-bar.vue +24 -3
- package/components/wd-status-tip/wd-status-tip.vue +7 -7
- package/components/wd-toast/index.scss +1 -1
- package/package.json +1 -1
- package/types/components/wd-index-anchor/type.d.ts +0 -4
- package/types/components/wd-index-anchor/wd-index-anchor.vue.d.ts +0 -9
- package/types/components/wd-index-bar/wd-index-bar.vue.d.ts +5 -1
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, #
|
|
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, #
|
|
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
|
-
#
|
|
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
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
{{
|
|
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
|
-
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
getInfo()
|
|
51
|
+
}, 200)
|
|
50
52
|
})
|
|
51
53
|
|
|
52
54
|
defineExpose({
|
|
@@ -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
|
-
},
|
|
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://
|
|
47
|
+
img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/collect.png'
|
|
48
48
|
break
|
|
49
49
|
case 'comment':
|
|
50
|
-
img = 'https://
|
|
50
|
+
img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/comment.png'
|
|
51
51
|
break
|
|
52
52
|
case 'content':
|
|
53
|
-
img = 'https://
|
|
53
|
+
img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/content.png'
|
|
54
54
|
break
|
|
55
55
|
case 'halo':
|
|
56
|
-
img = 'https://
|
|
56
|
+
img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/halo.png'
|
|
57
57
|
break
|
|
58
58
|
case 'message':
|
|
59
|
-
img = 'https://
|
|
59
|
+
img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/message.png'
|
|
60
60
|
break
|
|
61
61
|
case 'network':
|
|
62
|
-
img = 'https://
|
|
62
|
+
img = 'https://qdll-lycs.oss-cn-nanjing.aliyuncs.com/staticSaas/basis/network.png'
|
|
63
63
|
break
|
|
64
64
|
case 'search':
|
|
65
|
-
img = 'https://
|
|
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
|
package/package.json
CHANGED
|
@@ -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
|
{},
|