You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/sureOrder/index.vue

860 lines
17 KiB

11 months ago
<template>
<view class="sureOrder">
<view>
<u-navbar title="确认订单" back-icon-color="#fff" :border-bottom="false" title-color="#333"
:background="background"></u-navbar>
11 months ago
</view>
<view class="buyType">
10 months ago
<view class="toDoor" :style="{'background':buyType=='sm'?'#fff':'rgba(255, 255, 255, 0.57)'}">
11 months ago
送货上门
</view>
<view class="bySelf">
到店自取
</view>
</view>
<view class="address" v-if="buyType">
<view class="addAddress">
请点击添加收货地址
</view>
<view class="leftImg">
<image src="/static/order/left.png" mode=""></image>
11 months ago
</view>
</view>
<view class="getSelf">
<view class="shopAddress">
<view class="youTime">
花梨服务站
</view>
<view class="leftImg">
切换
<image src="/static/order/left.png" mode=""></image>
11 months ago
</view>
</view>
<view class="addressDetail">
{{addressInfo.name}}
11 months ago
</view>
<view class="lookMap">
<image src="/static/user/address.png" mode="" class="addressIcon"></image>
<view class="range">
距您16.39km
</view>
<view class="checkMap">
查看地图
</view>
<image src="/static/order/left.png" mode="" class="rightIcon"></image>
</view>
<view class="pickUp">
<view class="pickPeople">
<view class="title">
取件人
</view>
<view class="name">
{{addressInfo.name}}
11 months ago
</view>
</view>
<view class="pickPeople">
<view class="title">
11 months ago
</view>
<view class="name">
<image src="/static/order/edit.png" mode="" class="edit"></image>
</view>
</view>
<view class="pickPeople">
<view class="title">
预留电话
</view>
<view class="name">
{{addressInfo.phone}}
11 months ago
</view>
</view>
<view class="pickPeople">
<view class="title">
11 months ago
</view>
<view class="name">
<image src="/static/order/edit.png" mode="" class="edit"></image>
</view>
</view>
</view>
</view>
<view class="preTime">
<view class="left">
<view class="bagImg">
<image src="/static/order/bag.png" mode="" class="bag"></image>
街边取
</view>
11 months ago
<view class="preText">
如果您不方便只需要在街边稍候送到您的手上
</view>
</view>
<view class="switch">
<switch />
</view>
</view>
<view class="time">
<view class="youTime">
预计到货时间
</view>
<view class="leftImg">
<text class="leftText">2024-12-20 0930</text>
<image src="/static/order/left.png" mode=""></image>
11 months ago
</view>
</view>
<view class="time">
<view class="youTime">
您期待的收货时间
</view>
<view class="leftImg">
请选择
<image src="/static/order/left.png" mode=""></image>
11 months ago
</view>
</view>
<view class="goodsDetail">
<view class="goodsType">
<image src="/static/order/bag.png" mode="" class="bag"></image>
<text>大白兔家电</text>
<image src="/static/order/left.png" mode="" class="leftIcon"></image>
</view>
<view class="goods">
<view class="goodsImg">
<image src="/static/home/goodsDemo.png" mode=""></image>
</view>
<view class="goodsInfo">
<view class="goodsName">
iphone13 绿色 128GB
</view>
<view class="goodsPrice">
<text>7599</text>
</view>
</view>
<view class="goodsNum">
x1
</view>
</view>
</view>
<view class="time">
<view class="youTime">
留言
</view>
<view class="leftImg">
建议留言前与客服沟通确认
<image src="/static/order/left.png" mode=""></image>
11 months ago
</view>
</view>
<view class="orderTips">
<view class="orderTitle">
<view class="total">
商品总额
</view>
<view class="price">
7599
</view>
</view>
<view class="orderTitle">
<view class="total">
运费
</view>
<view class="price">
7599
</view>
</view>
<view class="orderTitle">
<view class="total">
商品数量
</view>
<view class="price">
<text class="couponNum">1</text>
</view>
</view>
<view class="orderTitle">
<view class="total">
优惠券
</view>
<view class="price">
<text class="couponNum">0张可用</text>
<image src="/static/order/left.png" mode=""></image>
</view>
</view>
<view class="line">
11 months ago
</view>
<view class="amount">
<view class="left">
11 months ago
</view>
<view class="right">
<text class="totalNum">共1件合计</text>
<text class="allPrice">7664</text>
</view>
</view>
</view>
<view class="payType">
<view class="itemType">
<view class="payName">
<image src="/static/order/wChat.png" mode="" class="payIcon"></image>
微信支付
</view>
<image src="/static/order/right.png" mode="" class="chose"></image>
</view>
<view class="line">
11 months ago
</view>
<view class="itemType">
<view class="payName">
<image src="/static/order/friends.png" mode="" class="payIcon"></image>
找微信好友代付
</view>
<!-- <image src="/static/order/right.png" mode="" class="chose"></image> -->
</view>
<view class="line">
11 months ago
</view>
<view class="itemType">
<view class="payName">
<image src="/static/order/shop.png" mode="" class="payIcon"></image>
到店支付
</view>
<!-- <image src="/static/order/right.png" mode="" class="chose"></image> -->
</view>
</view>
<view class="footer">
<view class="meetPrice">
应付款
<text class="type"></text>
<text class="price">7640</text>
</view>
<view class="btn" @click="orderSubmit">
11 months ago
提交订单
</view>
</view>
</view>
</template>
<script>
import * as order from '@/api/checkout.js'
10 months ago
import img from "@/static/member/head.png"
import * as storeShop from '@/api/shop.js'
import * as address from '@/api/address.js'
export default {
data() {
return {
buyType: false,
10 months ago
background: {
background: 'url(' + img + ') center top no-repeat',
10 months ago
backgroundSize: '100% auto',
},
goodsInfo: {},
shopInfo:{},
addressList:[],
addressInfo:{}
11 months ago
}
},
onLoad(options) {
if(options.goodsInfo){
this.goodsInfo = JSON.parse(options.goodsInfo)
}
},
onShow() {
this.getGoodsInfo()
this.getAddressList();
},
methods: {
getDefaultAddress(){
return new Promise((resolve, reject) => {
address.defaultId().then(res => {
if(res.code==200){
for(var i=0;i<that.addressList.length;i++){
if(res.data.defaultId==that.addressList[i].address_id){
that.addressInfo = that.addressList[i]
that.getOrderInfo()
}
}
}
})
.catch()
})
},
getOrderInfo(){
const that = this
return new Promise((resolve, reject) => {
address.list().then(res => {
if(res.code==200){
that.addressList = res.data.list
that.getDefaultAddress()
}
})
.catch()
})
},
getAddressList(){
const that = this
return new Promise((resolve, reject) => {
address.list().then(res => {
if(res.code==200){
that.addressList = res.data.list
that.getDefaultAddress()
}
})
.catch()
})
},
getGoodsInfo() {
return new Promise((resolve, reject) => {
storeShop.list().then(res => {
console.log(res,'获取店铺信息')
})
.catch()
})
},
orderSubmit() {
const that = this
let params = {
mode: '结算模式',
delivery: '配送方式(10快递配送 20上门自提',
couponId: '',
isUsePoints: 0,
remark: '留言',
shopId: '',
linkman: '姓名',
phone: '手机哈',
goodsId: '商品id',
goodsNum: 1,
goodsSkuId: '',
cartIds: ''
}
order.submit(params)
.then(res => {
if (res.status == 200) {
// that.$toast(res.message)
}
})
.catch()
},
},
11 months ago
}
</script>
<style lang="scss" scoped>
.sureOrder {
11 months ago
width: 750rpx;
padding-bottom: 120rpx;
background-image: url('../../static/home/homeback.png');
background-size: 100% 100%;
}
.buyType {
11 months ago
display: flex;
margin: 70rpx 0 0 26rpx;
.toDoor {
11 months ago
width: 348rpx;
height: 88rpx;
background-color: #fff;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #000000;
line-height: 88rpx;
text-align: center;
}
.bySelf {
width: 350rpx;
11 months ago
height: 74rpx;
background-color: rgba(255, 255, 255, 0.570000);
11 months ago
line-height: 74rpx;
text-align: center;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #606060;
line-height: 74rpx;
position: relative;
top: 14rpx;
}
}
.getSelf {
.shopAddress {
11 months ago
display: flex;
align-items: center;
justify-content: space-between;
.youTime {
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
}
.leftImg {
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #9E9E9E;
image {
11 months ago
width: 18rpx;
height: 18rpx;
margin-left: 16rpx;
}
}
}
11 months ago
margin-left: 26rpx;
background-image: url('../../static/order/map.png');
background-size: 100% 100%;
width: 694rpx;
height: 246rpx;
padding:14rpx 46rpx 0 32rpx;
.addressDetail {
11 months ago
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #838383;
line-height: 34rpx;
margin-top: 6rpx;
}
.lookMap {
11 months ago
display: flex;
align-items: center;
margin-top: 8rpx;
.addressIcon {
width: 23rpx;
11 months ago
height: 26rpx;
margin-right: 14rpx;
}
.range {
11 months ago
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #F42B17;
line-height: 26rpx;
padding-right: 10rpx;
border-right: 2rpx solid #D9D9D9;
11 months ago
margin-right: 10rpx;
}
.checkMap {
11 months ago
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #2B2B2B;
line-height: 26rpx;
margin-right: 24rpx;
}
.rightIcon {
11 months ago
width: 18rpx;
height: 18rpx;
}
}
.pickUp {
11 months ago
display: flex;
justify-content: space-around;
margin-top: 26rpx;
.pickPeople {
.title {
11 months ago
height: 28rpx;
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #838383;
line-height: 28rpx;
}
.name {
11 months ago
height: 28rpx;
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #2C2C2C;
line-height: 28rpx;
margin-top: 10rpx;
.edit {
11 months ago
width: 20rpx;
height: 20rpx;
}
}
}
}
}
.leftText {
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #F21A1C;
line-height: 28rpx;
}
.address {
11 months ago
margin-left: 26rpx;
background-image: url('../../static/order/map.png');
width: 694rpx;
height: 154rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 52rpx 0 32rpx;
.addAddress {
11 months ago
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #F32E2E;
}
.leftImg {
11 months ago
width: 18rpx;
height: 18rpx;
image {
11 months ago
width: 100%;
height: 100%;
}
}
}
.preTime {
11 months ago
width: 694rpx;
height: 140rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 12rpx 0 0 26rpx;
11 months ago
display: flex;
justify-content: space-between;
padding: 34rpx 0 0 30rpx;
.left {
.bagImg {
11 months ago
height: 30rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
line-height: 30rpx;
margin-bottom: 10rpx;
.bag {
11 months ago
width: 30rpx;
height: 30rpx;
}
}
11 months ago
}
.preText {
11 months ago
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #959595;
line-height: 34rpx;
}
}
.time {
11 months ago
display: flex;
width: 694rpx;
height: 90rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 12rpx 0 0 26rpx;
11 months ago
align-items: center;
justify-content: space-between;
padding: 0 32rpx 0 28rpx;
.youTime {
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
}
.leftImg {
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #9E9E9E;
image {
11 months ago
width: 18rpx;
height: 18rpx;
margin-left: 16rpx;
}
}
}
.goodsDetail {
11 months ago
width: 694rpx;
height: 266rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 12rpx 0 0 26rpx;
padding: 32rpx 24rpx 24rpx 12rpx;
.goodsType {
11 months ago
display: flex;
align-items: center;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #333333;
.bag {
11 months ago
width: 30rpx;
height: 30rpx;
margin-right: 20rpx;
}
.leftIcon {
11 months ago
width: 18rpx;
height: 18rpx;
margin-left: 20rpx;
}
}
.goods {
11 months ago
display: flex;
align-items: center;
margin-top: 28rpx;
.goodsImg {
11 months ago
width: 162rpx;
height: 148rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
opacity: 1;
image {
11 months ago
width: 100%;
height: 100%;
}
}
.goodsInfo {
11 months ago
margin-left: 20rpx;
.goodsName {
11 months ago
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #1E1E1E;
line-height: 40rpx;
margin-bottom: 4rpx;
}
.goodsPrice {
11 months ago
height: 50rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #F21A1C;
line-height: 50rpx;
text {
11 months ago
font-size: 36rpx;
}
}
}
.goodsNum {
11 months ago
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #1E1E1E;
margin-left: 150rpx;
}
}
}
.orderTips {
11 months ago
width: 694rpx;
height: 342rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 12rpx 0 0 26rpx;
11 months ago
padding: 22rpx 36rpx 24rpx 24rpx;
.orderTitle {
11 months ago
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
height: 34rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #2D2D2D;
line-height: 34rpx;
.total {
11 months ago
font-size: 24rpx;
}
.price {
.couponNum {
11 months ago
font-size: 28rpx;
color: #F42B17;
}
11 months ago
font-size: 28rpx;
image {
11 months ago
width: 18rpx;
height: 18rpx;
margin-left: 18rpx;
}
}
}
.amount {
11 months ago
display: flex;
justify-content: space-between;
margin-top: 20rpx;
.left {
11 months ago
width: 20rpx;
height: 34rpx;
}
.right {
11 months ago
display: flex;
align-items: center;
.totalNum {
11 months ago
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
line-height: 34rpx;
}
.allPrice {
11 months ago
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #F42B17;
line-height: 34rpx;
11 months ago
}
}
}
}
.line {
11 months ago
width: 100%;
height: 0rpx;
opacity: 1;
border: 2rpx solid #F1F1F1;
}
.payType {
11 months ago
width: 694rpx;
height: 270rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 12rpx 0 0rpx 26rpx;
padding: 24rpx 26rpx 0;
.line {
11 months ago
margin-bottom: 24rpx;
}
.itemType {
11 months ago
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 28rpx;
.payName {
11 months ago
display: flex;
align-items: center;
height: 42rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
line-height: 42rpx;
.payIcon {
11 months ago
width: 42rpx;
height: 42rpx;
margin-right: 16rpx;
}
}
.chose {
11 months ago
width: 34rpx;
height: 24rpx;
margin-right: 26rpx;
}
}
}
.footer {
11 months ago
width: 100%;
height: 120rpx;
position: fixed;
background-color: #FFF;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
.meetPrice {
margin-left: 26rpx;
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
.type {
11 months ago
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #F42B17;
margin-left: 12rpx;
}
.price {
11 months ago
font-size: 40rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #F42B17;
}
}
.btn {
11 months ago
width: 214rpx;
height: 74rpx;
background: linear-gradient(180deg, #FD5D06 0%, #F3211A 100%);
border-radius: 100rpx 100rpx 100rpx 100rpx;
opacity: 1;
text-align: center;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 74rpx;
margin-right: 20rpx;
}
}
</style>