瀏覽代碼

bug 修复

lilei 4 年之前
父節點
當前提交
a137390a94
共有 2 個文件被更改,包括 3 次插入5 次删除
  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 => {
 				addGoodsToCart(item).then(res => {
 					if(res.status == 200){
 					if(res.status == 200){
-						// 刷新购物车数据
-						uni.$emit('getCartList')
 						// 刷新购物车数量
 						// 刷新购物车数量
 						if(!item.hasCunzai){
 						if(!item.hasCunzai){
 							this.$store.state.vuex_cartNums = this.$store.state.vuex_cartNums + 1
 							this.$store.state.vuex_cartNums = this.$store.state.vuex_cartNums + 1
 						}
 						}
+						// 刷新购物车数据
+						uni.$emit('getCartList')
 						uni.showToast({
 						uni.showToast({
 							icon: 'none',
 							icon: 'none',
 							title:'加入购物车成功'
 							title:'加入购物车成功'

+ 1 - 3
pages/login/login.vue

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