@tplc/business 0.0.48 → 0.0.51

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +278 -0
  2. package/action.d.ts +7 -2
  3. package/api/user.ts +6 -0
  4. package/components/lcb-action-view/lcb-action-view.vue +1 -1
  5. package/components/lcb-action-view/types.ts +2 -2
  6. package/components/lcb-advert/lcb-advert.vue +78 -0
  7. package/components/lcb-advert/types.ts +3 -0
  8. package/components/lcb-block/types.ts +1 -0
  9. package/components/lcb-button/lcb-button.vue +32 -0
  10. package/components/lcb-button/types.ts +8 -0
  11. package/components/lcb-city-select/components/lcb-city-letter/index.vue +1 -1
  12. package/components/lcb-city-select/components/lcb-city-list/index.vue +1 -1
  13. package/components/lcb-city-select/components/lcb-city-list/types.ts +1 -1
  14. package/components/lcb-dynamic-data/lcb-dynamic-data.vue +10 -3
  15. package/components/lcb-image/Image/index.vue +15 -25
  16. package/components/lcb-list/components/FilterList/index.vue +9 -4
  17. package/components/lcb-list/components/FilterList/mockData.ts +575 -0
  18. package/components/lcb-list/hooks/useSelect.ts +2 -0
  19. package/components/lcb-list/lcb-list.vue +32 -17
  20. package/components/lcb-list/types.ts +0 -13
  21. package/components/lcb-nav/lcb-nav.vue +1 -1
  22. package/components/lcb-notice/api/index.ts +21 -0
  23. package/components/lcb-notice/lcb-notice.vue +66 -50
  24. package/components/lcb-notice/types.ts +11 -26
  25. package/components/lcb-product/lcb-product.vue +37 -33
  26. package/components/lcb-product-item/components/ItemValue.vue +103 -22
  27. package/components/lcb-product-item/lcb-product-item.vue +249 -70
  28. package/components/lcb-product-item/types.ts +15 -14
  29. package/components/lcb-text/lcb-text.vue +20 -0
  30. package/components/lcb-text/types.ts +5 -0
  31. package/components/lcb-user-top/Nums/index.vue +19 -10
  32. package/components/lcb-user-top/lcb-user-top.vue +51 -43
  33. package/constants.ts +2 -0
  34. package/global.d.ts +3 -0
  35. package/hooks/useUpload.ts +3 -6
  36. package/index.ts +1 -1
  37. package/package.json +2 -2
  38. package/tsconfig.json +24 -0
  39. package/types/api/user.d.ts +6 -0
  40. package/types/components/lcb-action-view/types.d.ts +2 -2
  41. package/types/components/lcb-advert/lcb-advert.vue.d.ts +28 -0
  42. package/types/components/lcb-advert/types.d.ts +3 -0
  43. package/types/components/lcb-area-picker/lcb-area-picker.vue.d.ts +1 -1
  44. package/types/components/lcb-banner-block/lcb-banner-block.vue.d.ts +2 -2
  45. package/types/components/lcb-block/types.d.ts +1 -0
  46. package/types/components/{lcb-notice/Item/index.vue.d.ts → lcb-button/lcb-button.vue.d.ts} +4 -18
  47. package/types/components/lcb-button/types.d.ts +7 -0
  48. package/types/components/lcb-calendar-search/lcb-calendar-search.vue.d.ts +1 -1
  49. package/types/components/lcb-city-select/components/lcb-city-letter/index.vue.d.ts +1 -1
  50. package/types/components/lcb-city-select/components/lcb-city-list/types.d.ts +1 -1
  51. package/types/components/lcb-grid/lcb-grid.vue.d.ts +2 -2
  52. package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +1 -1
  53. package/types/components/lcb-list/components/FilterList/mockData.d.ts +63 -0
  54. package/types/components/lcb-list/lcb-list.vue.d.ts +8 -4
  55. package/types/components/lcb-list/types.d.ts +0 -1
  56. package/types/components/lcb-notice/api/index.d.ts +19 -0
  57. package/types/components/lcb-notice/lcb-notice.vue.d.ts +25 -19
  58. package/types/components/lcb-notice/types.d.ts +11 -24
  59. package/types/components/lcb-product/lcb-product.vue.d.ts +2 -22
  60. package/types/components/lcb-product-item/components/ItemValue.vue.d.ts +26 -8
  61. package/types/components/lcb-product-item/lcb-product-item.vue.d.ts +63 -23
  62. package/types/components/lcb-product-item/types.d.ts +14 -13
  63. package/types/components/lcb-swiper/lcb-swiper.vue.d.ts +2 -2
  64. package/types/components/lcb-text/lcb-text.vue.d.ts +42 -0
  65. package/types/components/lcb-text/types.d.ts +4 -0
  66. package/types/components/lcb-title/lcb-title.vue.d.ts +1 -1
  67. package/types/constants.d.ts +2 -0
  68. package/types/hooks/useUpload.d.ts +1 -3
  69. package/types/utils/auth.d.ts +2 -0
  70. package/types/utils/utils.d.ts +2 -0
  71. package/utils/auth.ts +19 -0
  72. package/utils/utils.ts +6 -1
  73. package/components/lcb-notice/Item/index.vue +0 -112
  74. package/components/lcb-user-top/api/index.ts +0 -13
  75. package/types/components/lcb-user-top/api/index.d.ts +0 -10
