|
|
@@ -124,6 +124,23 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
+ <u-popup v-model="errorShow" mode="center" width="500rpx" height="600rpx" border-radius="30">
|
|
|
+ <view class="bg-img text-center" style="background-image: url('https://upload-file-data.obs.cn-south-1.myhuaweicloud.com/e914f556be414767aca011a30961560a-dialogBgImg.png');height: 600rpx;">
|
|
|
+ <view style="height: 120upx;"></view>
|
|
|
+ <u-avatar :src="boostDetail.avatar" size="160"></u-avatar>
|
|
|
+ <view class="text-center margin-top text-lg text-bold">支付失败</view>
|
|
|
+ <view class="padding">
|
|
|
+ <u-button class="custom-style" shape="circle" @click="errorShow = false">确定</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <u-popup v-model="payShow" mode="center" width="500rpx" height="320rpx" border-radius="30">
|
|
|
+ <view class="text-center text-lg padding">请确定支付是否已完成</view>
|
|
|
+ <u-line color="#c2c2c2"></u-line>
|
|
|
+ <view class="text-red text-center text-lg padding" @click="checkPayInterval">已完成支付</view>
|
|
|
+ <u-line color="#c2c2c2"></u-line>
|
|
|
+ <view class="text-gray text-center text-lg padding" @click="pay">支付遇到问题,重新支付</view>
|
|
|
+ </u-popup>
|
|
|
<view class="cu-modal" :class="wxShareShow ? 'show' : ''" style="z-index: 9999;">
|
|
|
<view class="cu-dialog">
|
|
|
<view style="height:150px;">
|
|
|
@@ -181,6 +198,9 @@
|
|
|
presentId:'',
|
|
|
successShow: false,
|
|
|
presentDetail: {},
|
|
|
+ errorShow: false,
|
|
|
+ payShow: false,
|
|
|
+ orderId: '',
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -226,64 +246,45 @@
|
|
|
},
|
|
|
//礼物支付
|
|
|
async pay() {
|
|
|
+ this.payShow = false;
|
|
|
let _this = this;
|
|
|
|
|
|
- // if (this.$u.test.isEmpty(this.senderId)) {
|
|
|
- // let path = 'pages/activityList/activity/authorBoost?activityId=' + this.activityId + '&receiverId=' + this.receiverId;
|
|
|
- // window.location.href = authUrl(path);
|
|
|
- // } else {}
|
|
|
- let orderId=new Date().getTime();
|
|
|
- let orderInfo = (await this.$u.api.yeePay.initOrder(
|
|
|
- {
|
|
|
- "channel": "ALIPAY",
|
|
|
- "goodsName": this.boostDetail.presentList[this.current].name,
|
|
|
- "notifyUrl": "1",
|
|
|
- "orderAmount": this.count * this.currentPresentSum,
|
|
|
- "orderId": orderId,
|
|
|
- "payWay": "USER_SCAN",
|
|
|
- "scene": "OFFLINE",
|
|
|
- "userIp": "127.0.0.1"
|
|
|
- }
|
|
|
- // {
|
|
|
- // "appId": appId,
|
|
|
- // "channel": "WECHAT",
|
|
|
- // "channelPromotionInfo": "",
|
|
|
- // "channelSpecifiedInfo": "",
|
|
|
- // "csUrl": "",
|
|
|
- // "expiredTime": "",
|
|
|
- // "fundProcessType": "",
|
|
|
- // "goodsName": this.boostDetail.presentList[this.current].name,
|
|
|
- // "memo": "",
|
|
|
- // "notifyUrl": "https://music.nanyue6688.com/ldt/api/yeePay/notify",
|
|
|
- // "orderAmount": this.count * this.currentPresentSum,
|
|
|
- // "orderId": orderId,
|
|
|
- // "payWay": "WECHAT_OFFIACCOUNT",
|
|
|
- // "redirectUrl": "",
|
|
|
- // "scene": "OFFLINE",
|
|
|
- // "uniqueOrderNo": "",
|
|
|
- // "userId": uni.getStorageSync("openid"),
|
|
|
- // "userIp": "127.0.0.1"
|
|
|
- // }
|
|
|
- ));
|
|
|
- this.toPay(orderInfo.prePayTn);
|
|
|
- // _this.$u.api.boost.billRecord({
|
|
|
- // userId: _this.senderId,
|
|
|
- // orderId:orderId,
|
|
|
- // payPath: encodeURIComponent(window.location.href),
|
|
|
- // openId: uni.getStorageSync("openid"),
|
|
|
- // activityId: _this.activityId,
|
|
|
- // price: _this.count * _this.currentPresentSum,
|
|
|
- // presentId: _this.boostDetail.presentList[_this.current].id,
|
|
|
- // presentCount: _this.count,
|
|
|
- // relationId: _this.receiverId,
|
|
|
- // type: 2,
|
|
|
- // payStatus: 0,
|
|
|
- // }).then(res=>{
|
|
|
- // if(typeof orderInfo.prePayTn != 'undefined' ){
|
|
|
- // //调起支付
|
|
|
- // this.toPay(JSON.parse(orderInfo.prePayTn));
|
|
|
- // }
|
|
|
- // })
|
|
|
+ if (this.$u.test.isEmpty(this.senderId)) {
|
|
|
+ let path = 'pages/activityList/activity/authorBoost?activityId=' + this.activityId + '&receiverId=' + this.receiverId;
|
|
|
+ window.location.href = authUrl(path);
|
|
|
+ } else {
|
|
|
+ this.orderId = new Date().getTime();
|
|
|
+ let orderInfo = (await this.$u.api.yeePay.initOrder(
|
|
|
+ {
|
|
|
+ "channel": "ALIPAY",
|
|
|
+ "goodsName": this.boostDetail.presentList[this.current].name,
|
|
|
+ "notifyUrl": "1",
|
|
|
+ "orderAmount": this.count * this.currentPresentSum,
|
|
|
+ "orderId": this.orderId,
|
|
|
+ "payWay": "USER_SCAN",
|
|
|
+ "scene": "OFFLINE",
|
|
|
+ "userIp": "127.0.0.1"
|
|
|
+ }
|
|
|
+ ));
|
|
|
+ _this.$u.api.boost.billRecord({
|
|
|
+ userId: _this.senderId,
|
|
|
+ orderId: this.orderId,
|
|
|
+ payPath: encodeURIComponent(window.location.href),
|
|
|
+ openId: "",
|
|
|
+ activityId: _this.activityId,
|
|
|
+ price: _this.count * _this.currentPresentSum,
|
|
|
+ presentId: _this.boostDetail.presentList[_this.current].id,
|
|
|
+ presentCount: _this.count,
|
|
|
+ relationId: _this.receiverId,
|
|
|
+ type: 2,
|
|
|
+ payStatus: 0,
|
|
|
+ }).then(res=>{
|
|
|
+ if(typeof orderInfo.prePayTn != 'undefined' ){
|
|
|
+ //调起支付
|
|
|
+ this.toPay(orderInfo.prePayTn);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//获取助力详情
|
|
|
getBoostDetail(activityId, receiverId) {
|
|
|
@@ -363,18 +364,21 @@
|
|
|
// this.type = "分享到朋友圈"
|
|
|
},
|
|
|
toPay(info) {
|
|
|
- // console.log(info,456789);
|
|
|
- // let _this = this;
|
|
|
- // WeixinJSBridge.invoke('getBrandWCPayRequest', info, (res) => {
|
|
|
- // if (res.err_msg == "get_brand_wcpay_request:ok" ) {
|
|
|
- // _this.successShow = true;
|
|
|
- // } else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
|
|
- // console.log("cancel");
|
|
|
- // } else {
|
|
|
- // console.log(res.err_msg);
|
|
|
- // }
|
|
|
- // });
|
|
|
location.href = `alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=${info}`;
|
|
|
+ this.dialogShow = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.payShow = true;
|
|
|
+ }, 3000)
|
|
|
+ },
|
|
|
+ async checkPayInterval() {
|
|
|
+ this.payShow = false;
|
|
|
+ let res = await this.$u.api.boost.billRecordDetail({orderId: this.orderId})
|
|
|
+ if (res && res.payStatus == 1) {
|
|
|
+ this.successShow = true;
|
|
|
+ this.getBoostDetail(this.activityId, this.receiverId);
|
|
|
+ } else {
|
|
|
+ this.errorShow = true;
|
|
|
+ }
|
|
|
},
|
|
|
presentBoost(id) {
|
|
|
this.$u.api.boost.presentDetail({id: id}).then(res => {
|