diff --git a/static/js/request.js b/static/js/request.js index a8bfb5d..dc5df2c 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -8,7 +8,7 @@ const DEV_API_URL = 'http://1.13.193.49'; // const PROD_API_URL = 'https://epic.js-dyyj.com'; const PROD_API_URL = 'http://1.13.193.49'; const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL; -const DEV_API_URL_DES = 'http://192.168.124.177:8083/xcx'; +const DEV_API_URL_DES = 'http://192.168.124.118:8083/xcx'; // const DEV_API_URL_DES = 'https://des.js-dyyj.com/xcx'; // const DEV_API_URL_DES = 'http://1.13.193.49:8083/xcx'; // const PROD_API_URL_DES = 'https://des.js-dyyj.com/xcx'; diff --git a/subPackages/techan/detail.vue b/subPackages/techan/detail.vue index 352eae2..9346c65 100644 --- a/subPackages/techan/detail.vue +++ b/subPackages/techan/detail.vue @@ -61,15 +61,14 @@ - + @@ -186,18 +185,19 @@ }; }, onShow() { - // 获取购物车数量 - this.Post({ - is_post: 1, - }, '/api/shopping/getShoppingList').then(res => { - console.log(res) - }) + this.getShoppingList() }, onLoad(option) { this.id = option.id; this.getInfo(); }, methods: { + getShoppingList() { + this.Post({}, "/framework/cart/list", "DES") + .then((res) => { + this.paramData.num = res.data.length + }) + }, changPopShow (e) { this.popShow = e.show }, @@ -318,10 +318,13 @@ if (!currentGoods) { selectedData.push(goods.goodsId) } - uni.showToast({ - title:'加购成功', - icon:'none' - }) + setTimeout(() =>{ + uni.showToast({ + title:'加购成功', + icon:'none' + }) + },400) + this.getShoppingList() uni.setStorageSync('cartDataInfo', JSON.stringify(selectedData)); uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null}) this.closePopup() diff --git a/subPackages/techan/order.vue b/subPackages/techan/order.vue index 9e4100d..e503d26 100644 --- a/subPackages/techan/order.vue +++ b/subPackages/techan/order.vue @@ -64,17 +64,24 @@ - + {{ supplierGroup.supplierName }} - + - + - + 购买数量 - + @@ -156,10 +167,10 @@ 商品总价: {{ getGoodsTotal() }} - - 运费: - 包邮 - + + 运费: + 包邮 + 积分抵扣: { - const supplierId = item.supplierId || 'default'; - const supplierName = item.supplierName || '默认供应商'; - + + this.info.forEach((item) => { + const supplierId = item.supplierId || "default"; + const supplierName = item.supplierName || "默认供应商"; + if (!supplierMap.has(supplierId)) { supplierMap.set(supplierId, { supplierId, supplierName, - goods: [] + goods: [], }); // 初始化该供应商的备注 - this.$set(this.supplierRemarks, supplierId, ''); + this.$set(this.supplierRemarks, supplierId, ""); } - + supplierMap.get(supplierId).goods.push(item); }); - + this.groupedGoods = Array.from(supplierMap.values()); - console.log('分组后的商品:', this.groupedGoods); + console.log("分组后的商品:", this.groupedGoods); }, // 获取总积分 @@ -632,15 +643,16 @@ export default { } else if (sku.quantity == 1) { this.$nextTick(() => { // 从原始info数组中移除该商品 - const skuIndex = this.info.findIndex(item => - item.goodsName === sku.goodsName && - item.specValueOne === sku.specValueOne && - item.specValueTwo === sku.specValueTwo + 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(); } @@ -916,21 +928,23 @@ export default { // 按供应商分组构建 createDtos let createDtos = []; - this.groupedGoods.forEach(supplierGroup => { - const supplierRemark = this.supplierRemarks[supplierGroup.supplierId] || ''; + this.groupedGoods.forEach((supplierGroup) => { + const supplierRemark = + this.supplierRemarks[supplierGroup.supplierId] || ""; createDtos.push({ supplierId: supplierGroup.supplierId, remark: supplierRemark, - shoppingCartBoList: supplierGroup.goods + shoppingCartBoList: supplierGroup.goods, }); }); - + let data = { createDtos: createDtos, userContactId: this.contacts.id, expectedAmount: this.allprice, usePoints: this.usePoints ? 0 : 1, // 是否使用积分 pointsQuantity: parseInt(this.usePoints) || 0, // 使用的积分数量 + shippingFee: 0, }; this.Post( @@ -1964,7 +1978,7 @@ $bg-light: #f9f9f9; .supplier-header { padding: 20rpx 24rpx; background: #ffffff; - + .supplier-name { font-size: 30rpx; font-weight: 600; @@ -1975,10 +1989,10 @@ $bg-light: #f9f9f9; // 供应商商品列表样式 .supplier-goods { padding: 0; - + .commodity-item { border-bottom: 1rpx solid #f0f0f0; - + &:last-child { border-bottom: none; } @@ -1990,35 +2004,35 @@ $bg-light: #f9f9f9; 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; + 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; - font-weight: 500; + text-align: right; + width: 100%; } - - .note-input { - flex: 1; - margin-left: 40rpx; - - input { - font-size: 26rpx; - color: #333333; - text-align: right; - width: 100%; - } - - .placeholder { - color: #999999; - } + + .placeholder { + color: #999999; } } + } } .tickets-box {