Commit 6abbc877 authored by mengcuiguang's avatar mengcuiguang

添加ios支付及标记

parent f831908c
......@@ -71,7 +71,8 @@
<script>
import common from '@/mixins/common';
import {
message
message,
alert
} from '@/utils/fun';
export default {
name: 'coinPopup',
......@@ -98,6 +99,7 @@
title: '超多精彩好剧一键解锁',
userBean: {},
showClone: false,
os: 'android',
isFirstPayFlag: false,
popType: 'bottom',
showAnim: true
......@@ -115,6 +117,9 @@
},
handleShow() {
let that = this;
if (wx.getSystemInfoSync().platform == 'ios') {
this.os = 'ios'
}
that.post({
url: '/vip/getVipProducts/point',
......@@ -197,12 +202,28 @@
// 符合首充
vipBean = this.firstPayList[0];
}
if(this.os=='ios'){
this.post({
url: '/vip/getVipPayParams',
data: {
vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid,
payChannel: 'WEIXIN'
},
showLoading: true,
success: ({
data
}) => {
that.wxPay(data, vipBean.largeType);
}
});
}else{
this.post({
url: '/vip/getVipPayParams/xpay',
data: {
vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid,
os: that.os,
payChannel: 'WEIXIN'
},
showLoading: true,
......@@ -212,6 +233,24 @@
that.wxVirtuallyPay(data, vipBean.largeType);
}
});
}
},
wxPay(wxData, largeType) {
let wxParams = wxData.params;
let that = this;
// 发起微信支付
wx.requestPayment({
timeStamp: wxParams.timeStamp,
nonceStr: wxParams.nonceStr,
package: wxParams.packageStr,
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
that.paySuccess(largeType);
},
fail(res) {}
})
},
wxVirtuallyPay(wxData, largeType) {
// 虚拟支付
......@@ -233,6 +272,10 @@
errMsg,
errCode
}) {
alert({
content: 'errCode=' + errCode + ' errMsg=' + errMsg
});
if (that.isFirstPayFlag && errCode == -2) {
// 符合首充
that.handleClose()
......
......@@ -12,7 +12,7 @@
</view>
<view v-if="userBean.showVipInner && os === 'android' "
<view v-if="os === 'ios' && xxxPayFlag "
style="display: flex;flex-direction: row;background: #f5ca86;margin: 20rpx;padding: 40rpx;border-radius:20rpx;align-items: center;justify-content:space-between;">
<view style="display: flex;flex-direction: column;justify-content: center;">
<view style="font-size: 36rpx;color: #5b1500;font-weight: 777;">
......@@ -38,7 +38,7 @@
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png" mode="scaleToFill"></image>
</view>
<view v-if="os === 'android' "
<view v-if="os === 'ios' && xxxPayFlag "
style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;">
<view style="flex-grow: 2; margin-left: 20rpx;">
<view
......@@ -67,15 +67,15 @@
<view class="infobg" style="margin: 20rpx;">
<view v-if="userBean.showVipInner && os === 'android' " class="item arrow" @click="handlePayRecord">
<view v-if="os === 'ios' && xxxPayFlag " class="item arrow" @click="handlePayRecord">
我的订单
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view v-if="os === 'android' " class="item arrow" @click="handleDotRecord">
<view v-if="os === 'ios' && xxxPayFlag " class="item arrow" @click="handleDotRecord">
看点记录
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
<view v-if="os === 'android' " class="item arrow" @click="handleUseDotRecord">
<view v-if="os === 'ios' && xxxPayFlag " class="item arrow" @click="handleUseDotRecord">
消费记录
<view class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view>
......@@ -127,6 +127,7 @@
statusBarHeight: app.globalData.statusBarHeight,
userBean: {},
showAnimate: false,
xxxPayFlag: false,
windowHeight: 0,
os: 'android',
versionName: app.globalData.versionName,
......@@ -146,6 +147,7 @@
data
}) => {
this.userBean = data;
this.xxxPayFlag = data.xxxPayFlag;
}
});
},
......
......@@ -150,6 +150,7 @@
windowHeight: 0,
current: 0, // swiper 下标
oid: 0,
xxxPayFlag: false,
isplay: true, //是否自动播放下一个视频
duration: 500,
isqp: false,
......@@ -183,6 +184,16 @@
this.windowHeight = uni.getSystemInfoSync().windowHeight - this.safeArea - this.ttuop
console.log(this.windowHeight)
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.xxxPayFlag = data.xxxPayFlag;
}
});
this.getData()
},
onShow() {
......@@ -205,6 +216,7 @@
}
},
showPayDialog() {
if (!this.xxxPayFlag) {
let isIOS = wx.getSystemInfoSync().platform;
if (isIOS === 'ios') {
uni.showToast({
......@@ -214,6 +226,8 @@
return
}
}
this.$nextTick(() => {
// 延迟渲染,否则位置错乱
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment