|
@@ -44,7 +44,7 @@ const { send, data, pageCount, loading, page, pageSize, isLastPage, refresh, rel
|
|
|
name: searchValue.value === '' ? '' : searchValue.value,
|
|
name: searchValue.value === '' ? '' : searchValue.value,
|
|
|
relatedId: categoryType.value,
|
|
relatedId: categoryType.value,
|
|
|
type: couponType.value === '0' ? '' : couponType.value,
|
|
type: couponType.value === '0' ? '' : couponType.value,
|
|
|
- country: currentCity.value?.value === 'all' ? '' : currentCity.value?.value,
|
|
|
|
|
|
|
+ country: currentCity.value?.value === 'all' ? '' : currentCity.value.value,
|
|
|
}), {
|
|
}), {
|
|
|
initialPage: 1,
|
|
initialPage: 1,
|
|
|
initialPageSize: 7,
|
|
initialPageSize: 7,
|
|
@@ -99,7 +99,7 @@ const downOption = reactive({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const upOption = computed(() => ({
|
|
const upOption = computed(() => ({
|
|
|
- use: hasLogin.value,
|
|
|
|
|
|
|
+ use: true,
|
|
|
auto: false,
|
|
auto: false,
|
|
|
noMoreSize: 6,
|
|
noMoreSize: 6,
|
|
|
isBounce: true,
|
|
isBounce: true,
|
|
@@ -108,7 +108,7 @@ const upOption = computed(() => ({
|
|
|
size: pageSize.value,
|
|
size: pageSize.value,
|
|
|
},
|
|
},
|
|
|
empty: {
|
|
empty: {
|
|
|
- use: hasLogin.value,
|
|
|
|
|
|
|
+ use: true,
|
|
|
tip: '暂无优惠券',
|
|
tip: '暂无优惠券',
|
|
|
// btnText: '刷新试试',
|
|
// btnText: '刷新试试',
|
|
|
icon: '/static/images/mescroll-empty1.png',
|
|
icon: '/static/images/mescroll-empty1.png',
|
|
@@ -168,10 +168,22 @@ onLoad(async () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
onHide(() => {
|
|
onHide(() => {
|
|
|
-
|
|
|
|
|
areaStore.resetCurrentCity();
|
|
areaStore.resetCurrentCity();
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+onShow(async () => {
|
|
|
|
|
+ // 登录后重新获取分类列表
|
|
|
|
|
+ if (hasLogin.value) {
|
|
|
|
|
+ couponType.value = '2'
|
|
|
|
|
+ // 重置分类类型
|
|
|
|
|
+ categoryType.value = '0'
|
|
|
|
|
+ searchValue.value = ''
|
|
|
|
|
+ await sendCategoryList()
|
|
|
|
|
+ }
|
|
|
|
|
+ // 重新获取优惠券数据
|
|
|
|
|
+ await send()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
onUnload(() => {
|
|
onUnload(() => {
|
|
|
areaStore.resetCurrentCity();
|
|
areaStore.resetCurrentCity();
|
|
|
})
|
|
})
|
|
@@ -266,8 +278,8 @@ async function couponTypeChange(type) {
|
|
|
@click="couponTypeChange('3')">
|
|
@click="couponTypeChange('3')">
|
|
|
满减券
|
|
满减券
|
|
|
</view>
|
|
</view>
|
|
|
- <view :class="{ 'coupon_type_active': couponType === '1' }"
|
|
|
|
|
- @click="couponTypeChange('1')">
|
|
|
|
|
|
|
+ <view :class="{ 'coupon_type_active': couponType === '4' }"
|
|
|
|
|
+ @click="couponTypeChange('4')">
|
|
|
兑换券
|
|
兑换券
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -301,7 +313,16 @@ async function couponTypeChange(type) {
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- coupon-list -->
|
|
<!-- coupon-list -->
|
|
|
- <view class="invite-content-list">
|
|
|
|
|
|
|
+ <view v-if="!hasLogin" class="empty-container">
|
|
|
|
|
+ <view class="custom-empty"
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ backgroundImage: `url(${getImageUrl('@img/index/login_bg.png')})`,
|
|
|
|
|
+ backgroundSize: 'cover',
|
|
|
|
|
+ backgroundPosition: 'center'
|
|
|
|
|
+ }"/>
|
|
|
|
|
+ <view class="login-btn" @click="login">去登录</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else class="invite-content-list">
|
|
|
<!-- :style="{ height: `calc(100vh - ${topSafeAreaHeight}px - 70rpx - 88rpx - 20rpx - 176rpx)` }"> -->
|
|
<!-- :style="{ height: `calc(100vh - ${topSafeAreaHeight}px - 70rpx - 88rpx - 20rpx - 176rpx)` }"> -->
|
|
|
<mescroll-uni id="mescrollContainer" :down="downOption" :up="upOption" :fixed="false" offset="70"
|
|
<mescroll-uni id="mescrollContainer" :down="downOption" :up="upOption" :fixed="false" offset="70"
|
|
|
@init="mescrollInit" @down="downCallback" @up="upCallback" @emptyclick="reload">
|
|
@init="mescrollInit" @down="downCallback" @up="upCallback" @emptyclick="reload">
|
|
@@ -323,8 +344,8 @@ async function couponTypeChange(type) {
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<view v-for="item in data" :key="item.templateId" class="invite-content-item">
|
|
<view v-for="item in data" :key="item.templateId" class="invite-content-item">
|
|
|
<!-- <invite-item :data="item" /> -->
|
|
<!-- <invite-item :data="item" /> -->
|
|
|
- <!-- 优惠券类型:1-兑换券,2-兑换券,3-满减券 -->
|
|
|
|
|
- <template v-if="item.type == '1'">
|
|
|
|
|
|
|
+ <!-- 优惠券类型:4-兑换券,2-折扣券,3-满减券 -->
|
|
|
|
|
+ <template v-if="item.type == '4'">
|
|
|
<ExchangeCoupon :coupon="item" />
|
|
<ExchangeCoupon :coupon="item" />
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
@@ -337,15 +358,6 @@ async function couponTypeChange(type) {
|
|
|
<view class="loading-spinner" />
|
|
<view class="loading-spinner" />
|
|
|
<text class="loading-text">加载中...</text>
|
|
<text class="loading-text">加载中...</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="!hasLogin" class="empty-container">
|
|
|
|
|
- <view class="custom-empty"
|
|
|
|
|
- :style="{
|
|
|
|
|
- backgroundImage: `url(${getImageUrl('@img/index/login_bg.png')})`,
|
|
|
|
|
- backgroundSize: 'cover',
|
|
|
|
|
- backgroundPosition: 'center'
|
|
|
|
|
- }"/>
|
|
|
|
|
- <view class="login-btn" @click="login">去登录</view>
|
|
|
|
|
- </view>
|
|
|
|
|
</mescroll-uni>
|
|
</mescroll-uni>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -354,7 +366,6 @@ async function couponTypeChange(type) {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.invite-container {
|
|
.invite-container {
|
|
|
- // height: 100vh;
|
|
|
|
|
padding: 0 20rpx 20rpx;
|
|
padding: 0 20rpx 20rpx;
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
background: linear-gradient( 180deg, #FF8180 0%, rgba(255,127,92,0.49) 30%);
|
|
background: linear-gradient( 180deg, #FF8180 0%, rgba(255,127,92,0.49) 30%);
|