|
|
@@ -103,6 +103,7 @@
|
|
|
|
|
|
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
|
|
<script>
|
|
|
+ import {appId} from '@/common/conf/config.js'
|
|
|
import {authUrl} from '@/common/conf/config.js';
|
|
|
import {getUrlParams} from '@/common/utils/utils.js';
|
|
|
export default {
|
|
|
@@ -152,13 +153,40 @@
|
|
|
}
|
|
|
},
|
|
|
//礼物支付
|
|
|
- pay() {
|
|
|
- if (this.$u.test.isEmpty(this.userId)) {
|
|
|
- let path = 'pages/activityList/activity/musicBoost?id=' + this.productId;
|
|
|
- window.location.href = authUrl(path);
|
|
|
- } else {
|
|
|
-
|
|
|
+ async pay() {
|
|
|
+ alert(1)
|
|
|
+ let orderInfo = (await this.$u.api.yeePay.initOrder(
|
|
|
+ {
|
|
|
+ "appId": appId,
|
|
|
+ "channel": "WECHAT",
|
|
|
+ "channelPromotionInfo": "",
|
|
|
+ "channelSpecifiedInfo": "",
|
|
|
+ "csUrl": "",
|
|
|
+ "expiredTime": "",
|
|
|
+ "fundProcessType": "",
|
|
|
+ "goodsName": "测试",
|
|
|
+ "memo": "",
|
|
|
+ "notifyUrl": "https://vote.guosen-fumao.cn/vote-h5/index.html",
|
|
|
+ "orderAmount": 0.01,
|
|
|
+ "orderId": "363223222169",
|
|
|
+ "payWay": "MINI_PROGRAM",
|
|
|
+ "redirectUrl": "",
|
|
|
+ "scene": "ONLINE",
|
|
|
+ "uniqueOrderNo": "",
|
|
|
+ "userId": "ofODrjk12F8egZQJELDhcD-kMd2Y",
|
|
|
+ "userIp": "127.0.0.1"
|
|
|
+ }
|
|
|
+ )).data;
|
|
|
+ if(typeof orderInfo.prePayTn != 'undefined' ){
|
|
|
+ //调起支付
|
|
|
+ this.toPay(orderInfo.prePayTn);
|
|
|
}
|
|
|
+ // if (this.$u.test.isEmpty(this.userId)) {
|
|
|
+ // let path = 'pages/activityList/activity/musicBoost?id=' + this.productId;
|
|
|
+ // window.location.href = authUrl(path);
|
|
|
+ // } else {
|
|
|
+
|
|
|
+ // }
|
|
|
},
|
|
|
//获取助力详情
|
|
|
getBoostDetail(productId, userId) {
|
|
|
@@ -210,8 +238,12 @@
|
|
|
//邀请
|
|
|
invite() {
|
|
|
this.shareShow = true;
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ toPay(info){
|
|
|
+ WeixinJSBridge.invoke(
|
|
|
+ 'getBrandWCPayRequest',info ,
|
|
|
+ (res) =>{});
|
|
|
+ }}
|
|
|
}
|
|
|
</script>
|
|
|
|