diff --git a/subPackages/techan/detail.vue b/subPackages/techan/detail.vue index 82b28dc..352eae2 100644 --- a/subPackages/techan/detail.vue +++ b/subPackages/techan/detail.vue @@ -295,7 +295,9 @@ ...goods, specUrl:goods.imageUrl, goodsName:this.info.goodsName, - quantity:goods.buyNum + quantity:goods.buyNum, + supplierId:this.info.supplierId, + supplierName:this.info.supplierName, }] this.$store.commit("changeOrderSCart", list); this.gotoPath("/subPackages/techan/order"); @@ -303,7 +305,7 @@ addToCart () { let goods = this.sku[this.productIndex] goods.buyNum = this.buyNum - this.Post({goodsId: this.info.goodsId, specCombinationId: goods.specCombinationId,quantity: this.buyNum,method:'post' }, + this.Post({goodsId: this.info.goodsId, specCombinationId: goods.specCombinationId,quantity: this.buyNum,method:'post',supplierId:this.info.supplierId, }, '/framework/cart/add',"DES").then(res => { if (res.code==200) { let selectedData = [] diff --git a/subPackages/techan/order.vue b/subPackages/techan/order.vue index e39e8c9..9e4100d 100644 --- a/subPackages/techan/order.vue +++ b/subPackages/techan/order.vue @@ -63,47 +63,72 @@ - - - - - - - {{ sku.goodsName }} - - {{ sku.salePrice }} + + + + + + + {{ supplierGroup.supplierName }} + + + + + + + + + + {{ sku.goodsName }} + + {{ sku.salePrice }} + + + + {{ sku.specValueOne }}-{{ sku.specValueTwo }} + x{{ sku.quantity }} + + + + + 购买数量 + + - + + + + - - - {{ sku.specValueOne }}-{{ sku.specValueTwo }} - x{{ sku.quantity }} - - - 购买数量 - - - - - - + + + + + + + + + + @@ -125,35 +150,16 @@ - - - - - - - - - - - - - - - 包邮 - - - 商品总价: {{ getGoodsTotal() }} + + 运费: + 包邮 + 积分抵扣: { + const supplierId = item.supplierId || 'default'; + const supplierName = item.supplierName || '默认供应商'; + + if (!supplierMap.has(supplierId)) { + supplierMap.set(supplierId, { + supplierId, + supplierName, + goods: [] + }); + // 初始化该供应商的备注 + this.$set(this.supplierRemarks, supplierId, ''); + } + + supplierMap.get(supplierId).goods.push(item); + }); + + this.groupedGoods = Array.from(supplierMap.values()); + console.log('分组后的商品:', this.groupedGoods); + }, + // 获取总积分 async getTotalPoints() { try { @@ -582,7 +621,7 @@ export default { } }); }, - reduce(sku, index) { + reduce(sku, supplierIndex, index) { if (sku.quantity > 1) { this.$nextTick(() => { sku.quantity -= 1; @@ -592,10 +631,20 @@ export default { }); } else if (sku.quantity == 1) { this.$nextTick(() => { - this.info.splice(index, 1); + // 从原始info数组中移除该商品 + const skuIndex = this.info.findIndex(item => + item.goodsName === sku.goodsName && + item.specValueOne === sku.specValueOne && + item.specValueTwo === sku.specValueTwo + ); + if (skuIndex !== -1) { + this.info.splice(skuIndex, 1); + } + if (this.flag) { this.getPost(); } + // 重新分组 this.handleOrderGoods(); }); } @@ -865,10 +914,20 @@ export default { this.isOrderLoading = true; // 开始加载 + // 按供应商分组构建 createDtos + let createDtos = []; + this.groupedGoods.forEach(supplierGroup => { + const supplierRemark = this.supplierRemarks[supplierGroup.supplierId] || ''; + createDtos.push({ + supplierId: supplierGroup.supplierId, + remark: supplierRemark, + shoppingCartBoList: supplierGroup.goods + }); + }); + let data = { - shoppingCartBoList: this.info, + createDtos: createDtos, userContactId: this.contacts.id, - remark: this.remark, expectedAmount: this.allprice, usePoints: this.usePoints ? 0 : 1, // 是否使用积分 pointsQuantity: parseInt(this.usePoints) || 0, // 使用的积分数量 @@ -1890,6 +1949,78 @@ $bg-light: #f9f9f9; border-radius: 14rpx; } +// 供应商卡片样式 +.supplier-card { + background-color: #ffffff; + border-radius: 16rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1); + width: 697rpx; + margin: 30rpx auto; + overflow: hidden; + border: 1rpx solid #f0f0f0; +} + +// 供应商标题样式 +.supplier-header { + padding: 20rpx 24rpx; + background: #ffffff; + + .supplier-name { + font-size: 30rpx; + font-weight: 600; + color: #333333; + } +} + +// 供应商商品列表样式 +.supplier-goods { + padding: 0; + + .commodity-item { + border-bottom: 1rpx solid #f0f0f0; + + &:last-child { + border-bottom: none; + } + } +} + +// 供应商备注样式 +.supplier-remark { + background-color: #ffffff; + padding: 20rpx 24rpx; + border-top: 1rpx solid #f0f0f0; + + .section-row { + display: flex; + justify-content: space-between; + align-items: center; + min-height: 60rpx; + + .section-label { + font-size: 28rpx; + color: #333333; + font-weight: 500; + } + + .note-input { + flex: 1; + margin-left: 40rpx; + + input { + font-size: 26rpx; + color: #333333; + text-align: right; + width: 100%; + } + + .placeholder { + color: #999999; + } + } + } +} + .tickets-box { width: 698rpx; margin: 26rpx auto 0; diff --git a/subPackages/user/gwc.vue b/subPackages/user/gwc.vue index afac28e..654c910 100644 --- a/subPackages/user/gwc.vue +++ b/subPackages/user/gwc.vue @@ -1,822 +1,891 @@ \ No newline at end of file +.bg { + width: 100%; + min-height: 100vh; + padding: 0 27rpx 200rpx; + box-sizing: border-box; + background-color: #f8f8f8; +} + +.guanli { + height: 76rpx; + text-align: right; + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 500; + color: #6ca5aa; + line-height: 76rpx; + padding: 0 20rpx; + border-radius: 20rpx; + transition: all 0.3s ease; + + &:active { + background: rgba(108, 165, 170, 0.1); + transform: scale(0.95); + } +} + +.goodBox { + width: 697rpx; + height: auto; + background: #ffffff; + border-radius: 20rpx; + margin: 0 auto 27rpx; + padding: 25rpx 20rpx; + box-sizing: border-box; + + .title { + font-size: 30rpx; + font-weight: 600; + color: #333333; + } + + .goodItem { + width: 100%; + height: 173rpx; + margin-top: 46rpx; + display: flex; + + .noSelect { + width: 37rpx; + height: 37rpx; + border-radius: 50%; + border: 2rpx solid #666666; + box-sizing: border-box; + margin-right: 25rpx; + margin-top: 68rpx; + } + + .selectBox { + width: 37rpx; + height: 37rpx; + // background: linear-gradient(90deg, #FA2B66, #FF9834); + // border-radius: 50%; + margin-right: 25rpx; + margin-top: 68rpx; + + img { + width: 100%; + height: 100%; + } + } + + image { + width: 173rpx; + height: 173rpx; + border-radius: 13rpx; + } + + .contentBox { + width: 400rpx; + height: 173rpx; + margin-left: 23rpx; + + .title { + font-size: 31rpx; + font-family: PingFang SC; + font-weight: 500; + color: #000000; + } + + .subTitle { + font-size: 27rpx; + font-family: PingFang SC; + font-weight: 400; + color: #7c7c7c; + margin-top: 13rpx; + } + + .priceBox { + margin-top: 35rpx; + + .price { + font-size: 40rpx; + font-family: PingFang SC; + font-weight: 500; + color: #ff2d3b; + } + + .price:before { + content: "¥"; + font-size: 27rpx; + } + + .quantity-control { + display: flex; + align-items: center; + border: 2rpx solid #e5e5e5; + border-radius: 25rpx; + overflow: hidden; + + .quantity-btn { + width: 60rpx; + height: 50rpx; + display: flex; + align-items: center; + justify-content: center; + background: #f8f9fa; + transition: all 0.3s ease; + + &.minus-btn { + border-right: 1rpx solid #e5e5e5; + } + + &.plus-btn { + border-left: 1rpx solid #e5e5e5; + } + + &.disabled { + background: #f1f1f1; + color: #ccc; + } + + &:not(.disabled):active { + background: #e9ecef; + } + + font-size: 50rpx; + font-weight: 500; + color: #333; + + .btn-text { + } + } + + .quantity-input { + width: 80rpx; + height: 50rpx; + display: flex; + align-items: center; + justify-content: center; + background: #fff; + font-size: 28rpx; + color: #333; + font-weight: 500; + } + } + } + } + } +} + +.loseGood { + width: 697rpx; + height: auto; + background: #ffffff; + border-radius: 20rpx; + margin: 0 auto 27rpx; + padding: 25rpx 20rpx; + box-sizing: border-box; + + .title { + font-size: 35rpx; + font-family: PingFang SC; + font-weight: 500; + color: #666666; + + span { + font-size: 32rpx; + font-family: PingFang SC; + font-weight: 400; + color: #2791f7; + } + } + + .goodItem { + width: 100%; + height: 173rpx; + margin-top: 46rpx; + display: flex; + color: #999999; + + .noSelect { + width: 37rpx; + height: 37rpx; + border-radius: 50%; + border: 2rpx solid #cccccc; + background: #f1f1f1; + box-sizing: border-box; + margin-right: 25rpx; + margin-top: 68rpx; + } + + image { + width: 173rpx; + height: 173rpx; + border-radius: 13rpx; + margin-right: 23rpx; + } + + .contentBox { + width: 421rpx; + height: 173rpx; + + .title { + font-size: 31rpx; + font-family: PingFang SC; + font-weight: 500; + } + + .subTitle { + font-size: 27rpx; + font-family: PingFang SC; + font-weight: 400; + } + + .priceBox { + margin-top: 35rpx; + + .price { + font-size: 40rpx; + font-family: PingFang SC; + font-weight: 500; + } + + .price:before { + content: "¥"; + font-size: 27rpx; + } + + .btn { + width: 125rpx; + height: 53rpx; + background: #999999; + border-radius: 13rpx; + text-align: center; + line-height: 53rpx; + font-size: 29rpx; + font-family: PingFang SC; + font-weight: 500; + color: #ffffff; + } + } + } + } +} + +/* 空状态样式 */ +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 200rpx 0; + + .empty-icon { + width: 200rpx; + height: 200rpx; + margin-bottom: 40rpx; + opacity: 0.6; + } + + .empty-title { + font-size: 36rpx; + color: #333; + font-weight: 500; + margin-bottom: 20rpx; + } + + .empty-desc { + font-size: 28rpx; + color: #999; + margin-bottom: 60rpx; + } + + .empty-btn { + width: 240rpx; + height: 80rpx; + background: #6ca5aa; + border-radius: 40rpx; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 30rpx; + font-weight: 500; + box-shadow: 0 8rpx 20rpx rgba(108, 165, 170, 0.3); + transition: all 0.3s ease; + + &:active { + transform: scale(0.95); + box-shadow: 0 4rpx 10rpx rgba(108, 165, 170, 0.2); + } + } +} + +.orderBox { + width: 750rpx; + height: 151rpx; + background: #ffffff; + box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); + padding: 0 27rpx; + box-sizing: border-box; + position: fixed; + left: 0; + bottom: 0; + + .priceBox { + display: flex; + font-size: 27rpx; + font-family: PingFang SC; + font-weight: 400; + color: #666666; + + span { + font-size: 27rpx; + font-family: PingFang SC; + font-weight: 400; + color: #333333; + margin-left: 20rpx; + } + + p { + font-size: 36rpx; + font-family: PingFang SC; + font-weight: 500; + color: #ff2d3b; + margin-top: -5rpx; + } + + .noSelect { + width: 41rpx; + height: 41rpx; + border-radius: 50%; + border: 2rpx solid #666666; + box-sizing: border-box; + margin-right: 10rpx; + } + + .selectBox { + width: 41rpx; + height: 41rpx; + // background: linear-gradient(90deg, #FA2B66, #FF9834); + border-radius: 50%; + margin-right: 10rpx; + + img { + width: 100%; + height: 100%; + } + } + } + + .btn { + width: 219rpx; + height: 77rpx; + background: #6ca5aa; + border-radius: 39rpx; + text-align: center; + line-height: 77rpx; + font-size: 33rpx; + font-family: PingFang SC; + font-weight: 500; + color: #ffffff; + } +} + +/* 移除旧的样式 */ +.zhihui { + background: #e8e8e8 !important; + color: #999999 !important; +} + +/* 优化商品卡片样式 */ +.goodBox { + box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08); + transition: all 0.3s ease; + + &:hover { + transform: translateY(-2rpx); + box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.12); + } +} + +/* 优化选择框样式 */ +.noSelect { + transition: all 0.3s ease; + + &:active { + transform: scale(0.9); + } +} + +.selectBox { + transition: all 0.3s ease; + + &:active { + transform: scale(0.9); + } +} +