| | |
| | | import { resolveApiUrl } from '../../services/http.uts' |
| | | import { getSession } from '../../services/session.uts' |
| | | import { safeBack } from '../../utils/navigation.uts' |
| | | import { openMerchantDetail } from '../../utils/merchant-navigation.uts' |
| | | |
| | | const navTop = ref(28) |
| | | const navHeight = ref(32) |
| | |
| | | keyword.value = value |
| | | performSearch() |
| | | } |
| | | const openMerchant = (item: any) => { |
| | | const action = item.targetAction != null ? item.targetAction as string : 'MERCHANT' |
| | | const detailBusinessId = item.detailBusinessId != null ? item.detailBusinessId as string : item.id as string |
| | | if (action == 'CINEMA') { |
| | | uni.navigateTo({ url: '/pages/cinema-merchant/cinema-merchant?merchantId=' + encodeURIComponent(detailBusinessId) + '&name=' + encodeURIComponent(item.name) }) |
| | | return |
| | | } |
| | | if (action == 'SHOPPING') { |
| | | uni.navigateTo({ url: '/pages/shopping-merchant/shopping-merchant?name=' + encodeURIComponent(item.name) + '&discount=' + encodeURIComponent(item.discount) + '&address=' + encodeURIComponent(item.address) }) |
| | | return |
| | | } |
| | | if (action == 'MEDICAL') { |
| | | uni.navigateTo({ url: '/pages/merchant/merchant?type=medical&name=' + encodeURIComponent(item.name) }) |
| | | return |
| | | } |
| | | if (action == 'FINANCE') { |
| | | uni.navigateTo({ url: '/pages/finance-merchant/finance-merchant?name=' + encodeURIComponent(item.name) + '&discount=' + encodeURIComponent(item.discount) + '&address=' + encodeURIComponent(item.address) + '&image=' + encodeURIComponent(item.image) }) |
| | | return |
| | | } |
| | | if (action == 'CAR_WASH') { |
| | | uni.navigateTo({ url: '/pages/car-wash-merchant/car-wash-merchant?merchantId=' + encodeURIComponent(detailBusinessId) + '&name=' + encodeURIComponent(item.name) }) |
| | | return |
| | | } |
| | | if (action == 'FUEL' || action == 'PARKING') { |
| | | const transportAction = action == 'PARKING' ? 'plate' : 'mobile' |
| | | uni.navigateTo({ url: '/pages/merchant/merchant?type=transport&name=' + encodeURIComponent(item.name) + '&action=' + transportAction + '&plateMode=withParking' }) |
| | | return |
| | | } |
| | | uni.navigateTo({ |
| | | url: '/pages/merchant/merchant?merchantType=' + encodeURIComponent(item.merchantType) |
| | | + '&merchantId=' + encodeURIComponent(detailBusinessId) |
| | | + '&name=' + encodeURIComponent(item.name) |
| | | + '&image=' + encodeURIComponent(item.image) |
| | | + '&address=' + encodeURIComponent(item.address) |
| | | + '&discount=' + encodeURIComponent(item.discount) |
| | | }) |
| | | } |
| | | const openMerchant = (item: any) => openMerchantDetail(item) |
| | | const loadMoreMerchants = () => { |
| | | if (initialLoading.value || loadingMore.value || !hasMore.value) return |
| | | const requestVersion = listRequestVersion.value |