Przeglądaj źródła

解决分类加入后少一个得问题

WangYiHan 10 miesięcy temu
rodzic
commit
5bfb7a31ff

+ 8 - 3
components/order_addcart/index.vue

@@ -103,12 +103,12 @@
 					</view>
 				</view>
 				<!-- 热门推荐 -->
-				<view class='noCart' v-if="cartList.valid.length === 0 && cartList.invalid.length === 0 && canShow">
+				<!-- <view class='noCart' v-if="cartList.valid.length === 0 && cartList.invalid.length === 0 && canShow">
 					<view class='pictrue'>
 						<image src='../../static/images/noCart.png' />
 					</view>
 					<recommend :hostProduct='hostProduct'></recommend>
-				</view>
+				</view> -->
 			</view>
 		</view>
 		<!-- 管理操作 -->
@@ -410,6 +410,8 @@
 				}
 				TradeCartApi.deleteCart(selectValue).then(res => {
 					this.getCartList();
+					this.footerswitch=true
+					this.$emit('hideMask')
 				});
 			},
 			getSelectValueProductId: function() {
@@ -585,7 +587,9 @@
 			 */
 			subCart: function(index) {
 				let item = this.cartList.valid[index];
-				if (item.count < 1) {
+				console.log('我是减少的打印',item)
+				if (item.count <= 1) {
+					console.log('我进来减少了')
 					this.$util.Tips({
 						title: '商品数量不能减少!'
 					});
@@ -675,6 +679,7 @@
 					}
 				}
 				this.$Cache
+				console.log(validList,'11111111111111111111111111111111111111111')
 				this.$emit('cartList', validList);
 				this.$set(this.cartList, 'valid', validList);
 				console.log(this.cartList,888)

+ 33 - 2
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "yudao",
+    "name" : "易益康养",
     "appid" : "__UNI__F8A9CA1",
     "description" : "芋道商城",
     "versionName" : "1.0.0",
@@ -59,7 +59,38 @@
                     }
                 }
             },
-            "icons" : {}
+            "icons" : {
+                "android" : {
+                    "hdpi" : "unpackage/res/icons/72x72.png",
+                    "xhdpi" : "unpackage/res/icons/96x96.png",
+                    "xxhdpi" : "unpackage/res/icons/144x144.png",
+                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
+                },
+                "ios" : {
+                    "appstore" : "unpackage/res/icons/1024x1024.png",
+                    "ipad" : {
+                        "app" : "unpackage/res/icons/76x76.png",
+                        "app@2x" : "unpackage/res/icons/152x152.png",
+                        "notification" : "unpackage/res/icons/20x20.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "proapp@2x" : "unpackage/res/icons/167x167.png",
+                        "settings" : "unpackage/res/icons/29x29.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "spotlight" : "unpackage/res/icons/40x40.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png"
+                    },
+                    "iphone" : {
+                        "app@2x" : "unpackage/res/icons/120x120.png",
+                        "app@3x" : "unpackage/res/icons/180x180.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "notification@3x" : "unpackage/res/icons/60x60.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "settings@3x" : "unpackage/res/icons/87x87.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png",
+                        "spotlight@3x" : "unpackage/res/icons/120x120.png"
+                    }
+                }
+            }
         },
         "nvueLaunchMode" : "",
         "uniStatistics" : {

+ 1 - 1
pages.json

@@ -638,7 +638,7 @@
 				"pagePath": "pages/goods_cate/goods_cate",
 				"iconPath": "static/images/2-001.png",
 				"selectedIconPath": "static/images/2-002.png",
-				"text": "分类"
+				"text": "点餐"
 			},
 			// {
 			// 	"pagePath": "pages/order_addcart/order_addcart",

+ 13 - 12
pages/goods_cate/goods_cate.vue

@@ -44,8 +44,9 @@
 									<view class='money font-color' :class='is_switch?"":"on"'> <text
 											class='num'>¥{{ fen2yuan(item.price) }}</text>
 										<view class="carnum num-dis row-left" v-if="item.selected_goods_num>0">
+										<!-- :class="item.selected_goods_num <= 1 ? 'on' : ''" -->
 											<view class="item reduce"
-												:class="item.selected_goods_num <= 1 ? 'on' : ''"
+												
 												@click.stop="CartNumDes(item.id)">
 												-
 											</view>
@@ -53,14 +54,12 @@
 												<input style="color: #000;background-color: #EAEAEA;" type="number" v-model="item.selected_goods_num"
 													@input="updateCart" />
 											</view>