@@ -1,34 +1,57 @@
1
1
  import { LcbProductItemProps } from './types'
2
2
  declare function __VLS_template(): Readonly<{
3
- image(): any
4
- title(): any
5
- subTitle(): any
6
- price(): any
7
- priceUnit(): any
8
- priceSuffix(): any
9
- originPrice(): any
10
- originPriceUnit(): any
11
- tags(): any
12
- location(): any
13
- distance(): any
3
+ image(props: { value: any }): any
4
+ title(props: { value: any }): any
5
+ subTitle(props: { value: any }): any
6
+ price(props: { value: any }): any
7
+ priceUnit(props: { value: any }): any
8
+ priceSuffix(props: { value: any }): any
9
+ originPrice(props: { value: any }): any
10
+ originPriceUnit(props: { value: any }): any
11
+ originPriceSuffix(props: { value: any }): any
12
+ tags(props: { value: any }): any
13
+ location(props: { value: any }): any
14
+ distance(props: { value: any }): any
15
+ itemSection(): any
16
+ itemTopSection(): any
17
+ itemBottomSection(): any
18
+ itemLeftSection(): any
19
+ itemRightSection(): any
20
+ imageSection(): any
21
+ contentSection(): any
14
22
  }> & {
15
- image(): any
16
- title(): any
17
- subTitle(): any
18
- price(): any
19
- priceUnit(): any
20
- priceSuffix(): any
21
- originPrice(): any
22
- originPriceUnit(): any
23
- tags(): any
24
- location(): any
25
- distance(): any
23
+ image(props: { value: any }): any
24
+ title(props: { value: any }): any
25
+ subTitle(props: { value: any }): any
26
+ price(props: { value: any }): any
27
+ priceUnit(props: { value: any }): any
28
+ priceSuffix(props: { value: any }): any
29
+ originPrice(props: { value: any }): any
30
+ originPriceUnit(props: { value: any }): any
31
+ originPriceSuffix(props: { value: any }): any
32
+ tags(props: { value: any }): any
33
+ location(props: { value: any }): any
34
+ distance(props: { value: any }): any
35
+ itemSection(): any
36
+ itemTopSection(): any
37
+ itemBottomSection(): any
38
+ itemLeftSection(): any
39
+ itemRightSection(): any
40
+ imageSection(): any
41
+ contentSection(): any
26
42
  }
27
43
  declare const __VLS_component: import('vue').DefineComponent<
28
44
  __VLS_WithDefaults<
