@@ -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:'加入购物车成功'
@@ -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