Commit 6abbc877 authored by mengcuiguang's avatar mengcuiguang

添加ios支付及标记

parent f831908c
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
<script> <script>
import common from '@/mixins/common'; import common from '@/mixins/common';
import { import {
message message,
alert
} from '@/utils/fun'; } from '@/utils/fun';
export default { export default {
name: 'coinPopup', name: 'coinPopup',
...@@ -98,6 +99,7 @@ ...@@ -98,6 +99,7 @@
title: '超多精彩好剧一键解锁', title: '超多精彩好剧一键解锁',
userBean: {}, userBean: {},
showClone: false, showClone: false,
os: 'android',
isFirstPayFlag: false, isFirstPayFlag: false,
popType: 'bottom', popType: 'bottom',
showAnim: true showAnim: true
...@@ -115,6 +117,9 @@ ...@@ -115,6 +117,9 @@
}, },
handleShow() { handleShow() {
let that = this; let that = this;
if (wx.getSystemInfoSync().platform == 'ios') {
this.os = 'ios'
}
that.post({ that.post({
url: '/vip/getVipProducts/point', url: '/vip/getVipProducts/point',
...@@ -197,21 +202,55 @@ ...@@ -197,21 +202,55 @@
// 符合首充 // 符合首充
vipBean = this.firstPayList[0]; vipBean = this.firstPayList[0];
} }
if(this.os=='ios'){
this.post({ this.post({
url: '/vip/getVipPayParams/xpay', url: '/vip/getVipPayParams',
data: { data: {
vedioId: that.point <= 0 ? null : that.vedioId, vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid, pid: vipBean.pid,
payChannel: 'WEIXIN' payChannel: 'WEIXIN'
}, },
showLoading: true, showLoading: true,
success: ({ success: ({
data data
}) => { }) => {
that.wxVirtuallyPay(data, vipBean.largeType); 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,
success: ({
data
}) => {
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) { wxVirtuallyPay(wxData, largeType) {
// 虚拟支付 // 虚拟支付
...@@ -233,6 +272,10 @@ ...@@ -233,6 +272,10 @@
errMsg, errMsg,
errCode errCode
}) { }) {
alert({
content: 'errCode=' + errCode + ' errMsg=' + errMsg
});
if (that.isFirstPayFlag && errCode == -2) { if (that.isFirstPayFlag && errCode == -2) {
// 符合首充 // 符合首充
that.handleClose() that.handleClose()
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </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;"> 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="display: flex;flex-direction: column;justify-content: center;">
<view style="font-size: 36rpx;color: #5b1500;font-weight: 777;"> <view style="font-size: 36rpx;color: #5b1500;font-weight: 777;">
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png" mode="scaleToFill"></image> src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png" mode="scaleToFill"></image>
</view> </view>
<view v-if="os === 'android' " <view v-if="os === 'ios' && xxxPayFlag "
style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;"> style="display: flex;height: 200rpx;margin: 20rpx;background: #f5ca86;border-radius: 20rpx;">
<view style="flex-grow: 2; margin-left: 20rpx;"> <view style="flex-grow: 2; margin-left: 20rpx;">
<view <view
...@@ -67,15 +67,15 @@ ...@@ -67,15 +67,15 @@
<view class="infobg" style="margin: 20rpx;"> <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 class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</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 class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</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 class="item_bd ellipsis" style="margin-left: 58rpx;"></view>
</view> </view>
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
statusBarHeight: app.globalData.statusBarHeight, statusBarHeight: app.globalData.statusBarHeight,
userBean: {}, userBean: {},
showAnimate: false, showAnimate: false,
xxxPayFlag: false,
windowHeight: 0, windowHeight: 0,
os: 'android', os: 'android',
versionName: app.globalData.versionName, versionName: app.globalData.versionName,
...@@ -146,6 +147,7 @@ ...@@ -146,6 +147,7 @@
data data
}) => { }) => {
this.userBean = data; this.userBean = data;
this.xxxPayFlag = data.xxxPayFlag;
} }
}); });
}, },
......
...@@ -150,6 +150,7 @@ ...@@ -150,6 +150,7 @@
windowHeight: 0, windowHeight: 0,
current: 0, // swiper 下标 current: 0, // swiper 下标
oid: 0, oid: 0,
xxxPayFlag: false,
isplay: true, //是否自动播放下一个视频 isplay: true, //是否自动播放下一个视频
duration: 500, duration: 500,
isqp: false, isqp: false,
...@@ -183,6 +184,16 @@ ...@@ -183,6 +184,16 @@
this.windowHeight = uni.getSystemInfoSync().windowHeight - this.safeArea - this.ttuop this.windowHeight = uni.getSystemInfoSync().windowHeight - this.safeArea - this.ttuop
console.log(this.windowHeight) console.log(this.windowHeight)
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.xxxPayFlag = data.xxxPayFlag;
}
});
this.getData() this.getData()
}, },
onShow() { onShow() {
...@@ -205,16 +216,19 @@ ...@@ -205,16 +216,19 @@
} }
}, },
showPayDialog() { showPayDialog() {
let isIOS = wx.getSystemInfoSync().platform; if (!this.xxxPayFlag) {
if (isIOS === 'ios') { let isIOS = wx.getSystemInfoSync().platform;
uni.showToast({ if (isIOS === 'ios') {
title: '暂不支持IOS系统', uni.showToast({
icon: 'none' title: '暂不支持IOS系统',
}) icon: 'none'
})
return return
}
} }
this.$nextTick(() => { this.$nextTick(() => {
// 延迟渲染,否则位置错乱 // 延迟渲染,否则位置错乱
this.showCoinPop = true this.showCoinPop = true
......
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