Browse Source

refactor: 富页面去掉我的邀请码区域

E2E Test Bot 1 month ago
parent
commit
5e2af55ee9
1 changed files with 2 additions and 57 deletions
  1. 2 57
      cfc-frontend/pages/promotion/index.vue

+ 2 - 57
cfc-frontend/pages/promotion/index.vue

@@ -1,18 +1,5 @@
 <template>
   <scroll-view class="container" scroll-y scroll-with-animation>
-    <!-- 邀请码区域 -->
-    <view class="invite-card">
-      <view class="code-section">
-        <text class="code-label">我的邀请码</text>
-        <view class="code-value" @click="copyCode">
-          <text class="code-text">{{ referralCode || '加载中...' }}</text>
-          <text class="copy-icon">⎘</text>
-        </view>
-        <text class="code-hint">点击复制邀请码,分享给好友</text>
-      </view>
-      <button class="share-btn" @click="shareCard">分享邀请卡</button>
-    </view>
-
     <!-- 家庭公共收益总览 -->
     <view class="family-earnings-card" v-if="familySummary">
       <view class="fe-header">
@@ -205,27 +192,19 @@
 
     <!-- 底部安全区 -->
     <view style="height:40rpx"></view>
-
-    <SharePoster :show="showPoster" :referralCode="referralCode" :qrCodeBase64="qrCodeBase64" :nickname="userNickname" :userAvatar="userAvatar" @close="showPoster = false" />
   </scroll-view>
 </template>
 
 <script>
-import { getReferralCode, getReferralSummary, getCommissionSummary, getInviteQrCode, getFamilyEarningsSummary, getFamilyEarningsMembers, getFamilyEarningsRecords, distributeToMember, toggleMemberBalance, withdrawFamilyEarnings } from '../../utils/api.js'
-import SharePoster from '@/components/SharePoster.vue'
+import { getReferralSummary, getCommissionSummary, getFamilyEarningsSummary, getFamilyEarningsMembers, getFamilyEarningsRecords, distributeToMember, toggleMemberBalance, withdrawFamilyEarnings } from '../../utils/api.js'
 
 export default {
-  components: { SharePoster },
+  components: {},
   data() {
     return {
-      referralCode: '',
       totalEarnings: '0.00',
       availableAmount: '0.00',
       summary: null,
-      showPoster: false,
-      qrCodeBase64: '',
-      userAvatar: '',
-      userNickname: '',
       stats: {},
       funnelData: {},
       funnelSteps: [],
@@ -274,11 +253,7 @@ export default {
     this.loadFamilyData()
   },
   onShareAppMessage() {
-    var code = this.referralCode || ''
     var path = '/pages/invite/join'
-    if (code) {
-      path = path + '?inviteCode=' + code
-    }
     return {
       title: '我在浠艾福发现了好用的家庭成长工具,快来加入!',
       path: path,
@@ -288,11 +263,6 @@ export default {
   methods: {
     async loadData() {
       try {
-        var codeRes = await getReferralCode()
-        if (codeRes.data) {
-          this.referralCode = codeRes.data.referralCode || codeRes.data.code || ''
-        }
-      } catch (e) {
         console.error('获取邀请码失败', e)
       }
       try {
@@ -488,31 +458,6 @@ export default {
     goRecords() {
       uni.navigateTo({ url: '/pages/promotion/records' })
     },
-    copyCode() {
-      if (!this.referralCode) return
-      uni.setClipboardData({
-        data: this.referralCode,
-        success: function() {
-          uni.showToast({ title: '邀请码已复制', icon: 'success' })
-        }
-      })
-    },
-    async shareCard() {
-      try {
-        uni.showLoading({ title: '生成中...' })
-        var res = await getInviteQrCode()
-        if (res.data) {
-          this.qrCodeBase64 = res.data.qrCodeBase64 || ''
-          this.userNickname = uni.getStorageSync('nickname') || ''
-          this.userAvatar = uni.getStorageSync('avatar') || ''
-          this.showPoster = true
-        }
-      } catch (e) {
-        uni.showToast({ title: '生成失败', icon: 'none' })
-      } finally {
-        uni.hideLoading()
-      }
-    },
     goCommission() {
       uni.navigateTo({ url: '/pages/promotion/commission' })
     },