|
|
@@ -178,35 +178,37 @@
|
|
|
}
|
|
|
},
|
|
|
//礼物支付
|
|
|
- pay() {
|
|
|
- if (this.$u.test.isEmpty(this.senderId)) {
|
|
|
+ async pay() {
|
|
|
+ if (this.$u.test.isEmpty(this.userId)) {
|
|
|
let path = 'pages/activityList/activity/authorBoost?activityId=' + this.activityId + '&receiverId=' + this.receiverId;
|
|
|
window.location.href = authUrl(path);
|
|
|
} else {
|
|
|
- console.log("发起支付");
|
|
|
- //支付成功后:
|
|
|
- // this.$u.api.boost.billRecord({
|
|
|
- // userId: this.senderId,
|
|
|
- // openId: uni.getStorageSync("openid"),
|
|
|
- // activityId: this.activityId,
|
|
|
- // price: this.count * this.currentPresentSum,
|
|
|
- // presentId: this.presentId,
|
|
|
- // presentCount: this.count,
|
|
|
- // type: 2,
|
|
|
- // payStatus: '',
|
|
|
- // }).then(res => {
|
|
|
- // this.$u.api.boost.doReward({
|
|
|
- // activityId: this.activityId,
|
|
|
- // presentId: this.presentId,
|
|
|
- // senderId: this.senderId,
|
|
|
- // receiverId: this.receiverId,
|
|
|
- // type: 3,
|
|
|
- // count: this.count,
|
|
|
- // }).then(res => {
|
|
|
- // this.successShow = true;
|
|
|
- // })
|
|
|
- // })
|
|
|
- this.successShow = true;
|
|
|
+ let orderInfo = (await this.$u.api.yeePay.initOrder(
|
|
|
+ {
|
|
|
+ "appId": appId,
|
|
|
+ "channel": "WECHAT",
|
|
|
+ "channelPromotionInfo": "",
|
|
|
+ "channelSpecifiedInfo": "",
|
|
|
+ "csUrl": "",
|
|
|
+ "expiredTime": "",
|
|
|
+ "fundProcessType": "",
|
|
|
+ "goodsName": this.boostDetail.presentList[this.current].name,
|
|
|
+ "memo": "",
|
|
|
+ "notifyUrl": "https://vote.guosen-fumao.cn/vote-h5/index.html",
|
|
|
+ "orderAmount": this.count * this.currentPresentSum,
|
|
|
+ "orderId": new Date().getTime(),
|
|
|
+ "payWay": "WECHAT_OFFIACCOUNT",
|
|
|
+ "redirectUrl": "",
|
|
|
+ "scene": "OFFLINE",
|
|
|
+ "uniqueOrderNo": "",
|
|
|
+ "userId": uni.getStorageSync("openid"),
|
|
|
+ "userIp": "127.0.0.1"
|
|
|
+ }
|
|
|
+ ));
|
|
|
+ if(typeof orderInfo.prePayTn != 'undefined' ){
|
|
|
+ //调起支付
|
|
|
+ this.toPay(JSON.parse(orderInfo.prePayTn));
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//获取助力详情
|
|
|
@@ -272,6 +274,47 @@
|
|
|
this.shareShow = false;
|
|
|
this.wxShareShow = true;
|
|
|
this.type = "分享到朋友圈"
|
|
|
+ },
|
|
|
+ toPay(info) {
|
|
|
+ console.log(info,456789);
|
|
|
+ WeixinJSBridge.invoke('getBrandWCPayRequest', info, (res) => {
|
|
|
+ if (res.err_msg == "get_brand_wcpay_request:ok" ) {
|
|
|
+ this.$u.api.boost.billRecord({
|
|
|
+ userId: this.senderId,
|
|
|
+ openId: uni.getStorageSync("openid"),
|
|
|
+ activityId: this.activityId,
|
|
|
+ price: this.count * this.currentPresentSum,
|
|
|
+ presentId: this.presentId,
|
|
|
+ presentCount: this.count,
|
|
|
+ type: 2,
|
|
|
+ payStatus: 1,
|
|
|
+ }).then(res => {
|
|
|
+ this.$u.api.boost.doReward({
|
|
|
+ activityId: this.activityId,
|
|
|
+ presentId: this.presentId,
|
|
|
+ senderId: this.senderId,
|
|
|
+ receiverId: this.receiverId,
|
|
|
+ type: 3,
|
|
|
+ count: this.count,
|
|
|
+ }).then(res => {
|
|
|
+ this.successShow = true;
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
|
|
+ this.$u.api.boost.billRecord({
|
|
|
+ userId: this.senderId,
|
|
|
+ openId: uni.getStorageSync("openid"),
|
|
|
+ activityId: this.activityId,
|
|
|
+ price: this.count * this.currentPresentSum,
|
|
|
+ presentId: this.presentId,
|
|
|
+ presentCount: this.count,
|
|
|
+ type: 2,
|
|
|
+ payStatus: 2,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log(res.err_msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|