| | |
| | | </view> |
| | | </view> |
| | | |
| | | <scroll-view class="content" scroll-y lower-threshold="80" @scroll="handleScroll" @scrolltolower="loadMoreBenefits"> |
| | | <scroll-view :show-scrollbar="false" class="content" scroll-y lower-threshold="80" @scroll="handleScroll" @scrolltolower="loadMoreBenefits"> |
| | | <view class="hero"> |
| | | <image class="hero-image" src="/static/benefits-assets/benefits-hero.jpg" mode="aspectFill"></image> |
| | | <view class="hero-shade"></view> |
| | |
| | | import { isApiConfigured } from '../../config/api.uts' |
| | | import { getMerchants } from '../../services/portal.uts' |
| | | import { resolveApiUrl } from '../../services/http.uts' |
| | | import { getSession } from '../../services/session.uts' |
| | | import { resolveTalentId } from '../../utils/talent-id.uts' |
| | | import { openMerchantDetail } from '../../utils/merchant-navigation.uts' |
| | | |
| | | const navTop = ref(28) |
| | | const navHeight = ref(32) |
| | |
| | | failInitialOnce.value = previewState == 'initialError' |
| | | failLoadMoreOnce.value = previewState == 'loadMoreError' |
| | | } |
| | | const session = getSession() |
| | | if (session != null && session.talentId != null) talentId.value = '' + session.talentId |
| | | talentId.value = resolveTalentId() |
| | | loadInitialBenefits() |
| | | }) |
| | | |
| | |
| | | ] |
| | | |
| | | const allBenefits = [ |
| | | { id: 1, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/food-assets/food-1.jpg' }, |
| | | { id: 2, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/food-assets/food-2.jpg' }, |
| | | { id: 3, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/food-assets/food-1.jpg' }, |
| | | { id: 4, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/food-assets/food-2.jpg' }, |
| | | { id: 5, name: '百杏厨房(中环天地店)', discount: '8.8折', address: '东区炳三区新福路20号中环天地负一层', image: '/static/food-assets/food-1.jpg' }, |
| | | { id: 6, name: '香佰里鲜货火锅(万象城店)', discount: '8.8折', address: '东区攀枝花大道东段298号', image: '/static/food-assets/food-2.jpg' }, |
| | | { id: 7, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/food-assets/food-1.jpg' }, |
| | | { id: 8, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/food-assets/food-2.jpg' }, |
| | | { id: 9, name: '百杏厨房(中环天地店)', discount: '8.8折', address: '东区炳三区新福路20号中环天地负一层', image: '/static/food-assets/food-1.jpg' }, |
| | | { id: 10, name: '香佰里鲜货火锅(万象城店)', discount: '8.8折', address: '东区攀枝花大道东段298号', image: '/static/food-assets/food-2.jpg' }, |
| | | { id: 11, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/food-assets/food-1.jpg' }, |
| | | { id: 12, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/food-assets/food-2.jpg' } |
| | | { id: 1, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 2, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 3, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 4, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 5, name: '百杏厨房(中环天地店)', discount: '8.8折', address: '东区炳三区新福路20号中环天地负一层', image: '/static/common/image-placeholder.png' }, |
| | | { id: 6, name: '香佰里鲜货火锅(万象城店)', discount: '8.8折', address: '东区攀枝花大道东段298号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 7, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 8, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 9, name: '百杏厨房(中环天地店)', discount: '8.8折', address: '东区炳三区新福路20号中环天地负一层', image: '/static/common/image-placeholder.png' }, |
| | | { id: 10, name: '香佰里鲜货火锅(万象城店)', discount: '8.8折', address: '东区攀枝花大道东段298号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 11, name: '乡菜郎·攀枝花特色延边菜', discount: '6折', address: '西区格里坪镇清香坪东街78号', image: '/static/common/image-placeholder.png' }, |
| | | { id: 12, name: '金府酒楼(西区店)', discount: '6折', address: '西区清香坪北街51号', image: '/static/common/image-placeholder.png' } |
| | | ] |
| | | const visibleBenefits = ref<any[]>([]) |
| | | const loadedBenefitCount = ref(0) |
| | |
| | | id: '' + item.id, |
| | | name: item.merchantName != null ? item.merchantName as string : '人才权益商户', |
| | | merchantType: merchantType, |
| | | detailType: item.detailType != null ? item.detailType as string : 'MERCHANT', |
| | | detailBusinessId: item.detailBusinessId != null ? '' + item.detailBusinessId : '' + item.id, |
| | | targetAction: item.targetAction != null ? item.targetAction as string : 'MERCHANT', |
| | | hasCoupon: hasCoupon, |
| | | discount: discount, |
| | | tags: tags, |
| | |
| | | } |
| | | uni.showToast({ title: '已选择' + name, icon: 'none' }) |
| | | } |
| | | const openMerchant = (item: any) => uni.navigateTo({ |
| | | url: '/pages/merchant/merchant?merchantType=' + encodeURIComponent(item.merchantType != null ? item.merchantType : 'food') + '&merchantId=' + encodeURIComponent(item.id) |
| | | + '&name=' + encodeURIComponent(item.name) |
| | | + '&image=' + encodeURIComponent(item.image) |
| | | + '&address=' + encodeURIComponent(item.address) |
| | | + '&discount=' + encodeURIComponent(item.discount) |
| | | }) |
| | | const openMerchant = (item: any) => openMerchantDetail(item) |
| | | const loadMoreBenefits = () => { |
| | | if (initialLoading.value || loadingMore.value || !hasMoreBenefits.value) return |
| | | loadMoreError.value = false |