@tplc/business 0.2.39 → 0.2.40

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,20 @@
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.2.40](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.38...v0.2.40) (2024-12-27)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.2.39 ([188053e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/188053edc4e98d208740c6a364aba343fa146f18))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * 支持头像昵称 ([a1061f0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a1061f0646637c797cdd2f5d9dbadd0862256398))
16
+ * 新增测试waterfall ([34b352d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/34b352dffc3fcc852a658e34ac673bd5d1c77a4d))
17
+ * 更新product ([3fb575b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3fb575b7be9ec92b10c3cd36d19ee9593999bb4a))
18
+
5
19
  ### [0.2.39](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.46...v0.2.39) (2024-12-27)
6
20
 
7
21
 
@@ -2,7 +2,7 @@ import { FilterTabsProps } from './components/FilterTabs/type'
2
2
  import { Option } from './types'
3
3
  export interface LcbListInfo {
4
4
  url: string
5
- baseParam: Record<string, unknown>
5
+ baseParam?: Record<string, unknown>
6
6
  }
7
7
  export interface LcbFilterResult {
8
8
  btnComponent: BtnComponent
@@ -18,7 +18,7 @@
18
18
  import { inject, Ref, ref, watch, watchEffect } from 'vue'
19
19
  import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging'
20
20
  import { FORM_KEY } from '../../../../constants'
21
- import { formatJson, getPageOptions } from '../../../../utils/utils'
21
+ import { getPageOptions } from '../../../../utils/utils'
22
22
  import { LcbFilterListProps } from './type'
23
23
  import useAutoHeight from '../../../../hooks/useAutoHeight'
24
24
 
@@ -40,33 +40,7 @@ const modelValue = defineModel<unknown[]>({
40
40
  default: [],
41
41
  })
42
42
  watchEffect(() => {
43
- const list = dataList.value?.map?.((item: any) => {
44
- return item
45
- // // 以下假数据无效
46
- // // const imgArr = formatJson(item.coverImg, [])
47
- // // const tags = formatJson(item.tags, [])
48
- // // eslint-disable-next-line no-unreachable
49
- // return {
50
- // title: item?.productName,
51
- // addressIntro: item?.address,
52
- // price: item?.price,
53
- // priceSuffix: item?.behindUnit,
54
- // subTitle: '专用通道接送8分钟到候机楼',
55
- // score: 4.7,
56
- // scoreTips: '很好',
57
- // level: 4,
58
- // // imgCornerIcon: 'test',
59
- // // imgBottomIcon: 'test',
60
- // titleIcon: 'I',
61
- // userInteractionInfo: '2991点评 · 8039收藏',
62
- // orderTips: '18分钟前有人预定',
63
- // priceTips: '白银贵宾价 | 十亿豪补 | 2项优惠',
64
- // ...item,
65
- // // coverImg: imgArr?.[1] || imgArr?.[0],
66
- // // tags,
67
- // }
68
- })
69
- modelValue.value = list
43
+ modelValue.value = dataList.value
70
44
  })
71
45
 
72
46
  watch(
@@ -45,6 +45,7 @@
45
45
  <lcb-product v-bind="{ ...attrs, form }" :listType="listType" :items="items" v-else />
46
46
  </template>
47
47
  </FilterList>
48
+ <lcb-map v-else-if="mode === 'map'" v-bind="{ ...info.listInfo, ...attrs }" />
48
49
  </template>
49
50
  </template>
50
51
 
@@ -116,10 +117,6 @@ watch(
116
117
  immediate: true,
117
118
  },
118
119
  )
119
- defineSlots<{
120
- list(props: { items: any }): any
121
- item(props: { item: any }): any
122
- }>()
123
120
  </script>
124
121
 
125
122
  <style lang="scss" scoped>
@@ -1,25 +1,45 @@
1
1
  <template>
2
- <view class="flex-col flex h-full w-full">
2
+ <view class="flex-col flex h-180 w-full">
3
3
  <view class="flex-1 h-0 relative">
4
4
  <map
5
- style="width: 100%; height: 100%"
6
- :latitude="form.latitude"
7
- :longitude="form.longitude"
5
+ :latitude="form.mapLatitude"
6
+ :longitude="form.mapLongitude"
8
7
  :markers="info.covers"
9
8
  show-location
10
9
  show-compass
11
10
  show-scale
11
+ class="w-full h-full"
12
12
  @regionchange="onRegionChange"
13
- @markertap="onMarkerTap"
13
+ @callouttap="onCalloutTap"
14
14
  />
15
15
  <image
16
16
  src="./images/2.png"
17
17
  class="w-36rpx h-66rpx absolute z-1 left-0 top-0 m-auto bottom-0 right-0"
18
18
  />
19
- <view class="absolute bottom-0 left-0 p-3 w-full box-border" v-if="data?.[current]">
20
- <view class="card w-full !p-0">
21
- <lcb-product-item :item="data?.[current]" />
22
- </view>
19
+
20
+ <view class="absolute bottom-0 left-0 p-3 box-border z-1 w-full h-fit" v-if="list[current]">
21
+ <lcb-product-item
22
+ v-bind="{
23
+ ...list[current],
24
+ ...attrs,
25
+ }"
26
+ />
27
+ <wd-icon
28
+ class-prefix="lcb"
29
+ size="28"
30
+ name="youbian"
31
+ custom-class="icon right-0"
32
+ @click="onCurrentChange(1)"
33
+ v-if="list[current + 1]"
34
+ />
35
+ <wd-icon
36
+ class-prefix="lcb"
37
+ size="28"
38
+ name="zuobian"
39
+ custom-class="icon left-0"
40
+ @click="onCurrentChange(-1)"
41
+ v-if="list[current - 1]"
42
+ />
23
43
  </view>
