瀏覽代碼

测试会员分享

lex 2 年之前
父節點
當前提交
d3bcd799bb
共有 2 個文件被更改,包括 11 次插入5 次删除
  1. 6 4
      src/teacher/share-page/share-vip/index.tsx
  2. 5 1
      src/views/member-center/index.tsx

+ 6 - 4
src/teacher/share-page/share-vip/index.tsx

@@ -65,10 +65,12 @@ export default defineComponent({
         }
       })
 
-      const active = await request.post(
-        `/api-teacher/open/activity/state/${this.activityId}`
-      )
-      this.discount = active.data.check || 0
+      if (this.activityId) {
+        const active = await request.post(
+          `/api-teacher/open/activity/state/${this.activityId}`
+        )
+        this.discount = active.data.check || 0
+      }
     } catch {
       //
     }

+ 5 - 1
src/views/member-center/index.tsx

@@ -134,7 +134,11 @@ export default defineComponent({
           }
         })
 
-        this.shareUrl = `${location.origin}/teacher#/shareVip?recomUserId=${this.userInfo.id}&activityId=${res.data.activityId}&userType=${state.platformType}`
+        this.shareUrl = `${location.origin}/teacher#/shareVip?recomUserId=${this.userInfo.id}&userType=${state.platformType}`
+        // 判断是否有我分享的编号
+        if (res.data && res.data.activityId) {
+          this.shareUrl = this.shareUrl + '&activityId=' + res.data.activityId
+        }
         this.shareStatus = true
         this.shareDiscount = res.data.discount || 0
         // let url =