Commit e670a9f9 by sunchao

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

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