'
main
xingqq 4 months ago
parent 654ead35bb
commit adf9e9db53

@ -68,7 +68,10 @@
"schemes": "shopro" "schemes": "shopro"
}, },
"ios": { "ios": {
"urlschemewhitelist": ["baidumap", "iosamap"], "urlschemewhitelist": [
"baidumap",
"iosamap"
],
"dSYMs": false, "dSYMs": false,
"privacyDescription": { "privacyDescription": {
"NSPhotoLibraryUsageDescription": "需要同意访问您的相册选取图片才能完善该条目", "NSPhotoLibraryUsageDescription": "需要同意访问您的相册选取图片才能完善该条目",
@ -79,7 +82,9 @@
"urltypes": "shopro", "urltypes": "shopro",
"capabilities": { "capabilities": {
"entitlements": { "entitlements": {
"com.apple.developer.associated-domains": ["applinks:shopro.sheepjs.com"] "com.apple.developer.associated-domains": [
"applinks:shopro.sheepjs.com"
]
} }
}, },
"idfa": true "idfa": true
@ -98,12 +103,18 @@
}, },
"payment": { "payment": {
"weixin": { "weixin": {
"__platform__": ["ios", "android"], "__platform__": [
"ios",
"android"
],
"appid": "wxae7a0c156da9383b", "appid": "wxae7a0c156da9383b",
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/" "UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
}, },
"alipay": { "alipay": {
"__platform__": ["ios", "android"] "__platform__": [
"ios",
"android"
]
} }
}, },
"share": { "share": {
@ -113,7 +124,9 @@
} }
} }
}, },
"orientation": ["portrait-primary"], "orientation": [
"portrait-primary"
],
"splashscreen": { "splashscreen": {
"androidStyle": "common", "androidStyle": "common",
"iosStyle": "common", "iosStyle": "common",
@ -157,9 +170,11 @@
"quickapp-native": { "quickapp-native": {
"icon": "/static/logo.png", "icon": "/static/logo.png",
"package": "com.example.demo", "package": "com.example.demo",
"features": [{ "features": [
{
"name": "system.clipboard" "name": "system.clipboard"
}] }
]
}, },
"quickapp-webview": { "quickapp-webview": {
"icon": "/static/logo.png", "icon": "/static/logo.png",
@ -182,7 +197,9 @@
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"usingComponents": {}, "usingComponents": {},
"permission": {}, "permission": {},
"requiredPrivateInfos": ["chooseAddress"] "requiredPrivateInfos": [
"chooseAddress"
]
}, },
"mp-alipay": { "mp-alipay": {
"usingComponents": true "usingComponents": true

@ -297,6 +297,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,
@ -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