@tplc/business 0.5.84 → 0.5.89

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,40 @@
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.5.89](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.88...v0.5.89) (2025-12-10)
6
+
7
+ ### [0.5.88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.14...v0.5.88) (2025-12-10)
8
+
9
+
10
+ ### 🚀 Chore | 构建/工程依赖/工具
11
+
12
+ * **release:** 0.5.84 ([b0001c5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/b0001c597ad82c90324923f1b74428d0a9999bdf))
13
+ * **release:** 0.5.85 ([33cb28a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/33cb28aa00f219ef61d09f1798d0754aaec81b34))
14
+ * **release:** 0.5.86 ([a834adc](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/a834adcf9ffd3e7c2ffd4e84dbe746d65207b31e))
15
+ * **release:** 0.5.87 ([5b63acf](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/5b63acf2142d48f41a5fee9c5c5729fcf369c395))
16
+ * **release:** 0.5.88 ([29ba0c7](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/29ba0c76fd08103f805e8f2e64b5e46d46b93996))
17
+
18
+
19
+ ### ✨ Features | 新功能
20
+
21
+ * form 删除 gap ([f5158bd](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/f5158bd25f0e53240401e40248b588ac5b523a8c))
22
+ * 兼容onUnmounted ([77dc8fb](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/77dc8fbb9d2bb144633696f8329f60e55255a15c))
23
+ * 调整cityAddress 只有4个字段 ([72d81ef](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/72d81efde8f3ce1a918c68942710277160971d94))
24
+
25
+ ### [0.5.87](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.88...v0.5.87) (2025-12-10)
26
+
27
+ ### [0.5.88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.86...v0.5.88) (2025-12-10)
28
+
29
+ ### [0.5.86](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.85...v0.5.86) (2025-12-10)
30
+
31
+ ### [0.5.85](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.84...v0.5.85) (2025-12-10)
32
+
33
+
34
+ ### ✨ Features | 新功能
35
+
36
+ * form 删除 gap ([f5158bd](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/f5158bd25f0e53240401e40248b588ac5b523a8c))
37
+ * 兼容onUnmounted ([77dc8fb](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/77dc8fbb9d2bb144633696f8329f60e55255a15c))
38
+
5
39
  ### [0.5.84](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.77...v0.5.84) (2025-12-09)
6
40
 
7
41
 
@@ -68,6 +68,7 @@ import { LcbAddress } from '../lcb-city-select/api'
68
68
  import { FORM_KEY } from '../../constants'
69
69
  import { getHistoryCity } from '../../utils/history'
70
70
  import { stringify } from 'qs'
71
+ import { getCityData } from '../../utils/utils'
71
72
  defineOptions({
72
73
  name: 'LcbCalendarSearch',
73
74
  options: {
@@ -128,7 +129,7 @@ watch(
128
129
  () => form.value.addressName,
129
130
  (val) => {
130
131
  if (addressCity.value?.addressName !== val) {
131
- addressCity.value = form.value as LcbAddress
132
+ addressCity.value = getCityData(form.value)
132
133
  }
133
134
  },
134
135
  )
package/hooks/usePay.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { commitOrder, queryOrderPaymentStatus, type CommitPageDetailParams } from '../api/pay'
2
2
  import { onPageHide } from '@dcloudio/uni-app'
3
3
  import { IResData } from '../action'
4
- import { ref } from 'vue'
4
+ import { onUnmounted, ref } from 'vue'
5
5
 
6
6
  const usePay = (
7
7
  fun?: (data: unknown) => Promise<IResData<any>>,
@@ -65,7 +65,9 @@ const usePay = (
65
65
  })
66
66
  }
67
67
  onPageHide(() => {
68
- console.log('onPageHide')
68
+ cancel?.()
69
+ })
70
+ onUnmounted(() => {
69
71
  cancel?.()
70
72
  })
71
73
  return [pay]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.5.84",
3
+ "version": "0.5.89",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -2,4 +2,4 @@ import { ChildHotAddress } from '../components/lcb-city-select/api'
2
2
  /** 设置城市历史记录 */
3
3
  export declare const setHistoryCity: (address?: ChildHotAddress) => void
4
4
  /** 获取城市历史记录如果超过3天就不使用历史 */
5
- export declare const getHistoryCity: () => any
5
+ export declare const getHistoryCity: () => import('../components/lcb-city-select/api').LcbAddress
@@ -1,4 +1,5 @@
1
1
  import { UploadMethod } from '@tplc/wot/types/components/wd-upload/types'
2
+ import { LcbAddress } from '../components/lcb-city-select/api'
2
3
  export declare function formatJson(str: string | object | undefined, defVal?: {}): {}
3
4
  /** 获取上个页面Exposed */
4
5
  export declare const getExposed: () => any
@@ -47,3 +48,4 @@ export declare const getOssImageSize: (url: string) => Promise<{
47
48
  width: number
48
49
  height: number
49
50
  }>
51
+ export declare const getCityData: (data?: Record<string, unknown>) => LcbAddress
package/utils/history.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ChildHotAddress } from '../components/lcb-city-select/api'
2
+ import { getCityData } from './utils'
2
3
 
3
4
  /** 设置城市历史记录 */
4
5
  export const setHistoryCity = (address?: ChildHotAddress) => {
@@ -12,9 +13,6 @@ export const setHistoryCity = (address?: ChildHotAddress) => {
12
13
  /** 获取城市历史记录如果超过3天就不使用历史 */
13
14
  export const getHistoryCity = () => {
14
15
  const history = uni.getStorageSync('cityHistory')
15
- if (history) {
16
- return history.address as ChildHotAddress
17
- } else {
18
- return getApp().globalData!.currentCity
19
- }
16
+ const data = history?.address ? getCityData(history.address) : getApp().globalData!.currentCity
17
+ return getCityData(data)
20
18
  }
package/utils/utils.ts CHANGED
@@ -3,8 +3,8 @@ 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
5
  import { get } from 'lodash-es'
6
- import { transformValueUnit } from './transform'
7
6
  import { getCurrentInstance } from 'vue'
7
+ import { LcbAddress } from '../components/lcb-city-select/api'
8
8
  export function formatJson(str: string | object | undefined, defVal = {}) {
9
9
  if (!str) return defVal
10
10
  if (typeof str === 'object') return str
@@ -197,3 +197,16 @@ export const getOssImageSize = async (url: string) => {
197
197
  })
198
198
  })
199
199
  }
200
+
201
+ export const getCityData = (data: Record<string, unknown> = {}) => {
202
+ const keys = ['addressName', 'cityId', 'provinceId', 'areaId']
203
+ return keys.reduce(
204
+ (acc, key) => {
205
+ if (data[key] !== undefined) {
206
+ acc[key] = data[key]
207
+ }
208
+ return acc
209
+ },
210
+ {} as unknown as LcbAddress,
211
+ )
212
+ }