29
45
  __VLS_TypePropsToOption<LcbProductItemProps>,
30
46
  {
31
47
  layoutType: string
48
+ titleLineClamp: number
49
+ tagOverflowWrap: boolean
50
+ tagType: string
51
+ tagPlain: boolean
52
+ tagMark: boolean
53
+ tagRound: boolean
54
+ distanceUnit: string
32
55
  priceUnit: string
33
56
  originPriceUnit: string
34
57
  imageVisible: boolean
@@ -39,6 +62,7 @@ declare const __VLS_component: import('vue').DefineComponent<
39
62
  priceSuffixVisible: boolean
40
63
  originPriceVisible: boolean
41
64
  originPriceUnitVisible: boolean
65
+ originPriceSuffixVisible: boolean
42
66
  tagsVisible: boolean
43
67
  locationVisible: boolean
44
68
  distanceVisible: boolean
@@ -59,6 +83,13 @@ declare const __VLS_component: import('vue').DefineComponent<
59
83
  __VLS_TypePropsToOption<LcbProductItemProps>,
60
84
  {
61
85
  layoutType: string
86
+ titleLineClamp: number
87
+ tagOverflowWrap: boolean
88
+ tagType: string
89
+ tagPlain: boolean
90
+ tagMark: boolean
91
+ tagRound: boolean
92
+ distanceUnit: string
62
93
  priceUnit: string
63
94
  originPriceUnit: string
64
95
  imageVisible: boolean
@@ -69,6 +100,7 @@ declare const __VLS_component: import('vue').DefineComponent<
69
100
  priceSuffixVisible: boolean
70
101
  originPriceVisible: boolean
71
102
  originPriceUnitVisible: boolean
103
+ originPriceSuffixVisible: boolean
72
104
  tagsVisible: boolean
73
105
  locationVisible: boolean
74
106
  distanceVisible: boolean
@@ -77,9 +109,16 @@ declare const __VLS_component: import('vue').DefineComponent<
77
109
  >
78
110
  >,
79
111
  {
112
+ layoutType: 'vertical' | 'horizontal'
80
113
  priceUnit: any
81
114
  originPriceUnit: any
82
- layoutType: 'vertical' | 'horizontal'
115
+ titleLineClamp: number
116
+ tagOverflowWrap: boolean
117
+ tagType: import('@tplc/wot/components/wd-tag/types').TagType
118
+ tagPlain: boolean
119
+ tagMark: boolean
120
+ tagRound: boolean
121
+ distanceUnit: string
83
122
  imageVisible: boolean
84
123
  titleVisible: boolean
85
124
  subTitleVisible: boolean
@@ -88,6 +127,7 @@ declare const __VLS_component: import('vue').DefineComponent<
88
127
  priceSuffixVisible: boolean
89
128
  originPriceVisible: boolean
90
129
  originPriceUnitVisible: boolean
130
+ originPriceSuffixVisible: boolean
91
131
  tagsVisible: boolean
92
132
  locationVisible: boolean
93
133
  distanceVisible: boolean
@@ -1,20 +1,17 @@
1
1
  import { CSSProperties } from 'vue'
2
- export declare const lcbProductItemContentTypes: readonly [
3
- 'image',
4
- 'title',
5
- 'subTitle',
6
- 'price',
7
- 'priceUnit',
8
- 'priceSuffix',
9
- 'originPrice',
10
- 'originPriceUnit',
11
- 'tags',
12
- 'location',
13
- 'distance',
14
- ]
2
+ import { TagType } from '@tplc/wot/components/wd-tag/types'
15
3
  export interface LcbProductItemProps {
16
4
  className?: string
17
5
  layoutType?: 'vertical' | 'horizontal'
6
+ titleLineClamp?: number
7
+ tagOverflowWrap?: boolean
8
+ tagType?: TagType
9
+ tagContentColor?: string
10
+ tagBgColor?: string
11
+ tagPlain?: boolean
12
+ tagMark?: boolean
13
+ tagRound?: boolean
14
+ distanceUnit?: string
18
15
  image?: any
19
16
  title?: any
20
17
  subTitle?: any
@@ -23,6 +20,7 @@ export interface LcbProductItemProps {
23
20
  priceSuffix?: any
24
21
  originPrice?: any
25
22
  originPriceUnit?: any
23
+ originPriceSuffix?: any
26
24
  tags?: any
27
25
  location?: any
28
26
  distance?: any
@@ -34,6 +32,7 @@ export interface LcbProductItemProps {
34
32
  priceSuffixVisible?: boolean
35
33
  originPriceVisible?: boolean
36
34
  originPriceUnitVisible?: boolean
35
+ originPriceSuffixVisible?: boolean
37
36
  tagsVisible?: boolean
38
37
  locationVisible?: boolean
39
38
  distanceVisible?: boolean
@@ -45,6 +44,7 @@ export interface LcbProductItemProps {
45
44
  priceSuffixClass?: string
46
45
  originPriceClass?: string
47
46
  originPriceUnitClass?: string
47
+ originPriceSuffixClass?: string
48
48
  tagsClass?: string
49
49
  tagsWrapperClass?: string
50
50
  locationClass?: string
@@ -57,6 +57,7 @@ export interface LcbProductItemProps {
57
57
  priceSuffixStyle?: CSSProperties
58
58
  originPriceStyle?: CSSProperties
59
59
  originPriceUnitStyle?: CSSProperties
60
+ originPriceSuffixStyle?: CSSProperties
60
61
  tagsStyle?: CSSProperties
61
62
  tagsWrapperStyle?: CSSProperties
62
63
  locationStyle?: CSSProperties
@@ -70,11 +70,10 @@ declare const _default: import('vue').DefineComponent<
70
70
  >
71
71
  >,
72
72
  {
73
- styleGroup: 1 | 2 | 3 | 4
73
+ duration: number
74
74
  autoplay: boolean
75
75
  direction: 'horizontal' | 'vertical'
76
76
  displayMultipleItems: number
77
- duration: number
78
77
  height: number
79
78
  loop: boolean
80
79
  indicatorPosition:
@@ -87,6 +86,7 @@ declare const _default: import('vue').DefineComponent<
87
86
  | 'bottom-right'
88
87
  | 'right'
89
88
  indicator: boolean
89
+ styleGroup: 1 | 2 | 3 | 4
90
90
  borderRadius: number
91
91
  indicatorType: 'dots' | 'dots-bar' | 'fraction'
92
92
  },
@@ -0,0 +1,42 @@
1
+ import { LcbTextProps } from './types'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_WithDefaults<__VLS_TypePropsToOption<LcbTextProps>, {}>,
4
+ {},
5
+ unknown,
6
+ {},
7
+ {},
8
+ import('vue').ComponentOptionsMixin,
9
+ import('vue').ComponentOptionsMixin,
10
+ {},
11
+ string,
12
+ import('vue').PublicProps,
13
+ Readonly<
14
+ import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LcbTextProps>, {}>>
15
+ >,
16
+ {},
17
+ {}
18
+ >
19
+ export default _default
20
+ type __VLS_WithDefaults<P, D> = {
21
+ [K in keyof Pick<P, keyof P>]: K extends keyof D
22
+ ? __VLS_Prettify<
23
+ P[K] & {
24
+ default: D[K]
25
+ }
26
+ >
27
+ : P[K]
28
+ }
29
+ type __VLS_Prettify<T> = {
30
+ [K in keyof T]: T[K]
31
+ } & {}
32
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
33
+ type __VLS_TypePropsToOption<T> = {
34
+ [K in keyof T]-?: {} extends Pick<T, K>
35
+ ? {
36
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
37
+ }
38
+ : {
39
+ type: import('vue').PropType<T[K]>
40
+ required: true
41
+ }
42
+ }
@@ -0,0 +1,4 @@
1
+ import { LcbBlockProps } from '../lcb-block/types'
2
+ export interface LcbTextProps extends LcbBlockProps {
3
+ text: string
4
+ }
@@ -35,8 +35,8 @@ declare const _default: import('vue').DefineComponent<
35
35
  >,
36
36
  {
37
37
  title: string
38
- marginHorizontal: number
39
38
  color: string
39
+ marginHorizontal: number
40
40
  fontSize: number
41
41
  fontWeight: number
42
42
  },
@@ -1,3 +1,5 @@
1
1
  export declare const FORM_KEY = 'form'
2
2
  /** 页面信息 */
3
3
  export declare const PAGE_PROVIDE_KEY = 'page_provide'
4
+ /** 页面类型 */
5
+ export declare const PAGE_TYPE_PROVIDE_KEY = 'page_type_provide'
@@ -10,13 +10,11 @@ export default function useUpload(onSuccess?: (url: string) => void): {
10
10
  }
11
11
  export declare function uploadFile({
12
12
  filePath,
13
- file,
14
13
  data,
15
14
  name,
16
15
  onSuccess,
17
16
  }: {
18
- filePath?: string
19
- file?: File
17
+ filePath: string
20
18
  data?: Ref<string>
21
19
  name: string
22
20
  onSuccess?: (url: string) => void
@@ -0,0 +1,2 @@
1
+ /** 获取手机号 */
2
+ export declare const getPhone: (e: any) => Promise<void>
@@ -1 +1,3 @@
1
1
  export declare function formatJson(str: string | object | undefined, defVal?: {}): {}
2
+ /** 获取上个页面Exposed */
3
+ export declare const getExposed: () => any
package/utils/auth.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { getUserPhone } from '../api/user'
2
+
3
+ /** 获取手机号 */
4
+ export const getPhone = (e) => {
5
+ return new Promise<void>((resolve, reject) => {
6
+ uni.login({
7
+ provider: 'weixin',
8
+ success: async (res) => {
9
+ const { code } = res
10
+ await getUserPhone({
11
+ ...e.detail,
12
+ code,
13
+ })
14
+ resolve()
15
+ },
16
+ fail: reject,
17
+ })
18
+ })
19
+ }
package/utils/utils.ts CHANGED
@@ -4,9 +4,14 @@ export function formatJson(str: string | object | undefined, defVal = {}) {
4
4
  let json = defVal
5
5
  try {
6
6
  json = JSON.parse(str)
7
- // console.log('formatJson :', json)
8
7
  } catch (e) {
9
8
  json = defVal
10
9
  }
11
10
  return json
12
11
  }
12
+ /** 获取上个页面Exposed */
13
+ export const getExposed = () => {
14
+ const pages = getCurrentPages()
15
+ const page = pages[pages.length - 2]
16
+ return page.$vm.$.exposed
17
+ }
@@ -1,112 +0,0 @@
1
- <template>
2
- <view class="flex items-center">
3
- <div
4
- v-if="iconType === 1"
5
- class="overflow-hidden bg-no-repeat bg-contain mr-12rpx"
6
- :style="{
7
- height: transformValueUnit(40),
8
- width: transformValueUnit(40),
9
- backgroundImage: `url('${item?.icon}')`,
10
- }"
11
- />
12
- <view v-if="iconType === 0" class="mr-12rpx">
13
- <wd-icon
14
- class-prefix="lcb"
15
- v-bind="{
16
- name: item?.icon || '',
17
- size: transformValueUnit(40),
18
- }"
19
- />
20
- </view>
21
- <view class="flex-1 noticeBar relative overflow-hidden">
22
- <view
23
- :class="`text-24rpx absolute left-0 top-0 noticeItem flex overflow-hidden${lens == 1 ? ' infinite' : ''}${showAni ? ' animation' : ''}`"
24
- :style="{
25
- animationDuration: getTime(item?.noticeContent),
26
- color: textColor,
27
- }"
28
- >
29
- {{ item?.noticeContent }}
30
- <lcb-action-view v-bind="item?.link" customClass="absolute top-0 left-0 right-0 bottom-0" />
31
- </view>
32
- </view>
33
- <wd-icon name="arrow-right" size="32rpx" :color="textColor" />
34
- </view>
35
- </template>
36
-
37
- <script setup lang="ts">
38
- import { NoticeBarItemProps } from '../types'
39
- import { computed } from 'vue'
40
- import { transformValueUnit } from '../../../utils/transform'
41
- defineOptions({
42
- name: 'NoticeBarItem',
43
- options: {
44
- addGlobalClass: true,
45
- virtualHost: true,
46
- styleIsolation: 'shared',
47
- },
48
- })
49
- const props = withDefaults(defineProps<NoticeBarItemProps>(), {
50
- textSpeed: 1,
51
- })
52
- // const { proxy } = getCurrentInstance() as any
53
- const showAni = computed(() => {
54
- // const query = uni.createSelectorQuery().in(proxy)
55
- // query.select('.noticeBar').boundingClientRect()
56
- // query.exec((res) => {
57
- // console.log(res)
58
- // })
59
- const len = props.item?.noticeContent?.length || 0
60
- // console.log('showAni', props.idx, len)
61
- return props.current === props.idx && len > 25
62
- })
63
-
64
- function getTime(text: string | undefined) {
65
- const len = text?.length || 0
66
- // console.log('item---', props.textSpeed)
67
- return `${((50 - len) / 10) * props.textSpeed + 3}s`
68
- }
69
- </script>
70
- <style lang="scss" scoped>
71
- .noticeBar {
72
- height: 72rpx;
73
- }
74
-
75
- .noticeItem {
76
- height: 72rpx;
77
- line-height: 72rpx;
78
- transform: translateZ(0.5px);
79
- line-clamp: 1;
80
- white-space: nowrap;
81
- text-overflow: ellipsis;
82
- word-break: break-all;
83
- animation-delay: 0.5s;
84
- animation-direction: normal;
85
- animation-duration: 3s;
86
- animation-fill-mode: forwards;
87
- animation-play-state: running;
88
- animation-range-end: normal;
89
- animation-range-start: normal;
90
- animation-timeline: auto;
91
- animation-timing-function: linear;
92
- }
93
-
94
- .infinite {
95
- animation-iteration-count: infinite;
96
- }
97
-
98
- .animation {
99
- animation-name: change;
100
- // animation-duration: 5s;
101
- }
102
-
103
- @keyframes change {
104
- 0% {
105
- transform: translate(0%);
106
- }
107
-
108
- 100% {
109
- transform: translate(-60%);
110
- }
111
- }
112
- </style>
@@ -1,13 +0,0 @@
1
- const env = import.meta as unknown as { env: Record<string, string> }
2
- export const getUserPhone = (data: { encryptedData: string; iv: string; code?: string }) =>
3
- uni.$lcb.http.post('/wechatProgram/api/getPhone', {
4
- ...data,
5
- appId: env.env.VITE_WX_APPID,
6
- })
7
-
8
- export const saveUserInfo = (data: { nickName?: string; avatarUrl?: string }) =>
9
- uni.$lcb.http.post('/wechatProgram/saveUserInfo', data)
10
-
11
- // /api/login/getUserInfo
12
-
13
- export const getUserInfo = () => uni.$lcb.http.post('/login/getUserInfo')
@@ -1,10 +0,0 @@
1
- export declare const getUserPhone: (data: {
2
- encryptedData: string
3
- iv: string
4
- code?: string
5
- }) => Promise<import('../../../action').IResData<unknown>>
6
- export declare const saveUserInfo: (data: {
7
- nickName?: string
8
- avatarUrl?: string
9
- }) => Promise<import('../../../action').IResData<unknown>>
10
- export declare const getUserInfo: () => Promise<import('../../../action').IResData<unknown>>