|
@@ -8,19 +8,20 @@
|
|
</view>
|
|
</view>
|
|
</s-address-item>
|
|
</s-address-item>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 商品信息 -->
|
|
<!-- 商品信息 -->
|
|
<!-- {{shopsByNames}} -->
|
|
<!-- {{shopsByNames}} -->
|
|
-
|
|
|
|
|
|
+
|
|
<view class="order-card-box ss-m-b-14" v-for="(items, name) in shopsByNames" :key="name">
|
|
<view class="order-card-box ss-m-b-14" v-for="(items, name) in shopsByNames" :key="name">
|
|
-
|
|
|
|
|
|
+
|
|
<view class="title-text ss-p-x-20 ss-p-t-20">
|
|
<view class="title-text ss-p-x-20 ss-p-t-20">
|
|
{{name}}
|
|
{{name}}
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<s-goods-item v-for="item in items.items" :key="item?.skuId" :img="item?.picUrl" :title="item?.spuName"
|
|
<s-goods-item v-for="item in items.items" :key="item?.skuId" :img="item?.picUrl" :title="item?.spuName"
|
|
- :skuText="item?.properties?.map((property) => property.valueName).join(' ')" :price="item.highPrecisionPrice ? item?.highPrecisionPrice :item?.price "
|
|
|
|
- :num="item?.count" :virtualPirce="item.highPrecisionPrice ? true :false " />
|
|
|
|
|
|
+ :skuText="item?.properties?.map((property) => property.valueName).join(' ')"
|
|
|
|
+ :price="item.highPrecisionPrice ? item?.highPrecisionPrice :item?.price " :num="item?.count"
|
|
|
|
+ :virtualPirce="item.highPrecisionPrice ? true :false " />
|
|
<view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10">
|
|
<view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10">
|
|
<view class="item-title">运费</view>
|
|
<view class="item-title">运费</view>
|
|
<view class="ss-flex ss-col-center">
|
|
<view class="ss-flex ss-col-center">
|
|
@@ -47,18 +48,20 @@
|
|
:clearable="false" />
|
|
:clearable="false" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
- <view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10" v-if="state.orderPayload.spuType == 0">
|
|
|
|
|
|
+
|
|
|
|
+ <view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10"
|
|
|
|
+ v-if="state.orderPayload.spuType == 0">
|
|
<view class="item-title">数量</view>
|
|
<view class="item-title">数量</view>
|
|
<view class="ss-flex ss-col-center">
|
|
<view class="ss-flex ss-col-center">
|
|
-
|
|
|
|
|
|
+
|
|
{{totalItemCount}}
|
|
{{totalItemCount}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10" v-else>
|
|
<view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10" v-else>
|
|
<view class="item-title">总价</view>
|
|
<view class="item-title">总价</view>
|
|
<view class="ss-flex ss-col-center">
|
|
<view class="ss-flex ss-col-center">
|
|
- <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2" style="width:30rpx;height:30rpx" ></image>
|
|
|
|
|
|
+ <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2"
|
|
|
|
+ style="width:30rpx;height:30rpx"></image>
|
|
<text v-else>¥</text>
|
|
<text v-else>¥</text>
|
|
{{fen2yuan(items.price.payPrice)}}
|
|
{{fen2yuan(items.price.payPrice)}}
|
|
</view>
|
|
</view>
|
|
@@ -75,7 +78,8 @@
|
|
<view class="item-title">商品总价 共{{totalItemCount}}件商品</view>
|
|
<view class="item-title">商品总价 共{{totalItemCount}}件商品</view>
|
|
<view class="ss-flex ss-col-center">
|
|
<view class="ss-flex ss-col-center">
|
|
<text class="item-value ss-m-r-24">
|
|
<text class="item-value ss-m-r-24">
|
|
- <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2" style="width:30rpx;height:30rpx" ></image>
|
|
|
|
|
|
+ <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2"
|
|
|
|
+ style="width:30rpx;height:30rpx"></image>
|
|
<text v-else>¥</text>
|
|
<text v-else>¥</text>
|
|
{{ fen2yuan(state.orderInfo.price.totalPrice) }}
|
|
{{ fen2yuan(state.orderInfo.price.totalPrice) }}
|
|
</text>
|
|
</text>
|
|
@@ -86,7 +90,8 @@
|
|
<view class="item-title">运费</view>
|
|
<view class="item-title">运费</view>
|
|
<view class="ss-flex ss-col-center">
|
|
<view class="ss-flex ss-col-center">
|
|
<text class="item-value ss-m-r-24">
|
|
<text class="item-value ss-m-r-24">
|
|
- <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2" style="width:30rpx;height:30rpx" ></image>
|
|
|
|
|
|
+ <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2"
|
|
|
|
+ style="width:30rpx;height:30rpx"></image>
|
|
<text v-else>¥</text>
|
|
<text v-else>¥</text>
|
|
{{ fen2yuan(state.orderInfo.price.deliveryPrice) }}
|
|
{{ fen2yuan(state.orderInfo.price.deliveryPrice) }}
|
|
</text>
|
|
</text>
|
|
@@ -146,13 +151,19 @@
|
|
共{{ totalItemCount }}件
|
|
共{{ totalItemCount }}件
|
|
</view>
|
|
</view>
|
|
<view>合计:</view>
|
|
<view>合计:</view>
|
|
- <view class="total-num text-red">
|
|
|
|
-
|
|
|
|
- <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2" style="width:30rpx;height:30rpx" ></image>
|
|
|
|
- <text v-else>¥</text>
|
|
|
|
-
|
|
|
|
- <text v-if="state.orderPayload.spuPayType == 2" >{{ fen2yuan(state.orderInfo.price.payPrice) - 0.01 }} </text>
|
|
|
|
- <text v-else >{{ fen2yuan(state.orderInfo.price.payPrice) }} </text>
|
|
|
|
|
|
+ <view class="total-num text-red ss-flex">
|
|
|
|
+
|
|
|
|
+ <image src="@/static/icon/points.png" class='ss-m-r-10' v-if="state.orderPayload.spuPayType == 2"
|
|
|
|
+ style="width:30rpx;height:30rpx"></image>
|
|
|
|
+ <text v-else>¥</text>
|
|
|
|
+
|
|
|
|
+ <text
|
|
|
|
+ v-if="state.orderPayload.highPrecision">{{ fen2yuan6(state.orderInfo.price.virtualTotalPrice) - 0.01 }}
|
|
|
|
+ </text>
|
|
|
|
+ <text
|
|
|
|
+ v-else-if="state.orderPayload.spuPayType == 2">{{ fen2yuan(state.orderInfo.price.payPrice) - 0.01 }}
|
|
|
|
+ </text>
|
|
|
|
+ <text v-else>{{ fen2yuan(state.orderInfo.price.payPrice) }} </text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -173,8 +184,15 @@
|
|
<su-fixed bottom :opacity="false" bg="bg-white" placeholder :noFixed="false" :index="200">
|
|
<su-fixed bottom :opacity="false" bg="bg-white" placeholder :noFixed="false" :index="200">
|
|
<view class="footer-box border-top ss-flex ss-row-between ss-p-x-20 ss-col-center">
|
|
<view class="footer-box border-top ss-flex ss-row-between ss-p-x-20 ss-col-center">
|
|
<view class="total-box-footer ss-flex ss-col-center">
|
|
<view class="total-box-footer ss-flex ss-col-center">
|
|
- <view class="total-num ss-font-30 text-red " v-if="state.orderPayload.spuPayType == 2">
|
|
|
|
- <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2" style="width:30rpx;height:30rpx" ></image>
|
|
|
|
|
|
+ <view v-if="state.orderPayload.highPrecision">
|
|
|
|
+ <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2"
|
|
|
|
+ style="width:30rpx;height:30rpx"></image>
|
|
|
|
+ {{ fen2yuan6(state.orderInfo.price.virtualPayPrice) - 0.01 }}
|
|
|
|
+ ¥0.01
|
|
|
|
+ </view>
|
|
|
|
+ <view class="total-num ss-font-30 text-red " v-else-if="state.orderPayload.spuPayType == 2">
|
|
|
|
+ <image src="@/static/icon/points.png" v-if="state.orderPayload.spuPayType == 2"
|
|
|
|
+ style="width:30rpx;height:30rpx"></image>
|
|
{{ state.usedPoint }}
|
|
{{ state.usedPoint }}
|
|
¥0.01
|
|
¥0.01
|
|
</view>
|
|
</view>
|
|
@@ -261,12 +279,12 @@
|
|
});
|
|
});
|
|
console.log(state.orderPayload.spuType)
|
|
console.log(state.orderPayload.spuType)
|
|
// 如果是虚拟商品 进入选虚拟地址
|
|
// 如果是虚拟商品 进入选虚拟地址
|
|
- if(state.orderPayload.spuType){
|
|
|
|
|
|
+ if (state.orderPayload.spuType) {
|
|
sheep.$router.go('/pages/user/address/list');
|
|
sheep.$router.go('/pages/user/address/list');
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
sheep.$router.go('/pages/user/dummyAddress/list');
|
|
sheep.$router.go('/pages/user/dummyAddress/list');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
// 更改收货人地址&计算订单信息
|
|
// 更改收货人地址&计算订单信息
|
|
@@ -295,8 +313,8 @@
|
|
sheep.$helper.toast('请选择收货地址');
|
|
sheep.$helper.toast('请选择收货地址');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(state.usedPoint > state.currentMemberPoints){
|
|
|
|
|
|
+
|
|
|
|
+ if (state.usedPoint > state.currentMemberPoints) {
|
|
sheep.$helper.toast('可用积分不足');
|
|
sheep.$helper.toast('可用积分不足');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -306,7 +324,7 @@
|
|
|
|
|
|
// 创建订单&跳转
|
|
// 创建订单&跳转
|
|
async function submitOrder() {
|
|
async function submitOrder() {
|
|
-
|
|
|
|
|
|
+
|
|
// 处理每个店铺的留言 以{店铺id:留言}的形式返回
|
|
// 处理每个店铺的留言 以{店铺id:留言}的形式返回
|
|
const shops = shopsByNames.value;
|
|
const shops = shopsByNames.value;
|
|
const shopRemarks = {};
|
|
const shopRemarks = {};
|
|
@@ -314,7 +332,7 @@
|
|
const shop = shops[shopName];
|
|
const shop = shops[shopName];
|
|
shopRemarks[shop.shopId] = shop.remark;
|
|
shopRemarks[shop.shopId] = shop.remark;
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
const {
|
|
const {
|
|
code,
|
|
code,
|
|
data
|
|
data
|
|
@@ -322,7 +340,7 @@
|
|
items: state.orderPayload.items,
|
|
items: state.orderPayload.items,
|
|
couponId: state.orderPayload.couponId,
|
|
couponId: state.orderPayload.couponId,
|
|
addressId: state.addressInfo.id,
|
|
addressId: state.addressInfo.id,
|
|
- deliveryType: state.orderPayload.spuType == 1 ? 1 : 3, // TODO 非繁人:需要支持【门店自提】
|
|
|
|
|
|
+ deliveryType: state.orderPayload.spuType == 1 ? 1 : 3, // TODO 非繁人:需要支持【门店自提】
|
|
pointStatus: false, // TODO 非繁人:需要支持【积分选择】
|
|
pointStatus: false, // TODO 非繁人:需要支持【积分选择】
|
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
|
@@ -354,7 +372,7 @@
|
|
shopRemarks[shopName] = shop.remark;
|
|
shopRemarks[shopName] = shop.remark;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
const {
|
|
const {
|
|
data,
|
|
data,
|
|
code
|
|
code
|
|
@@ -362,13 +380,13 @@
|
|
items: state.orderPayload.items,
|
|
items: state.orderPayload.items,
|
|
couponId: state.orderPayload.couponId,
|
|
couponId: state.orderPayload.couponId,
|
|
addressId: state.addressInfo.id,
|
|
addressId: state.addressInfo.id,
|
|
- deliveryType: state.orderPayload.spuType == 1 ? 1 : 3, // TODO 非繁人:需要支持【门店自提】
|
|
|
|
|
|
+ deliveryType: state.orderPayload.spuType == 1 ? 1 : 3, // TODO 非繁人:需要支持【门店自提】
|
|
pointStatus: false, // TODO 非繁人:需要支持【积分选择】
|
|
pointStatus: false, // TODO 非繁人:需要支持【积分选择】
|
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
|
seckillActivityId: state.orderPayload.seckillActivityId,
|
|
seckillActivityId: state.orderPayload.seckillActivityId,
|
|
usedPoint: state.usedPoint,
|
|
usedPoint: state.usedPoint,
|
|
- addressType:state.orderPayload.spuType == 1 ? 1 : 2 //如果是虚拟产品
|
|
|
|
|
|
+ addressType: state.orderPayload.spuType == 1 ? 1 : 2 //如果是虚拟产品
|
|
});
|
|
});
|
|
if (code !== 0) {
|
|
if (code !== 0) {
|
|
return;
|
|
return;
|
|
@@ -389,12 +407,12 @@
|
|
state.currentTotalPrice = fen2yuan(state.orderInfo.price.payPrice)
|
|
state.currentTotalPrice = fen2yuan(state.orderInfo.price.payPrice)
|
|
state.currentDeliveryPrice = fen2yuan(state.orderInfo.price.deliveryPrice)
|
|
state.currentDeliveryPrice = fen2yuan(state.orderInfo.price.deliveryPrice)
|
|
// console.log("父",state.currentTotalPrice)
|
|
// console.log("父",state.currentTotalPrice)
|
|
-
|
|
|
|
- if(state.orderPayload.spuPayType == 2){
|
|
|
|
|
|
+
|
|
|
|
+ if (state.orderPayload.spuPayType == 2) {
|
|
state.usedPoint = state.currentTotalPrice - 0.01
|
|
state.usedPoint = state.currentTotalPrice - 0.01
|
|
console.log(state.spuType)
|
|
console.log(state.spuType)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -422,7 +440,7 @@
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
state.orderPayload = JSON.parse(options.data);
|
|
state.orderPayload = JSON.parse(options.data);
|
|
-
|
|
|
|
|
|
+
|
|
await getOrderInfo();
|
|
await getOrderInfo();
|
|
|
|
|
|
});
|
|
});
|