فهرست منبع

improve: 分类跳转底部菜单刷新

From-wh 2 سال پیش
والد
کامیت
ea06e5bef0

+ 12 - 3
template/uni-app/components/pageFooter/index.vue

@@ -58,8 +58,7 @@
 		computed: mapGetters(['isLogin', 'cartNum', 'activityTab']),
 		watch: {
 			activityTab: {
-				handler(nVal, oVal) {
-				},
+				handler(nVal, oVal) {},
 				deep: true
 			},
 			configData: {
@@ -83,6 +82,14 @@
 			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
 			let curRoute = routes[routes.length - 1].route //获取当前页面路由
 			this.$store.commit('ACTIVITYTAB', '/' + curRoute);
+			uni.$on('uploadFooter', () => {
+				let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
+				let curRoute = routes[routes.length - 1].route //获取当前页面路由
+				this.$store.commit('ACTIVITYTAB', '/' + curRoute);
+			})
+		},
+		onShow() {
+
 		},
 		mounted() {
 			getNavigation().then(res => {
@@ -97,7 +104,9 @@
 				this.getCartNum()
 			}
 		},
-
+		onHide() {
+			uni.$off(['uploadFooter'])
+		},
 		methods: {
 			goRouter(item) {
 				var pages = getCurrentPages();

+ 4 - 2
template/uni-app/pages/goods_cate/goods_cate.vue

@@ -49,7 +49,7 @@
 				getCategoryVersion().then(res => {
 					if (!uni.getStorageSync('CAT_VERSION') || res.data.version != uni.getStorageSync(
 							'CAT_VERSION')) {
-						this.isNew = !this.isNew
+						this.isNew = !this.isNew
 						uni.setStorageSync('CAT_VERSION', res.data.version)
 					} else {
 						// this.isNew = false
@@ -58,7 +58,9 @@
 				})
 			},
 			jumpIndex() {
-				if (this.is_diy) {}
+				// uni.reLaunch({
+				// 	url: '/pages/index/index'
+				// })
 			},
 			classStyle() {
 				colorChange('category').then(res => {

+ 0 - 1
template/uni-app/pages/goods_cate/goods_cate3.vue

@@ -564,7 +564,6 @@
 						title: that.$t(`不能输入0喔`)
 					});
 				}
-				console.log(that.attr.productSelect.cart_num, 'that.attr.productSelect.cart_num')
 				let q = {
 					product_id: id,
 					num: duo ? that.attr.productSelect.cart_num : 1,

+ 5 - 3
template/uni-app/pages/index/diy/index.vue

@@ -13,7 +13,8 @@
 						:isSortType="isSortType" @bindSortId="bindSortId" @bindHeight="bindHeight" :isFixed="isFixed">
 					</component>
 				</view>
-				<!-- #endif -->
+				<!-- #endif -->
+				
 				<!-- #ifdef MP || APP-PLUS -->
 				<block v-for="(item, index) in styleConfig" :key="index">
 					<activeParty v-if="item.name == 'activeParty'" :dataConfig="item" :isSortType="isSortType">
@@ -141,7 +142,9 @@
 				<view v-if="site_config" class="site-config" @click="goICP">{{ site_config }}</view>
 				<!-- #endif -->
 				<view class="uni-p-b-98"></view>
+				<!-- #ifndef H5 -->
 				<pageFoot></pageFoot>
+				<!-- #endif -->
 			</view>
 		</view>
 		<view v-else>
@@ -460,7 +463,6 @@
 				uni.showLoading({
 					title: this.$t(`加载中`)
 				})
-				console.log('1111')
 				this.diyData();
 				this.getIndexData();
 				getShare().then(res => {
@@ -659,7 +661,7 @@
 			},
 			diyData() {
 				let that = this;
-				getDiy(0).then(res => {
+				getDiy(0).then(res => {
 					uni.hideLoading()
 					uni.setStorageSync('DIY_DATA', res.data)
 					setTimeout(() => {

+ 1 - 0
template/uni-app/pages/index/index.vue

@@ -39,6 +39,7 @@
 		},
 		methods: {
 			getVersion(name) {
+				uni.$emit('uploadFooter')
 				getVersion(name).then(res => {
 					this.version = res.data.version
 					this.isDiy = res.data.is_diy