diff --git a/pages/classify/goods-list/goods-list.vue b/pages/classify/goods-list/goods-list.vue index ac9bc15..73246aa 100644 --- a/pages/classify/goods-list/goods-list.vue +++ b/pages/classify/goods-list/goods-list.vue @@ -145,8 +145,6 @@ import noMore from '@/pages/classify/no-more/no-more.vue' import wybPopup from '@/components/wyb-popup/wyb-popup.vue' import cartChoose from '@/pages/classify/cart-choose/cart-choose.vue' - // import dataList from '@/components/dataList/dataList.vue' - // import uniNumberBox from '@/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue' import { findGoodsSkuByGoodsId,getShoppingCartList } from '@/Utils/physicalObject.js' import uniBadge from '@/components/uni-badge/components/uni-badge/uni-badge.vue' const app = getApp(); @@ -198,9 +196,7 @@ this.refreshCartNum(); }, - mounted(){ - console.log("挂载了") - }, + props: { propData: { type: Array, @@ -280,16 +276,7 @@ refreshCartNum(){ getShoppingCartList().then( res=>{ if (res.return_code == '000000') { - this.cartNum = res.return_data.length; - // uni.setStorage({ - // key:'cartNum', //存储到本地的名字 - // data:res.return_data.length, //存储的数据 - // success(){ - // console.log('存储成功') - // console.log(app.globalData.cartNum,"this.cartNum") - // } - // }) - + this.cartNum = res.return_data.length; }else{ uni.showToast({ title: res.return_msg, diff --git a/pages/tabBar/classify/classify.vue b/pages/tabBar/classify/classify.vue index 6ead194..2b2e76d 100644 --- a/pages/tabBar/classify/classify.vue +++ b/pages/tabBar/classify/classify.vue @@ -55,7 +55,7 @@ - + @@ -117,7 +117,7 @@ sortOrder:0,//1表示升序,2表示降序 // cartNum:app.globalData.cartNum, - + hackReset:false,//强制刷新子组件 @@ -130,6 +130,12 @@ }, onShow(){ + this.hackReset = false; + this.$nextTick(() => { + this.hackReset = true; + }) + + }, methods:{