jyy-smart-canteen-h5/pages/advanceOrder/payResult.vue

90 lines
2.7 KiB
Vue
Raw Permalink Normal View History

2025-05-27 10:30:44 +08:00
<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view>
<div class="body"></div>
<view style="width: 100%;height: 50vh;display: flex;flex-direction: column;align-items: center;">
<view style="margin-top: 20vh;display: flex;flex-direction: column;align-items: center;width: 100%;">
<u-icon name="checkmark-circle-fill" size="64" color="#00aa00"></u-icon>
<view style="color: 00aa00;font-size: 36rpx;margin-top: 40rpx;color: #00aa00;">支付成功</view>
<view style="font-size: 48rpx;width: 100%;text-align: center;margin: 20rpx;font-weight: bold;">{{(resultData.payAmount/100).toFixed(2)}}</view>
<view style="width: 80%;display: flex; justify-content: space-between;margin: 20rpx auto;">
<view class="search-btn" @click="goIndex">返回首页</view>
<view class="back-btn" @click="goDetail">查看订单</view>
</view>
</view>
<!-- <view style="margin-top: 20vh;display: flex;flex-direction: column;align-items: center;width: 100%;" v-else>
<u-icon name="error-circle-fill" size="64" color="#ff007f"></u-icon>
<view style="color: 00aa00;font-size: 36rpx;margin-top: 40rpx;">支付失败</view>
<view style="width: 80%;display: flex; justify-content: space-between;margin: 20rpx auto;">
<view class="search-btn" @click="goBack">返回</view>
<view class="back-btn" @click="goIndex">取消</view>
</view>
</view> -->
</view>
</view>
</template>
<script>
import { syncPayStateApi } from '@/api/advanceOrder/index.js'
export default {
data() {
return {
fontValue:uni.getStorageSync('fontSize') || 8,
resultData:{},
};
},
onLoad(option) {
this.resultData = JSON.parse(option.result)
this.$forceUpdate()
console.log(this.resultData)
console.log(this.resultData.orderList[0])
setTimeout(()=>{
this.syncPayState()
},1000)
},
methods:{
async syncPayState() {
let param = {
"orderId":this.resultData.orderList[0].orderId,
"ifManualSync": 2
}
const res = await syncPayStateApi(param)
console.log(res)
},
goIndex(){
uni.switchTab({
url: '/pages/index'
})
},
goBack(){
uni.navigateBack()
},
goDetail(){
uni.navigateTo({
url: `/pages/work/details?params=${JSON.stringify(this.resultData.orderList[0])}`
})
},
}
};
</script>
<style scoped>
.search-btn{
width: 40%;background: #fff;
height: 40px;line-height: 40px;
text-align: center;color: #000;font-size: 28rpx;
border-radius: 10rpx;margin-top: 40rpx;
border: 1px solid #ccc;
}
.back-btn{
width: 40%;background: #ff6633;height: 40px;line-height: 40px;text-align: center;color: #fff;border-radius: 10rpx;margin-top: 40rpx;font-size: 28rpx;
}
</style>