浏览代码

自动登录

twt 1 周之前
父节点
当前提交
2a65cff7f9
共有 2 个文件被更改,包括 37 次插入6 次删除
  1. 16 4
      pages/index/discountCard.vue
  2. 21 2
      pages/integral/scoreRecord.vue

+ 16 - 4
pages/index/discountCard.vue

@@ -136,14 +136,26 @@
 				src: '', // 二维码生成后的图片地址或base64
 				hxShow:false,
 				detail:'',
-
+                userInfo:'',
+				ext:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad(opt) {
-   
+            
 			this.tabIndex = opt.num;
-
-			this.myOrderCoupon()
+            this.userInfo=this.$store.state.userInfo;
+            this.ext=this.$common.getExtStoreId();
+            if(this.userInfo){
+            	this.myOrderCoupon()
+            }else{
+            	this.$common.automaticlogin().then(val => {
+            		this.userInfo=this.$store.state.userInfo;
+            		this.myOrderCoupon()
+            		
+            	})
+            }
+			
 			this.$refs.authoriz.init();
 		},
 		onShow() {

+ 21 - 2
pages/integral/scoreRecord.vue

@@ -60,12 +60,24 @@
 				itemData: [],
 				noMoreShow: false,
 				avaIntegral: '',
+				userInfo:'',
+				ext:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad(opt) {
-			this.avaIntegral = opt.avaIntegral
+			//this.avaIntegral = opt.avaIntegral
 			this.page = 1
-			this.myOrderCoupon()
+			if(this.userInfo){
+				this.myOrderCoupon()
+			}else{
+				this.$common.automaticlogin().then(val => {
+					this.userInfo=this.$store.state.userInfo;
+					this.myOrderCoupon()
+					
+				})
+			}
+			
 		},
 		methods: {
 			
@@ -105,6 +117,13 @@
 
 
 
+				})
+				this.$http('openreservation/getInfo', {
+					lat: '',
+					lng: '',
+				
+				}, 'GET').then(res => {
+					this.avaIntegral =res.data.totalIntegral
 				})
 			},