源文件
This commit is contained in:
175
jeepay-ui-uapp-cashier/pages/paySuccess/paySuccess.vue
Normal file
175
jeepay-ui-uapp-cashier/pages/paySuccess/paySuccess.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view class="pay-result">
|
||||
<image src="/static/img/success.svg" class="pay-result-icon"></image>
|
||||
<text class="pay-result-err">支付成功</text>
|
||||
<text style="margin-top: 30rpx ; color:#00000059 ;">{{ vdata.member?'会员支付':'普通支付' }}</text>
|
||||
<view class="pay-result-amount">
|
||||
<text class="pay-result-amount-text">金额:<text style="color: #FC0100;">¥</text></text>
|
||||
<text class="pay-result-amount-value">{{ doubleToThousands(vdata.amount) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="ad-wrapper" v-if="vdata.advertUrl" @tap="toH5">
|
||||
<image mode="aspectFill" :src="vdata.advertUrl"></image>
|
||||
</view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button v-if="appConfig.scene == 1069" class="back-btn" :style="{'backgroundColor': vdata.primaryColor || '#F1F1F1'}" open-type="launchApp" :app-parameter="'success'" @error="launchAppError">完 成</button>
|
||||
<button v-else-if="appConfig.scene == 1037" class="back-btn" :style="{'backgroundColor': vdata.primaryColor || '#F1F1F1'}" @click="backMiniFunc">完 成</button>
|
||||
<navigator v-else open-type="exit" target="miniProgram" class="back-btn" :style="{'backgroundColor': vdata.primaryColor || '#F1F1F1'}">完 成</navigator>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<navigator open-type="exit" target="miniProgram" class="back-btn" :style="{'backgroundColor': vdata.primaryColor || '#F1F1F1'}">完 成</navigator>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
||||
<view class="back-btn" :style="{'backgroundColor': vdata.primaryColor || '#F1F1F1'}" @click="back">完 成</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { doubleToThousands } from '@/util/amount.js'
|
||||
import { onLoad,onUnload } from '@dcloudio/uni-app'
|
||||
import { reactive } from 'vue'
|
||||
import { $getAdvert } from '@/http/apiManager.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import theme from '@/config/theme.js'
|
||||
|
||||
const vdata = reactive({
|
||||
amount: '0', // 订单金额
|
||||
payOrderId: '', // 订单号
|
||||
doubleToThousands: doubleToThousands(),
|
||||
primaryColor: '',
|
||||
advertUrl: ''
|
||||
})
|
||||
|
||||
onLoad((params) => {
|
||||
console.log(appConfig.video,'appConfigvideo')
|
||||
vdata.amount = params.amount
|
||||
vdata.primaryColor = theme.changeColors()
|
||||
vdata.member = params.member
|
||||
|
||||
if (params.payOrderId) {
|
||||
vdata.payOrderId = params.payOrderId
|
||||
}
|
||||
sphGet()
|
||||
|
||||
$getAdvert().then(({bizData}) => {
|
||||
if(bizData) {
|
||||
vdata.advertUrl = bizData.imgUrl || ''
|
||||
vdata.linkUrl = bizData.linkUrl || ''
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
})
|
||||
//视频号数据
|
||||
function sphGet(){
|
||||
if(appConfig.currentPageType == 'alipayLite' || appConfig.currentPageType == 'alipayH5' || appConfig.video == undefined || appConfig.video == null){
|
||||
|
||||
}else{alipayLite
|
||||
uni.openChannelsActivity({
|
||||
finderUserName: appConfig.video.uniqueId,//视频号ID
|
||||
feedId: appConfig.video.exportId,//视频ID
|
||||
complete (res) {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
function back() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
function backMiniFunc() {
|
||||
uni.navigateBackMiniProgram({
|
||||
extraData: {
|
||||
'amount': vdata.amount,
|
||||
'payOrderId': vdata.payOrderId
|
||||
},
|
||||
success(res) {
|
||||
console.log('返回成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
const toH5 = ()=>{
|
||||
if(!vdata.linkUrl) return
|
||||
uni.navigateTo({
|
||||
url: '/pages/H5/H5?url='+ vdata.linkUrl
|
||||
})
|
||||
}
|
||||
onUnload(()=>{
|
||||
console.log('页面卸载');
|
||||
uni.$emit('onRechargeSuccess',true)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.pay-result {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.pay-result-icon {
|
||||
padding-top: 120rpx;
|
||||
width: 240rpx;
|
||||
height: 166rpx;
|
||||
}
|
||||
.pay-result-err {
|
||||
// padding-top: 30rpx;
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #242526;
|
||||
}
|
||||
.pay-result-msg {
|
||||
width: 75%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-top: 70rpx;
|
||||
color: #999999;
|
||||
|
||||
.msg {
|
||||
line-height: 42rpx;
|
||||
}
|
||||
}
|
||||
.pay-result-amount {
|
||||
padding-top: 34rpx;
|
||||
|
||||
.pay-result-amount-text{
|
||||
font-size: 28rpx;
|
||||
font-family: HiraginoSansGB-W3, HiraginoSansGB;
|
||||
color: #303132;
|
||||
}
|
||||
.pay-result-amount-value {
|
||||
font-size: 36rpx;
|
||||
font-family: HiraginoSansGB-W3, HiraginoSansGB;
|
||||
font-weight: 600;
|
||||
color: #FC0100;
|
||||
}
|
||||
}
|
||||
.back-btn {
|
||||
position: fixed;
|
||||
bottom: 260rpx;
|
||||
width: 350rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 6rpx 6rpx 6rpx 6rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.ad-wrapper{
|
||||
margin: 50rpx auto;
|
||||
margin-top: 100rpx;
|
||||
width: 700rpx;
|
||||
min-height: 380rpx;
|
||||
display: flex;
|
||||
border-radius: 10rpx;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
image {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
167
jeepay-ui-uapp-cashier/pages/paySuccess/redSuccess.vue
Normal file
167
jeepay-ui-uapp-cashier/pages/paySuccess/redSuccess.vue
Normal file
@@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<view class="page-view" :style="{'background-image': `url(${vdata.sysBgUrl})`}" >
|
||||
<view class="page-text-title" @click="goToPreviousPage()">
|
||||
<view> <返回 </view>
|
||||
</view>
|
||||
<view class="page-view-weapper" :style="{'background-image': `url(${vdata.sysBgUrl2})`}">
|
||||
<view class="price-box">
|
||||
<text class="price-ico">¥</text>
|
||||
<text class="price-text">{{vdata.rewardAmt}}</text>
|
||||
</view>
|
||||
<view class="order-text">
|
||||
<view class="order-text-box">
|
||||
<text class="price-ico">订单金额</text>
|
||||
<text class="price-text">¥{{vdata.transAmt}}</text>
|
||||
</view>
|
||||
<view class="order-text-box">
|
||||
<text class="price-ico">红包抵扣</text>
|
||||
<text class="price-text">¥{{vdata.changeAmt}}</text>
|
||||
</view>
|
||||
<view class="order-text-box order-text-box-price">
|
||||
<text class="price-ico">实际支付</text>
|
||||
<text class="price-text">¥{{vdata.findAmt}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { doubleToThousands } from '@/util/amount.js'
|
||||
import { onLoad,onUnload } from '@dcloudio/uni-app'
|
||||
import { reactive } from 'vue'
|
||||
import { $getAdvert,$getMarketingConfig,$getDiscountDetail } from '@/http/apiManager.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import theme from '@/config/theme.js'
|
||||
|
||||
const vdata = reactive({
|
||||
amount: '0', // 订单金额
|
||||
payOrderId: '', // 订单号
|
||||
doubleToThousands: doubleToThousands(),
|
||||
primaryColor: '',
|
||||
advertUrl: '',
|
||||
sysBgUrl:"",
|
||||
sysBgUrl2:"",
|
||||
rewardAmt:0,
|
||||
transAmt:0,
|
||||
changeAmt:0,
|
||||
findAmt:0,
|
||||
})
|
||||
|
||||
onLoad((params) => {
|
||||
//获取平台红包功能
|
||||
// getMarketingConfig();
|
||||
// vdata.amount = params.amount
|
||||
vdata.primaryColor = theme.changeColors()
|
||||
// vdata.member = params.member
|
||||
console.log(params,'paramsparamsparams')
|
||||
|
||||
if (params.payOrderId) {
|
||||
vdata.payOrderId = params.payOrderId
|
||||
}
|
||||
vdata.sysBgUrl = appConfig.marketingConfig.sysBgUrl
|
||||
vdata.sysBgUrl2 = appConfig.marketingConfig.sysBgUrl2
|
||||
|
||||
$getDiscountDetail(vdata.payOrderId).then(({bizData}) => {
|
||||
|
||||
//订单金额
|
||||
vdata.transAmt = (bizData.order.amount/100).toFixed(2)
|
||||
//红包抵扣
|
||||
vdata.changeAmt = (bizData.order.discountAmt/100).toFixed(2)
|
||||
//实际支付
|
||||
vdata.findAmt = (bizData.order.findAmt/100).toFixed(2)
|
||||
if(bizData.redPacketInfo){
|
||||
//红包奖励
|
||||
vdata.rewardAmt = (bizData.redPacketInfo.rewardAmt/100).toFixed(2)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
})
|
||||
function back() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
function getMarketingConfig(){
|
||||
$getMarketingConfig('marketingConfig').then(({bizData}) => {
|
||||
vdata.sysBgUrl = bizData.marketingConfig.sysBgUrl
|
||||
// console.log(vdata.sysBgUrl,'vdata.sysBgUrl')
|
||||
vdata.sysBgUrl2 = bizData.marketingConfig.sysBgUrl2
|
||||
})
|
||||
}
|
||||
// 点击按钮时触发的事件处理函数
|
||||
function goToPreviousPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/payway/index'
|
||||
})
|
||||
}
|
||||
onUnload(()=>{
|
||||
console.log('页面卸载');
|
||||
uni.$emit('onRechargeSuccess',true)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.page-text-title{
|
||||
position: absolute;
|
||||
color: #090909;
|
||||
font-family: 600;
|
||||
font-size: 36rpx;
|
||||
width: 100%;
|
||||
top: 5%;
|
||||
left: 5%;
|
||||
}
|
||||
//https://syb-jq-public.oss-cn-hangzhou.aliyuncs.com/oem/5999e9eb-6839-4608-869c-f6f39cef7bc1.png
|
||||
// https://syb-jq-public.oss-cn-hangzhou.aliyuncs.com/oem/a86ccec4-ed2a-46bc-b5b5-bb42b9e8939d.png
|
||||
// https://syb-jq-public.oss-cn-hangzhou.aliyuncs.com/oem/eecc2da4-9e9e-4ee2-a206-900e38298224.png
|
||||
.page-view{
|
||||
// background-image: url('https://syb-jq-public.oss-cn-hangzhou.aliyuncs.com/oem/a86ccec4-ed2a-46bc-b5b5-bb42b9e8939d.png') ;
|
||||
background-size: cover;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.page-view-weapper{
|
||||
// background-image: url('https://syb-jq-public.oss-cn-hangzhou.aliyuncs.com/oem/eecc2da4-9e9e-4ee2-a206-900e38298224.png') ;
|
||||
// background-image: url('https://syb-jq-public.oss-cn-hangzhou.aliyuncs.com/oem/ae73fd83-89dc-4b47-838e-6d67b150f7ee.png') ;
|
||||
background-size: cover;
|
||||
height: 50vh;
|
||||
width: 50vh;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
top: 30px;
|
||||
}
|
||||
.price-box{
|
||||
// margin-top: 10%;
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
background: linear-gradient(to right, #FF7300, #FF312B); /* 设置线性渐变色 */
|
||||
-webkit-background-clip: text; /* 使用文本作为背景剪辑 */
|
||||
color: transparent; /* 隐藏实际文本颜色 */
|
||||
.price-ico{
|
||||
font-size: 100rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.price-text{
|
||||
font-size: 140rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
.order-text{
|
||||
margin-top: 8%;
|
||||
.order-text-box{
|
||||
font-size: 35rpx;
|
||||
color: #CD5E18;
|
||||
text{
|
||||
padding: 20rpx 100rpx;
|
||||
}
|
||||
}
|
||||
.order-text-box-price{
|
||||
color: #9F4A14;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user