Browse Source

Merge branch 'dev_des' of http://123.60.98.226:3000/jiazhipeng/EpicSoul into dev_des

dev_des
zhangminghao 1 month ago
parent
commit
a5173c37a5
  1. 2
      static/js/request.js
  2. 35
      subPackages/techan/detail.vue
  3. 124
      subPackages/techan/order.vue

2
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';

35
subPackages/techan/detail.vue

@ -61,15 +61,14 @@
<template v-if="!popShow">
<view class="btn-list" v-if="!paramData.showCart">
<view class="left-box">
<!-- <view class="img-box" slot="content">
<view class="left-box" @click="gotoPath('/subPackages/user/gwc')">
<view class="img-box" slot="content">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#D90F01',color:'#ffffff',border:'1px solid #ffffff'}">
<image @click.stop="showCartClick" :src="showImg('/uploads/20250513/29fd015f8c779f08e53d1016d3643c58.png')" mode="aspectFill"
style="width: 60rpx;height: 50rpx;"></image>
<uni-icons type="cart" size="30"></uni-icons>
</uni-badge>
<text class="text">购物车</text>
</view> -->
</view>
</view>
<view class="btn-post">
<view class="left-btn-buy" @click="openPop(true)">加入购物车</view>
@ -102,7 +101,7 @@
</view>
</template>
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" :key="new Date().getTime()"></cartDataVue>
<!-- <cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" :key="new Date().getTime()"></cartDataVue> -->
<uni-popup ref="popup" type="bottom" @change="changPopShow"
:safe-area="false" style="position: relative;z-index: 50;">
@ -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()

124
subPackages/techan/order.vue

@ -64,17 +64,24 @@
</view>
</view>
<!-- 按供应商分组显示商品 -->
<view v-for="(supplierGroup, supplierIndex) in groupedGoods" :key="supplierGroup.supplierId">
<view
v-for="(supplierGroup, supplierIndex) in groupedGoods"
:key="supplierGroup.supplierId"
>
<!-- 供应商卡片 -->
<view class="supplier-card">
<!-- 供应商名称 -->
<view class="supplier-header">
<text class="supplier-name">{{ supplierGroup.supplierName }}</text>
</view>
<!-- 该供应商的商品列表 -->
<view class="supplier-goods">
<view class="commodity-item" v-for="(sku, index) in supplierGroup.goods" :key="index">
<view
class="commodity-item"
v-for="(sku, index) in supplierGroup.goods"
:key="index"
>
<view class="commodity box">
<image
class="img"
@ -96,7 +103,11 @@
</view>
</view>
</view>
<view class="commodity box sb" style="padding-left: 10rpx" v-if="false">
<view
class="commodity box sb"
style="padding-left: 10rpx"
v-if="false"
>
<view class="title" style="font-weight: bold"> 购买数量 </view>
<view class="num-box">
<view
@ -115,7 +126,7 @@
</view>
</view>
</view>
<!-- 该供应商的备注 -->
<view class="supplier-remark">
<view class="section-row">
@ -156,10 +167,10 @@
<view class="text">商品总价:</view>
<view class="price">{{ getGoodsTotal() }}</view>
</view>
<view class="price-detail">
<view class="text">运费:</view>
<view class="price">包邮</view>
</view>
<view class="price-detail">
<view class="text">运费:</view>
<view class="price">包邮</view>
</view>
<view class="price-detail" v-if="usePoints > 0">
<view class="text">积分抵扣:</view>
<view class="price deduction"
@ -438,26 +449,26 @@ export default {
// supplierId
const supplierMap = new Map();
this.info.forEach(item => {
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 {

Loading…
Cancel
Save