极光推送权限修改
This commit is contained in:
@@ -20,30 +20,29 @@
|
||||
|
||||
<view class="cf_radio">
|
||||
<u-radio-group v-model="payType">
|
||||
<!-- #ifdef APP-ANDROID -->
|
||||
<view style="width: 100%;" >
|
||||
|
||||
<view style="width: 100%;" v-if="isAndroid">
|
||||
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
|
||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||
<image :src="item.img"></image>
|
||||
{{item.title}}
|
||||
<u-radio v-if="isAndroid" :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
style="float: right;margin-top: 5rpx;"></u-radio>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-IOS -->
|
||||
<view style="width: 100%;" >
|
||||
|
||||
<view style="width: 100%;" v-else>
|
||||
<view v-for="(item, index) in iosPaylist" @click="choseType(item.id)"
|
||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||
<image :src="item.img"></image>
|
||||
{{item.title}}
|
||||
<u-radio v-if="isAndroid" :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
style="float: right;margin-top: 5rpx;"></u-radio>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
@@ -57,12 +56,11 @@
|
||||
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《增值服务协议》</span></view>
|
||||
</view>
|
||||
<view class="char_btn">
|
||||
<!-- #ifdef APP-ANDROID -->
|
||||
|
||||
<view @click="kaiChar">立即充值</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-IOS -->
|
||||
<view @click="iosPay" >立即充值</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- <view @click="iosPay" >立即充值</view> -->
|
||||
|
||||
</view>
|
||||
<!-- 充值协议 -->
|
||||
<u-popup :show="xieyiShow" :round="10" @close="xieyiShow=false">
|
||||
@@ -143,6 +141,7 @@
|
||||
onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.getDevName()
|
||||
// this.requestIapOrder()
|
||||
},
|
||||
computed: {
|
||||
@@ -182,8 +181,7 @@
|
||||
// 判断是否苹果支付
|
||||
if (channels[i].id === 'appleiap') {
|
||||
that.iapChannel = channels[i]
|
||||
that.requestOrder()
|
||||
consle.log(666666666)
|
||||
that.requestOrder()
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -191,7 +189,7 @@
|
||||
},
|
||||
requestOrder() {
|
||||
uni.showLoading({
|
||||
title: '到这...',
|
||||
title: '获取商品信息',
|
||||
mask: true
|
||||
})
|
||||
const that = this
|
||||
@@ -227,20 +225,21 @@
|
||||
provider: 'appleiap',
|
||||
orderInfo: {
|
||||
productid: id,
|
||||
username: 'ordersn', // 用户标识
|
||||
// username: 'ordersn', // 用户标识
|
||||
username: that.orderSn, // 用户标识
|
||||
optimize: false // 设置 optimize: true 解决丢单问题
|
||||
},
|
||||
success: (res => {
|
||||
console.log(res,'成功的返回值1') // 成功的返回值
|
||||
console.log(res,'成功的返回值') // 成功的返回值
|
||||
uni.hideLoading()
|
||||
let data= {
|
||||
receipt:res.transactionReceipt, // 校验体
|
||||
TransactionID: this.orderSn,
|
||||
transactionId: res.transactionIdentifier //交易id
|
||||
orderId: this.orderSn,
|
||||
transactionIdentifier: res.transactionIdentifier //交易id
|
||||
}
|
||||
const orderId = this.orderId //这个订单id 是由后端返回的
|
||||
const transactionId = res.transactionIdentifier //交易id
|
||||
const payload = res.transactionReceipt //校验体
|
||||
// const orderId = this.orderId //这个订单id 是由后端返回的
|
||||
// const transactionIdentifier = res.transactionIdentifier //交易id
|
||||
// const payload = res.transactionReceipt //校验体
|
||||
$http.request({
|
||||
url: "/apple/applePay",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
@@ -249,12 +248,31 @@
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
uni.showToast({
|
||||
title: '充值成功'
|
||||
})
|
||||
// 发送给后台逻辑处理
|
||||
// 进行后续操作
|
||||
///that.getUserInfo()
|
||||
console.log(res)
|
||||
let data= {
|
||||
// receipt: 'MIIUKAYJKoZIhvcNAQcCoIIUGTCCFBUCAQExCzAJBgUrDgMCGgUAMIIDZgYJKoZIhvcNAQcBoIIDVwSCA1MxggNPMAoCAQgCAQEEAhYAMAoCARQCAQEEAgwAMAsCAQECAQEEAwIBADALAgELAgEBBAMCAQAwCwIBDwIBAQQDAgEAMAsCARACAQEEAwIBADALAgEZAgEBBAMCAQMwDAIBCgIBAQQEFgI0KzAMAgEOAgEBBAQCAgCJMA0CAQMCAQEEBQwDMTEwMA0CAQ0CAQEEBQIDAf4oMA0CARMCAQEEBQwDMS4wMA4CAQkCAQEEBgIEUDI2MDAYAgEEAgECBBAX4ibAXjZ7IAwLx10evzedMBsCAQACAQEEEwwRUHJvZHVjdGlvblNhbmRib3gwHAIBBQIBAQQUYpDtGI14h',
|
||||
transactionId: res.transactionIdentifier, // 支付交易id
|
||||
// userId: that.userInfo.id,
|
||||
// productId: 'add69',
|
||||
orderId: res.payment.username // 系统订单号
|
||||
receiptData: res.transactionReceipt //苹果返回状态码
|
||||
}
|
||||
$http.request({
|
||||
url: "/Ipa/veri",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
// alert(res)
|
||||
uni.showToast({
|
||||
title: '充值成功'
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
}),
|
||||
fail: (e) => {
|
||||
@@ -266,8 +284,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
getDevName() {
|
||||
// 获取使用环境
|
||||
if (uni.getSystemInfoSync().platform === 'android') {
|
||||
@@ -304,8 +320,7 @@
|
||||
},
|
||||
//ios充值
|
||||
iosPay() {
|
||||
if(this.radioValue == '1'){
|
||||
|
||||
// if(this.radioValue == '1'){
|
||||
let that = this
|
||||
|
||||
let data = {
|
||||
@@ -332,22 +347,25 @@
|
||||
// this.topay(15)
|
||||
this.iphonepay()
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'请勾选服务协议',
|
||||
icon:'error'
|
||||
})
|
||||
}
|
||||
// }else{
|
||||
// uni.showToast({
|
||||
// title:'请勾选服务协议',
|
||||
// icon:'error'
|
||||
// })
|
||||
// }
|
||||
},
|
||||
// 充值
|
||||
kaiChar() {
|
||||
if(this.radioValue == '1'){
|
||||
|
||||
if(this.radioValue == '1'){
|
||||
uni.showLoading({
|
||||
title:'支付中,请勿离开',
|
||||
icon:'loading'
|
||||
})
|
||||
let that = this
|
||||
let data = {
|
||||
userId: that.userInfo.id, //下单人ID
|
||||
userPhone: that.userInfo.tel, //收货人手机号
|
||||
paymentMethod: that.payType, //1支付宝,2微信,3ios内购
|
||||
paymentMethod: that.payType, //2支付宝,1微信,3ios内购
|
||||
orderMoney: that.stepsCj.money * 1, //订单金额
|
||||
districtMoney: 0, //优惠金额
|
||||
realMoney: that.stepsCj.money * 1, //实收金额
|
||||
@@ -359,11 +377,13 @@
|
||||
url: "book/buyorder/rechargeSave",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
header: { //默认 无 说明:请求头1
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
if(that.payType == 2){
|
||||
setPay({
|
||||
typePay: 'alipay',
|
||||
subject: 'point',
|
||||
@@ -384,12 +404,22 @@
|
||||
});
|
||||
}
|
||||
})
|
||||
}else if(that.payType == 1){
|
||||
// 微信支付
|
||||
uni.showToast({
|
||||
title:'微信支付',
|
||||
none: 'none'
|
||||
})
|
||||
}else if(that.payType == 3){
|
||||
console.log('苹果支付',)
|
||||
that.iosPay()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'请勾选 已阅读会员服务协议',
|
||||
icon:'error'
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user