Browse Source

处理未登录

yuxingxing 2 years ago
parent
commit
8d52f6cd40
2 changed files with 11 additions and 5 deletions
  1. 10 4
      pages/goods_details/index.vue
  2. 1 1
      pages/users/register/index.vue

+ 10 - 4
pages/goods_details/index.vue

@@ -515,9 +515,12 @@ export default {
 		isLogin: {
 			handler: function (newV, oldV) {
 				if (newV == true) {
-					this.getCouponList();
-					this.getCartCount();
-					this.downloadFilePromotionCode();
+					console.log("受邀码:"+this.$Cache.get('INVITE_CODE_LOGIN'));
+					this.id = this.$Cache.get('GOOD_ID_LOGIN')
+					this.getGoodsDetails();
+					// this.getCouponList();
+					// this.getCartCount();
+					// this.downloadFilePromotionCode();
 				}
 			},
 			deep: true,
@@ -535,12 +538,15 @@ export default {
 			immediate: true,
 		},
 	},
+	
 	onLoad(options) {
 		uni.hideShareMenu();
 		// 判断是否登录
 		if (!this.isLogin) {
+			console.log("未登录的推荐码:" + options.inviteCode);
 			if (options.inviteCode) {
-				this.$Cache.set('INVITE_CODE', options.inviteCode);
+				this.$Cache.set('INVITE_CODE_LOGIN', options.inviteCode);
+				this.$Cache.set('GOOD_ID_LOGIN', options.id);
 			}
 			uni.showToast({
 				title: "您暂未登录,即将跳登录界面",

+ 1 - 1
pages/users/register/index.vue

@@ -208,7 +208,7 @@ export default {
 		});
 	},
 	mounted: function () {
-		this.codeInvitation = this.$Cache.get('INVITE_CODE');
+		this.codeInvitation = this.$Cache.get('INVITE_CODE_LOGIN');
 		// this.getCode();
 		// this.getLogoImage();
 	},