24
44
  </view>
25
45
  </view>
@@ -27,33 +47,11 @@
27
47
 
28
48
  <script lang="ts" setup>
29
49
  import { FORM_KEY } from '@tplc/business/constants'
30
- import { getJsonStrFirstUrl } from '../../utils/transform'
31
- import { reactive, inject, ref } from 'vue'
32
- import { LcbMapProps } from './types'
33
- export interface MapMarker {
34
- id: number
35
- name?: string
36
- longitude: number
37
- latitude: number
38
- iconPath: string
39
- width: number
40
- height: number
41
- poiId: string
42
- anchor?: {
43
- x: number
44
- y: number
45
- }
46
- callout?: {
47
- content: string
48
- color: string
49
- fontSize: number
50
- borderRadius: number
51
- bgColor: string
52
- padding: number
53
- display: 'ALWAYS' | 'BYCLICK'
54
- }
55
- zIndex?: number
56
- }
50
+ import { reactive, inject, ref, useAttrs } from 'vue'
51
+ import { LcbListInfo } from '../lcb-list/api'
52
+ import { getPageOptions } from '../../utils/utils'
53
+ import { MapItem, MapMarker } from './types'
54
+
57
55
  defineOptions({
58
56
  name: 'LcbMap',
59
57
  options: {
@@ -62,7 +60,8 @@ defineOptions({
62
60
  styleIsolation: 'shared',
63
61
  },
64
62
  })
65
- defineProps<LcbMapProps>()
63
+ const attrs = useAttrs()
64
+ const props = defineProps<LcbListInfo>()
66
65
  const scaleRadius: Record<string, number> = {
67
66
  3: 1_000_000,
68
67
  4: 500_000,
@@ -83,19 +82,41 @@ const scaleRadius: Record<string, number> = {
83
82
  19: 10,
84
83
  20: 5,
85
84
  }
85
+ const callout: MapMarker['callout'] = {
86
+ content: '腾讯总部大楼',
87
+ padding: 10,
88
+ display: 'ALWAYS',
89
+ fontSize: 14,
90
+ textAlign: 'center',
91
+ borderRadius: 2,
92
+ borderWidth: 2,
93
+ borderColor: '#3875FF',
94
+ bgColor: '#ffffff',
95
+ color: '#3875FF',
96
+ }
86
97
  const info = reactive({
87
98
  covers: [] as MapMarker[],
88
99
  })
89
- const form = inject<Record<string, any>>(FORM_KEY, {})
100
+ const form = inject<Record<string, any>>(FORM_KEY, {
101
+ mapViewRadius: scaleRadius[16],
102
+ })
90
103
  const current = ref(0)
91
- const data = ref<any[]>([])
104
+ const list = ref<MapItem[]>([])
105
+
92
106
  const getData = async () => {
93
- const { data: list } = await uni.$lcb.http.post<any[]>('/productInfo/map', form.value)
94
- data.value = list
95
- getCurrentData(list[0], list.slice(1, list.length))
107
+ // || props.url
108
+ const { data } = (await uni.$lcb.http.post('/productInfo/map', {
109
+ ...props.baseParam,
110
+ ...form?.value,
111
+ ...getPageOptions(),
112
+ })) as {
113
+ data: MapItem[]
114
+ }
115
+ list.value = data
116
+ getCurrentData(data)
96
117
  }
97
-
98
118
  const getLocation = () => {
119
+ getData()
99
120
  uni.getLocation({
100
121
  type: 'gcj02',
101
122
  success: (res) => {
@@ -132,72 +153,60 @@ const onRegionChange = (e: {
132
153
  getData()
133
154
  }
134
155
  }
135
- const onMarkerTap = (e: { markerId: number }) => {
136
- const marker = info.covers.find((item) => item?.id === e.markerId)
137
- if (marker) {
138
- const item = data.value?.find((item) => item?.poiId === marker.poiId)
139
- const firstMarker = info.covers[0]!
140
- getCurrentData(item, [
141
- {
142
- ...firstMarker,
143
- id: e.markerId,
144
- iconPath: './images/4.png',
145
- width: 26,
146
- height: 26,
147
- },
148
- ...info.covers.filter((item) => ![1, 2, e.markerId].includes(item.id)),
149
- ])
156
+ const onCurrentChange = (p: number) => {
157
+ onCalloutTap({
158
+ detail: {
159
+ markerId: current.value + p,
160
+ },
161
+ })
162
+ }
163
+ const onCalloutTap = (e: { detail: { markerId: number } }) => {
164
+ const pre = info.covers[e.detail.markerId].callout
165
+ const old = info.covers[current.value].callout
166
+ info.covers[e.detail.markerId].callout = {
167
+ ...pre,
168
+ borderColor: '#eeeeee',
169
+ bgColor: '#3875FF',
170
+ color: '#fff',
171
+ }
172
+ info.covers[current.value].callout = {
173
+ ...old,
174
+ borderColor: '#eeeeee',
175
+ bgColor: '#ffffff',
176
+ color: '#3875FF',
150
177
  }
178
+ current.value = e.detail.markerId
151
179
  }
152
- const getCurrentData = (item: any, list: MapMarker[]) => {
153
- uni.downloadFile({
154
- url:
155
- getJsonStrFirstUrl(item.coverImg) +
156
- '?x-oss-process=image/resize,m_fixed,w_64,h_64/circle,r_100/format,png',
157
- success: (res) => {
158
- info.covers = [
159
- {
160
- id: 1,
161
- iconPath: './images/3.png',
162
- width: 42,
163
- height: 49,
164
- anchor: {
165
- x: 0.5,
166
- y: 0.78,
167
- },
168
- poiId: item.poiId,
169
- latitude: item.latitude,
170
- longitude: item.longitude,
171
- },
172
- {
173
- zIndex: 2,
174
- iconPath: res.tempFilePath,
175
- width: 34,
176
- height: 34,
177
- id: 2,
178
- poiId: item.poiId,
179
- latitude: item.latitude,
180
- longitude: item.longitude,
181
- },
182
- ...list.map((item: any, index: number) => ({
183
- id: index + 3,
184
- iconPath: './images/4.png',
185
- width: 26,
186
- height: 26,
187
- poiId: item.poiId,
188
- latitude: item.latitude,
189
- longitude: item.longitude,
190
- })),
191
- ]
192
- console.log(item.poiId, data.value)
193
- current.value = data.value?.findIndex?.(({ poiId }) => item.poiId === poiId) || -1
194
- },
180
+ const getCurrentData = (markers: MapItem[]) => {
181
+ info.covers = markers.map((current, index: number) => {
182
+ const isCurrent = index === 0
183
+ return {
184
+ id: index,
185
+ iconPath: 'https://lycs.eluying.com/default/1319653665276882944/20241226142012/饭店竖图.png',
186
+ width: 1,
187
+ height: 1,
188
+ poiId: current.productId,
189
+ latitude: current.latitude,
190
+ longitude: current.longitude,
191
+ callout: {
192
+ ...callout,
193
+ content: current.mapPriceTips,
194
+ borderColor: '#eeeeee',
195
+ bgColor: isCurrent ? '#3875FF' : '#ffffff',
196
+ color: isCurrent ? '#ffffff' : '#3875FF',
197
+ },
198
+ }
195
199
  })
200
+ current.value = 0
196
201
  }
197
202
  </script>
198
-
199
- <style>
200
- page {
201
- background-color: #f7f7f7;
203
+ <style lang="scss" scoped>
204
+ .icon {
205
+ position: absolute;
206
+ top: 0;
207
+ height: fit-content;
208
+ bottom: 0;
209
+ margin: auto;
210
+ color: #666;
202
211
  }
203
212
  </style>
@@ -1,3 +1,34 @@
1
- export interface LcbMapProps {
2
- // Define the component's prop types here
1
+ export interface MapMarker {
2
+ id: number
3
+ name?: string
4
+ longitude: number
5
+ latitude: number
6
+ iconPath: string
7
+ width: number
8
+ height: number
9
+ poiId: string
10
+ anchor?: {
11
+ x: number
12
+ y: number
13
+ }
14
+
15
+ callout: {
16
+ textAlign: string
17
+ borderWidth: number
18
+ borderColor: string
19
+ content: string
20
+ color: string
21
+ fontSize: number
22
+ borderRadius: number
23
+ bgColor: string
24
+ padding: number
25
+ display: 'ALWAYS' | 'BYCLICK'
26
+ }
27
+ zIndex?: number
28
+ }
29
+ export interface MapItem {
30
+ mapPriceTips: string
31
+ latitude: number
32
+ longitude: number
33
+ productId: string
3
34
  }
@@ -86,14 +86,26 @@ const value = computed(() => {
86
86
  <!-- 图片 -->
87
87
  <slot :value="value" v-if="prop === 'coverImg'" name="coverImg">
88
88
  <view :class="`relative ${className}`" :style="style">
89
- <image :src="value" class="w-full h-full" mode="aspectFill" />
89
+ <wd-img :src="value" mode="aspectFill" width="100%" height="100%" />
90
90
  <!-- imgBottomIcon -->
91
91
  <view class="absolute bottom-0 left-0 w-full z-1" v-if="itemProps.imgBottomIcon">
92
- <image :src="itemProps.imgBottomIcon" class="w-full h-auto block" mode="widthFix" />
92
+ <wd-img
93
+ :src="itemProps.imgBottomIcon"
94
+ custom-class="block"
95
+ mode="widthFix"
96
+ width="100%"
97
+ height="auto"
98
+ />
93
99
  </view>
94
100
  <!-- imgCornerIcon -->
95
101
  <view class="absolute top-0 left-0 h-8 z-1" v-if="itemProps.imgCornerIcon">
96
- <image :src="itemProps.imgCornerIcon" class="w-auto h-full block" mode="heightFix" />
102
+ <wd-img
103
+ :src="itemProps.imgCornerIcon"
104
+ width="auto"
105
+ height="100%"
106
+ custom-class="block"
107
+ mode="heightFix"
108
+ />
97
109
  </view>
98
110
  <slot></slot>
99
111
  </view>
@@ -1,9 +1,9 @@
1
1
  @font-face {
2
2
  font-family: 'lcb'; /* Project id 4710234 */
3
3
  src:
4
- url('//at.alicdn.com/t/c/font_4710234_2ayg4b3nknw.woff2?t=1733320036132') format('woff2'),
5
- url('//at.alicdn.com/t/c/font_4710234_2ayg4b3nknw.woff?t=1733320036132') format('woff'),
6
- url('//at.alicdn.com/t/c/font_4710234_2ayg4b3nknw.ttf?t=1733320036132') format('truetype');
4
+ url('//at.alicdn.com/t/c/font_4710234_0cmn6exn7ocb.woff2?t=1735307783373') format('woff2'),
5
+ url('//at.alicdn.com/t/c/font_4710234_0cmn6exn7ocb.woff?t=1735307783373') format('woff'),
6
+ url('//at.alicdn.com/t/c/font_4710234_0cmn6exn7ocb.ttf?t=1735307783373') format('truetype');
7
7
  }
8
8
 
9
9
  .lcb {
@@ -14,6 +14,106 @@
14
14
  -moz-osx-font-smoothing: grayscale;
15
15
  }
16
16
 
17
+ .lcb-ditu:before {
18
+ content: '\e6a8';
19
+ }
20
+
21
+ .lcb-ruzhu:before {
22
+ content: '\e6a0';
23
+ }
24
+
25
+ .lcb-xihu:before {
26
+ content: '\e6a1';
27
+ }
28
+
29
+ .lcb-qipai:before {
30
+ content: '\e6a2';
31
+ }
32
+
33
+ .lcb-huwei:before {
34
+ content: '\e6a3';
35
+ }
36
+
37
+ .lcb-dayin:before {
38
+ content: '\e6a4';
39
+ }
40
+
41
+ .lcb-jiatingtaofang:before {
42
+ content: '\e6a5';
43
+ }
44
+
45
+ .lcb-jiageyouhui:before {
46
+ content: '\e6a6';
47
+ }
48
+
49
+ .lcb-bingxiang:before {
50
+ content: '\e6a7';
51
+ }
52
+
53
+ .lcb-you1:before {
54
+ content: '\e69d';
55
+ }
56
+
57
+ .lcb-wifi1:before {
58
+ content: '\e69e';
59
+ }
60
+
61
+ .lcb-qianbao:before {
62
+ content: '\e69f';
63
+ }
64
+
65
+ .lcb-xuanzhong1:before {
66
+ content: '\e691';
67
+ }
68
+
69
+ .lcb-Frame:before {
70
+ content: '\e692';
71
+ }
72
+
73
+ .lcb-songxi:before {
74
+ content: '\e693';
75
+ }
76
+
77
+ .lcb-yule:before {
78
+ content: '\e694';
79
+ }
80
+
81
+ .lcb-jianshen:before {
82
+ content: '\e695';
83
+ }
84
+
85
+ .lcb-qiantai:before {
86
+ content: '\e696';
87
+ }
88
+
89
+ .lcb-qiche:before {
90
+ content: '\e697';
91
+ }
92
+
93
+ .lcb-xingji:before {
94
+ content: '\e698';
95
+ }
96
+
97
+ .lcb-hanglijicun:before {
98
+ content: '\e699';
99
+ }
100
+
101
+ .lcb-huiyi:before {
102
+ content: '\e69a';
103
+ }
104
+
105
+ .lcb-fapiao:before {
106
+ content: '\e69b';
107
+ }
108
+
109
+ .lcb-jinzhi:before {
110
+ content: '\e69c';
111
+ }
112
+
113
+ .lcb-wifi:before {
114
+ content: '\e690';
115
+ }
116
+
17
117
  .lcb-shoucanghou:before {
18
118
  content: '\e68f';
19
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -2,7 +2,7 @@ import { FilterTabsProps } from './components/FilterTabs/type'
2
2
  import { Option } from './types'
3
3
  export interface LcbListInfo {
4
4
  url: string
5
- baseParam: Record<string, unknown>
5
+ baseParam?: Record<string, unknown>
6
6
  }
7
7
  export interface LcbFilterResult {
8
8
  btnComponent: BtnComponent
@@ -1,11 +1,8 @@
1
1
  import { LcbListProps } from './types'
2
2
  import './index.scss'
3
- declare function __VLS_template(): Readonly<{
4
- list(props: { items: any }): any
5
- item(props: { item: any }): any
6
- }> & {
7
- list(props: { items: any }): any
8
- item(props: { item: any }): any
3
+ declare function __VLS_template(): {
4
+ list?(_: { items: never[] }): any
5
+ item?(_: { item: any }): any
9
6
  }
10
7
  declare const __VLS_component: import('vue').DefineComponent<
11
8
  __VLS_WithDefaults<__VLS_TypePropsToOption<LcbListProps>, any>,
@@ -1,33 +1,6 @@
1
- export interface MapMarker {
2
- id: number
3
- name?: string
4
- longitude: number
5
- latitude: number
6
- iconPath: string
7
- width: number
8
- height: number
9
- poiId: string
10
- anchor?: {
11
- x: number
12
- y: number
13
- }
14
- callout?: {
15
- content: string
16
- color: string
17
- fontSize: number
18
- borderRadius: number
19
- bgColor: string
20
- padding: number
21
- display: 'ALWAYS' | 'BYCLICK'
22
- }
23
- zIndex?: number
24
- }
1
+ import { LcbListInfo } from '../lcb-list/api'
25
2
  declare const _default: import('vue').DefineComponent<
26
- Readonly<
27
- import('vue').ComponentPropsOptions<{
28
- [x: string]: unknown
29
- }>
30
- >,
3
+ __VLS_TypePropsToOption<LcbListInfo>,
31
4
  {},
32
5
  unknown,
33
6
  {},
@@ -37,20 +10,19 @@ declare const _default: import('vue').DefineComponent<
37
10
  {},
38
11
  string,
39
12
  import('vue').PublicProps,
40
- | readonly string[]
41
- | Readonly<
42
- import('vue').ExtractPropTypes<
43
- Readonly<
44
- import('vue').ComponentObjectPropsOptions<{
45
- [x: string]: unknown
46
- }>
47
- >
48
- >
49
- >,
50
- | {
51
- readonly [x: number]: string
52
- }
53
- | {},
13
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<LcbListInfo>>>,
14
+ {},
54
15
  {}
55
16
  >
56
17
  export default _default
18
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
19
+ type __VLS_TypePropsToOption<T> = {
20
+ [K in keyof T]-?: {} extends Pick<T, K>
21
+ ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
23
+ }
24
+ : {
25
+ type: import('vue').PropType<T[K]>
26
+ required: true
27
+ }
28
+ }
@@ -1 +1,33 @@
1
- export interface LcbMapProps {}
1
+ export interface MapMarker {
2
+ id: number
3
+ name?: string
4
+ longitude: number
5
+ latitude: number
6
+ iconPath: string
7
+ width: number
8
+ height: number
9
+ poiId: string
10
+ anchor?: {
11
+ x: number
12
+ y: number
13
+ }
14
+ callout: {
15
+ textAlign: string
16
+ borderWidth: number
17
+ borderColor: string
18
+ content: string
19
+ color: string
20
+ fontSize: number
21
+ borderRadius: number
22
+ bgColor: string
23
+ padding: number
24
+ display: 'ALWAYS' | 'BYCLICK'
25
+ }
26
+ zIndex?: number
27
+ }
28
+ export interface MapItem {
29
+ mapPriceTips: string
30
+ latitude: number
31
+ longitude: number
32
+ productId: string
33
+ }
Binary file
Binary file
Binary file