Compare commits

..

2 Commits

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

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

@ -1,14 +1,27 @@
<template> <template>
<s-layout title="确认订单"> <s-layout title="确认订单">
<!-- TODO这个判断先删除 v-if="state.orderInfo.need_address === 1" --> <!-- 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"> <s-address-item :item="state.addressInfo" :hasBorderBottom="false">
<view class="ss-rest-button"> <view class="ss-rest-button">
<text class="_icon-forward" /> <text class="_icon-forward" />
</view> </view>
</s-address-item> </s-address-item>
</view> </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"> <view class="order-card-box ss-m-b-14">
<s-goods-item <s-goods-item
@ -173,6 +186,8 @@
items: [], // items: [], //
price: {}, // price: {}, //
}, },
deliType:2,
pickUpInfo:{},//
addressInfo: {}, // addressInfo: {}, //
showCoupon: false, // showCoupon: false, //
couponInfo: [], // 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() { function onSelectAddress() {
uni.$once('SELECT_ADDRESS', (e) => { uni.$once('SELECT_ADDRESS', (e) => {
changeConsignee(e.addressInfo); changeConsignee(e.addressInfo);
}); });
sheep.$router.go('/pages/user/address/list'); sheep.$router.go('/pages/user/address/list');
} }
// & // &
async function changeConsignee(addressInfo = {}) { async function changeConsignee(addressInfo = {}) {
if (!isEmpty(addressInfo)) { if (!isEmpty(addressInfo)) {
@ -210,14 +236,22 @@
} }
submitOrder(); submitOrder();
} }
//
const switch1Change = ()=>{
if(state.deliType == 1){
state.deliType = 2
}else{
state.deliType = 1
}
}
// & // &
async function submitOrder() { async function submitOrder() {
const { code, data } = await OrderApi.createOrder({ const { code, data } = await OrderApi.createOrder({
items: state.orderPayload.items, items: state.orderPayload.items,
couponId: state.orderPayload.couponId, couponId: state.orderPayload.couponId,
addressId: state.addressInfo.id, addressId: state.deliType === 1 ? state.addressInfo.id: null,
deliveryType: 1, // TODO pickUpStoreId:state.deliType === 2 ? state.pickUpInfo.id : null,
deliveryType: state.deliType, // TODO
pointStatus: false, // TODO pointStatus: false, // TODO
combinationActivityId: state.orderPayload.combinationActivityId, combinationActivityId: state.orderPayload.combinationActivityId,
combinationHeadId: state.orderPayload.combinationHeadId, combinationHeadId: state.orderPayload.combinationHeadId,
@ -253,7 +287,7 @@
return; return;
} }
state.orderInfo = data; state.orderInfo = data;
// //
if (state.orderInfo.address) { if (state.orderInfo.address) {
state.addressInfo = state.orderInfo.address; state.addressInfo = state.orderInfo.address;
} }
@ -284,6 +318,14 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pickUpInfo{
display:flex;
background-color: white;
align-items: center ;
justify-content: space-between;
margin-bottom: 2vw;
padding: 2vw;
}
:deep() { :deep() {
.uni-input-wrapper { .uni-input-wrapper {
width: 320rpx; width: 320rpx;

@ -49,9 +49,25 @@
formatOrderStatusDescription(state.orderInfo) formatOrderStatusDescription(state.orderInfo)
}}</view> }}</view>
</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"> <view class="ss-flex ss-col-center">
<text class="address-username"> <text class="address-username">
{{ state.orderInfo.receiverName }} {{ state.orderInfo.receiverName }}
@ -268,8 +284,8 @@
orderInfo: {}, orderInfo: {},
merchantTradeNo: '', // merchantTradeNo: '', //
comeinType: '', // comeinType: '', //
pinkUpInfo:{},//
}); });
// //
const onCopy = () => { const onCopy = () => {
sheep.$helper.copyText(state.orderInfo.sn); sheep.$helper.copyText(state.orderInfo.sn);
@ -378,6 +394,7 @@
async function getOrderDetail(id) { async function getOrderDetail(id) {
// //
let res; let res;
// let pinkUP;
if (state.comeinType === 'wechat') { if (state.comeinType === 'wechat') {
// TODO // TODO
res = await OrderApi.getOrder(id, { res = await OrderApi.getOrder(id, {
@ -388,6 +405,9 @@
} }
if (res.code === 0) { if (res.code === 0) {
state.orderInfo = res.data; state.orderInfo = res.data;
const {data} = await OrderApi.getPinkUp(1)
state.pinkUpInfo = data;
console.log(data,state.pinkUpInfo)
handleOrderButtons(state.orderInfo); handleOrderButtons(state.orderInfo);
} else { } else {
sheep.$router.back(); 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' 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) => { createAddress: (data) => {
return request({ return request({

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

Loading…
Cancel
Save