chenrong 1 éve
szülő
commit
24ea7aef48
4 módosított fájl, 26 hozzáadás és 4 törlés
  1. 10 0
      component/paymentPopup.vue
  2. 3 0
      pages/invite/invite.vue
  3. 7 2
      pages/mine/mine.vue
  4. 6 2
      pages/user/user.vue

+ 10 - 0
component/paymentPopup.vue

@@ -180,6 +180,7 @@
 		},
 		methods: {
 			show(id, list, info) {
+				this.refresh()
 				console.log(list, 'list')
 				this.params.raffleId = id
 				this.params.raffleNumList = list
@@ -188,6 +189,15 @@
 				// 获取优惠券列表
 				this.getCoupon()
 			},
+			refresh() {
+				// 刷新组件状态
+				this.selestCouponId = null,
+				this.selestCoupon = {}
+				this.prizes = []
+				this.checkbox1 = false
+				this.checkbox2 = false
+				this.orderId = null
+			},
 			close() {
 				this.$refs.popup.close()
 			},

+ 3 - 0
pages/invite/invite.vue

@@ -58,6 +58,9 @@
 		onLoad() {
 			this.getInviteList()
 		},
+		onShow() {
+			this.getInviteList()
+		},
 		computed: {
 			userInfo() {
 				return wx.getStorageSync('userInfo')

+ 7 - 2
pages/mine/mine.vue

@@ -83,13 +83,18 @@
 			}
 		},
 		onShow() {
+			this.userInfo = wx.getStorageSync('userInfo');
+			this.userId = wx.getStorageSync('userId');
 			//获取用户的登录信息
 			if (wx.getStorageSync('token')) {
-				this.userInfo = wx.getStorageSync('userInfo');
-				this.userId = wx.getStorageSync('userId');
 				this.hasLogin = true
+				getApp().globalData.hasLogin = true
 				// 获取用户信息详情
 				this.getUserInfo()
+			} else {
+				this.hasLogin = false
+				getApp().globalData.hasLogin = false
+				this.userInfoDetail = {}
 			}
 		},
 		methods: {

+ 6 - 2
pages/user/user.vue

@@ -21,7 +21,9 @@
 				wx.removeStorageSync('userId')
 				wx.removeStorageSync('token')
 				getApp().globalData.hasLogin = false;
-				this.hasLogin = false
+				wx.switchTab({
+					url: '/pages/mine/mine'
+				})
 			},
 			logOff() {
 				wx.showModal({
@@ -35,7 +37,9 @@
 								wx.removeStorageSync('userId')
 								wx.removeStorageSync('token')
 								getApp().globalData.hasLogin = false;
-								this.hasLogin = false
+								wx.switchTab({
+									url: '/pages/mine/mine'
+								})
 							})
 						} else if (res.cancel) {
 							console.log('用户点击取消')