Commit 14f930e8 authored by jyx's avatar jyx

添加ios钻石支付

parent ac4bd3f7
<template>
<view>
<uni-popup type="bottom" ref="coinPop" :maskClick="false" :isMaskClick="false">
<view style="position: relative;">
<view v-if="agreeFlag"
style="width: 100%;height: 100%;background-color: black;opacity: 0.8;display: flex;position: absolute;z-index: 100;color: white;flex-direction: column;align-items: center;padding:40rpx 0;">
<text style="font-size: 30rpx;">
付费须知 \n
1、看点和会员属于虚拟商品,一经购买不可退换 \n
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;\n
3、充值看点一般5分钟内到账,如未到账请在“我的”页面联系客服;
</text>
<image @click="agreeFlag=false" style="width: 30rpx;height: 30rpx;margin-top:150rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
<view class="body" style="width: 100%;height: 100%;">
<scroll-view scroll-y>
<view style="display: flex;flex-direction: column;align-items: flex-end;">
<view style="display: flex;flex-direction: row;">
<view @click="handleAgree" style="margin-top: 12rpx;margin-right: 10rpx;">付费须知></view>
<image @click="handleClickClose"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin-top: 20rpx;margin-right: 20rpx;margin-bottom: 10rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
</view>
<view style="display: flex;flex-direction: column;margin-bottom: 20rpx;padding-left: 14rpx;">
<view style="font-size: 38rpx;color: black;">{{titleText}}</view>
<view class="flex">
<view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本集需:</view>
<view style="font-size: 42rpx;color: red;font-weight: 777;">{{point}}</view>
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;">
看点,
</view>
</view>
<view v-if="point>0" style="width: 60rpx;"></view>
<view style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">当前账户余额:</view>
<view style="font-size: 42rpx;color: red;font-weight: 777;">{{userBean.point}}
</view>
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;">
看点
</view>
</view>
</view>
</view>
<view class="section">
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row">
{{item.firstPayPrice}}
</view>
<view class="name row" v-if="item.title!=null&&item.title!=''">
{{item.title}}
</view>
<view class="origin row" v-if="item.remarks!=null&&item.remarks!=''">
{{item.remarks}}
</view>
</view>
<view class="cut-down" v-if='item.topTitle!=null&&item.topTitle.length>0'>
{{item.topTitle}}
</view>
<view v-if="index==selectedIndex" style="position: absolute;bottom: 0;right: 0;">
<image mode="scaleToFill"
style="width: 100rpx;height: 100rpx;display: flex;align-items: right;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_loading.gif">
</image>
</view>
</view>
</view>
</view>
<view style="display: flex;flex-direction: column;align-items: center;">
<view @click="onVip"
style="font-size: 34rpx;color: black;margin-top: 16rpx;margin-bottom: 10rpx;">
更多充值及说明 ></view>
</view>
<view style="display: flex;flex-direction: column;align-items: center;">
<view style="font-size: 29rpx;color: gray;margin-top: 16rpx;">
客服时间工作日 9:00-18:00</view>
<button class="button2" open-type="im" data-im-id="578292405">在线客服</button>
</view>
</scroll-view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
navigateTo,
message,
loading
} from '@/utils/fun.js';
export default {
name: 'coinPopup',
mixins: [common],
props: {
show: {
type: Boolean,
default: false
},
point: {
type: [Number, String],
default: 0
},
vedioId: {
type: [Number, String],
default: 0
}
},
data() {
return {
vipList: [],
selectedIndex: 0,
agreeFlag: false,
userBean: {},
os: 'android',
titleText: '解锁剧集',
showClone: false
};
},
methods: {
// 支付完成回调
paySuccess(largeType) {
this.$emit('paySuccess', largeType);
this.handleClose();
},
handleShow() {
let that = this;
this.$refs.coinPop.open('bottom');
if (tt.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
this.post({
url: '/vip/getVipProducts/point',
data: {
vedioId: that.point <= 0 ? null : that.vedioId
},
showLoading: false,
success: ({
data
}) => {
this.vipList = data.list;
if (data.list != null) {
// this.selectedIndex = data.list[0].activityType;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
this.selectedIndex = i;
break;
}
}
}
}
});
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
}
});
},
handleAgree() {
this.agreeFlag = true
},
handleClickClose() {
this.$refs.coinPop.close('bottom');
this.$emit('clickClose');
this.$emit('close');
},
handleClose() {
this.$refs.coinPop.close('bottom');
this.$emit('close');
},
choosePack(item, index) {
this.selectedIndex = index;
this.handlePay();
},
handlePay() {
if (this.os == 'ios') {
message.notify('暂不支持ios支付');
return
}
let that = this;
let vipBean = this.vipList[this.selectedIndex];
this.post({
url: '/vip/getVipPayParams/douyin',
data: {
vedioId: that.point <= 0 ? null : that.vedioId,
os: that.os,
pid: vipBean.pid
},
showLoading: true,
success: ({
data
}) => {
that.ttPrePay(data, vipBean.largeType);
}
});
},
onVip() {
navigateTo(`/pagesA/vipPay/vipPay`)
this.handleClose();
},
ttPrePay(ttData, largeType) {
if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本');
return
}
let that = this;
tt.requestOrder({
data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization,
success(res) {
that.ttPay(largeType, res.orderId, ttData);
},
fail(res) {
// message.notify(res.errMsg);
},
});
},
ttPay(largeType, oid, ttData) {
if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本');
return
}
let that = this;
if (this.os == 'ios') {
if (!tt.canIUse('getOrderPayment.object.imId')) {
message.notify('请升级抖音APP版本');
return
}
if (ttData.imId == null) {
message.notify('暂不支付ios支付,请更换设备');
return
}
tt.getOrderPayment({
orderId: oid,
imId: ttData.imId,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
if (res.errNo == '4') {
// 4-支付取消
}
// message.notify(res.errMsg);
},
});
} else {
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
if (res.errNo == '4') {
// 4-支付取消
}
// message.notify(res.errMsg);
},
});
}
},
queryOrderStatus(largeType, tid) {
let that = this;
this.post({
data: {
tid: tid
},
url: '/vip/queryVipOrder',
showLoading: true,
success: ({
data
}) => {
that.paySuccess(largeType);
}
});
}
},
watch: {
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
}
},
immediate: true
}
}
};
</script>
<style lang="scss">
.body {
padding: 10rpx 0 30rpx 0;
border-radius: 20rpx 20rpx 0 0;
background-color: white;
display: flex;
flex-direction: column;
align-items: center;
}
.section {
display: flex;
flex-direction: column;
background: white;
}
.pack-box {
margin-top: 25rpx;
margin-left: 18rpx;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
.active {
border: 6rpx solid #fd5350 !important;
}
.pack-item {
margin-bottom: 25rpx;
margin-right: 22rpx;
width: calc(45%);
height: 190rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
// background: #f5f5f5;
border: 6rpx solid #f5f5f5;
border-radius: 10rpx;
position: relative;
.row {
margin: 8rpx 15rpx;
margin-bottom: 1rpx;
}
.row:last-child {
margin-bottom: 8rpx;
}
.name {
font-size: 29rpx;
color: #333;
}
.price {
font-size: 40rpx;
color: #fd5350;
font-weight: 700;
}
.origin {
color: #5A3C0F;
// background: #5a1505;
background-image: linear-gradient(90deg, #F3DEBE, #EAC180);
font-size: 22rpx;
border-radius: 20rpx;
height: 30rpx;
line-height: 30rpx;
padding-top: 4rpx;
padding-bottom: 3rpx;
padding-left: 16rpx;
padding-right: 16rpx;
}
.cut-down {
position: absolute;
top: 0;
color: #fff;
background: #ff502f;
font-size: 22rpx;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding-top: 6rpx;
padding-bottom: 3rpx;
padding-left: 16rpx;
padding-right: 16rpx;
transform: translate(0, -50%);
}
}
}
.button2 {
width: 300rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
margin: 10rpx 20rpx;
border-radius: 10rpx;
background-color: white;
border: 1px orange solid;
color: orange;
font-size: 26rpx;
box-shadow: 0 0 2px 0px rgba(255, 255, 255, 0.1);
}
<template>
<view>
<uni-popup type="bottom" ref="coinPop" :maskClick="false" :isMaskClick="false">
<view style="position: relative;">
<view v-if="agreeFlag"
style="width: 100%;height: 100%;background-color: black;opacity: 0.8;display: flex;position: absolute;z-index: 100;color: white;flex-direction: column;align-items: center;padding:40rpx 0;">
<text style="font-size: 30rpx;">
付费须知 \n
1、看点和会员属于虚拟商品,一经购买不可退换 \n
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;\n
3、充值看点一般5分钟内到账,如未到账请在“我的”页面联系客服;
</text>
<image @click="agreeFlag=false" style="width: 30rpx;height: 30rpx;margin-top:150rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
<view class="body" style="width: 100%;height: 100%;">
<scroll-view scroll-y>
<view style="display: flex;flex-direction: column;align-items: flex-end;">
<view style="display: flex;flex-direction: row;">
<view @click="handleAgree" style="margin-top: 12rpx;margin-right: 10rpx;">付费须知></view>
<image @click="handleClickClose"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin-top: 20rpx;margin-right: 20rpx;margin-bottom: 10rpx;"
src="@/static/index/ic_quit_white.png"></image>
</view>
</view>
<view style="display: flex;flex-direction: column;margin-bottom: 20rpx;padding-left: 14rpx;">
<view style="font-size: 38rpx;color: black;">{{titleText}}</view>
<view class="flex">
<view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本集需:</view>
<view style="font-size: 42rpx;color: red;font-weight: 777;">{{point}}</view>
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;">
看点,
</view>
</view>
<view v-if="point>0" style="width: 60rpx;"></view>
<view style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">当前账户余额:</view>
<view style="font-size: 42rpx;color: red;font-weight: 777;">{{userBean.point}}
</view>
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;margin-left: 6rpx;">
看点
</view>
</view>
</view>
</view>
<view class="section">
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f5f5f5;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList'
:key='index' @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-if="os=='android'" class="price row">
{{item.firstPayPrice}}
</view>
<view v-else style="display: flex;align-items: center;font-size: 40rpx;
color: #f2b068;
font-weight: 700;">
<image style="width: 50rpx;height: 50rpx;display: flex;margin-right: 10rpx;"
src="@/static/ic_zuan.png">
</image>
+{{multiply(item.firstPayPrice)}}
</view>
<view class="name row" v-if="item.title!=null&&item.title!=''">
{{item.title}}
</view>
<view class="origin row" v-if="item.remarks!=null&&item.remarks!=''">
{{item.remarks}}
</view>
</view>
<view class="cut-down" v-if='item.topTitle!=null&&item.topTitle.length>0'>
{{item.topTitle}}
</view>
<view v-if="index==selectedIndex" style="position: absolute;bottom: 0;right: 0;">
<image mode="scaleToFill"
style="width: 100rpx;height: 100rpx;display: flex;align-items: right;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_loading.gif">
</image>
</view>
</view>
</view>
</view>
<view style="display: flex;flex-direction: column;align-items: center;">
<view @click="onVip"
style="font-size: 34rpx;color: black;margin-top: 16rpx;margin-bottom: 10rpx;">
更多充值及说明 ></view>
</view>
<view style="display: flex;flex-direction: column;align-items: center;">
<view style="font-size: 29rpx;color: gray;margin-top: 16rpx;">
客服时间工作日 9:00-18:00</view>
<button class="button2" open-type="im" data-im-id="kaixinhaha7785">在线客服</button>
</view>
</scroll-view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import common from '@/mixins/common';
import {
navigateTo,
message,
loading
} from '@/utils/fun.js';
export default {
name: 'coinPopup',
mixins: [common],
props: {
show: {
type: Boolean,
default: false
},
point: {
type: [Number, String],
default: 0
},
vedioId: {
type: [Number, String],
default: 0
}
},
data() {
return {
vipList: [],
selectedIndex: 0,
agreeFlag: false,
userBean: {},
os: 'android',
titleText: '解锁剧集',
showClone: false
};
},
methods: {
multiply(num) {
return parseInt(num * 10);
},
// 支付完成回调
paySuccess(largeType) {
this.$emit('paySuccess', largeType);
this.handleClose();
},
handleShow() {
let that = this;
this.$refs.coinPop.open('bottom');
if (tt.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
this.post({
url: '/vip/getVipProducts/point',
data: {
vedioId: that.point <= 0 ? null : that.vedioId
},
showLoading: false,
success: ({
data
}) => {
this.vipList = data.list;
if (data.list != null) {
// this.selectedIndex = data.list[0].activityType;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
this.selectedIndex = i;
break;
}
}
}
}
});
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
}
});
},
handleAgree() {
this.agreeFlag = true
},
handleClickClose() {
this.$refs.coinPop.close('bottom');
this.$emit('clickClose');
this.$emit('close');
},
handleClose() {
this.$refs.coinPop.close('bottom');
this.$emit('close');
},
choosePack(item, index) {
this.selectedIndex = index;
this.handlePay();
},
handlePay() {
let that = this;
let vipBean = this.vipList[this.selectedIndex];
this.post({
url: '/vip/getVipPayParams/douyin',
data: {
vedioId: that.point <= 0 ? null : that.vedioId,
os: that.os,
pid: vipBean.pid
},
showLoading: true,
success: ({
data
}) => {
that.ttPrePay(data, vipBean.largeType);
}
});
},
onVip() {
navigateTo(`/pagesA/vipPay/vipPay`)
this.handleClose();
},
ttPrePay(ttData, largeType) {
if (!tt.canIUse('requestOrder')) {
message.notify('请升级抖音APP版本');
return
}
let that = this;
tt.requestOrder({
data: ttData.params.data,
byteAuthorization: ttData.params.byteAuthorization,
success(res) {
that.ttPay(largeType, res.orderId, ttData);
},
fail(res) {
// message.notify(res.errMsg);
},
});
},
ttPay(largeType, oid, ttData) {
if (!tt.canIUse('getOrderPayment')) {
message.notify('请升级抖音APP版本');
return
}
let that = this;
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
if (res.errNo == '4') {
// 4-支付取消
}
// message.notify(res.errMsg);
},
});
},
queryOrderStatus(largeType, tid) {
let that = this;
this.post({
data: {
tid: tid
},
url: '/vip/queryVipOrder',
showLoading: true,
success: ({
data
}) => {
that.paySuccess(largeType);
}
});
}
},
watch: {
show: {
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
}
},
immediate: true
}
}
};
</script>
<style lang="scss">
.body {
padding: 10rpx 0 30rpx 0;
border-radius: 20rpx 20rpx 0 0;
background-color: white;
display: flex;
flex-direction: column;
align-items: center;
}
.section {
display: flex;
flex-direction: column;
background: white;
}
.pack-box {
margin-top: 25rpx;
margin-left: 18rpx;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
.active {
border: 6rpx solid #fd5350 !important;
}
.pack-item {
margin-bottom: 25rpx;
margin-right: 22rpx;
width: calc(45%);
height: 190rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
// background: #f5f5f5;
border: 6rpx solid #f5f5f5;
border-radius: 10rpx;
position: relative;
.row {
margin: 8rpx 15rpx;
margin-bottom: 1rpx;
}
.row:last-child {
margin-bottom: 8rpx;
}
.name {
font-size: 29rpx;
color: #333;
}
.price {
font-size: 40rpx;
color: #fd5350;
font-weight: 700;
}
.origin {
color: #5A3C0F;
// background: #5a1505;
background-image: linear-gradient(90deg, #F3DEBE, #EAC180);
font-size: 22rpx;
border-radius: 20rpx;
height: 30rpx;
line-height: 30rpx;
padding-top: 4rpx;
padding-bottom: 3rpx;
padding-left: 16rpx;
padding-right: 16rpx;
}
.cut-down {
position: absolute;
top: 0;
color: #fff;
background: #ff502f;
font-size: 22rpx;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding-top: 6rpx;
padding-bottom: 3rpx;
padding-left: 16rpx;
padding-right: 16rpx;
transform: translate(0, -50%);
}
}
}
.button2 {
width: 300rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
margin: 10rpx 20rpx;
border-radius: 10rpx;
background-color: white;
border: 1px orange solid;
color: orange;
font-size: 26rpx;
box-shadow: 0 0 2px 0px rgba(255, 255, 255, 0.1);
}
</style>
\ No newline at end of file
......@@ -5,15 +5,24 @@
<view class="section">
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f5f5f5;'"
:class="[{active: index==selectedIndex}]" v-for='(item, index) in pointList' :key='index'
@click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row">
<view v-if="os=='android'" class="price row">
{{item.firstPayPrice}}
</view>
<view v-else style="display: flex;align-items: center;font-size: 40rpx;
color: #f2b068;
font-weight: 700;">
<image style="width: 50rpx;height: 50rpx;display: flex;margin-right: 10rpx;"
src="@/static/ic_zuan.png">
</image>
+{{multiply(item.firstPayPrice)}}
</view>
<view class="name row" v-if="item.title!=null&&item.title!=''">
{{item.title}}
</view>
......@@ -41,15 +50,24 @@
<view class="section">
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f5f5f5;'"
:class="[{active: index==selectedVipIndex}]" v-for='(item, index) in vipList' :key='index'
@click="choosePack2(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row">
<view v-if="os=='android'" class="price row">
{{item.firstPayPrice}}
</view>
<view v-else style="display: flex;align-items: center;font-size: 40rpx;
color: #f2b068;
font-weight: 700;">
<image style="width: 50rpx;height: 50rpx;display: flex;margin-right: 10rpx;"
src="@/static/ic_zuan.png">
</image>
+{{multiply(item.firstPayPrice)}}
</view>
<view class="name row" v-if="item.title!=null&&item.title!=''">
{{item.title}}
</view>
......@@ -89,13 +107,13 @@
{{ btnText }}
</text>
</view>
</view>
<view class="box-wrap" @click="handleKefu">
<image src="../../static/ic_service.png"></image>
<text>客服时间</text>
<text>工作日9:00-18:00</text>
</view>
</view>
<view class="box-wrap" @click="handleKefu">
<image src="../../static/ic_service.png"></image>
<text>客服时间</text>
<text>工作日9:00-18:00</text>
</view>
<kefu-popup :show="showKefuPop" @close="showKefuPop = false" />
</view>
</template>
......@@ -125,90 +143,118 @@
selectedVipIndex: -1,
btnText: '',
userBean: {},
os: 'android',
showKefuPop:false
os: 'android',
showKefuPop: false
}
},
onLoad(options) {
let that = this;
if (tt.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
}
});
this.post({
url: '/vip/getVipProducts',
showLoading: false,
success: ({
data
}) => {
if (data.list != null && data.list.length > 0) {
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].largeType == 'point') {
that.pointList.push(data.list[i]);
} else {
that.vipList.push(data.list[i]);
}
}
}
if (that.pointList != null && that.pointList.length > 0) {
for (let i = 0; i < that.pointList.length; i++) {
if (that.pointList[i].activityType == 1) {
that.selectedIndex = i;
let cashStr = that.pointList[i].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.pointList[i].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[i]
.yhqRateBalance)).toNumber()
},
onLoad(options) {
let that = this;
if (tt.getSystemInfoSync().platform === 'ios') {
this.os = 'ios';
}
this.post({
url: '/user/baseMsg',
showLoading: false,
success: ({
data
}) => {
this.userBean = data;
}
});
this.post({
url: '/vip/getVipProducts',
showLoading: false,
success: ({
data
}) => {
if (data.list != null && data.list.length > 0) {
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].largeType == 'point') {
that.pointList.push(data.list[i]);
} else {
that.vipList.push(data.list[i]);
}
}
}
if (that.pointList != null && that.pointList.length > 0) {
for (let i = 0; i < that.pointList.length; i++) {
if (that.pointList[i].activityType == 1) {
that.selectedIndex = i;
let cashStr = that.pointList[i].firstPayPrice
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(cashStr) + "钻石"
} else {
that.btnText = "立即支付" + cashStr + "元"
}
if (that.pointList[i].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[i]
.yhqRateBalance)).toNumber()
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(that.pointList[i]
.yhqRateBalance) + "钻石,已优惠" +
that.multiply(tempYhq) + "钻石"
} else {
that.btnText = "立即支付" + that.pointList[i].yhqRateBalance + "元,已优惠" +
tempYhq + "元"
}
}
if (that.pointList[i].weixin) {
that.wxShowFlag = true
that.isZfb = false
} else {
that.wxShowFlag = false
that.isZfb = true
}
break;
}
}
}
if (that.pointList != null && that.pointList.length > 0 && that.selectedIndex == 0) {
let cashStr = that.pointList[0].firstPayPrice
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(cashStr) + "钻石"
} else {
that.btnText = "立即支付" + cashStr + "元"
}
if (that.pointList[0].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[0]
.yhqRateBalance)).toNumber()
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(that.pointList[i]
.yhqRateBalance) + "钻石,已优惠" +
that.multiply(tempYhq) + "钻石"
} else {
that.btnText = "立即支付" + that.pointList[i].yhqRateBalance + "元,已优惠" +
tempYhq + "元"
}
if (that.pointList[i].weixin) {
that.wxShowFlag = true
that.isZfb = false
} else {
that.wxShowFlag = false
that.isZfb = true
}
break;
}
}
}
if (that.pointList != null && that.pointList.length > 0 && that.selectedIndex == 0) {
let cashStr = that.pointList[0].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.pointList[0].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[0]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[0].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
}
if (that.pointList[0].weixin) {
that.wxShowFlag = true
that.isZfb = false
} else {
that.wxShowFlag = false
that.isZfb = true
}
}
}
});
}
}
if (that.pointList[0].weixin) {
that.wxShowFlag = true
that.isZfb = false
} else {
that.wxShowFlag = false
that.isZfb = true
}
}
}
});
},
methods: {
multiply(num) {
return parseInt(num * 10);
},
loadData() {
},
dialogClose() {
this.$refs.alertDialog.close();
......@@ -220,21 +266,42 @@
// this.handlePay();
if (this.selectedIndex == -1) {
// vip充值
let cashStr = this.vipList[this.selectedVipIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
let cashStr = this.vipList[this.selectedVipIndex].firstPayPrice
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(cashStr) + "钻石"
} else {
that.btnText = "立即支付" + cashStr + "元"
}
if (that.vipList[this.selectedVipIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.vipList[this.selectedVipIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.vipList[this.selectedVipIndex].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
.yhqRateBalance)).toNumber()
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(that.vipList[selectedVipIndex]
.yhqRateBalance) + "钻石,已优惠" +
that.multiply(tempYhq) + "钻石"
} else {
that.btnText = "立即支付" + that.vipList[this.selectedVipIndex].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
}
}
} else {
let cashStr = this.pointList[this.selectedIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(cashStr) + "钻石"
} else {
that.btnText = "立即支付" + cashStr + "元"
}
if (that.pointList[this.selectedIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[this.selectedIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[this.selectedIndex].yhqRateBalance + "元,已优惠" + tempYhq + "元"
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(that.pointList[this.selectedIndex].yhqRateBalance) + "钻石,已优惠" +
that.multiply(tempYhq) + "钻石"
} else {
that.btnText = "立即支付" + that.pointList[this.selectedIndex].yhqRateBalance + "元,已优惠" + tempYhq + "元"
}
}
}
},
......@@ -246,20 +313,40 @@
if (this.selectedIndex == -1) {
// vip充值
let cashStr = this.vipList[this.selectedVipIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(cashStr) + "钻石"
} else {
that.btnText = "立即支付" + cashStr + "元"
}
if (that.vipList[this.selectedVipIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.vipList[this.selectedVipIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.vipList[this.selectedVipIndex].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
.yhqRateBalance)).toNumber()
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(that.vipList[selectedVipIndex]
.yhqRateBalance) + "钻石,已优惠" +
that.multiply(tempYhq) + "钻石"
} else {
that.btnText = "立即支付" + that.vipList[this.selectedVipIndex].yhqRateBalance + "元,已优惠" + tempYhq +
"元"
}
}
} else {
let cashStr = this.pointList[this.selectedIndex].firstPayPrice
that.btnText = "立即支付" + cashStr + "元"
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(cashStr) + "钻石"
} else {
that.btnText = "立即支付" + cashStr + "元"
}
if (that.pointList[this.selectedIndex].yhqRateBalance != null) {
let tempYhq = new Decimal(cashStr).sub(new Decimal(that.pointList[this.selectedIndex]
.yhqRateBalance)).toNumber()
that.btnText = "立即支付" + that.pointList[this.selectedIndex].yhqRateBalance + "元,已优惠" + tempYhq + "元"
if (that.os == 'ios') {
that.btnText = "立即支付" + that.multiply(that.pointList[this.selectedIndex].yhqRateBalance) + "钻石,已优惠" +
that.multiply(tempYhq) + "钻石"
} else {
that.btnText = "立即支付" + that.pointList[this.selectedIndex].yhqRateBalance + "元,已优惠" + tempYhq + "元"
}
}
}
},
......@@ -274,11 +361,6 @@
// this.$refs.alertDialog.open();
},
handlePay() {
if (this.os == 'ios') {
message.notify('暂不支持ios支付');
return
}
let that = this;
let vipBean = this.pointList[this.selectedIndex];
if (this.selectedIndex == -1) {
......@@ -326,36 +408,16 @@
}
let that = this;
if (this.os == 'ios') {
if (!tt.canIUse('getOrderPayment.object.imId')) {
message.notify('请升级抖音APP版本.');
return
}
tt.getOrderPayment({
orderId: oid,
imId: ttData.imId,
immediate: true,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('ios=ttPay res.errMsg', res)
// message.notify(res.errMsg);
},
});
} else {
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('android=ttPay res.errMsg', res)
// message.notify(res.errMsg);
},
});
}
tt.getOrderPayment({
orderId: oid,
success(res) {
that.queryOrderStatus(largeType, ttData.tidStr);
},
fail(res) {
console.log('android=ttPay res.errMsg', res)
// message.notify(res.errMsg);
},
});
},
queryOrderStatus(largeType, tid) {
let that = this;
......@@ -480,24 +542,24 @@
color: white;
font-size: 26rpx;
margin-bottom: 40rpx;
}
.box-wrap {
position: absolute;
bottom: 20%;
right: 6%;
z-index: 999;
display: flex;
flex-direction: column;
align-items: center;
image {
width: 100rpx;
height: 100rpx;
}
text {
color: #2c2c2c;
}
}
.box-wrap {
position: absolute;
bottom: 20%;
right: 6%;
z-index: 999;
display: flex;
flex-direction: column;
align-items: center;
image {
width: 100rpx;
height: 100rpx;
}
text {
color: #2c2c2c;
}
}
</style>
\ No newline at end of file
......@@ -11,7 +11,15 @@
<view style="font-size: 26rpx;color: gray;margin-top: 16rpx;">付款时间:{{item.createtime}}</view>
<view style="font-size: 26rpx;color: gray;margin-top: 1rpx;">订单编号:{{item.orderid}}</view>
</view>
<view style="display: flex;align-items: center;margin-right: 8rpx;font-size: 36rpx;color: red;">
<view v-if="item.detailChannel=='DIAMOND'"
style="display: flex;align-items: center;margin-right: 8rpx;font-size: 36rpx;color: #f2b068;">
<image style="width: 50rpx;height: 50rpx;display: flex;margin-right: 10rpx;"
src="@/static/ic_zuan.png">
</image>
{{multiply(item.balance)}}
</view>
<view v-else
style="display: flex;align-items: center;margin-right: 8rpx;font-size: 36rpx;color: red;">
{{item.balance}}
</view>
</view>
......@@ -35,8 +43,8 @@
mixins: [common],
data() {
return {
dataList: [],
showKefuPop:false
dataList: [],
showKefuPop: false
};
},
methods: {
......@@ -44,6 +52,9 @@
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
},
multiply(num) {
return parseInt(num * 10);
},
queryList(page, size) {
this.post({
......
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