From 7e081cadeda2d7b5d3cc3f6055b4ee2799d19c00 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期四, 08 八月 2024 15:11:54 +0800
Subject: [PATCH] feat(支付): 云闪付
---
pay/paySuccess.vue | 79 +++++++++++++++++++++------------------
1 files changed, 42 insertions(+), 37 deletions(-)
diff --git a/pay/paySuccess.vue b/pay/paySuccess.vue
index ec3d7e6..3afcd17 100644
--- a/pay/paySuccess.vue
+++ b/pay/paySuccess.vue
@@ -7,10 +7,10 @@
<view class="u-font-32 font-bold u-m-t-10" style="color: #14AF0D;">鏀粯鎴愬姛</view>
</view>
<view class="shop-info">
- <view class="u-text-center u-font-32 color-666">{{youHuiInfo.shopName}}娴嬭瘯闂ㄥ簵</view>
- <view class="u-flex u-col-top u-row-center">
- <view class="u-font-24 lh-1">锟�</view>
- <view class="u-font-money lh-1">{{$u.priceFormat(youHuiInfo.payMoney/100, 2)}}</view>
+ <view class="u-text-center u-font-32 color-666">{{youHuiInfo.shopName}}</view>
+ <view class="u-text-center u-m-t-20">
+ <text class="u-font-30 lh-1">锟�</text>
+ <text class="u-font-money lh-1">{{$u.priceFormat(youHuiInfo.payMoney/100, 2)}}</text>
</view>
</view>
<view class="u-flex u-m-t-30 u-font-30">
@@ -19,15 +19,15 @@
</view>
<view class="u-flex-1 u-text-right">锟{$u.priceFormat(youHuiInfo.money/100, 2)}}</view>
</view>
- <view class="u-flex u-m-t-16 u-font-30">
+<!-- <view class="u-flex u-m-t-16 u-font-30">
<view class="color-999 u-flex">
<view class="label" style="color: #F69249;">浣跨敤绉垎</view>
</view>
<view class="u-flex-1 u-text-right" style="color: #F69249;">{{youHuiInfo.score}}绉垎<text
v-if="youHuiInfo.score>0">鎶垫墸{{$u.priceFormat(youHuiInfo.scoreDkPrice/100, 2)}}鍏�</text>
</view>
- </view>
- <view class="u-flex u-m-t-16 u-font-30">
+ </view>-->
+ <view v-if="youHuiInfo.couponDkPrice!=0" class="u-flex u-m-t-16 u-font-30">
<view class="color-999 u-flex">
<view class="label">浼樻儬鍒�</view>
</view>
@@ -80,15 +80,15 @@
</view>
<view class="u-flex-1">锟{$u.priceFormat(orderInfo.orderPrice/100, 2)}}</view>
</view>
- <view class="u-flex u-m-t-30 u-font-30">
+<!-- <view class="u-flex u-m-t-30 u-font-30">
<view class="color-999 u-flex">
<view class="label">浣跨敤绉垎</view>锛�
</view>
<view class="u-flex-1">{{orderInfo.payIntegral}}绉垎<text
v-if="orderInfo.payIntegral>0">鎶垫墸{{$u.priceFormat(orderInfo.integralMoney/100, 2)}}鍏�</text>
</view>
- </view>
- <view class="u-flex u-m-t-30 u-font-30">
+ </view>-->
+ <view class="u-flex u-m-t-30 u-font-30">
<view class="color-999 u-flex">
<view class="label">浼樻儬鍒�</view>锛�
</view>
@@ -102,7 +102,7 @@
</view>
</view>
<view class="btn-box">
- <u-button @click="doJump" text="瀹屾垚" type="success" plain shape="circle"></u-button>
+ <u-button @click="clickDone" text="瀹屾垚" type="success" plain shape="circle"></u-button>
</view>
</block>
@@ -111,17 +111,12 @@
<script>
import {
- getPayCompleteUrl,
getWxOrderInfo,
- } from '@/common/api/index'
- import {
- activityInfo,
- myBrushDetail,
- orderRefBrushNode
- } from '@/common/api/shuaka'
+ } from 'common/api/index'
export default {
data() {
return {
+ plat: this.$utils.getPlat(),
info: {
bankCardName: '',
totalDiscount: 0,
@@ -152,33 +147,20 @@
};
},
onLoad(opt) {
- activityInfo().then(res => {
- this.info = res
- })
- myBrushDetail().then(res => {
- if (res) {
- this.join = true
- } else {
- this.join = false
- }
- })
if (uni.getStorageSync("bankCardStyle")) {
this.bankCardStyle = uni.getStorageSync("bankCardStyle")
}
- getPayCompleteUrl().then(res => {
- this.jumpUrl = res
- })
if (opt.youHuiInfo) {
this.youHuiInfo = JSON.parse(opt.youHuiInfo)
}
if (opt.orderId) {
this.orderId = opt.orderId
- orderRefBrushNode({
+ /*orderRefBrushNode({
orderId: this.orderId
}).then(res => {
this.couponList = res.coupIdsMap || []
- })
+ })*/
}
},
onReady() {
@@ -230,9 +212,32 @@
return null;
},
clickDone() {
- // window.close()
- WeixinJSBridge.call('closeWindow');
-
+ let browser = navigator.userAgent.toLowerCase();
+ if (browser.match(/Alipay/i) == "alipay") {
+ console.log("鏀粯瀹漚pp鐨勬祻瑙堝櫒");
+ //杩欎釜鍙互鍏抽棴瀹夊崜绯荤粺鐨勬墜鏈�
+ document.addEventListener("AlipayJSBridgeReady", function () {
+ AlipayJSBridge.call("closeWindow");
+ },
+ false
+ );
+ //杩欎釜鍙互鍏抽棴ios绯荤粺鐨勬墜鏈�
+ AlipayJSBridge.call('closeWebview'); //鏀粯瀹�
+ } else if (browser.match(/MicroMessenger/i) == "micromessenger") {
+ //杩欎釜鍙互鍏抽棴瀹夊崜绯荤粺鐨勬墜鏈�
+ document.addEventListener("WeixinJSBridgeReady", function () {
+ WeixinJSBridge.call("closeWindow");
+ },
+ false
+ );
+ //杩欎釜鍙互鍏抽棴ios绯荤粺鐨勬墜鏈�
+ WeixinJSBridge.call("closeWindow");
+ } else {
+ console.log("鍏跺畠娴忚鍣�");
+ window.opener = null; //濡傛灉娌℃湁杩欒鍜屼笅闈㈢殑涓�琛屽垯浼氬嚭鐜颁笂闈㈢殑绗簩涓闂銆�
+ window.open(' ', '_self', ' ');
+ window.close()
+ }
},
doJump() {
var mchData = {
@@ -290,7 +295,7 @@
.coupon {
width: 638rpx;
height: 172rpx;
- background-image: url('~@/static/shuaka/pay-by-card-coupon.png');
+ background-image: url('~@/static/pay-by-card-coupon.png');
background-size: cover;
margin: 10rpx auto 20rpx;
display: flex;
--
Gitblit v1.9.1