panhui %!s(int64=3) %!d(string=hai) anos
pai
achega
5fb826519a
Modificáronse 4 ficheiros con 35 adicións e 14 borrados
  1. 19 13
      src/components/auction/Share.vue
  2. 4 0
      src/main.js
  3. 5 1
      src/store/index.js
  4. 7 0
      src/views/account/Register.vue

+ 19 - 13
src/components/auction/Share.vue

@@ -33,23 +33,29 @@ export default {
     computed: {
         ...mapState(['userInfo']),
         url() {
-            return resolveUrl(this.$baseUrl, '9th/register?invitor=' + this.userInfo.id + '&inviteType=AUCTION');
+            if (this.isLogin) {
+                return resolveUrl(this.$baseUrl, '9th/register?invitor=' + this.userInfo.id + '&inviteType=AUCTION');
+            } else {
+                return resolveUrl(this.$baseUrl, '9th/register?inviteType=AUCTION');
+            }
         }
     },
     methods: {
         init() {
-            this.show = true;
-            if (!this.img) {
-                this.$toast.loading({
-                    message: '加载中...',
-                    forbidClick: true
-                });
-                this.$nextTick(() => {
-                    setTimeout(() => {
-                        this.loadImg();
-                    }, 1000);
-                });
-            }
+            this.checkLogin().then(() => {
+                this.show = true;
+                if (!this.img) {
+                    this.$toast.loading({
+                        message: '加载中...',
+                        forbidClick: true
+                    });
+                    this.$nextTick(() => {
+                        setTimeout(() => {
+                            this.loadImg();
+                        }, 1000);
+                    });
+                }
+            });
         },
         loadImg() {
             html2canvas(this.$refs.post, {

+ 4 - 0
src/main.js

@@ -130,6 +130,10 @@ if (query.invitor) {
     if (query.id) {
         store.commit('setProductId', query.id);
     }
+
+    if (query.inviteType) {
+        store.commit('setInviteType', query.inviteType);
+    }
 }
 if (query.from) {
     store.commit('setFrom', query.from);

+ 5 - 1
src/store/index.js

@@ -23,7 +23,8 @@ export default createStore({
         showRoomId: null,
         platform: '',
         darkTheme: false,
-        starPage: false
+        starPage: false,
+        inviteType: 'NORMAL'
     },
     mutations: {
         setFinished(state, finished) {
@@ -85,6 +86,9 @@ export default createStore({
         },
         setStarPage(state, starPage) {
             state.starPage = starPage;
+        },
+        setInviteType(state, inviteType) {
+            state.inviteType = inviteType;
         }
     },
     actions: {

+ 7 - 0
src/views/account/Register.vue

@@ -209,9 +209,16 @@ export default {
     mounted() {
         if (this.$store.state.invitor && this.$store.state.productId) {
             this.showInvite = false;
+            this.form.inviteType = this.$store.state.inviteType;
         } else {
             this.showInvite = true;
         }
+
+        if (this.$store.state.invitor && this.$store.state.inviteType) {
+            this.form.inviteType = this.$store.state.inviteType;
+            this.form.invitor = this.$store.state.invitor;
+            this.showInvite = false;
+        }
     },
     beforeRouteLeave(to, from, next) {
         if (to.path === '/agreement') {