This commit is contained in:
张慢慢
2021-05-24 13:56:00 +08:00
commit a7995d90bc
208 changed files with 13143 additions and 0 deletions

View File

@@ -0,0 +1,138 @@
/*
* 本时生活
*/
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
statusHeight : app.globalData.statusBarHeight,
order : '' //订单详情
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
// 获取商品活动订单详情
this.orderInfo(options.id);
},
/**
* 商品活动订单详情
*/
orderInfo(id) {
wx.$api.index.ordersInfo(id).then(res=>{
this.setData({
order : res.data
})
})
},
/**
* 取消订单
*/
orderDelete(e) {
let orderId = e.currentTarget.dataset.id
wx.showModal({
title : '订单取消',
content : '确认取消吗?',
success : res=> {
if (res.confirm) {
wx.$api.index.cance(orderId).then(res=>{
wx.showToast({
title: res.data,
icon : 'none'
})
setTimeout(()=>{
wx.reLaunch({
url: '/pages/activityOrder/activityOrder',
})
},2000)
})
} else if (res.cancel) {
wx.showToast({
title : '取消',
icon : 'loading',
duration: 1000
})
}
}
})
},
/**
* 订单支付
*/
orderPay(e) {
let orderId = e.currentTarget.dataset.id
wx.login({
success: res=> {
wx.$api.index.repay(orderId).then(res=>{
let payInfo = JSON.parse(res.data.json)
wx.requestPayment({
timeStamp: payInfo.timeStamp,
nonceStr : payInfo.nonceStr,
package : payInfo.package,
paySign : payInfo.paySign,
signType : payInfo.signType,
success : res=>{
if(res.errMsg == "requestPayment:ok"){
wx.showToast({
title: '支付成功',
icon : 'success'
})
setTimeout(()=>{
wx.reLaunch({
url: '/pages/activityOrder/activityOrder',
})
},2000)
}
},
fail : res=>{
wx.reLaunch({
url: '/pages/activityOrder/activityOrder',
})
}
})
})
}
})
},
/**
* 返回上一页
*/
orderRun() {
wx.navigateBack({
delta: 1
})
},
/**
* 复制快递单号
*/
copyText (e) {
let text = e.currentTarget.dataset.text
wx.setClipboardData({
data : text,
success : res=> {
wx.getClipboardData({
success: res => {
wx.showToast({
title: '复制成功'
})
}
})
}
})
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "订单详情",
"navigationBarBackgroundColor": "#f57e32",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,115 @@
<!-- 订单状态 -->
<view class="order-statl">
{{order.status_text}}
<block wx:if="{{order.status == '0'}}">
<image src="/static/icon/order_icon_00.png" class="order-statl-icon"></image>
</block>
<block wx:elif="{{order.status == '1'}}">
<image src="/static/icon/order_icon_01.png" class="order-statl-icon"></image>
</block>
<block wx:elif="{{order.status == '2'}}">
<image src="/static/icon/order_icon_02.png" class="order-statl-icon"></image>
</block>
</view>
<!-- 收货人 -->
<view class="order-address" wx:if="{{order.address != ''}}">
<image class="address-icon" src="https://storage.funnyzhibo.com/images/2020/05/06/address_icon.png" mode="widthFix"></image>
<view class="order-address-name nowrap">
收货人:{{order.address.name}}
<text>{{order.address.mobile}}</text>
</view>
<view class="order-address-text">{{order.address.province}}{{order.address.city}}{{order.address.district}}{{order.address.info}}</view>
<image class="order-address-back" src="/static/img/address_back.png" mode="widthFix"></image>
</view>
<view class="order-goods">
<view class="goods-goods-li">
<image class="goods-img" src="{{order.param.cover}}" mode="aspectFill"></image>
<view class="goods-body">
<view class="goods-name nowrap">{{order.title}}</view>
<view class="goods-price nowrap">¥{{order.param.price}}
<text class="goods-qty">×{{order.param.number}}</text>
</view>
</view>
</view>
</view>
<!-- 券赠送 -->
<block wx:if="{order.have_coupon != 0}}">
<view class="ni-border-bottom goodsCoupon" wx:for="{{order.coupons}}" wx:key="coupons">
<view class="goodsCoupon-left">
<image class="goodsCoupon-img" mode="scaleToFill" src="/static/img/activity_coupon.png"></image>
<view class="goodsCoupon-number">
<text>¥</text>{{item.amount}}
</view>
<view class="nowrap goodsCoupon-btn">
超市券满减券
</view>
<view class="goodsCoupon-tips"><text>赠</text></view>
</view>
<view class="goodsCoupon-right">
<view class="nowrap goodsCoupon-name">{{item.title}}</view>
<view class="goodsCoupon-sheet">
<view>卡数(张)</view>
<text>x</text> {{item.number}}
</view>
</view>
</view>
</block>
<!-- 礼盒 -->
<block wx:if="{order.have_gift != 0}}">
<view class="goodsCoupon" wx:for="{{order.gifts}}" wx:key="gifts">
<view class="goodsCoupon-left goodsCoupon-box">
<image src="{{item.cover}}" mode="scaleToFill" class="goodsBox-img"></image>
<view class="goodsBox-tips"><text>赠</text></view>
</view>
<view class="goodsCoupon-right goodsCoupon-box-right">
<view class="nowrap goodsCoupon-name goodsCoupon-name-box">{{item.title}}</view>
<view class="nowrap goodsCoupon-text" wx:if="{{item.subtitle != null}}">{{item.subtitle}}</view>
<view class="goodsCoupon-cost">原价:{{item.amount}}元</view>
<view class="goodsCoupon-sheet">
<view class="goodsCoupon-price">活动0.00元</view>
<text>x</text> {{item.number}}
</view>
</view>
</view>
</block>
<view class="order-total">
<view class="order-total-li">
订单号
<text bindtap="copyText" data-text="{{order.order_id}}">{{order.order_id}}</text>
</view>
<!-- <view class="order-total-li">
下单时间
<text>{{order.order_id}}</text>
</view> -->
</view>
<view class="order-total" wx:if="{{order.ex_type_text != '无'}}">
<view class="order-total-li">
物流公司
<text data-text="">{{order.ex_type_text}}</text>
</view>
</view>
<view class="order-total" wx:if="{{order.ex_no != null}}">
<view class="order-total-li">
快递单号
<text bindtap="copyText" data-text="{{order.ex_no}}">{{order.ex_no}}</text>
</view>
</view>
<view class="order-total">
<view class="order-total-li">
实际支付
<text class="redCor">¥{{order.amount}}</text>
</view>
</view>
<view class="order-data-footer {{statusHeight > 30 ? 'iphoneX':''}}">
<view class="order-btn" bindtap="orderRun">返回订单</view>
<view class="order-btn" bindtap="orderDelete" data-id="{{order.id}}" wx:if="{{order.iscancel}}">取消订单</view>
<view class="order-btn order-btn-back" bindtap="orderPay" wx:if="{{order.ispay}}" data-id="{{order.id}}">立即支付</view>
</view>

View File

@@ -0,0 +1,427 @@
/*
* 亿时代
*/
.order-statl{
background-color: #f57e32;
padding: 0 30rpx 10rpx;
color: white;
line-height: 90rpx;
height: 90rpx;
position: relative;
}
.order-statl-icon{
width: 80rpx;
height: 80rpx;
vertical-align: middle;
position: absolute;
right: 30rpx;
top: 5rpx;
}
/* 收货人信息 */
.order-address{
padding: 30rpx 30rpx 30rpx 100rpx;
position: relative;
background: white;
}
.order-address-back{
position: absolute;
left: 0;
bottom: 0;
width: 100%;
vertical-align:bottom;
}
.order-address-name{
padding-right: 300rpx;
position: relative;
font-size: 33rpx;
padding-bottom: 10rpx;
}
.order-address-name text{
position: absolute;
right: 0;
top: 0;
width: 280rpx;
text-align: right;
}
.order-address-text{
color: #464854;
font-size: 26rpx;
}
.address-icon,
.arrows-right{
position: absolute;
}
.address-icon{
height: 42rpx;
width: 42rpx;
left: 30rpx;
top: calc(50% - 26rpx);
top: -webkit-calc(50% - 26rpx);
}
.arrows-right{
height: 28rpx;
width: 28rpx;
right: 30rpx;
top: calc(50% - 19rpx);
top: -webkit-calc(50% - 19rpx);
}
.order-add-address{
text-align: center;
padding: 30rpx 0;
}
.order-add-address navigator{
display: inline-block;
background: #e92344;
color: white;
line-height: 60rpx;
padding: 0 30rpx;
margin-right: 20rpx;
}
/* 订单商品 */
.order-content{
border-bottom: solid 100rpx transparent;
}
.order-goods{
margin-bottom: 20rpx;
}
.goods-goods-mall{
padding: 20rpx 30rpx 0 30rpx;
line-height: 50rpx;
}
.goods-goods-mall image{
width: 48rpx;
height: 48rpx;
vertical-align: middle;
margin-right: 15rpx;
margin-bottom: 2rpx;
}
.goods-goods-li{
padding: 20rpx 30rpx;
position: relative;
border-bottom: solid 1rpx #f2f2f2;
min-height: 130rpx;
background: white;
}
.goods-goods-li:last-child{
border-bottom: none;
}
.goods-img{
position: absolute;
top: 20rpx;
left: 30rpx;
height: 130rpx;
width: 130rpx;
background: #f5f6fa;
}
.goods-body{
padding-left: 150rpx;
}
.goods-name{
font-weight: bold;
padding: 10rpx 0 20rpx;
}
.goods-price{
color: #e92344;
}
.goods-qty{
color: gray;
font-weight: normal;
padding-left: 10rpx;
font-size: 28rpx;
}
.goods-params{
color: gray;
padding-bottom: 20rpx;
font-size: 28rpx;
}
/* 统计信息 */
.order-total{
background: white;
margin: 20rpx 0;
}
.order-total-li{
padding: 0 30rpx;
line-height: 90rpx;
position: relative;
font-size: 28rpx;
}
.order-total-li::before{
position: absolute;
content: " ";
left: 30rpx;
bottom: 0;
right: 0;
height: 1rpx;
background: #f2f2f2;
}
.order-total-li:last-child::before{
display: none;
}
.order-total-li text{
float: right;
color: #999;
}
.order-total-li .redCor {
color: #e92344;
font-size: 32rpx;
}
/* 购物券 */
.goodsCoupon {
background: #fff;
padding: 20rpx;
box-sizing: border-box;
position: relative;
}
.goodsCoupon-right {
width: calc(100% - 270rpx);
position: absolute;
left: 250rpx;
top: 20rpx;
right: 20rpx;
}
.goodsCoupon-text {
color: #999;
font-size: 26rpx;
margin-bottom: 24rpx;
}
.goodsCoupon-name {
margin-bottom: 40rpx;
font-size: 32rpx;
}
.goodsCoupon-name-box {
margin-bottom: 10rpx;
}
.goodsCoupon-sheet {
display: flex;
font-size: 28rpx;
color: #999;
}
.goodsCoupon-cost {
color: #000;
font-size: 28rpx;
margin: 14rpx 0;
}
.goodsCoupon-price {
font-size: 28rpx;
color: #f57e32;
}
.goodsCoupon-sheet view {
display: inline-block;
flex: 1;
}
.goodsCoupon-sheet text {
font-size: 24rpx;
line-height: 40rpx;
padding-right: 6rpx;
}
.goodsCoupon-left {
position: relative;
width: 200rpx;
height: 130rpx;
}
.goodsCoupon-box {
width: 200rpx;
height: 200rpx;
}
.goodsBox-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.goodsCoupon-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.goodsCoupon-number {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
text-align: center;
font-size: 40rpx;
color: #f57e32;
height: 94rpx;
line-height: 94rpx;
font-weight: 600;
}
.goodsCoupon-number text {
font-size: 28rpx;
}
.goodsCoupon-btn {
position: absolute;
right: 10rpx;
left: 10rpx;
bottom: 4rpx;
z-index: 2;
background: #f57e32;
color: #fff;
font-size: 24rpx;
width: calc(100% - 20rpx);
text-align: center;
height: 40rpx;
line-height: 40rpx;
border-radius: 30rpx;
transform: scale(0.83, 0.83);
}
.goodsCoupon-tips {
position: absolute;
top: -4rpx;
left: 10rpx;
z-index: 2;
color: #fff;
transform: rotate(-45deg);
}
.goodsCoupon-tips text {
transform: scale(0.83, 0.83);
font-size: 24rpx;
display: inline-block;
}
.goodsBox-tips {
display: inline-block;
width: 49rpx;
padding: 8rpx 0 6rpx 0;
background: #EDBA19;
top: -10rpx;
left: 10rpx;
position: absolute;
text-align: center;
border-top-left-radius: 4rpx;
font-size: 24rpx;
color: #ffff;
transform: scale(.9, .9);
}
.goodsBox-tips:before, .goodsBox-tips:after {
content: "";
position: absolute;
}
.goodsBox-tips:before {
height: 0;
width: 0;
border-bottom: 10rpx solid #745800;
border-right: 10rpx solid transparent;
right: -10rpx;
top: 0;
}
.goodsBox-tips:after {
height: 0;
width: 0;
border-left: 25rpx solid #EDBA19;
border-right: 25rpx solid #EDBA19;
border-bottom: 25rpx solid transparent;
bottom: -22rpx;
left: 0;
}
.goodsLabel {
background: #fff;
text-align: right;
padding: 20rpx;
font-size: 32rpx;
}
.goodsLabel text {
font-weight: 600;
}
/* 底部工具栏 */
.order-data-footer{
position: fixed;
bottom: 0;
left: 0;
right: 0;
border-top: solid 1rpx #f2f2f2;
padding-top: 17rpx;
padding-right: 30rpx;
padding-left: 30rpx;
height: 83rpx;
background: white;
display: flex;
flex-wrap: wrap;
flex-direction:row-reverse;
}
.order-data-footer.iphoneX {
padding-bottom: 30rpx;
}
.order-btn{
margin-left: 20rpx;
height: 54rpx;
line-height: 50rpx;
box-sizing: border-box;
border:solid 1rpx #747788;
padding: 0 20rpx;
font-size: 26rpx;
border-radius: 40rpx;
margin-top: 10rpx;
}
.order-btn-back {
border-color: #f57e32;
color: #f57e32;
}