-											<view v-if="iSplus" class="item plus"
+											<!-- <view v-if="iSplus" class="item plus"
 												:class="attr.productSelect.cart_num >= attr.productSelect.stock ? 'on'  : ''"
 												@click.stop="CartNumAdd(item.id)">
 												+
-											</view>
-											<view v-else class='item plus' :class='(attr.productSelect.cart_num >= attr.productSelect.stock)
-														|| (attr.productSelect.cart_num >= attr.productSelect.limitCount)
-														? "on":""' @click.stop='CartNumAdd(item.id)'>+</view>
+											</view> -->
+											<view  class='item plus'  @click.stop='CartNumAdd(item.id)'>+</view>
 										</view>
 										<view class="circle" v-else @click.stop="addGoods(item.skus[0].id,index)">+
 										</view>
@@ -95,7 +94,7 @@
 		<!-- 购物车列表 -->
 		<!--  :style="{display: showCar ? 'flex' : 'none'}" -->
 		<view class="cart-box" v-if="goodsRightList.length>0">
-			<orderAddcart ref='orderAddcart' @showMask='isShowMask' @cartList="handleCartList"></orderAddcart>
+			<orderAddcart ref='orderAddcart' @showMask='isShowMask' @hideMask='hideMask' @cartList="handleCartList"></orderAddcart>
 		</view>
 		<view class="zz" @click="hideShoppingCar" v-if="showMask"></view>
 	</view>
@@ -183,7 +182,7 @@
 				// }
 			},
 			handleCartList(data){
-				console.log(data,'datadtaa',this.goodsRightList)
+				console.log(data,'222222222222222222222222222222',this.goodsRightList)
 				this.cartList=data
 				this.goodsRightList.forEach(goodsItem => {
 				    data.forEach(item => {
@@ -212,7 +211,6 @@
 					pageNo: this.page,
 					pageSize: this.limit
 				}).then(res => {
-					console.log(res, 77788999)
 					this.goodsRightList = res.data.list.map(item => {
 						return {
 							...item,
@@ -288,11 +286,11 @@
 					skuId: id,
 				}).then(res => {
 					console.log('我进拉了', index, this.goodsRightList, )
-					console.log(this.goodsRightList[index].selected_goods_num, 888)
+					// console.log(this.goodsRightList[index].selected_goods_num, 888)
 					// this.$set(this.goodsRightList[index],'selected_goods_num')
 					// this.goodsRightList[index].selected_goods_num++
 					this.$set(this.goodsRightList[index], 'selected_goods_num', this.goodsRightList[index].selected_goods_num + 1);
-					console.log(this.goodsRightList[index].selected_goods_num,'我是购物车的数量')
+					// console.log(this.goodsRightList[index].selected_goods_num,'我是购物车的数量')
 					// // 关闭 attr 组件
 					// this.attr.cartAttr = false;
 					// 提示成功
@@ -331,9 +329,12 @@
 			hideShoppingCar(){
 				// this.footHeight = '0';
 				this.$refs.orderAddcart.showCartList  = false;
-				// this.$refs.orderAddcart.footerswitch = true
 				this.showMask=false
 			},
+			hideMask(){
+				this.$refs.orderAddcart.showCartList  = false;
+				this.showMask=false
+			}
 		}
 	}
 </script>

+ 0 - 1
utils/request - 副本.js

@@ -64,7 +64,6 @@ function baseRequest(url, method, data, {
     header['Authorization'] = 'Bearer ' + store.state.app.token;
   }
   const isUseSleep = uni.getStorageSync("useSleep")
-  console.log(uni.getStorageSync("useSleep"),'判断从哪来的,true代表从首页来'); 
   // : 'http://yunai.natapp1.cc/' + url, // TODO 芋艿:搞个 url 的配置
   // : 'http://127.0.0.1:48080/' + url, // TODO 芋艿:搞个 url 的配置
   // : 'http://api-dashboard.yudao.iocoder.cn/' + url, // TODO 芋艿:搞个 url 的配置

+ 0 - 1
utils/request.js

@@ -79,7 +79,6 @@ function baseRequest(url, method, data, { noAuth = false, noVerify = false }, pa
 	}
 
 	const isUseSleep = uni.getStorageSync("useSleep");
-	console.log(uni.getStorageSync("useSleep"), '判断从哪来的,true代表从首页来'); 
 	// : 'http://yunai.natapp1.cc/' + url, // TODO 芋艿:搞个 url 的配置
 	// : 'http://127.0.0.1:48080/' + url, // TODO 芋艿:搞个 url 的配置
 	// : 'http://api-dashboard.yudao.iocoder.cn/' + url, // TODO 芋艿:搞个 url 的配置