소스 검색

bug 修复

lilei 4 년 전
부모
커밋
6df4cc1621
2개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 1
      components/uni-coods/uni-coods.vue
  2. 4 2
      pages/goods/goodsDetail.vue

+ 3 - 1
components/uni-coods/uni-coods.vue

@@ -77,7 +77,9 @@
 				})
 				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
 						}

+ 4 - 2
pages/goods/goodsDetail.vue

@@ -97,7 +97,7 @@
 					console.log(res)
 					if(res.status == 200){
 						this.goodContent = res.data
-						this.goldLimit = res.data.goodsType.goldLimit
+						this.goldLimit = res.data.goodsType.goldLimit || 0
 						let arr=res.data.images.split(',')
 						arr.map(item => {
 							this.imageList.push({image:item})
@@ -113,7 +113,9 @@
 				})
 				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
 						}