@tplc/business 0.4.111 → 0.4.113

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,58 @@
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.4.113](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.111...v0.4.113) (2025-05-14)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.112 ([4cf93e5](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4cf93e53809128aa4d13200eb590e030e47a47ef))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * history 根据productName唯一 ([27149ba](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/27149ba0de8dd19cb84be79703d9915222634a99))
16
+ * propmt ([7904ba7](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7904ba753b23dd38ca995c64a2a9c269ad9c95de))
17
+ * 动态参数抽离 ([0082963](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/008296339ba898c05f241c8e78f54ddb39214f8b))
18
+ * 同步button text ([54e3778](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/54e3778dd724cfa489ef911c6cb37383001f9075))
19
+ * 定位调整为gcj02 ([9bf188c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9bf188c1216959c75ea7583254bfc87684d5245a))
20
+ * 新增下载地址 ([0885ce4](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0885ce48b5fc836461c0df3191cb2abb1605262e))
21
+
22
+ ### [0.4.112](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.102...v0.4.112) (2025-05-14)
23
+
24
+
25
+ ### 🐛 Bug Fixes | Bug 修复
26
+
27
+ * nav 判断 ([6fd5aa6](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6fd5aa6e27722e1a17ebd637cf4b1c29d0599eab))
28
+
29
+
30
+ ### 🚀 Chore | 构建/工程依赖/工具
31
+
32
+ * **release:** 0.1.84 ([978a423](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/978a423888285828ef7a67be92d7a768939177bf))
33
+ * **release:** 0.4.103 ([a4a3273](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a4a3273778bac7bdec891583d5e49023a971fb47))
34
+ * **release:** 0.4.104 ([b8893d9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b8893d9bfc936b60ef446fc870a62969f42494a3))
35
+ * **release:** 0.4.105 ([a72733f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a72733ffa323ae64de31ddf523adddbc1ec0fe12))
36
+ * **release:** 0.4.106 ([d01fdf2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d01fdf265ede3dae9a06411f818e21276e40954d))
37
+ * **release:** 0.4.107 ([f35a30e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f35a30ecfe25f99fe5aabd6eba304bb162d2df52))
38
+ * **release:** 0.4.108 ([db82232](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/db82232c95953ac1e803a3e299a8c918902cd1ec))
39
+ * **release:** 0.4.109 ([4dacd17](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4dacd172af9e5141ee2fe8b888e717e1164fc18f))
40
+ * **release:** 0.4.110 ([6fa19ee](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6fa19ee9cae724ef63dce386351b2efc59d69e0b))
41
+ * **release:** 0.4.111 ([3608ea5](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3608ea5b67a2e959bc8e5586b4f64a0ece9ab6c9))
42
+
43
+
44
+ ### ✨ Features | 新功能
45
+
46
+ * swiper 兼容小程序pc ([677655c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/677655c96596404322b76258db277d530c66f8e5))
47
+ * 兼容布局 ([7b50990](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7b50990b737c4a1d7a1ebf05f1b5c49194709dec))
48
+ * 同步button text ([54e3778](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/54e3778dd724cfa489ef911c6cb37383001f9075))
49
+ * 定位调整为gcj02 ([9bf188c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9bf188c1216959c75ea7583254bfc87684d5245a))
50
+ * 对比修改 ([2decf5d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2decf5d485bd6d9c197d1d9fd2566bbcb29d9ffb))
51
+ * 对比值对比 ([9673e9a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9673e9ae729a0d539bf30d2c9fe48dd151bd119d))
52
+ * 新增下载地址 ([0885ce4](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0885ce48b5fc836461c0df3191cb2abb1605262e))
53
+ * 新增骨架屏 ([6f837dd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6f837ddb1c1db52b25ec2155461a4cade58bfc09))
54
+ * 暂时提交骨架屏 ([4314836](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/43148361462a43b75f4f80806b6021d979b398d5))
55
+ * 系统参数变更 ([056e443](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/056e443c95c7cddadf15277ac2114255776a9142))
56
+
5
57
  ### [0.4.111](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.110...v0.4.111) (2025-05-12)
6
58
 
7
59
 
