lilei hace 4 años
padre
commit
a137390a94
Se han modificado 2 ficheros con 3 adiciones y 5 borrados
  1. 2 2
      components/uni-coods/uni-coods.vue
  2. 1 3
      pages/login/login.vue

+ 2 - 2
components/uni-coods/uni-coods.vue

@@ -77,12 +77,12 @@
 				})
 				addGoodsToCart(item).then(res => {
 					if(res.status == 200){
-						// 刷新购物车数据
-						uni.$emit('getCartList')
 						// 刷新购物车数量
 						if(!item.hasCunzai){
 							this.$store.state.vuex_cartNums = this.$store.state.vuex_cartNums + 1
 						}
+						// 刷新购物车数据
+						uni.$emit('getCartList')
 						uni.showToast({
 							icon: 'none',
 							title:'加入购物车成功'

+ 1 - 3
pages/login/login.vue

@@ -60,9 +60,6 @@
 				this.path = decodeURIComponent(path);
 			}
 		},
-		onUnload() {
-			uni.$off('getUserInfo')
-		},
 		methods: {
 			cansel(){
 				this.$store.state.vuex_noLogin = true
@@ -130,6 +127,7 @@
 				uni.login({
 					provider: 'weixin',
 					success(res) {
+						console.log(res.code)
 						_this.code = res.code
 					}
 				})