Quellcode durchsuchen

新增:我的邀请人页面

haiyang vor 2 Wochen
Ursprung
Commit
5529ad7597

+ 1 - 0
package.json

@@ -121,6 +121,7 @@
     "dayjs": "1.11.10",
     "image-tools": "^1.4.0",
     "js-cookie": "^3.0.5",
+    "lz-string": "^1.5.0",
     "mescroll-uni": "^1.3.7",
     "pinia": "2.0.36",
     "pinia-plugin-persistedstate": "3.2.1",

+ 4 - 0
src/api/me.ts

@@ -41,3 +41,7 @@ export function getInviteList(params) {
         }
     })
 }
+
+export function getInviterInfo() {
+    return http.Get('/couponCenter/APP/mine/queryParentInviter')
+}

+ 1 - 0
src/api/types/login.ts

@@ -34,6 +34,7 @@ export interface IUserInfoRes {
     username: string
     nickname: string
     avatar?: string
+    status: string
     [key: string]: any // 允许其他扩展字段
 }
 

+ 3 - 0
src/components/CustomNavigationBar.vue

@@ -9,6 +9,7 @@ const props = withDefaults(defineProps<Props>(), {
     backgroundColor: '#ffffff',
     textColor: '#333333',
     height: '88rpx',
+    isShadow: true,
 })
 
 // Props
@@ -18,6 +19,7 @@ interface Props {
     backIconColor?: string
     backgroundColor?: string
     textColor?: string
+    isShadow?: boolean
 }
 
 // 导航栏高度
