<template>
|
<div class="wrapper">
|
<!-- <div class="pay-wrapper">
|
<div class="pay-money">
|
¥{{ Number(payPrice) | unitPrice }}
|
</div>
|
<div class="pay-btns">
|
<div v-show="!from" @click="checkOrder">查看{{ this.orderType == "RECHARGE" ? '余额' : '订单' }}</div>
|
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
|
</div>
|
</div>
|
<div class="pay-box">
|
<div class="pay-tag-box">
|
<h2>订单支付成功!</h2>
|
<div class="pay-item">
|
<div>
|
支付方式:
|
</div>
|
<div>{{ paymentMethod | paymentTypeFilter }}</div>
|
</div>
|
</div>
|
</div> -->
|
|
<div class="pay-success-wrapper">
|
<div class="pay-success-content">
|
<image class="success-icon" src="@/pages/cart/static/paySuccess.png"></image>
|
<div class="success-title">支付成功</div>
|
<div class="amount">¥{{ Number(payPrice) | unitPrice }}</div>
|
|
<div class="payment-method" v-if="paymentMethod">
|
支付方式:{{ paymentMethod | paymentTypeFilter }}
|
</div>
|
|
<div class="action-buttons">
|
<div
|
class="btn view-order"
|
v-show="!from"
|
@click="checkOrder"
|
>
|
查看{{ this.orderType == "RECHARGE" ? '余额' : '订单' }}
|
</div>
|
<div
|
class="btn back-home"
|
@click="navigateTo('/pages/tabbar/index/home', 'switch')"
|
>
|
回到首页
|
</div>
|
</div>
|
</div>
|
</div>
|
<!-- <goodsRecommend /> -->
|
</div>
|
|
</template>
|
<script>
|
// import goodsRecommend from "@/pages/cart/m-goods-recommend/index.vue";
|
import { getSessionId, userAction } from "@/api/userAction.js";
|
export default {
|
data() {
|
return {
|
checked: false,
|
paymentMethod: "",
|
|
from: "",
|
payPrice: 0,
|
goodsList: [],
|
activeColor: this.$mainColor,
|
pageSessionNo:"",
|
actionParam:{
|
sessionId:'',
|
actionType:"PAGE",
|
joinType:"SELF",
|
pageCode:"PAY_SUCCESS",
|
pageParams:"{}",
|
pageStatus:"JOIN",
|
pageType:"DETAIL"
|
}
|
};
|
},
|
// components: {
|
// goodsRecommend,
|
// },
|
filters: {
|
paymentTypeFilter(val) {
|
switch (val) {
|
case "WECHAT":
|
return "微信";
|
case "ALIPAY":
|
return "支付宝";
|
case "WALLET":
|
return "余额支付";
|
default:
|
return "";
|
}
|
},
|
},
|
onUnload() {
|
let param = this.actionParam;
|
if (this.sendOnShow)return
|
param.pageStatus = "LEAVE"
|
userAction(param)
|
},
|
onHide() {
|
this.startHidenTime = Date.now()
|
let param = this.actionParam;
|
this.sendOnShow = true;
|
param.pageStatus = "LEAVE"
|
userAction(param)
|
},
|
onShow() {
|
getSessionId().then(res=>{
|
this.pageSessionNo = res.data.data
|
if(this.pageSessionNo){
|
let param = this.actionParam;
|
param.sessionId = this.pageSessionNo
|
userAction(param)
|
}
|
})
|
},
|
onLoad(options) {
|
this.actionParam.pageParams = JSON.stringify(options)
|
this.paymentMethod = options.paymentMethod || "";
|
this.from = options.from || "";
|
this.payPrice = options.payPrice || 0;
|
this.orderType = options.orderType;
|
|
},
|
methods: {
|
checkOrder() {
|
/**
|
* 查看订单
|
* 1.充值跳转到明细里面
|
* 2.支付跳转到订单详情
|
*/
|
if (this.orderType == "RECHARGE") {
|
uni.reLaunch({
|
url: `/pages/mine/deposit/operation`,
|
});
|
} else {
|
this.navigateTo("/pages/order/myOrder?status=0");
|
}
|
},
|
|
navigateTo(url, type) {
|
if (type === "switch") {
|
uni.redirectTo({
|
url,
|
fail(e) {
|
console.log('跳转失败',e)
|
}
|
});
|
} else {
|
uni.redirectTo({
|
url,
|
});
|
}
|
},
|
},
|
};
|
</script>
|
<style scoped lang="scss">
|
.subscribe {
|
justify-content: space-between;
|
align-items: center;
|
margin: 0 auto 40rpx auto;
|
padding: 0 20rpx 20rpx;
|
width: 80%;
|
}
|
|
.pay-btns {
|
display: flex;
|
width: 50%;
|
justify-content: space-between;
|
margin: 0 auto;
|
color: #fff;
|
|
>div {
|
padding: 6px 12px;
|
border: 1px solid #fff;
|
border-radius: 100px;
|
}
|
}
|
|
.pay-money {
|
line-height: 1;
|
font-size: 50rpx;
|
color: #fff;
|
margin-bottom: 100rpx;
|
}
|
|
.pay-item {
|
font-weight: bold;
|
margin: 32rpx 0;
|
display: flex;
|
justify-content: space-between;
|
font-size: 24rpx;
|
color: rgba($color: $main-color, $alpha: 0.8);
|
}
|
|
.pay-box {
|
overflow: hidden;
|
}
|
|
.pay-tag-box {
|
width: 80%;
|
margin: 80rpx auto 40rpx auto;
|
padding: 20rpx;
|
border-radius: 20rpx;
|
background: rgba($color: $main-color, $alpha: 0.2);
|
|
>h2 {
|
margin-top: 20rpx;
|
font-size: 40rpx;
|
color: $main-color;
|
}
|
}
|
|
.pay-wrapper {
|
background-image: linear-gradient(90deg, #fa123b, #ff6b35, #ff9f28, #ffcc03);
|
height: 480rpx;
|
position: relative;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
}
|
|
.pay-box {
|
transform: translateY(-100rpx);
|
width: 100%;
|
background: #fff;
|
border-top-right-radius: 100rpx;
|
}
|
.pay-success-wrapper {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
min-height: 100vh;
|
background-color: #f7f7f7;
|
padding: 40rpx;
|
}
|
|
.pay-success-content {
|
width: 100%;
|
max-width: 600rpx;
|
background: #fff;
|
border-radius: 24rpx;
|
padding: 60rpx 40rpx;
|
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.05);
|
text-align: center;
|
}
|
|
.success-icon {
|
width: 120rpx;
|
height: 120rpx;
|
margin-bottom: 30rpx;
|
}
|
|
.success-title {
|
font-size: 40rpx;
|
font-weight: bold;
|
color: #333;
|
margin-bottom: 20rpx;
|
}
|
|
.amount {
|
font-size: 48rpx;
|
font-weight: bold;
|
color: $main-color;
|
margin-bottom: 40rpx;
|
}
|
|
.payment-method {
|
font-size: 28rpx;
|
color: #666;
|
margin-bottom: 60rpx;
|
padding: 20rpx 0;
|
border-top: 1rpx solid #eee;
|
border-bottom: 1rpx solid #eee;
|
}
|
|
.action-buttons {
|
display: flex;
|
justify-content: space-between;
|
margin-top: 40rpx;
|
|
.btn {
|
flex: 1;
|
height: 80rpx;
|
line-height: 80rpx;
|
border-radius: 40rpx;
|
font-size: 30rpx;
|
font-weight: 500;
|
margin: 0 15rpx;
|
transition: all 0.3s;
|
}
|
|
.view-order {
|
background-color: #fff;
|
color: $main-color;
|
border: 1rpx solid $main-color;
|
|
&:active {
|
background-color: rgba($color: $main-color, $alpha: 0.1);
|
}
|
}
|
|
.back-home {
|
background-color: $main-color;
|
color: #fff;
|
|
&:active {
|
opacity: 0.9;
|
}
|
}
|
}
|
|
/* 响应式调整 */
|
@media (max-width: 500px) {
|
.action-buttons {
|
flex-direction: column;
|
|
.btn {
|
margin: 10rpx 0;
|
}
|
}
|
}
|
</style>
|