WIN-2CJ8FMUT9OF\Administrator 6 месяцев назад
Родитель
Сommit
a3b354bda4
2 измененных файлов с 7 добавлено и 54 удалено
  1. 5 53
      pages-takeout/new-shop.vue
  2. 2 1
      pages/index/index.vue

+ 5 - 53
pages-takeout/new-shop.vue

@@ -74,21 +74,21 @@
 						<view class="" v-if="item.list <= 0">
 							<EnBlank message='暂无商品' :customSrc='true'>
 								<template v-slot:blankImg>
-									<image class="black-custom-img"
-										src="@/static/img/common/no-order.png" mode="">
+									<image class="black-custom-img" src="@/static/img/common/no-order.png" mode="">
 									</image>
 								</template>
 							</EnBlank>
 						</view>
 						<view class="menu-list flex-justify-space box-border-box" v-for="(info,k) in item.list" :key="k"
 							:id="'goods_id'+ info.goods_id">
-							<image class="flex-shrink0 goods_img b-rad-12" :src="info.goods_image" mode="scaleToFill"></image>
+							<image class="flex-shrink0 goods_img b-rad-12" :src="info.goods_image" mode="scaleToFill">
+							</image>
 							<view class="menu-list-right flex-direction flex-justify-space">
 								<view class="mb-8">
 									<view class="mb-4 goods-name text-overflow-ellipsis fs-32 fw-600">
 										{{info.goods_name}}
 									</view>
-<!-- 									<view class="text-overflow-ellipsis fw-400 fc-9 fs-24 mb-2 goods-name"
+									<!-- 									<view class="text-overflow-ellipsis fw-400 fc-9 fs-24 mb-2 goods-name"
 										v-if="info.spec_type == 1">
 										{{info.goods_desc?info.goods_desc:''}}
 									</view> -->
@@ -167,7 +167,7 @@
 						<view class="flex-1 flex-direction flex-justify-space">
 							<view class="">
 								<view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-8">
-									{{goods.goods_name}}都算iOS对哦哎对哦哎对哦啊速度iOS
+									{{goods.goods_name}}
 								</view>
 								<view class="fc-6" v-show="goods.goods_attr">
 									{{goods.goods_attr}}
@@ -262,16 +262,6 @@
 				shop_id: '',
 				operate_id: '',
 				shopsInfo: {},
-				// cartData: {
-				// 	total_price: 0,
-				// 	total_num: 0,
-				// 	total_goods_money: 0,
-				// 	pack_price: 0,
-				// 	must_category: 0,
-				// 	is_place_order: 0,
-				// 	err_msg: 0,
-				// 	goods_list: [],
-				// },
 				isAjax: false,
 				newNavHeight: '',
 				navBgType: false,
@@ -301,7 +291,6 @@
 		onLoad(e) {
 			cartStore.setShopId();
 			this.getshopInfo();
-			console.log();
 		},
 		mounted() {},
 		onReachBottom(e) {},
@@ -447,17 +436,14 @@
 				if (this.type != item.category_id) {
 					this.type = item.category_id;
 					this.idMark = 'scroll' + item.category_id
-
 					// 立即更新
 					this.$forceUpdate();
-
 					// 延迟执行滚动
 					setTimeout(() => {
 						this.scrollToCategorySimple(item.category_id);
 					}, 100);
 				}
 			},
-
 			// 滚动方法
 			scrollToCategorySimple(type) {
 				const query = uni.createSelectorQuery();
@@ -466,27 +452,6 @@
 					selector: selector,
 					duration: 300,
 				});
-				return
-				let targetScrollTop = 0
-				query.select('.shop-info').boundingClientRect(rect => {
-					console.log('商家详情', rect);
-					targetScrollTop += rect.height
-				})
-				query.select('.shop-type-box').boundingClientRect(rect => {
-					console.log('详情切换', rect);
-					targetScrollTop += rect.height + this.newNavHeight
-					console.log('固定上部分位置', targetScrollTop);
-				})
-				query.select(selector).boundingClientRect(rect => {
-					console.log('id找到元素,top:', rect);
-					uni.pageScrollTo({
-						scrollTop: targetScrollTop,
-						duration: 300,
-						success: () => {
-							console.log('滚动完成');
-						}
-					});
-				}).exec();
 			},
 			addred(type, item) {
 				if (type === 1) {
@@ -508,19 +473,6 @@
 			},
 			shoppingSave(item, num) {
 				// 前端处理购物车
-				// const goodsData = {
-				// 	goods_id: item.goods_id,
-				// 	goods_name: item.goods_name,
-				// 	goods_image: item.goods_image,
-				// 	category_id: item.category_id,
-				// 	seckill_money: item.seckill_money || 0,
-				// 	price: item.price || 0,
-				// 	pack_price: item.pack_price || 0, // 添加配送费
-				// 	spec_type: item.spec_type || 1,
-				// 	goods_desc: item.goods_desc || '',
-				// 	line_price: item.line_price || '',
-				// 	sales: item.sales || 0
-				// };
 				if (num <= 0) {
 					// 数量为0,移除商品
 					cartStore.removeFromCart(item.goods_id, item.goods_spec || []);

+ 2 - 1
pages/index/index.vue

@@ -27,6 +27,7 @@
 </template>
 
 <script>
+	import cartStore from '@/utils/cartStore.js';
 	import {
 		appletLogin
 	} from "@/api/member";
@@ -41,7 +42,7 @@
 			// if (data) {
 			// 	uni.setStorageSync('shop_id', data.shop_id)
 			// }
-			
+			cartStore.clearCurrentShopCart();
 		},
 		onShow() {
 			// uni.setStorageSync('shop_id', 111)