@@ -53,6 +55,7 @@ onMounted(() => {
     <view class="top-nav" :style="{
         paddingTop: `${topSafeAreaHeight}px`,
         backgroundColor: props.backgroundColor,
+        boxShadow: props.isShadow ? '0rpx 8rpx 7rpx 0rpx rgba(233, 233, 233, 0.17)' : 'none',
     }">
         <view class="custom-navbar">
             <view v-if="props.showBack" class="back-btn" @tap="handleBack">

+ 399 - 0
src/pages-A/myInviter/index.vue

@@ -0,0 +1,399 @@
+<script lang="ts" setup>
+import { storeToRefs } from 'pinia'
+import { ref } from 'vue'
+import CustomNavigationBar from '@/components/CustomNavigationBar.vue'
+import { useInviteCodeStore } from '@/store/inviteQCCode'
+import { useInviterStore } from '@/store/inviter'
+import { safeAreaInsets } from '@/utils'
+import { getImageUrl } from '@/utils/imageUtil'
+
+definePage({
+    style: {
+        navigationBarTitleText: '我的邀请人',
+        navigationStyle: 'custom',
+    },
+})
+
+const inviteCodeStore = useInviteCodeStore()
+const inviterStore = useInviterStore()
+const { inviter: inviterInfo } = storeToRefs(inviterStore)
+const title = ref('掌柜369')
+const descText = ref('天天领券,笔笔省!吃喝玩乐,优惠随身!')
+const telephoneText = ref('400-633-3016')
+const qrCode = ref('')
+
+async function drawQRCode() {
+    const qrCodeImg = await inviteCodeStore.getInviteCode()
+    if (qrCodeImg) {
+        try {
+            let imgSrc = qrCodeImg
+            let tempFilePath = ''
+
+            // 检查是否已经是临时文件路径
+            const isTempFile = typeof qrCodeImg === 'string' && !qrCodeImg.startsWith('data:image')
+
+            // 如果是临时文件路径,直接使用
+            if (isTempFile) {
+                tempFilePath = qrCodeImg
+            }
+            else {
+                // 处理base64图片数据
+                if (typeof qrCodeImg === 'string') {
+                    // 安全地尝试解码URI,避免URIError
+                    try {
+                        if (qrCodeImg.includes('%')) {
+                            imgSrc = decodeURIComponent(qrCodeImg)
+                        }
+                    }
+                    catch (uriError) {
+                        console.warn('URI解码失败,使用原始数据:', uriError)
+                    }
+
+                    // 确保base64数据有正确的前缀
+                    if (!imgSrc.startsWith('data:image')) {
+                        imgSrc = `data:image/png;base64,${imgSrc}`
+                    }
+                }
+
+                // 尝试使用临时文件方式
+                try {
+                    // #ifdef MP-WEIXIN
+                    const fs = uni.getFileSystemManager()
+                    const tempFileName = `temp_qr_${Date.now()}.png`
+                    tempFilePath = `${uni.env.USER_DATA_PATH}/${tempFileName}`
+
+                    // 提取base64数据部分
+                    let base64Data = imgSrc
+                    if (imgSrc.includes('base64,')) {
+                        base64Data = imgSrc.split('base64,')[1]
+                    }
+
+                    fs.writeFileSync(tempFilePath, base64Data, 'base64')
+                    console.log('Base64已转换为临时文件:', tempFilePath)
+                    // #endif
+                }
+                catch (fileError) {
+                    console.warn('转换base64为临时文件失败,尝试直接使用base64:', fileError)
+                    // 清除临时文件路径,确保使用base64
+                    tempFilePath = ''
+                }
+            }
+            qrCode.value = tempFilePath || imgSrc
+
+            console.log('二维码绘制成功')
+        }
+        catch (error) {
+            console.error('绘制二维码失败:', error)
+
+            // 增加更详细的错误日志
+            if (typeof qrCodeImg === 'string') {
+                console.log('二维码数据源类型:', qrCodeImg.startsWith('data:image') ? 'base64' : '临时文件路径')
+            }
+        }
+    }
+}
+
+onShow(async () => {
+    await drawQRCode()
+})
+
+// 保存图片到相册
+async function handleSaveImage() {
+    if (!qrCode.value) {
+        uni.showToast({
+            title: '请先生成分享图片',
+            icon: 'none',
+        })
+        return
+    }
+
+    uni.showLoading({
+        title: '保存中...',
+        mask: true,
+    })
+
+    try {
+        await uni.saveImageToPhotosAlbum({
+            filePath: qrCode.value,
+        })
+
+        uni.hideLoading()
+        uni.showToast({
+            title: '保存成功',
+            icon: 'success',
+        })
+    }
+    catch (error) {
+        uni.hideLoading()
+        console.error('保存失败:', error)
+
+        if (error.errMsg && error.errMsg.includes('auth deny')) {
+            uni.showModal({
+                title: '提示',
+                content: '需要您授权保存到相册',
+                confirmText: '去设置',
+                success: (res) => {
+                    if (res.confirm) {
+                        uni.openSetting()
+                    }
+                }
+            })
+        }
+        else {
+            uni.showToast({
+                title: '保存失败,请重试',
+                icon: 'none',
+            })
+        }
+    }
+}
+</script>
+
+<template>
+    <view class="my-inviter-container"
+        :style="{ backgroundImage: `url(${getImageUrl('@img/me/myInviter-card-bg.png')})`, paddingTop: `calc(${safeAreaInsets.top}px + 88rpx)`, height: `calc(100vh - ${safeAreaInsets.top}px - 88rpx)` }">
+        <custom-navigation-bar :show-back="true" title="我的邀请人" back-icon-color="#ffffff" text-color="#ffffff"
+            background-color="transparent" :is-shadow="false" />
+        <view />
+        <view class="inviter-content" :style="{ backgroundImage: `url(${getImageUrl('@img/me/myInviter-bg.png')})` }">
+            <view class="my-inviter-content">
+                <view class="title">
+                    <view class="icon" />
+                    <text class="text">我的邀请人</text>
+                </view>
+                <view class="content">
+                    <up-image :src="inviterInfo.avatarUrl" width="114rpx" height="114rpx" shape="circle" />
+                    <view class="inviter-name">
+                        <text class="text">{{ inviterInfo.nickname }}</text>
+                    </view>
+                </view>
+            </view>
+            <view class="my-qcCode">
+                <view class="title">
+                    <view class="icon" />
+                    <text class="text">我的邀请码</text>
+                </view>
+                <view class="qcCode-content">
+                    <view class="qcCode-image">
+                        <image :src="qrCode" class="qcCode" />
+                    </view>
+                    <view class="qcCode-title">
+                        邀请码
+                    </view>
+                    <view class="qcCode-desc">
+                        发放优惠券、分享得佣金,下单尽享优惠,快来<br>邀请好友吧!
+                    </view>
+                </view>
+            </view>
+            <view class="invite-button">
+                <up-button class="btn" shape="circle" @tap="handleSaveImage">
+                    保存到相册
+                </up-button>
+            </view>
+        </view>
+        <view class="bottom-content">
+            <view class="logo">
+                <image :src="getImageUrl('@img/index/logo.jpg')" class="logo-image" />
+                <view class="logo-title-text">
+                    {{ title }}
+                </view>
+            </view>
+            <view class="desc-text">
+                {{ descText }}
+            </view>
+            <view class="telephone">
+                <view class="telephone-text">
+                    <up-icon name="phone-fill" color="#974542" size="24rpx" />
+                    <text class="text">客服热线:{{ telephoneText }}</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<style lang="scss" scoped>
+.my-inviter-container {
+    width: 100vw;
+    background-repeat: repeat-y;
+    background-position: right;
+    position: relative;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+
+    .inviter-content {
+        width: 634rpx;
+        height: 943rpx;
+        background-repeat: no-repeat;
+        background-size: cover;
+        margin-top: 61rpx;
+        display: flex;
+        flex-direction: column;
+
+        .my-inviter-content {
+            height: 194rpx;
+            display: flex;
+            flex-direction: column;
+
+            .content {
+                flex: 1;
+                display: flex;
+                flex-direction: row;
+                flex-wrap: nowrap;
+                padding-left: 47rpx;
+                align-items: center;
+                gap: 21rpx;
+
+                .inviter-name {
+                    font-weight: bolder;
+                    font-size: 26rpx;
+                    color: #333333;
+                }
+            }
+        }
+
+        .my-qcCode {
+            flex: 1;
+            display: flex;
+            flex-direction: column;
+
+            .qcCode-content {
+                flex: 1;
+                display: flex;
+                flex-direction: column;
+                justify-content: space-around;
+                align-items: center;
+
+                .qcCode-image {
+                    width: 317rpx;
+                    height: 313rpx;
+
+                    margin-bottom: 53rpx;
+
+                    .qcCode {
+                        width: 100%;
+                        height: 100%;
+                        object-fit: cover;
+                    }
+                }
+
+                .qcCode-title {
+                    font-weight: 400;
+                    font-size: 26rpx;
+                    color: #333333;
+                    margin-bottom: 9rpx;
+                }
+
+                .qcCode-desc {
+                    font-weight: 400;
+                    font-size: 22rpx;
+                    color: #979797;
+                    text-align: center;
+                }
+            }
+        }
+
+        .invite-button {
+            height: 145rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+
+            .btn {
+                width: 262rpx;
+                height: 70rpx;
+            }
+        }
+
+        .title {
+            display: flex;
+            flex-direction: row;
+            flex-wrap: nowrap;
+            gap: 16rpx;
+            padding: 20rpx 26rpx;
+
+            .icon {
+                width: 6rpx;
+                height: 33rpx;
+                background: #ed6b66;
+                border-radius: 3rpx;
+            }
+
+            .text {
+                height: 25rpx;
+                font-weight: bold;
+                font-size: 26rpx;
+                color: #333333;
+            }
+        }
+    }
+
+    .bottom-content {
+        position: absolute;
+        width: 100%;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        padding: 30rpx 40rpx;
+        box-sizing: border-box;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        gap: 14rpx;
+
+        .logo {
+            display: flex;
+            flex-direction: row;
+            flex-wrap: nowrap;
+            justify-content: center;
+            align-items: center;
+            gap: 16rpx;
+
+            .logo-image {
+                width: 80rpx;
+                height: 80rpx;
+                border-radius: 20rpx;
+                border: 2rpx solid #ffffff;
+                box-shadow: 0rpx 0rpx 5rpx 0rpx rgba(175, 175, 175, 0.39);
+            }
+
+            .logo-title-text {
+                font-weight: bold;
+                font-size: 24rpx;
+                color: #974542;
+            }
+        }
+
+        .desc-text {
+            font-weight: 400;
+            font-size: 24rpx;
+            color: #974542;
+        }
+
+        .telephone {
+            width: 414rpx;
+            height: 40rpx;
+            border-radius: 19rpx;
+            border: 1px solid #974542;
+
+            padding: 9rpx 68rpx;
+
+            .telephone-text {
+                display: flex;
+                flex-direction: row;
+                flex-wrap: nowrap;
+                justify-content: center;
+                align-items: center;
+
+                .text {
+                    margin-left: 6rpx;
+                    font-weight: 400;
+                    font-size: 24rpx;
+                    color: #974542;
+                }
+            }
+        }
+    }
+}
+</style>

+ 4 - 1
src/pages-A/shareFriend/index.vue

@@ -74,6 +74,7 @@ import { onLoad } from '@dcloudio/uni-app'
 import { nextTick, ref } from 'vue'
 import { getWxQcCode } from '@/api/receiveCoupon'
 import CustomNavigationBar from '@/components/CustomNavigationBar.vue'
+import { useInviteCodeStore } from '@/store/inviteQCCode'
 import { safeAreaInsets } from '@/utils'
 import { getImageUrl } from '@/utils/imageUtil'
 
@@ -95,6 +96,7 @@ const topSafeAreaHeight = safeAreaInsets?.top || 0
 
 // 系统信息
 const systemInfo = ref({})
+const inviteCodeStore = useInviteCodeStore()
 
 // 生命周期
 onLoad(async (options) => {
@@ -194,7 +196,8 @@ async function generateShareImage() {
         // 生成二维码
         let qrCodeImg = null
         try {
-            qrCodeImg = await getWxacodeBase64()
+            // qrCodeImg = await getWxacodeBase64()
+            qrCodeImg = await inviteCodeStore.getInviteCode()
         }
         catch (error) {
             console.error('获取小程序失败:', error)

+ 18 - 3
src/pages/income/income.vue

@@ -31,6 +31,8 @@ const { send: getAccountCountRequest, data: accountCountData } = useRequest(getA
     immediate: false,
 })
 
+// 新增:刷新状态
+const refreshing = ref(false)
 const activeIndex = ref(0)
 const showLoading = ref(false)
 const pickerDate = ref(Date.now())
@@ -66,14 +68,14 @@ const { send, data: incomeData, pageCount, loading, page, pageSize, isLastPage,
     append: true,
     preloadNextPage: false,
     preloadPreviousPage: false,
-    total: response => response.total,
-    data: response => response.detailList,
+    total: response => response?.total || 0,
+    data: response => response?.detailList || [],
     immediate: false,
 })
 
 // ============ mescroll 配置 ============
 const downOption = reactive({
-    use: false,
+    use: true,
     auto: false,
     bgColor: '#f8f8fa',
     textColor: '#666',
@@ -125,6 +127,17 @@ async function downCallback() {
     console.log('下拉刷新触发')
 
     // await refresh()
+    await getAccountCountRequest()
+    await refresh()
+    await userStore.fetchUserInfo()
+}
+
+async function onRefresh() {
+    refreshing.value = true
+    await getAccountCountRequest()
+    await refresh()
+    await userStore.fetchUserInfo()
+    refreshing.value = false
 }
 
 async function upCallback() {
@@ -215,6 +228,7 @@ function goPage(page: string) {
 <template>
     <view class="profile-container"
         :style="{ minHeight: `calc(100vh - ${safeAreaInsets.top}px - ${safeAreaInsets.bottom}px - 100rpx)` }">
+        <!-- <up-pull-refresh :refreshing="refreshing" :threshold="60" @refresh="onRefresh"> -->
         <!-- 顶部区域 -->
         <view class="income-header"
             :style="{ background: `url(${getImageUrl('@img/income/income-bg.png')})`, backgroundSize: '100% 110%', backgroundPosition: 'left bottom', backgroundRepeat: 'no-repeat' }">
@@ -313,6 +327,7 @@ function goPage(page: string) {
                 </mescroll-uni>
             </view>
         </view>
+        <!-- </up-pull-refresh> -->
     </view>
 </template>
 

+ 50 - 4
src/pages/my/my.vue

@@ -6,6 +6,7 @@ import { getCouponSituation } from '@/api/home'
 import { getCouponIssuerApplyById, getShareState } from '@/api/me'
 import { useShare } from '@/hooks/useShare'
 import { useUserStore } from '@/store'
+import { useInviterStore } from '@/store/inviter'
 import { useTokenStore } from '@/store/token'
 import { changtime } from '@/utils'
 import { getImageUrl } from '@/utils/imageUtil'
@@ -19,6 +20,7 @@ definePage({
 
 const userStore = useUserStore()
 const tokenStore = useTokenStore()
+const inviterStore = useInviterStore()
 // 使用storeToRefs解构userInfo
 const { userInfo } = storeToRefs(userStore)
 const { hasLogin } = storeToRefs(tokenStore)
@@ -113,7 +115,13 @@ function close() {
 function open() {
     show.value = true
 }
-function menuClick(page) {
+async function menuClick(page, otherJs?: () => Promise<boolean>) {
+    if (otherJs && typeof otherJs === 'function') {
+        const execRes = await otherJs(page)
+        if (execRes === false) {
+            return
+        }
+    }
     if (couponIssuerApplyByIdData.value?.status === '0') {
         open()
         return
@@ -123,6 +131,44 @@ function menuClick(page) {
     })
 }
 
+// 判断是否是发券人
+function isCouponIssuer(currentPage?: string) {
+    // 发券人相关页面
+    const validPages = ['myInviter']
+    // 判断跳转页面是否是发券人相关页面
+    if (!validPages.includes(currentPage)) {
+        return Promise.resolve(true)
+    }
+    // 是否已经成为发券人
+    if (userStore.isPassIssuer) {
+        return Promise.resolve(true)
+    }
+    else {
+        uni.showModal({
+            title: '提示',
+            content: '您还不是发券人,请先申请成为发券人',
+            showCancel: false,
+        })
+        return Promise.resolve(false)
+    }
+}
+
+async function getInviteInfo(currentPage?: string) {
+    const isCouponIssuerRes = await isCouponIssuer(currentPage)
+    if (!isCouponIssuerRes) {
+        return isCouponIssuerRes
+    }
+    const isInviter = await inviterStore.fetchInviterInfo()
+    if (!isInviter) {
+        uni.showModal({
+            title: '提示',
+            content: '您没有上级邀请人,无法查看邀请信息',
+            showCancel: false,
+        })
+    }
+    return isInviter
+}
+
 async function onRefresh() {
     refreshing.value = true
     await userStore.fetchUserInfo()
@@ -256,7 +302,7 @@ onShareTimeline(async () => {
                         <up-icon name="arrow-right" color="#979797" size="12" />
                     </view>
                 </view>
-                <view class="me-header-menu-item" @click="menuClick('invitePage')">
+                <view class="me-header-menu-item" @click="menuClick('invitePage', isCouponIssuer)">
                     <view class="me-header-menu-icon">
                         <image :src="getImageUrl('@img/me/invite.png')" mode="aspectFill" />
                         <view class="me-header-menu-text">
@@ -267,7 +313,7 @@ onShareTimeline(async () => {
                         <up-icon name="arrow-right" color="#979797" size="12" />
                     </view>
                 </view>
-                <view class="me-header-menu-item" @click="menuClick('applyForm')">
+                <view class="me-header-menu-item" @click="menuClick('myInviter', getInviteInfo)">
                     <view class="me-header-menu-icon">
                         <image :src="getImageUrl('@img/me/inviter.png')" mode="aspectFill" />
                         <view class="me-header-menu-text">
@@ -278,7 +324,7 @@ onShareTimeline(async () => {
                         <up-icon name="arrow-right" color="#979797" size="12" />
                     </view>
                 </view>
-                <view class="me-header-menu-item" @click="menuClick('shareFriend')">
+                <view class="me-header-menu-item" @click="menuClick('shareFriend', isCouponIssuer)">
                     <view class="me-header-menu-icon">
                         <image :src="getImageUrl('@img/me/share.png')" mode="aspectFill" />
                         <view class="me-header-menu-text">

+ 94 - 0
src/store/inviteQCCode.ts

@@ -0,0 +1,94 @@
+import lzString from 'lz-string'
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+import { getWxQcCode } from '@/api/receiveCoupon'
+
+export const useInviteCodeStore = defineStore('inviteCode', () => {
+    const inviteCode = ref({
+        compressedImage: '',
+        imageType: '',
+    })
+
+    const setInviteCode = (baseImg) => {
+        // 移除data:前缀
+        const pureBase64 = baseImg.split(',')[1] || baseImg
+
+        // 压缩
+        const compressed = lzString.compress(pureBase64)
+        inviteCode.value.compressedImage = compressed
+        inviteCode.value.imageType = baseImg.split(';')[0].split(':')[1]
+        uni.setStorageSync('inviteCode', inviteCode.value)
+    }
+
+    const getInviteCode = () => {
+        return new Promise<string>((resolve, reject) => {
+            let compressed, type
+            if (inviteCode.value.imageType && inviteCode.value.compressedImage) {
+                compressed = inviteCode.value.compressedImage
+                type = inviteCode.value.imageType
+            }
+            else if (uni.getStorageSync('inviteCode')) {
+                compressed = uni.getStorageSync('inviteCode').compressedImage
+                type = uni.getStorageSync('inviteCode').imageType
+            }
+            else {
+                reject(new Error('没有邀请码'))
+                return
+            }
+            // 解压
+            const decompressed = lzString.decompress(compressed)
+            resolve(`data:${type};base64,${decompressed}`)
+        })
+    }
+
+    const fetchInviteCode = async () => {
+        const res = await getWxQcCode({
+            shareType: 'INVITE',
+            sharePath: 'pages/home/home',
+            width: 360,
+        })
+
+        const contentType = res.header['Content-Type'] || res.header['content-type']
+
+        if (contentType && contentType.includes('image')) {
+            // 返回的是图片
+            // 将arraybuffer转换为base64
+            const arrayBuffer = res.data
+            const base64 = uni.arrayBufferToBase64(arrayBuffer)
+            const imageUrl = `data:image/jpeg;base64,${base64}`
+            setInviteCode(imageUrl)
+        }
+        else {
+            // 返回的是错误信息
+            try {
+                // 尝试将arraybuffer转换为字符串
+                const decoder = new TextDecoder('utf-8')
+                const errorText = decoder.decode(new Uint8Array(res.data))
+                const errorData = JSON.parse(errorText)
+                throw new Error(errorData.errmsg || '获取小程序码失败')
+            }
+            catch (e) {
+                console.log(e, '获取小程序码失败,请检查access_token')
+                // throw new Error('获取小程序码失败,请检查access_token')
+            }
+        }
+    }
+
+    const isFetchInviteCode = () => {
+        if ((inviteCode.value.compressedImage && inviteCode.value.imageType) || uni.getStorageSync('inviteCode')) {
+            console.log('当前用户已有小程序码')
+            return true
+        }
+        else {
+            fetchInviteCode()
+        }
+    }
+
+    return {
+        inviteCode,
+        getInviteCode,
+        isFetchInviteCode
+    }
+}, {
+    persist: true,
+})

+ 31 - 0
src/store/inviter.ts

@@ -0,0 +1,31 @@
+import { defineStore } from 'pinia'
+import { ref } from 'vue'
+import { getInviterInfo } from '@/api/me'
+
+export const useInviterStore = defineStore('inviter', () => {
+    const inviter = ref({
+        userId: '',
+        name: '',
+        phone: '',
+        nickname: '',
+        avatarUrl: '',
+    })
+    const setInviter = (inviterInfo) => {
+        inviter.value = inviterInfo
+    }
+    const fetchInviterInfo = async () => {
+        const res = await getInviterInfo()
+        console.log('inviterInfo:', res)
+        if (res) {
+            setInviter(res)
+            return true
+        }
+        else {
+            return false
+        }
+    }
+    return {
+        inviter,
+        fetchInviterInfo
+    }
+})

+ 11 - 5
src/store/user.ts

@@ -4,6 +4,7 @@ import { ref } from 'vue'
 import {
     getUserInfo,
 } from '@/api/login'
+import { useInviteCodeStore } from './inviteQCCode'
 
 // 初始化状态
 const userInfoState: IUserInfoRes = {
@@ -60,8 +61,8 @@ export const useUserStore = defineStore(
         }
 
         /**
-                                                                         * 获取用户信息
-                                                                         */
+                                                                             * 获取用户信息
+                                                                             */
         const fetchUserInfo = async () => {
             try {
                 const userInfo = await getUserInfo()
@@ -74,6 +75,11 @@ export const useUserStore = defineStore(
                     openId: userInfo.openid,
                     status: userInfo.status, // 是否是发券人
                 }
+                // 增加判断当前用户是否是发券人,获取邀请的小程序码
+                if (userInfo.status === '1') {
+                    const inviteCodeStore = useInviteCodeStore()
+                    inviteCodeStore.isFetchInviteCode()
+                }
                 setUserInfo(systemUserInfo)
                 return systemUserInfo
             }
@@ -84,9 +90,9 @@ export const useUserStore = defineStore(
         }
 
         /**
-             * 判断当前登录用户是否通过发券人申请
-             * @returns {boolean} 是否通过申请
-             */
+                 * 判断当前登录用户是否通过发券人申请
+                 * @returns {boolean} 是否通过申请
+                 */
         const isPassIssuer = () => {
             const currentUserStatus = userInfo.value.status
             return currentUserStatus === '1'