@tplc/business 0.2.50 → 0.2.52

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,33 @@
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.2.52](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.51...v0.2.52) (2025-01-02)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 兼容location ([cfeae91](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/cfeae9129e034ecec8055d930255894bfa05ebd9))
11
+
12
+ ### [0.2.51](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.50...v0.2.51) (2025-01-02)
13
+
14
+
15
+ ### 🚀 Chore | 构建/工程依赖/工具
16
+
17
+ * **release:** 0.2.47 ([47cc32b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/47cc32b906ccffb611a235174e92f6abc7a3f3da))
18
+ * **release:** 0.2.48 ([a5124e2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a5124e26342e7b2f597f1f3e187841fd975b5467))
19
+ * **release:** 0.2.49 ([0cf9dae](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0cf9dae889de78c64ac86bfc538a07dcce46ce39))
20
+ * **release:** 0.2.50 ([61b87b8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/61b87b87b7630c164c5603e2dfb98c393de7c744))
21
+
22
+
23
+ ### ✨ Features | 新功能
24
+
25
+ * home-search cityName ([265572a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/265572a3c7b2dc5a9ff203129551df0ec2a6dd20))
26
+ * sheet city-select 调整底部 ([e048be0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e048be0036c72a7648a8434bdfa66fd570df3bf4))
27
+ * 修复问题 ([2c67644](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2c67644cc03e4f88b8e0f5aac2f8837c9317f7ec))
28
+ * 修复问题 ([1c9f269](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1c9f269c95b79e67abeec8af5b309d765069fd3a))
29
+ * 修改打包方式 ([9580a78](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9580a789d427c2db7e07c493c36f7f03258d1462))
30
+ * 处理地址字段切换 ([27dd10e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/27dd10e9d609b88560dcb6671503035199e30d08))
31
+
5
32
  ### [0.2.50](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.49...v0.2.50) (2025-01-01)
6
33
 
7
34
 
@@ -71,28 +71,19 @@ const { getLocation, userLocation } = useLocation()
71
71
  watch(
72
72
  () => addressCity.value,
73
73
  (val) => {
74
- form!.value = {
75
- ...form!.value,
76
- cityId: val?.cityId,
77
- }
74
+ if (val) form.value.cityId = val?.cityId
78
75
  },
79
76
  )
80
77
  watch(
81
78
  () => dayRange.value,
82
79
  (val) => {
83
- form!.value = {
84
- ...form!.value,
85
- startDate: dayjs(val[0]).format('YYYY-MM-DD'),
86
- endDate: dayjs(val[1]).format('YYYY-MM-DD'),
87
- }
80
+ form.value.startDate = dayjs(val[0]).format('YYYY-MM-DD')
81
+ form.value.endDate = dayjs(val[1]).format('YYYY-MM-DD')
88
82
  },
89
83
  )
90
84
  getLocation()
91
85
  const onSearch = (e) => {
92
- form.value = {
93
- ...form.value,
94
- keywords: e.detail.value,
95
- }
86
+ form.value.keywords = e.target.value
96
87
  }
97
88
  </script>
98
89
 
@@ -1,6 +1,7 @@
1
1
  export interface HotAddress {
2
2
  categoryName: string
3
3
  hint?: string
4
+ tips?: string
4
5
  childHotAddress: ChildHotAddress[]
5
6
  }
6
7
 
@@ -11,8 +12,10 @@ export interface ChildHotAddress {
11
12
  categoryName: string
12
13
  createDate?: string
13
14
  hotAddressId: string
15
+ icon?: string
14
16
  lastModifyDate?: string
15
17
  latitude?: string
18
+ className?: string
16
19
  cityId: string
17
20
  longitude?: string
18
21
  weightSort: string
@@ -26,6 +26,7 @@
26
26
  class="address-tag"
27
27
  :class="{
28
28
  'current-address': modelValue && modelValue.cityId === city.cityId,
29
+ [city.className || '']: true,
29
30
  }"
30
31
  v-for="city in item.childHotAddress"
31
32
  :key="city.addr"
@@ -34,9 +35,17 @@
34
35
  fontSize: city.addr.length > 4 ? '20rpx' : '24rpx',
35
36
  }"
36
37
  >
