Commit e670a9f9 by sunchao

积分兑换添加判断授权接口

parent 920f239d
......@@ -288,5 +288,9 @@ export default {
// 退款
unifiedRefund(params){
return request(`${apiURL}/pay/unifiedRefund`, "POST", params)
},
//判断是否授权
isAuth(){
return request(`${apiURL}/aliPay/isAuth`, "POST", params)
}
}
......@@ -53,13 +53,11 @@
left: 50%;
width: 100%;
height: 70rpx;
border-top: 1px solid #f5f5f5;
border-top: 2rpx solid #f5f5f5;
background: #fff;
color: #333;
font-size: 12px;
min-width: 320px;
max-width: 640px;
padding-bottom: 20px;
font-size: 24rpx;
padding-bottom: 80rpx;
transform: translateX(-50%);
.menu_content{
display: flex;
......
<template>
</template>
<script>
</script>
<style>
</style>
\ No newline at end of file
......@@ -39,6 +39,7 @@
<courselist :tagIds="[1111]" :onlyShowList="0"></courselist>
</view>
<tabBar :currentPage="currentPage"></tabBar>
<!-- <view style="position: fixed;right: 0;top: 50%;" @click="tokefu()">在线客服</view> -->
</view>
<uni-popup ref="popup" type="top" background-color="#fff">
<view class="description">
......@@ -93,6 +94,9 @@
this.announcementQuery();
},
methods: {
tokefu(){
plus.runtime.openURL('http://q.url.cn/abkzV9?_type=wpa&qidian=true');
},
featureSelect(featureItem){
console.log(featureItem)
if(featureItem.isOpen && featureItem.link){
......
......@@ -118,67 +118,27 @@
},
//支付宝去提现
aliWithdrawal(){
this.aliWithdrawalResVO = {
...this.aliWithdrawalResVO,
orderNo:this.partnerTradeNo,
amount:this.exchangeAmount,
userId:uni.getStorageSync('cffp_userId'),
}
console.log(JSON.stringify(this.aliWithdrawalResVO))
api.aliWithdrawal(this.aliWithdrawalResVO).then((res)=>{
console.log(res)
if(res['success']){
if(res['data']['isAuth'] == 1){
// APP:
// #ifdef APP-PLUS
let urls= this.aliWithdrawalResVO.aliAuthUrl;
urls=encodeURIComponent(urls);
// 判断平台
if (plus.os.name == 'Android') {
plus.runtime.openURL(
'alipays://platformapi/startapp?appId=20000067&url=' + urls,
res => {
//这里写打开URL地址失败后的处理
console.log(res);
uni.showModal({
content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
success: function (res) {
if (res.confirm) {
//plus.runtime.openURL();
}
}
});
},
'com.eg.android.AlipayGphone'
);
} else if (plus.os.name == 'iOS') {
plus.runtime.openURL(
'alipay://platformapi/startapp?appId=20000067&url=' + urls,
res => {
console.log(res);
uni.showModal({
content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
success: function (res) {
if (res.confirm) {
//plus.runtime.openURL(url);
}
}
});
},
'com.eg.android.AlipayGphone'
);
uni.showModal({
content: '提现成功!',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
// #endif
}
});
}else{
uni.showModal({
content: res['message'],
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
......@@ -218,13 +178,74 @@
// #endif
},
confirmWithdrawal(){
if(this.paymentMethod == 1){
this.wxWithdrawal();
}
if(this.paymentMethod == 2){
this.aliWithdrawal();
this.aliWithdrawalResVO = {
...this.aliWithdrawalResVO,
orderNo:this.partnerTradeNo,
amount:this.exchangeAmount,
userId:uni.getStorageSync('cffp_userId'),
}
api.isAuth(this.aliWithdrawalResVO).then((res)=>{
if(res['success']){
if(res['data']['isAuth'] == 1){
if(this.paymentMethod == 1){
this.wxWithdrawal();
}
if(this.paymentMethod == 2){
// APP:
// #ifdef APP-PLUS
let urls= this.aliWithdrawalResVO.aliAuthUrl;
urls=encodeURIComponent(urls);
// 判断平台
if (plus.os.name == 'Android') {
plus.runtime.openURL(
'alipays://platformapi/startapp?appId=20000067&url=' + urls,
res => {
//这里写打开URL地址失败后的处理
console.log(res);
uni.showModal({
content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
success: function (res) {
if (res.confirm) {
//plus.runtime.openURL();
}
}
});
},
'com.eg.android.AlipayGphone'
);
} else if (plus.os.name == 'iOS') {
plus.runtime.openURL(
'alipay://platformapi/startapp?appId=20000067&url=' + urls,
res => {
console.log(res);
uni.showModal({
content: '本机未检测到对应客户端,是否打开浏览器访问页面?',
success: function (res) {
if (res.confirm) {
//plus.runtime.openURL(url);
}
}
});
},
'com.eg.android.AlipayGphone'
);
}
// #endif
}
}
}else{
uni.showModal({
content: res['message'],
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
}
}
}
......
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