init
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
.order-success{
|
||||
background-color:#F3F5F9 ;
|
||||
height: 90vh;
|
||||
.header{
|
||||
margin: 40rpx 50rpx;
|
||||
margin-top: 0rpx;
|
||||
padding-top: 40rpx;
|
||||
.title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 26rpx;
|
||||
font-size: 42rpx;
|
||||
font-weight:bold;
|
||||
.success-img{
|
||||
margin-right: 18rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
background-image: url('../../static/order-success.png');
|
||||
}
|
||||
uni-text{
|
||||
font-size: 42rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.send-time{
|
||||
font-size: 32rpx;
|
||||
uni-text:first-child{
|
||||
margin-right:36rpx ;
|
||||
}
|
||||
}
|
||||
.tips{
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
.orderBox{
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx 28rpx;
|
||||
margin: 0 18rpx;
|
||||
.order-detail{
|
||||
display: flex;
|
||||
.left{
|
||||
margin-right: 20rpx;
|
||||
.send,.get{
|
||||
width: 40rpx;
|
||||
height: 40prx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
line-height: 40rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.send{
|
||||
background: #000000;
|
||||
color: white;
|
||||
}
|
||||
.get{
|
||||
background: #E63E32;
|
||||
color: white;
|
||||
}
|
||||
.line{
|
||||
width: 2rpx;
|
||||
height: 123rpx;
|
||||
border-left: 2rpx dashed #D5D1D1;
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
.active{
|
||||
height: 155rpx;
|
||||
}
|
||||
|
||||
}
|
||||
.right{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
.send-people,.get-people{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.send-title{
|
||||
height: 100%;
|
||||
}
|
||||
.send-sub-title{
|
||||
color: #151515;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 12rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.send-desc{
|
||||
color: #888888;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.address-enter{
|
||||
font-weight: bold;
|
||||
border-left: 2rpx solid #F4F4F4;
|
||||
padding-left: 28rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.get-people{
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.send-people{
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.line{
|
||||
width: 100%;
|
||||
height: 2rpx;
|
||||
background-color: #F4F4F4;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.price-detail{
|
||||
border-bottom: 2rpx solid #F3F4F7;
|
||||
border-top: 2rpx solid #F3F4F7;
|
||||
padding: 40rpx 0;
|
||||
.goods,.weight,.payType,.base-price{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 28rpx;
|
||||
.label,.value{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.label{
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
.goods{
|
||||
margin-top: 0rpx;
|
||||
}
|
||||
}
|
||||
.all-account{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
color: #888;
|
||||
font-size: 24rpx;
|
||||
margin-top: 41rpx;
|
||||
text{
|
||||
color: #E84134;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
.feature{
|
||||
display: flex;
|
||||
margin-left: 81rpx;
|
||||
margin-top: 48rpx;
|
||||
.order-info,.order-share,.order-again{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
.img-box{
|
||||
width: 76rpx;
|
||||
height: 76rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
image{
|
||||
width:76rpx ;
|
||||
height:76rpx ;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
margin-right: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<!-- 头部导航栏 -->
|
||||
<nav-bar title='下单成功' :handleToLink="handleToLink" src="../../static/order-success-goBack.png"></nav-bar>
|
||||
<view class="order-success">
|
||||
<!-- 头部 -->
|
||||
<view class="header">
|
||||
<view class="title">
|
||||
<view class="success-img"></view>
|
||||
<text>下单成功!</text>
|
||||
</view>
|
||||
<view class="send-time">
|
||||
<text>快递员上门时间 </text>
|
||||
<text v-if="orderInfo.estimatedStartTime">{{handleTimeToStrTime(orderInfo.estimatedStartTime)}}</text>
|
||||
</view>
|
||||
<view class="tips">根据国家法律规定,如没有实名认证,寄件需出示身份证</view>
|
||||
</view>
|
||||
<!-- 运单信息 -->
|
||||
<view class="orderBox">
|
||||
<view class="order-detail">
|
||||
<view class="left">
|
||||
<view class="send">寄</view>
|
||||
<view class="line" :class="{active:twoLine>=2}"></view>
|
||||
<view class="get">收</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="send-people">
|
||||
<view class="send-title">
|
||||
<view class="send-sub-title">
|
||||
{{orderInfo.senderName}}
|
||||
<text>{{orderInfo.senderPhone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}}</text>
|
||||
</view>
|
||||
<view class="send-desc">{{orderInfo.senderAddress}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="get-people">
|
||||
<view class="send-title">
|
||||
<view class="send-sub-title">
|
||||
{{orderInfo.receiverName}}
|
||||
<text>{{orderInfo.receiverPhone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}}</text>
|
||||
</view>
|
||||
<view class="send-desc">{{orderInfo.receiverAddress}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="price-detail">
|
||||
<view class="goods">
|
||||
<view class="label">物品</view>
|
||||
<view class="value">{{orderInfo.goods}}</view>
|
||||
</view>
|
||||
<view class="weight">
|
||||
<view class="label">计费重量</view>
|
||||
<view class="value">{{orderInfo.goodsWeight}}kg</view>
|
||||
</view>
|
||||
<view class="payType">
|
||||
<view class="label">付费方式</view>
|
||||
<view class="value">{{orderInfo.paymentMethod}}</view>
|
||||
</view>
|
||||
<view class="base-price">
|
||||
<view class="label">基础运费</view>
|
||||
<view class="value">{{orderInfo.amount}}元</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="all-account">
|
||||
预估总价:
|
||||
<text>¥{{orderInfo.amount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能区域 -->
|
||||
<view class="feature">
|
||||
<view class="order-info" @click="handleToOrderInfo">
|
||||
<view class="img-box">
|
||||
<image src='../../static/btn-dingdanxiangqing.png'/>
|
||||
</view>
|
||||
|
||||
<view class="title">订单详情</view>
|
||||
</view>
|
||||
<view class="order-share" @click="handleSecondQi">
|
||||
<view class="img-box">
|
||||
<image src='../../static/btn-fenxiang.png' />
|
||||
</view>
|
||||
|
||||
<view class="title">分享</view>
|
||||
</view>
|
||||
<view class="order-again" @click="handleSecondQi">
|
||||
<view class="img-box">
|
||||
<image src='../../static/btn-zaijiyijian.png'/>
|
||||
</view>
|
||||
|
||||
<view class="title">再寄一件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
computed,
|
||||
nextTick
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
doOrder,
|
||||
getOrderDetail
|
||||
} from '@/pages/api/order.js'
|
||||
import {
|
||||
handleTimeToStrTime
|
||||
} from '@/utils/index.js'
|
||||
const orderId = ref()
|
||||
const twoLine = ref()
|
||||
const orderInfo = reactive({
|
||||
estimatedStartTime: '',
|
||||
receiverName: '',
|
||||
receiverAddress: '',
|
||||
receiverPhone:'',
|
||||
senderName: '',
|
||||
senderAddress: '',
|
||||
senderPhone:'',
|
||||
goods: '',
|
||||
goodsWeight: '',
|
||||
paymentMethod:'',
|
||||
amount:''
|
||||
})
|
||||
onMounted(()=>{
|
||||
|
||||
|
||||
})
|
||||
onLoad((options) => {
|
||||
orderId.value = options.orderId
|
||||
getOrderDetailFun()
|
||||
})
|
||||
const handleToLink = ()=>{
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
//跳转到订单详情页面
|
||||
const handleToOrderInfo = (event,id) => {
|
||||
uni.navigateTo({
|
||||
url: '/subPages/order-info/index?orderId=' + orderId.value
|
||||
});
|
||||
}
|
||||
const handleSecondQi = ()=>{
|
||||
uni.showToast({
|
||||
title: "程序员哥哥正在实现中",
|
||||
icon: "none",
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
//获取订单详情
|
||||
const getOrderDetailFun = () => {
|
||||
getOrderDetail(orderId.value).then((res) => {
|
||||
const {
|
||||
estimatedStartTime,
|
||||
receiverName,
|
||||
senderName,
|
||||
receiverProvince,
|
||||
receiverCity,
|
||||
receiverCounty,
|
||||
receiverAddress,
|
||||
senderProvince,
|
||||
senderCity,
|
||||
senderCounty,
|
||||
senderAddress,
|
||||
orderCargoVOS,
|
||||
paymentMethod,
|
||||
amount,
|
||||
senderPhone,
|
||||
receiverPhone
|
||||
} = res.data
|
||||
orderInfo.estimatedStartTime = estimatedStartTime
|
||||
orderInfo.receiverName = receiverName
|
||||
orderInfo.senderName = senderName
|
||||
orderInfo.receiverAddress = receiverProvince.name + receiverCity.name + receiverCounty.name +
|
||||
receiverAddress
|
||||
orderInfo.senderAddress = senderProvince.name + senderCity.name + senderCounty.name + senderAddress
|
||||
orderInfo.goods = orderCargoVOS[0].name + (orderCargoVOS[0].goodsType ? ('(' + orderCargoVOS[0]
|
||||
.goodsType.name + ')') : '')
|
||||
orderInfo.goodsWeight = orderCargoVOS[0].totalWeight
|
||||
orderInfo.paymentMethod = paymentMethod === 1?'寄付':'到付'
|
||||
orderInfo.amount = amount
|
||||
orderInfo.receiverPhone = receiverPhone
|
||||
orderInfo.senderPhone = senderPhone
|
||||
nextTick(()=>{
|
||||
//用来获取详细地址有几行,从而适配寄和收之间竖线的高度
|
||||
uni.createSelectorQuery().select('.send-desc').boundingClientRect(res => {
|
||||
let height = res.height;
|
||||
let line = height / 15
|
||||
twoLine.value = line
|
||||
}).exec();
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style src="./index.scss" lang="scss" scoped></style>
|
||||
Reference in New Issue
Block a user