|
@@ -1,7 +1,7 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { useRequest } from 'alova/client'
|
|
import { useRequest } from 'alova/client'
|
|
|
import { storeToRefs } from 'pinia'
|
|
import { storeToRefs } from 'pinia'
|
|
|
-import { computed, ref } from 'vue'
|
|
|
|
|
|
|
+import { computed, ref,watch } from 'vue'
|
|
|
import { getCouponSituation } from '@/api/home'
|
|
import { getCouponSituation } from '@/api/home'
|
|
|
import { getCouponIssuerApplyById, getShareState } from '@/api/me'
|
|
import { getCouponIssuerApplyById, getShareState } from '@/api/me'
|
|
|
import { useShare } from '@/hooks/useShare'
|
|
import { useShare } from '@/hooks/useShare'
|
|
@@ -34,10 +34,6 @@ const { send: getShareStateRequest, data: shareStateData, loading: shareStateLoa
|
|
|
immediate: false,
|
|
immediate: false,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-// 发卷人查询审核状态
|
|
|
|
|
-const { send: getCouponIssuerApplyByIdRequest, data: couponIssuerApplyByIdData } = useRequest(getCouponIssuerApplyById, {
|
|
|
|
|
- immediate: false,
|
|
|
|
|
-})
|
|
|
|
|
// 昵称输入值
|
|
// 昵称输入值
|
|
|
const nicknameInput = ref('')
|
|
const nicknameInput = ref('')
|
|
|
onShow(async () => {
|
|
onShow(async () => {
|
|
@@ -47,11 +43,6 @@ onShow(async () => {
|
|
|
await getCouponSituationRequest({ queryType: 'time' })
|
|
await getCouponSituationRequest({ queryType: 'time' })
|
|
|
await getShareStateRequest()
|
|
await getShareStateRequest()
|
|
|
deadline.value = Date.now()
|
|
deadline.value = Date.now()
|
|
|
- await getCouponIssuerApplyByIdRequest()
|
|
|
|
|
- if (couponIssuerApplyByIdData.value?.status === '0') {
|
|
|
|
|
- console.log('优惠券统计数据:', couponSituationData.value)
|
|
|
|
|
- // open()
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -122,10 +113,6 @@ async function menuClick(page, otherJs?: () => Promise<boolean>) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (couponIssuerApplyByIdData.value?.status === '0') {
|
|
|
|
|
- open()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: `/pages-A/${page}/index?couponSituation=${JSON.stringify(couponSituationData.value)}`,
|
|
url: `/pages-A/${page}/index?couponSituation=${JSON.stringify(couponSituationData.value)}`,
|
|
|
})
|
|
})
|
|
@@ -134,13 +121,14 @@ async function menuClick(page, otherJs?: () => Promise<boolean>) {
|
|
|
// 判断是否是发券人
|
|
// 判断是否是发券人
|
|
|
function isCouponIssuer(currentPage?: string) {
|
|
function isCouponIssuer(currentPage?: string) {
|
|
|
// 发券人相关页面
|
|
// 发券人相关页面
|
|
|
- const validPages = ['myInviter']
|
|
|
|
|
|
|
+ const validPages = ['myInviter', 'shareFriend', 'invitePage']
|
|
|
|
|
+ console.log('111111111111')
|
|
|
// 判断跳转页面是否是发券人相关页面
|
|
// 判断跳转页面是否是发券人相关页面
|
|
|
if (!validPages.includes(currentPage)) {
|
|
if (!validPages.includes(currentPage)) {
|
|
|
return Promise.resolve(true)
|
|
return Promise.resolve(true)
|
|
|
}
|
|
}
|
|
|
// 是否已经成为发券人
|
|
// 是否已经成为发券人
|
|
|
- if (userStore.isPassIssuer) {
|
|
|
|
|
|
|
+ if (userStore.isPassIssuer()) {
|
|
|
return Promise.resolve(true)
|
|
return Promise.resolve(true)
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -153,6 +141,16 @@ function isCouponIssuer(currentPage?: string) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//展开弹窗
|
|
|
|
|
+function watchUserStatus() {
|
|
|
|
|
+ if (userInfo.value.status === '0') {
|
|
|
|
|
+ open();
|
|
|
|
|
+ return Promise.resolve(false)
|
|
|
|
|
+ }
|
|
|
|
|
+ return Promise.resolve(true)
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function getInviteInfo(currentPage?: string) {
|
|
async function getInviteInfo(currentPage?: string) {
|
|
|
const isCouponIssuerRes = await isCouponIssuer(currentPage)
|
|
const isCouponIssuerRes = await isCouponIssuer(currentPage)
|
|
|
if (!isCouponIssuerRes) {
|
|
if (!isCouponIssuerRes) {
|
|
@@ -291,7 +289,7 @@ onShareTimeline(async () => {
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 菜单 -->
|
|
<!-- 菜单 -->
|
|
|
<view class="me-header-menu">
|
|
<view class="me-header-menu">
|
|
|
- <view class="me-header-menu-item" @click="menuClick('applyForm')">
|
|
|
|
|
|
|
+ <view class="me-header-menu-item" @click="menuClick('applyForm',watchUserStatus)">
|
|
|
<view class="me-header-menu-icon">
|
|
<view class="me-header-menu-icon">
|
|
|
<image :src="getImageUrl('@img/me/coupon-need.png')" mode="aspectFill" />
|
|
<image :src="getImageUrl('@img/me/coupon-need.png')" mode="aspectFill" />
|
|
|
<view class="me-header-menu-text">
|
|
<view class="me-header-menu-text">
|