@tplc/business 0.1.13 → 0.1.15

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 (111) hide show
  1. package/CHANGELOG.md +480 -0
  2. package/action.d.ts +2 -0
  3. package/{components/lcb-user-top/api/index.ts → api/user.ts} +1 -0
  4. package/components/lcb-action-view/lcb-action-view.vue +14 -2
  5. package/components/lcb-action-view/types.ts +21 -2
  6. package/components/lcb-advert/lcb-advert.vue +78 -0
  7. package/components/lcb-advert/types.ts +3 -0
  8. package/components/lcb-banner-block/lcb-banner-block.vue +3 -4
  9. package/components/lcb-block/lcb-block.vue +11 -3
  10. package/components/lcb-block/types.ts +5 -1
  11. package/components/lcb-button/lcb-button.vue +32 -0
  12. package/components/lcb-button/types.ts +8 -0
  13. package/components/lcb-calendar-search/lcb-calendar-search.vue +3 -2
  14. package/components/lcb-city-select/components/lcb-city-letter/index.vue +4 -1
  15. package/components/lcb-city-select/components/lcb-city-list/index.vue +6 -1
  16. package/components/lcb-city-select/lcb-city-select.vue +24 -8
  17. package/components/lcb-gap/lcb-gap.vue +15 -7
  18. package/components/lcb-gap/types.ts +4 -2
  19. package/components/lcb-grid/lcb-grid.vue +56 -20
  20. package/components/lcb-grid/types.ts +8 -0
  21. package/components/lcb-home-search/lcb-home-search.vue +44 -20
  22. package/components/lcb-img-nav/lcb-img-nav.vue +51 -30
  23. package/components/lcb-img-nav/types.ts +16 -0
  24. package/components/lcb-list/components/FilterList/index.vue +26 -21
  25. package/components/lcb-list/components/FilterList/type.ts +1 -1
  26. package/components/lcb-list/components/FilterView/index.vue +121 -0
  27. package/components/lcb-list/components/FilterView/type.ts +8 -0
  28. package/components/lcb-list/hooks/useSelect.ts +2 -0
  29. package/components/lcb-list/lcb-list.vue +57 -138
  30. package/components/lcb-list/types.ts +1 -0
  31. package/components/lcb-nav/lcb-nav.vue +22 -9
  32. package/components/lcb-notice/api/index.ts +21 -0
  33. package/components/lcb-notice/lcb-notice.vue +66 -50
  34. package/components/lcb-notice/types.ts +11 -26
  35. package/components/lcb-product/lcb-product.vue +114 -4
  36. package/components/lcb-product/types.ts +3 -0
  37. package/components/lcb-product-item/components/ItemValue.vue +14 -25
  38. package/components/lcb-product-item/lcb-product-item.vue +13 -7
  39. package/components/lcb-rich-text/lcb-rich-text.vue +22 -0
  40. package/components/lcb-rich-text/types.ts +5 -0
  41. package/components/lcb-text/lcb-text.vue +20 -0
  42. package/components/lcb-text/types.ts +5 -0
  43. package/components/lcb-title/lcb-title.vue +33 -6
  44. package/components/lcb-title/types.ts +17 -3
  45. package/components/lcb-user-order/lcb-user-order.vue +48 -61
  46. package/components/lcb-user-order/types.ts +5 -48
  47. package/components/lcb-user-top/Nums/index.vue +3 -2
  48. package/components/lcb-user-top/lcb-user-top.vue +40 -26
  49. package/components/lcb-vip/api/index.ts +35 -0
  50. package/components/lcb-vip/components/InfoDialog/index.vue +65 -0
  51. package/components/lcb-vip/lcb-vip.vue +96 -0
  52. package/components/lcb-vip/types.ts +8 -0
  53. package/constants.ts +2 -0
  54. package/global.d.ts +5 -0
  55. package/iconfonts/index.css +24 -3
  56. package/index.ts +5 -1
  57. package/package.json +18 -13
  58. package/types/{components/lcb-user-top/api/index.d.ts → api/user.d.ts} +2 -1
  59. package/types/components/lcb-action-view/lcb-action-view.vue.d.ts +2 -22
  60. package/types/components/lcb-action-view/types.d.ts +21 -2
  61. package/types/components/lcb-advert/lcb-advert.vue.d.ts +28 -0
  62. package/types/components/lcb-advert/types.d.ts +3 -0
  63. package/types/components/lcb-area-picker/lcb-area-picker.vue.d.ts +1 -1
  64. package/types/components/lcb-banner-block/lcb-banner-block.vue.d.ts +0 -9
  65. package/types/components/lcb-block/lcb-block.vue.d.ts +4 -0
  66. package/types/components/lcb-block/types.d.ts +5 -0
  67. package/types/components/lcb-button/lcb-button.vue.d.ts +42 -0
  68. package/types/components/lcb-button/types.d.ts +7 -0
  69. package/types/components/lcb-calendar-search/lcb-calendar-search.vue.d.ts +6 -4
  70. package/types/components/lcb-gap/types.d.ts +3 -2
  71. package/types/components/lcb-grid/lcb-grid.vue.d.ts +13 -4
  72. package/types/components/lcb-grid/types.d.ts +8 -0
  73. package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +4 -1
  74. package/types/components/lcb-img-nav/lcb-img-nav.vue.d.ts +21 -2
  75. package/types/components/lcb-img-nav/types.d.ts +15 -0
  76. package/types/components/lcb-list/components/FilterList/index.vue.d.ts +12 -4
  77. package/types/components/lcb-list/components/FilterList/type.d.ts +1 -1
  78. package/types/components/lcb-list/components/FilterView/index.vue.d.ts +36 -0
  79. package/types/components/lcb-list/components/FilterView/type.d.ts +7 -0
  80. package/types/components/lcb-list/lcb-list.vue.d.ts +2 -1
  81. package/types/components/lcb-list/types.d.ts +1 -0
  82. package/types/components/lcb-nav/lcb-nav.vue.d.ts +0 -3
  83. package/types/components/lcb-notice/api/index.d.ts +19 -0
  84. package/types/components/lcb-notice/lcb-notice.vue.d.ts +25 -19
  85. package/types/components/lcb-notice/types.d.ts +11 -24
  86. package/types/components/lcb-product/lcb-product.vue.d.ts +3 -0
  87. package/types/components/lcb-product/types.d.ts +3 -0
  88. package/types/components/lcb-product-item/lcb-product-item.vue.d.ts +2 -2
  89. package/types/components/{lcb-notice/Item/index.vue.d.ts → lcb-rich-text/lcb-rich-text.vue.d.ts} +4 -16
  90. package/types/components/lcb-rich-text/types.d.ts +4 -0
  91. package/types/components/lcb-swiper/lcb-swiper.vue.d.ts +2 -2
  92. package/types/components/lcb-text/lcb-text.vue.d.ts +42 -0
  93. package/types/components/lcb-text/types.d.ts +4 -0
  94. package/types/components/lcb-title/lcb-title.vue.d.ts +27 -1
  95. package/types/components/lcb-title/types.d.ts +15 -3
  96. package/types/components/lcb-user-order/types.d.ts +5 -35
  97. package/types/components/lcb-user-top/Nums/index.vue.d.ts +6 -2
  98. package/types/components/lcb-vip/api/index.d.ts +34 -0
  99. package/types/components/lcb-vip/components/InfoDialog/index.vue.d.ts +38 -0
  100. package/types/components/lcb-vip/lcb-vip.vue.d.ts +68 -0
  101. package/types/components/lcb-vip/types.d.ts +8 -0
  102. package/types/constants.d.ts +2 -0
  103. package/types/index.d.ts +6 -0
  104. package/types/utils/auth.d.ts +2 -0
  105. package/types/utils/transform.d.ts +5 -1
  106. package/types/utils/utils.d.ts +2 -0
  107. package/utils/auth.ts +19 -0
  108. package/utils/transform.ts +13 -2
  109. package/utils/utils.ts +6 -1
  110. package/components/lcb-notice/Item/index.vue +0 -112
  111. package/types/components/lcb-list/components/FilterList/mockData.d.ts +0 -63
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
+ }
@@ -1,3 +1,14 @@
1
- export const transformValueUnit = (value?: number, uni = 'rpx') => {
2
- return typeof value === 'number' ? value + uni : '0rpx'
1
+ export const transformValueUnit = (value?: number | string, uni = 'rpx') => {
2
+ return typeof value === 'number' ? value + uni : typeof value === 'string' ? value : '0rpx'
3
+ }
4
+
5
+ /** 获取json字符串第一个url */
6
+ export const getJsonStrFirstUrl = (jsonStr = '[]') => {
7
+ const json = JSON.parse(jsonStr)
8
+ return json[0]
9
+ }
10
+
11
+ /** 获取json字符串列表 */
12
+ export const getJsonStrList = (jsonStr = '[]') => {
13
+ return JSON.parse(jsonStr)
3
14
  }
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,63 +0,0 @@
1
- declare const _default: {
2
- code: string
3
- count: number
4
- data: {
5
- address: string
6
- agentId: string
7
- areaId: string
8
- areaName: string
9
- auditDateTime: string
10
- auditRemark: string
11
- auditStatus: number
12
- behindUnit: string
13
- bigIcon: boolean
14
- businessStatus: number
15
- cityAreaName: string
16
- cityId: string
17
- cityName: string
18
- clickCount: number
19
- collectCount: number
20
- collectFlag: boolean
21
- commentCount: number
22
- coverImg: string
23
- createDate: string
24
- distance: string
25
- hideTags: string
26
- hierarchy: number
27
- lastModifyDate: string
28
- latitude: string
29
- level: string
30
- longitude: string
31
- mapShowFlag: boolean
32
- marketingType: number
33
- merchantHeadId: string
34
- merchantId: string
35
- orderCount: number
36
- orderSkuCount: number
37
- peopleNumScope: string
38
- phone: string
39
- poiId: string
40
- poiName: string
41
- poiNameI18n: string
42
- poiType: string
43
- praiseCount: number
44
- praiseFlag: boolean
45
- price: number
46
- productId: string
47
- productName: string
48
- productNameI18n: string
49
- productType: string
50
- provinceId: string
51
- provinceName: string
52
- scribePrice: number
53
- showDateFlag: boolean
54
- startDateStr: string
55
- startTime: string
56
- status: number
57
- tags: string
58
- weightSort: string
59
- }[]
60
- dataClass: string
61
- traceId: string
62
- }
63
- export default _default