Compare commits

..

2 Commits

Author SHA1 Message Date
xingqq 535d9f9079 Merge branch 'main' of http://hmgit.huamar.com:8881/yanghaodong/zdsc 3 months ago
xingqq adf9e9db53 '自提
'
3 months ago

@ -333,6 +333,18 @@
"group": "用户中心"
}
},
{
"path": "address/listt",
"style": {
"navigationBarTitleText": "收货地址"
},
"meta": {
"auth": true,
"sync": true,
"title": "地址管理",
"group": "用户中心"
}
},
{
"path": "address/edit",
"style": {

@ -1,14 +1,27 @@
<template>
<s-layout title="确认订单">
<!-- TODO这个判断先删除 v-if="state.orderInfo.need_address === 1" -->
<view class="bg-white address-box ss-m-b-14 ss-r-b-10" @tap="onSelectAddress">
<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'>
<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
@ -173,6 +186,8 @@
items: [], //
price: {}, //
},
deliType:2,
pickUpInfo:{},//
addressInfo: {}, //
showCoupon: false, //
couponInfo: [], //
@ -180,13 +195,24 @@
});
//
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)) {
@ -210,14 +236,22 @@
}
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.addressInfo.id,
deliveryType: 1, // TODO
addressId: state.deliType === 1 ? state.addressInfo.id: null,
pickUpStoreId:state.deliType === 2 ? state.pickUpInfo.id : null,
deliveryType: state.deliType, // TODO
pointStatus: false, // TODO
combinationActivityId: state.orderPayload.combinationActivityId,
combinationHeadId: state.orderPayload.combinationHeadId,
@ -284,6 +318,14 @@
</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;

@ -49,9 +49,25 @@
formatOrderStatusDescription(state.orderInfo)
}}</view>
</view>
<view class="order-address-box" v-if="state.orderInfo.deliveryType === 2">
<view class="ss-flex ss-col-center">
<text class="address-username">
自提核销码
</text>
<text class="address-phone">{{ state.orderInfo.pickUpVerifyCode }}</text>
</view>
<view class="ss-flex ss-col-center">
<text class="address-username">
{{ state.pinkUpInfo.name }}
</text>
<text class="address-phone">{{ state.pinkUpInfo.phone }}</text>
</view>
<view class="address-detail">
{{ state.pinkUpInfo.areaName }} {{ state.pinkUpInfo.detailAddress }}
</view>
</view>
<!-- 收货地址 -->
<view class="order-address-box" v-if="state.orderInfo.receiverAreaId > 0">
<view class="order-address-box" v-else>
<view class="ss-flex ss-col-center">
<text class="address-username">
{{ state.orderInfo.receiverName }}
@ -268,8 +284,8 @@
orderInfo: {},
merchantTradeNo: '', //
comeinType: '', //
pinkUpInfo:{},//
});
//
const onCopy = () => {
sheep.$helper.copyText(state.orderInfo.sn);
@ -378,6 +394,7 @@
async function getOrderDetail(id) {
//
let res;
// let pinkUP;
if (state.comeinType === 'wechat') {
// TODO
res = await OrderApi.getOrder(id, {
@ -388,6 +405,9 @@
}
if (res.code === 0) {
state.orderInfo = res.data;
const {data} = await OrderApi.getPinkUp(1)
state.pinkUpInfo = data;
console.log(data,state.pinkUpInfo)
handleOrderButtons(state.orderInfo);
} else {
sheep.$router.back();

@ -0,0 +1,91 @@
<!-- 收件地址列表 -->
<template>
<s-layout title="收货地址" :bgStyle="{ color: '#FFF' }">
<view v-if="state.list.length">
<view class="list" v-for="item in state.list" :key="item.id" :item="item" @tap="onSelect(item)">
<view>
{{ item.detailAddress }}
</view>
<view>
{{ item.areaName }}
</view>
</view>
</view>
<s-empty v-if="state.list.length === 0 && !state.loading" text="暂无收货地址" icon="/static/data-empty.png" />
</s-layout>
</template>
<script setup>
import {
reactive,
onBeforeMount
} from 'vue';
import {
onShow
} from '@dcloudio/uni-app';
import sheep from '@/sheep';
import {
isEmpty
} from 'lodash';
import AreaApi from '@/sheep/api/system/area';
import AddressApi from '@/sheep/api/member/address';
const state = reactive({
list: [], //
loading: true,
});
//
const onSelect = (pickUpInfo) => {
uni.$emit('SELECT_ADDRESS1', {
pickUpInfo,
});
sheep.$router.back();
};
//
// TODO
onShow(async () => {
state.list = (await AddressApi.pickUpList()).data;
state.loading = false;
});
</script>
<style lang="scss" scoped>
.list {
margin: 2vw;
background-color: #fff;
border-radius: 3vw;
view {
padding: 1vw;
font-size: 1.3rem;
}
}
.footer-box {
.add-btn {
flex: 1;
background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
border-radius: 80rpx;
font-size: 30rpx;
font-weight: 500;
line-height: 80rpx;
color: $white;
position: relative;
z-index: 1;
}
.sync-wxaddress {
flex: 1;
line-height: 80rpx;
background: $white;
border-radius: 80rpx;
font-size: 30rpx;
font-weight: 500;
color: $dark-6;
margin-right: 18rpx;
}
}
</style>

@ -8,6 +8,20 @@ const AddressApi = {
method: 'GET'
});
},
//获取门店信息
pickUpList: () => {
return request({
url: '/trade/delivery/pick-up-store/list',
method: 'GET'
});
},
pickUpInfo: (id) => {
return request({
url: `/trade/delivery/pick-up-store/get`,
method: 'GET',
params: { id }
});
},
// 创建用户收件地址
createAddress: (data) => {
return request({

@ -51,6 +51,16 @@ const OrderApi = {
data,
});
},
//获取门店信息
getPinkUp: (id) => {
return request({
url: `/trade/delivery/pick-up-store/get`,
method: 'GET',
params: {
id,
},
});
},
// 获得订单
getOrder: (id) => {
return request({

Loading…
Cancel
Save