Bladeren bron

购物车优化

shish 1 maand geleden
bovenliggende
commit
3a2a68a995
2 gewijzigde bestanden met toevoegingen van 81 en 28 verwijderingen
  1. 32 10
      ghsApp/src/admin/billing/index2.vue
  2. 49 18
      hdApp/src/pagesPurchase/ghsProduct.vue

+ 32 - 10
ghsApp/src/admin/billing/index2.vue

@@ -128,20 +128,26 @@
 							<image class="item-icon" :src="item.cover" />
 							<view class="item-info">
 								<view class="info-line">
-									<text class="item-name">{{ item.name }}</text>
+									<view class="name-unit-col">
+										<text class="item-name">{{ item.name }}</text>
+										<text class="item-unit">
+											<block v-if="item.ratioType == 0">{{ item.ratio }}{{ item.smallUnit }}/{{ item.bigUnit }}</block>
+											<block v-else>若干{{ item.smallUnit }}/{{ item.bigUnit }}</block>
+										</text>
+									</view>
 									<text class="item-price">
 										<text class="unit">¥</text>
 										<text class="price">{{ getCartItemUnitPrice(item) }}</text>
 									</text>
 								</view>
 								<view style="text-align:right;">
-									<view class="open-bx">
+									<view class="open-bx cart-open-bx">
 										<text class="iconfont iconjian" @click.stop="delItem(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></text>
 										<text class="num" @click.stop="customUpdate(item)">
 											<text v-if="item.bigCount > 0" style="font-weight:bold;color:#3385ff;">{{ item.bigCount }}</text>
 											<text v-if="item.smallCount > 0"><text v-if="item.bigCount > 0">/</text>{{ item.smallCount }}</text>
 										</text>
-										<text class="iconfont iconzeng" @click.stop="addAction(item)"></text>
+										<text class="iconfont iconzeng icon-add-btn" @click.stop="addAction(item)"></text>
 									</view>
 								</view>
 							</view>
@@ -636,38 +642,54 @@ export default {
 					display: flex;
 					justify-content: space-between;
 					align-items: flex-end;
+					.name-unit-col {
+						flex: 1;
+						min-width: 0;
+					}
 					.item-name {
 						color: #666;
-						font-size: 28upx;
+						font-size: 30upx;
+						font-weight: bold;
 						overflow: hidden;
 						white-space: nowrap;
 						text-overflow: ellipsis;
 						width: 400upx;
 					}
+					.item-unit {
+						display: block;
+						margin-top: 8upx;
+						color: #999;
+						font-size: 24upx;
+					}
 					.item-price {
 						color: #333;
 						font-size: 22upx;
+						flex-shrink: 0;
 						.price {
 							font-size: 32upx;
 							font-weight: bold;
 						}
 					}
 				}
-				.open-bx {
+				/* 加减按钮尺寸对齐本页花材列表 app-commodity2 */
+				.cart-open-bx {
 					display: flex;
 					align-items: center;
 					justify-content: flex-end;
 					.iconfont {
 						color: #3385ff;
-						font-size: 60upx;
+						font-size: 55upx;
+					}
+					.icon-add-btn {
+						font-size: 69upx;
 					}
 					.num {
 						display: inline-block;
-						width: 130upx;
-						height: 55upx;
-						line-height: 55upx;
+						width: 100upx;
+						height: 50upx;
+						line-height: 50upx;
 						text-align: center;
-						margin: 0 8upx;
+						margin: 0 20upx;
 						color: #868686;
 						border-radius: 22upx;
 						background-color: #f5f5f5;

+ 49 - 18
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -108,7 +108,13 @@
 							<image class="item-icon" :src="item.cover" />
 							<view class="item-info">
 								<view class="info-line">
-									<text class="item-name">{{ item.name }}</text>
+									<view class="name-unit-col">
+										<text class="item-name">{{ item.name }}</text>
+										<text class="item-unit">
+											<block v-if="item.ratioType == 0">{{ item.ratio }}{{ item.smallUnit }}/{{ item.bigUnit }}</block>
+											<block v-else>若干{{ item.smallUnit }}/{{ item.bigUnit }}</block>
+										</text>
+									</view>
 									<view class="item-price-col">
 										<text class="item-price">
 											<text v-if="isReachDiscountReached(item)" class="price-original">¥{{ parseFloat(item.bigPrice || item.price) }}</text>
@@ -123,13 +129,13 @@
 									{{ getLimitBuyWarn(item) }}
 								</view>
 								<view style="text-align:right;">
-									<view class="open-bx" >
+									<view class="open-bx cart-open-bx">
 										<text class="iconfont iconjian" @click.stop="delItem(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></text>
 										<text class="num" @click.stop="customUpdate(item)">
 										<text v-if="item.bigCount > 0" style="font-weight:bold;color:#3385ff;">{{ item.bigCount }}</text>
 										<text v-if="item.smallCount > 0"><text v-if="item.bigCount > 0">/</text>{{ item.smallCount }}</text>
 										</text>
-										<text class="iconfont iconzeng" @click.stop="addAction(item)"></text>
+										<text class="iconfont iconzeng add-btn" @click.stop="addAction(item)"></text>
 									</view>
 								</view>
 							</view>
@@ -1031,14 +1037,25 @@ export default {
 					display: flex;
 					justify-content: space-between;
 					align-items: flex-end;
+					.name-unit-col {
+						flex: 1;
+						min-width: 0;
+					}
 					.item-name {
 						color: #666;
-						font-size: 34upx;
+						font-size: 36upx;
+						font-weight: bold;
 						overflow: hidden;
 						white-space: nowrap;
 						text-overflow: ellipsis;
 						width:400upx;
 					}
+					.item-unit {
+						display: block;
+						margin-top: 8upx;
+						color: #999;
+						font-size: 30upx;
+					}
 					.item-price {
 						color: #333;
 						font-size: 26upx;
@@ -1065,31 +1082,45 @@ export default {
 			.limit-buy-tip {
 				position: absolute;
 				left: 0;
-				top: 86upx;
+				top: 100upx;
 				color: red;
 				font-size: 30upx;
 				text-align: left;
 			}
 
-
-	.open-bx {
+	/* 加减按钮尺寸对齐本页花材列表 item 组件 */
+	.cart-open-bx {
+		display: flex;
 		align-items: center;
+		justify-content: flex-end;
+		box-sizing: border-box;
+		flex-shrink: 0;
 		& .iconfont {
-			color: #3385ff;
-			font-size: 60upx;
+			color: #09C567;
+			font-size: 55upx;
+		}
+		& .iconfont.add-btn {
+			font-size: 70upx;
+			line-height: 1;
+			padding: 6upx;
+			margin: -6upx 0 -6upx 0;
+			box-sizing: content-box;
 		}
-
 		& > .num {
-			display: inline-block;
-			width: 130upx;
-			height:55upx;
-			line-height:55upx;
-			text-align:center;
+			display: inline-flex;
+			align-items: center;
+			justify-content: center;
+			min-width: 100upx;
+			height: 60upx;
+			line-height: 60upx;
+			text-align: center;
 			margin: 0 8upx;
-			color: #868686;
-			border-radius: 22upx;
+			color: #757575;
+			border-radius: 25upx;
 			background-color: #f5f5f5;
-			font-size: 34upx;
+			font-size: 32upx;
+			box-sizing: border-box;
+			padding: 0 8upx;
 		}
 	}