@tplc/business 0.0.48 → 0.0.50

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 (63) hide show
  1. package/CHANGELOG.md +270 -0
  2. package/action.d.ts +7 -2
  3. package/api/user.ts +6 -0
  4. package/components/lcb-action-view/types.ts +2 -2
  5. package/components/lcb-block/types.ts +1 -0
  6. package/components/lcb-button/lcb-button.vue +32 -0
  7. package/components/lcb-button/types.ts +8 -0
  8. package/components/lcb-city-select/components/lcb-city-letter/index.vue +1 -1
  9. package/components/lcb-city-select/components/lcb-city-list/index.vue +1 -1
  10. package/components/lcb-city-select/components/lcb-city-list/types.ts +1 -1
  11. package/components/lcb-dynamic-data/lcb-dynamic-data.vue +10 -3
  12. package/components/lcb-image/Image/index.vue +15 -25
  13. package/components/lcb-list/components/FilterList/index.vue +9 -4
  14. package/components/lcb-list/components/FilterList/mockData.ts +575 -0
  15. package/components/lcb-list/hooks/useSelect.ts +2 -0
  16. package/components/lcb-list/lcb-list.vue +32 -17
  17. package/components/lcb-list/types.ts +0 -13
  18. package/components/lcb-nav/lcb-nav.vue +1 -1
  19. package/components/lcb-notice/api/index.ts +21 -0
  20. package/components/lcb-notice/lcb-notice.vue +66 -50
  21. package/components/lcb-notice/types.ts +11 -26
  22. package/components/lcb-product/lcb-product.vue +37 -33
  23. package/components/lcb-product-item/components/ItemValue.vue +103 -22
  24. package/components/lcb-product-item/lcb-product-item.vue +249 -70
  25. package/components/lcb-product-item/types.ts +15 -14
  26. package/components/lcb-text/lcb-text.vue +20 -0
  27. package/components/lcb-text/types.ts +5 -0
  28. package/components/lcb-user-top/Nums/index.vue +19 -10
  29. package/components/lcb-user-top/lcb-user-top.vue +51 -43
  30. package/constants.ts +2 -0
  31. package/global.d.ts +2 -0
  32. package/hooks/useUpload.ts +3 -6
  33. package/index.ts +1 -1
  34. package/package.json +2 -2
  35. package/tsconfig.json +24 -0
  36. package/types/api/user.d.ts +6 -0
  37. package/types/components/lcb-action-view/types.d.ts +2 -2
  38. package/types/components/lcb-block/types.d.ts +1 -0
  39. package/types/components/{lcb-notice/Item/index.vue.d.ts → lcb-button/lcb-button.vue.d.ts} +4 -18
  40. package/types/components/lcb-button/types.d.ts +7 -0
  41. package/types/components/lcb-city-select/components/lcb-city-letter/index.vue.d.ts +1 -1
  42. package/types/components/lcb-city-select/components/lcb-city-list/types.d.ts +1 -1
  43. package/types/components/lcb-list/components/FilterList/mockData.d.ts +63 -0
  44. package/types/components/lcb-list/lcb-list.vue.d.ts +7 -3
  45. package/types/components/lcb-list/types.d.ts +0 -1
  46. package/types/components/lcb-notice/api/index.d.ts +19 -0
  47. package/types/components/lcb-notice/lcb-notice.vue.d.ts +25 -19
  48. package/types/components/lcb-notice/types.d.ts +11 -24
  49. package/types/components/lcb-product/lcb-product.vue.d.ts +2 -22
  50. package/types/components/lcb-product-item/components/ItemValue.vue.d.ts +26 -8
  51. package/types/components/lcb-product-item/lcb-product-item.vue.d.ts +63 -23
  52. package/types/components/lcb-product-item/types.d.ts +14 -13
  53. package/types/components/lcb-text/lcb-text.vue.d.ts +42 -0
  54. package/types/components/lcb-text/types.d.ts +4 -0
  55. package/types/constants.d.ts +2 -0
  56. package/types/hooks/useUpload.d.ts +1 -3
  57. package/types/utils/auth.d.ts +2 -0
  58. package/types/utils/utils.d.ts +2 -0
  59. package/utils/auth.ts +19 -0
  60. package/utils/utils.ts +6 -1
  61. package/components/lcb-notice/Item/index.vue +0 -112
  62. package/components/lcb-user-top/api/index.ts +0 -13
  63. package/types/components/lcb-user-top/api/index.d.ts +0 -10
@@ -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
@@ -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
+ }
@@ -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>>