@@ -263,6 +263,24 @@ const onActionClick = async () => {
263
263
  case 142:
264
264
  onTemplateMessage()
265
265
  break
266
+ case 143:
267
+ if (jumpUrl) {
268
+ uni.downloadFile({
269
+ url: jumpUrl,
270
+ success: (res) => {
271
+ uni.saveImageToPhotosAlbum({
272
+ filePath: res.tempFilePath,
273
+ success: () => {
274
+ uni.showToast({
275
+ title: '下载成功',
276
+ icon: 'none',
277
+ })
278
+ },
279
+ })
280
+ },
281
+ })
282
+ }
283
+ break
266
284
  default:
267
285
  emits('click')
268
286
  break
@@ -16,6 +16,7 @@ export type LcbActionViewProps = {
16
16
  * 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页
17
17
  * 105 查看地图 106 查看地图 141 二维码 241 返回并刷新上个页面 142 模板消息
18
18
  * 107 图片预览
19
+ * 143 下载图片
19
20
  */
20
21
  jumpType?:
21
22
  | 1
@@ -38,6 +39,7 @@ export type LcbActionViewProps = {
38
39
  | 103
39
40
  | 104
40
41
  | 241
42
+ | 143
41
43
 
42
44
  /** 小程序appid */
43
45
  jumpAppid?: string
@@ -16,7 +16,7 @@
16
16
  ...innerItemStyle,
17
17
  }"
18
18
  >
19
- <lcb-action-view v-bind="action" @avatar="onAvatar">
19
+ <lcb-action-view v-bind="actionProps" @avatar="onAvatar">
20
20
  <view class="!flex items-center justify-center" :style="`gap: ${iconGap}rpx`">
21
21
  <wd-icon
22
22
  v-if="icon"
@@ -47,7 +47,7 @@ import { computed, inject, Ref } from 'vue'
47
47
  import { LcbButtonProps } from './types'
48
48
  import { PAGE_PROVIDE_KEY } from '../../constants'
49
49
  import { getFlexStyle, transformValueUnit } from '../../utils/transform'
50
- import { get } from 'lodash-es'
50
+ import { getDynamicData } from '../../utils/utils'
51
51
  defineOptions({
52
52
  name: 'LcbButton',
53
53
  options: {
@@ -69,11 +69,10 @@ const userStore = uni.$lcb.userStore?.()
69
69
  const dynamicValue = computed(() => {
70
70
  let value = ''
71
71
  if (props.dynamicKey) {
72
- if (props.keyFromUser) {
73
- value = get(userStore?.userInfo, props.dynamicKey)
74
- } else {
75
- value = get(pageInfo.value, props.dynamicKey)
76
- }
72
+ value = getDynamicData(props.dynamicKey, {
73
+ store: props.keyFromUser ? userStore?.userInfo : pageInfo.value,
74
+ defaultText: props.textDefaultValue,
75
+ })
77
76
  }
78
77
  return value
79
78
  })
@@ -81,17 +80,20 @@ const innerValue = computed(() => {
81
80
  if (props.mode === 'image') {
82
81
  return dynamicValue.value || props.url
83
82
  }
84
- let value = props.text
85
- if (props.text && props.text.includes('${')) {
86
- value = props.text.replace(/\$\{([^}]+)\}/g, (_, p) => {
87
- if (props.keyFromUser) {
88
- return get(userStore?.userInfo, p) ?? props.textDefaultValue ?? ''
89
- } else {
90
- return get(pageInfo.value, p) ?? props.textDefaultValue ?? ''
91
- }
92
- })
83
+ return getDynamicData(props.text, {
84
+ store: props.keyFromUser ? userStore?.userInfo : pageInfo.value,
85
+ defaultText: props.textDefaultValue,
86
+ })
87
+ })
88
+
89
+ /** 处理跳转链接中的动态参数 */
90
+ const actionProps = computed(() => {
91
+ return {
92
+ ...props.action,
93
+ jumpUrl: getDynamicData(props.action?.jumpUrl, {
94
+ store: props.keyFromUser ? userStore?.userInfo : pageInfo.value,
95
+ }),
93
96
  }
94
- return value
95
97
  })
96
98
  const onAvatar = (headImgUrl) => {
97
99
  userStore?.updateUser(
@@ -67,10 +67,10 @@ async function link({ item }: { item: IPageBtn }) {
67
67
  inputError: '内容不能为空',
68
68
  inputValidate: (value) => Boolean(value),
69
69
  })
70
- .then(async () => {
70
+ .then(async ({ value }) => {
71
71
  await uni.$lcb.http.post(item.requestUrl, {
72
72
  ...item.requestParam,
73
- [item.popUpRequestInfo.inputKey]: formValue.value,
73
+ [item.popUpRequestInfo.inputKey]: value,
74
74
  })
75
75
  emits('refresh')
76
76
  })
@@ -69,7 +69,7 @@ const saveHistory = (keyword: ProductInfo) => {
69
69
  try {
70
70
  const list = historyList.value
71
71
  // 删除已存在的相同记录
72
- const index = list.findIndex((item) => item.productInfoId === keyword.productInfoId)
72
+ const index = list.findIndex((item) => item.productName === keyword.productName)
73
73
  if (index !== -1) {
74
74
  list.splice(index, 1)
75
75
  }
@@ -54,7 +54,7 @@ const useLocation = (onLocation?: (location: UserLocation) => void) => {
54
54
  locationIng.value = true
55
55
  await new Promise<void>((resolve) => {
56
56
  uni.getLocation({
57
- // type: 'gcj02',
57
+ type: 'gcj02',
58
58
  // type: 'wgs84',
59
59
  success: function (res) {
60
60
  currentUserLatLon.value = res
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.111",
3
+ "version": "0.4.113",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -15,6 +15,7 @@ export type LcbActionViewProps = {
15
15
  * 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页
16
16
  * 105 查看地图 106 查看地图 141 二维码 241 返回并刷新上个页面 142 模板消息
17
17
  * 107 图片预览
18
+ * 143 下载图片
18
19
  */
19
20
  jumpType?:
20
21
  | 1
@@ -37,6 +38,7 @@ export type LcbActionViewProps = {
37
38
  | 103
38
39
  | 104
39
40
  | 241
41
+ | 143
40
42
  /** 小程序appid */
41
43
  jumpAppid?: string
42
44
  /** 弹窗文案 */
@@ -95,6 +95,7 @@ declare const _default: import('vue').DefineComponent<
95
95
  | 103
96
96
  | 104
97
97
  | 241
98
+ | 143
98
99
  jumpAppid?: string
99
100
  content?: string
100
101
  title?: string
@@ -23,3 +23,14 @@ export declare const calculateImageHeight: (
23
23
  ) => number
24
24
  export declare const customUpload: UploadMethod
25
25
  export declare const getSharePath: () => string
26
+ /** 获取动态数据 */
27
+ export declare const getDynamicData: (
28
+ text: string | undefined,
29
+ {
30
+ store,
31
+ defaultText,
32
+ }: {
33
+ store?: Record<string, any>
34
+ defaultText?: string
35
+ },
36
+ ) => string
package/utils/utils.ts CHANGED
@@ -2,6 +2,7 @@ import { isH5 } from '@tplc/wot/components/common/util'
2
2
  import { UploadMethod } from '@tplc/wot/types/components/wd-upload/types'
3
3
  import { uploadFile } from '../hooks/useUpload'
4
4
  import { parse, stringify } from 'qs'
5
+ import { get } from 'lodash-es'
5
6
  export function formatJson(str: string | object | undefined, defVal = {}) {
6
7
  if (!str) return defVal
7
8
  if (typeof str === 'object') return str
@@ -119,3 +120,23 @@ export const getSharePath = () => {
119
120
  distributorId: uni.$lcb.userStore?.()?.userInfo?.distributorId,
120
121
  })}`
121
122
  }
123
+
124
+ /** 获取动态数据 */
125
+ export const getDynamicData = (
126
+ text = '',
127
+ {
128
+ store,
129
+ defaultText,
130
+ }: {
131
+ store?: Record<string, any>
132
+ defaultText?: string
133
+ },
134
+ ) => {
135
+ let value = text
136
+ if (text && text.includes('${')) {
137
+ value = text.replace(/\$\{([^}]+)\}/g, (_, p) => {
138
+ return get(store, p) ?? defaultText ?? ''
139
+ })
140
+ }
141
+ return value
142
+ }