38
+ <wd-icon v-if="city.icon" :name="city.icon" class="mr-0.5" />
37
39
  {{ city.addr }}
38
40
  </view>
39
41
  </view>
42
+ <view
43
+ v-if="item.tips"
44
+ class="flex items-center text-red-5 text-3 gap-1 px-28rpx box-border mt-3"
45
+ >
46
+ <wd-icon name="error-circle" size="28rpx"></wd-icon>
47
+ <view>{{ item.tips }}</view>
48
+ </view>
40
49
  </view>
41
50
  </wd-index-bar>
42
51
  </view>
@@ -75,11 +84,17 @@ const locationAddress = computed<HotAddress[]>(() => {
75
84
  {
76
85
  categoryName: '定位',
77
86
  hint: '当前位置',
87
+ tips: props.location.haveNotTip || '当前地址未开通',
78
88
  childHotAddress: [
79
89
  {
80
- addressInfo: props.location.addressInfo,
81
- addr: props.location.cityName,
82
- cityId: props.location.cityId,
90
+ addr: props.location.haveNotCityName || props.location.cityName,
91
+ cityId: props.location.haveNotCityId || props.location.cityId,
92
+ icon: 'location',
93
+ },
94
+ {
95
+ addr: props.location.haveNotAddressInfo || props.location.addressInfo,
96
+ cityId: props.location.haveNotCityId || props.location.cityId,
97
+ className: 'w-25',
83
98
  },
84
99
  ],
85
100
  },
@@ -72,7 +72,6 @@ defineOptions({
72
72
  styleIsolation: 'shared',
73
73
  },
74
74
  })
75
- const isTabBar = uni.$lcb.getIsTabbar()
76
75
  const props = withDefaults(defineProps<LcbCitySelectProps>(), {
77
76
  placeholder: '搜索城市/区域/景点',
78
77
  })
@@ -52,7 +52,7 @@
52
52
  :placeholder="placeholder"
53
53
  v-model="form.keywords"
54
54
  />
55
- <view class="justify-center flex flex-col items-center" @click="getLocation">
55
+ <view class="justify-center flex flex-col items-center" @click="getLocation(true)">
56
56
  <wd-loading size="30rpx" v-if="locationIng" />
57
57
  <img
58
58
  class="w-30rpx h-30rpx"
@@ -145,6 +145,8 @@ const form = reactive({
145
145
  startDate: '',
146
146
  endDate: '',
147
147
  cityId: '',
148
+ addr: '',
149
+ cityName: '',
148
150
  })
149
151
 
150
152
  // 今天 明天 后天 周...
@@ -173,6 +175,7 @@ watchEffect(() => {
173
175
  watchEffect(() => {
174
176
  if (addressCity.value) {
175
177
  form.cityId = addressCity.value.cityId
178
+ form.addr = addressCity.value.addr
176
179
  }
177
180
  })
178
181
  </script>
@@ -12,6 +12,7 @@
12
12
  custom-class="px-4"
13
13
  custom-min-class="left-0 slider-text"
14
14
  custom-max-class="right--2 slider-text"
15
+ :active-color="themeColor"
15
16
  />
16
17
  <view class="grid grid-cols-4 gap-4 mt-2" v-if="options.length">
17
18
  <SelectTagView
@@ -29,7 +30,7 @@
29
30
  <script setup lang="ts">
30
31
  import { FilterSliderProps } from './types'
31
32
  import SelectTagView from '../SelectTagView/index.vue'
32
- import { onMounted, onUnmounted, ref, watch } from 'vue'
33
+ import { onMounted, onUnmounted, ref, watch, inject } from 'vue'
33
34
  import type { SliderInstance } from '@tplc/wot/components/wd-slider/types'
34
35
  defineOptions({
35
36
  name: 'FilterSlider',
@@ -39,6 +40,7 @@ defineOptions({
39
40
  styleIsolation: 'shared',
40
41
  },
41
42
  })
43
+ const themeColor = inject('theme-color', '#3875FF')
42
44
  const slider = ref<SliderInstance>()
43
45
  const props = defineProps<FilterSliderProps>()
44
46
  const model = defineModel<number[]>()
@@ -2,6 +2,10 @@ export interface UserLocation {
2
2
  addressInfo: string
3
3
  cityId: string
4
4
  cityName: string
5
+ haveNotCityId: string
6
+ haveNotCityName: string
7
+ haveNotAddressInfo: string
8
+ haveNotTip: string
5
9
  }
6
10
  export const getUserLocation = (data: { userLongitude: string; userLatitude: string }) =>
7
11
  uni.$lcb.http.post<UserLocation>('/hotAddress/userLocation', data)
@@ -1,10 +1,10 @@
1
1
  import { useTranslate } from '@tplc/wot'
2
2
  import { ref } from 'vue'
3
3
  import { getUserLocation, UserLocation } from './useLocation.api'
4
-
4
+ const currentLocation = ref<UserLocation>()
5
5
  const useLocation = () => {
6
6
  const { translate } = useTranslate()
7
- const userLocation = ref<UserLocation>()
7
+ const userLocation = ref<UserLocation | undefined>(currentLocation.value)
8
8
  // 正在获取经纬度
9
9
  const locationIng = ref(false)
10
10
  // 检查用户是否授权定位
@@ -41,22 +41,22 @@ const useLocation = () => {
41
41
  })
42
42
  }
43
43
 
44
- const getLocation = async () => {
44
+ const getLocation = async (force = false) => {
45
+ // 如果不是force并且当前位置有值,则不刷新
46
+ if (!force && currentLocation.value) return
45
47
  if ((await checkLocationPermission()) !== false) {
46
48
  locationIng.value = true
47
- console.log('开始获取位置信息')
48
49
  uni.getLocation({
49
50
  // type: 'gcj02',
50
51
  // type: 'wgs84',
51
52
  success: function (res) {
52
- console.log('当前位置的经度:' + res.longitude)
53
- console.log('当前位置的纬度:' + res.latitude)
54
53
  getUserLocation({
55
54
  userLongitude: res.longitude.toString(),
56
55
  userLatitude: res.latitude.toString(),
57
56
  })
58
57
  .then((res) => {
59
58
  userLocation.value = res.data
59
+ currentLocation.value = res.data
60
60
  })
61
61
  .finally(() => {
62
62
  locationIng.value = false
@@ -68,7 +68,6 @@ const useLocation = () => {
68
68
  },
69
69
  })
70
70
  } else {
71
- console.log('开始获取位2置信息')
72
71
  navigateToSettings()
73
72
  }
74
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -1,6 +1,7 @@
1
1
  export interface HotAddress {
2
2
  categoryName: string
3
3
  hint?: string
4
+ tips?: string
4
5
  childHotAddress: ChildHotAddress[]
5
6
  }
6
7
  export interface ChildHotAddress {
@@ -10,8 +11,10 @@ export interface ChildHotAddress {
10
11
  categoryName: string
11
12
  createDate?: string
12
13
  hotAddressId: string
14
+ icon?: string
13
15
  lastModifyDate?: string
14
16
  latitude?: string
17
+ className?: string
15
18
  cityId: string
16
19
  longitude?: string
17
20
  weightSort: string
@@ -2,6 +2,10 @@ export interface UserLocation {
2
2
  addressInfo: string
3
3
  cityId: string
4
4
  cityName: string
5
+ haveNotCityId: string
6
+ haveNotCityName: string
7
+ haveNotAddressInfo: string
8
+ haveNotTip: string
5
9
  }
6
10
  export declare const getUserLocation: (data: {
7
11
  userLongitude: string
@@ -1,7 +1,17 @@
1
- import { UserLocation } from './useLocation.api'
2
1
  declare const useLocation: () => {
3
- getLocation: () => Promise<void>
2
+ getLocation: (force?: boolean) => Promise<void>
4
3
  locationIng: import('vue').Ref<boolean>
5
- userLocation: import('vue').Ref<UserLocation | undefined>
4
+ userLocation: import('vue').Ref<
5
+ | {
6
+ addressInfo: string
7
+ cityId: string
8
+ cityName: string
9
+ haveNotCityId: string
10
+ haveNotCityName: string
11
+ haveNotAddressInfo: string
12
+ haveNotTip: string
13
+ }
14
+ | undefined
15
+ >
6
16
  }
7
17
  export default useLocation