|
|
|
@ -1,27 +1,14 @@
|
|
|
|
|
<template>
|
|
|
|
|
<s-layout title="确认订单">
|
|
|
|
|
<!-- TODO:这个判断先删除 v-if="state.orderInfo.need_address === 1" -->
|
|
|
|
|
<view class="top">
|
|
|
|
|
配送方式:是否自提
|
|
|
|
|
<switch checked @change="switch1Change" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bg-white address-box ss-m-b-14 ss-r-b-10" @tap="onSelectAddress" v-if='state.deliType === 1'>
|
|
|
|
|
<view class="bg-white address-box ss-m-b-14 ss-r-b-10" @tap="onSelectAddress">
|
|
|
|
|
<s-address-item :item="state.addressInfo" :hasBorderBottom="false">
|
|
|
|
|
<view class="ss-rest-button">
|
|
|
|
|
<text class="_icon-forward" />
|
|
|
|
|
</view>
|
|
|
|
|
</s-address-item>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="pickUpInfo" @tap="onSelectAddress1" v-else>
|
|
|
|
|
<view>
|
|
|
|
|
<view>门店信息</view>
|
|
|
|
|
<view>{{state.pickUpInfo.detailAddress}}</view>
|
|
|
|
|
<view>{{state.pickUpInfo.areaName}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="ss-rest-button">
|
|
|
|
|
<text class="_icon-forward" />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 商品信息 -->
|
|
|
|
|
<view class="order-card-box ss-m-b-14">
|
|
|
|
|
<s-goods-item
|
|
|
|
@ -186,8 +173,6 @@
|
|
|
|
|
items: [], // 商品项列表
|
|
|
|
|
price: {}, // 价格信息
|
|
|
|
|
},
|
|
|
|
|
deliType:2,
|
|
|
|
|
pickUpInfo:{},//门店信息
|
|
|
|
|
addressInfo: {}, // 选择的收货地址
|
|
|
|
|
showCoupon: false, // 是否展示优惠劵
|
|
|
|
|
couponInfo: [], // 优惠劵列表
|
|
|
|
@ -195,24 +180,13 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 选择地址
|
|
|
|
|
function onSelectAddress1() {
|
|
|
|
|
uni.$once('SELECT_ADDRESS1', (e) => {
|
|
|
|
|
changeConsignee1(e.pickUpInfo);
|
|
|
|
|
});
|
|
|
|
|
sheep.$router.go('/pages/user/address/listt');
|
|
|
|
|
}
|
|
|
|
|
function changeConsignee1(pickUpInfo = {}) {
|
|
|
|
|
if (!isEmpty(pickUpInfo)) {
|
|
|
|
|
state.pickUpInfo = pickUpInfo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///////////////////////
|
|
|
|
|
function onSelectAddress() {
|
|
|
|
|
uni.$once('SELECT_ADDRESS', (e) => {
|
|
|
|
|
changeConsignee(e.addressInfo);
|
|
|
|
|
});
|
|
|
|
|
sheep.$router.go('/pages/user/address/list');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更改收货人地址&计算订单信息
|
|
|
|
|
async function changeConsignee(addressInfo = {}) {
|
|
|
|
|
if (!isEmpty(addressInfo)) {
|
|
|
|
@ -236,22 +210,14 @@
|
|
|
|
|
}
|
|
|
|
|
submitOrder();
|
|
|
|
|
}
|
|
|
|
|
//是否自提
|
|
|
|
|
const switch1Change = ()=>{
|
|
|
|
|
if(state.deliType == 1){
|
|
|
|
|
state.deliType = 2
|
|
|
|
|
}else{
|
|
|
|
|
state.deliType = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建订单&跳转
|
|
|
|
|
async function submitOrder() {
|
|
|
|
|
const { code, data } = await OrderApi.createOrder({
|
|
|
|
|
items: state.orderPayload.items,
|
|
|
|
|
couponId: state.orderPayload.couponId,
|
|
|
|
|
addressId: state.deliType === 1 ? state.addressInfo.id: null,
|
|
|
|
|
pickUpStoreId:state.deliType === 2 ? state.pickUpInfo.id : null,
|
|
|
|
|
deliveryType: state.deliType, // TODO 芋艿:需要支持【门店自提】
|
|
|
|
|
addressId: state.addressInfo.id,
|
|
|
|
|
deliveryType: 1, // TODO 芋艿:需要支持【门店自提】
|
|
|
|
|
pointStatus: false, // TODO 芋艿:需要支持【积分选择】
|
|
|
|
|
combinationActivityId: state.orderPayload.combinationActivityId,
|
|
|
|
|
combinationHeadId: state.orderPayload.combinationHeadId,
|
|
|
|
@ -318,14 +284,6 @@
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.pickUpInfo{
|
|
|
|
|
display:flex;
|
|
|
|
|
background-color: white;
|
|
|
|
|
align-items: center ;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 2vw;
|
|
|
|
|
padding: 2vw;
|
|
|
|
|
}
|
|
|
|
|
:deep() {
|
|
|
|
|
.uni-input-wrapper {
|
|
|
|
|
width: 320rpx;
|
|
|
|
|