| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <template>
- <view class="payResult">
- <u-icon name="checkmark-circle-fill" color="#04BE02" style="margin-top: 50rpx;" size="180"></u-icon>
- <view>支付成功</view>
- <u-button shape="circle" :custom-style="customStyle" style="margin-top: 120rpx;" @click="goback">{{orderType == 'VOTE_ORDER' ? '返回投票' : '返回商城'}}</u-button>
- </view>
- </template>
- <script>
- // #ifdef H5
- let goldPlan = require('@/utils/jgoldplan-1.0.0.js');
- import VConsole from 'vconsole';
- // #endif
- export default {
- data() {
- return {
- customStyle: {
- color: 'white',
- background: "#04BE02",
- width: '320rpx',
- margin: '10rpx',
- height:"80rpx",
- fontSize:"30rpx"
- },
- redirect_url: '',
- bgColor: '',
- orderType: ''
- }
- },
- async onLoad(options) {
- // const vConsole = new VConsole();
- console.log("商品小票",options)
- let params = {
- orderId: options.out_trade_no
- }
- let res = await this.$api.yeepay.getOrderUrlAndColor(params)
- if(res.data.success){
- this.redirect_url = res.data.data.url;
- this.bgColor = res.data.data.color;
- this.orderType = res.data.data.type;
- }
-
- },
- onReady() {
- let mchData = {
- action: 'onIframeReady',
- displayStyle: 'SHOW_CUSTOM_PAGE'
- };
- let postData = JSON.stringify(mchData);
- parent.postMessage(postData, 'https://payapp.weixin.qq.com');
- },
-
- methods: {
- goback() {
- let mchData = {
- action: 'jumpOut',
- jumpOutUrl: decodeURIComponent(this.redirect_url) //跳转的页面
- }
- var postData = JSON.stringify(mchData);
- parent.postMessage(postData, 'https://payapp.weixin.qq.com')
- }
- }
- }
- </script>
- <style lang="scss">
- .payResult{
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- background: #FFFFFF;
- width: 100vw;
- height: 100vh;
- }
- </style>
|