极光推送权限修改

This commit is contained in:
@fawn-nine
2023-04-23 15:11:26 +08:00
parent ee74da48cc
commit db2beb84e5
2 changed files with 101 additions and 54 deletions

View File

@@ -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
}

View File

@@ -692,7 +692,7 @@ import { nextTick } from "vue";
'lineHeight':'',
'oldReadPage':0
},
setShow: true, // 设置显示?
setShow: false, // 设置显示?
clientlast: null, //开始位置
touchNum: 0, //点击次数
touchTime: null, //定时器清除
@@ -3178,13 +3178,22 @@ import { nextTick } from "vue";
musicPlaying:false,
fontSize:'',
lineHeight:'',
containerStyle: ''
containerStyle: '',
devName:false,
letterSpacing:1,
}
},
},
mounted() {
this.onTurn();
this.onTurn();
this.isAndroid()
console.log(this.devName,'devName')
},
methods: {
isAndroid() { //判断是否为安卓手机
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
this.devName = isAndroid
},
updateReaderSet(newVal, oldVal){
// 阅读器设置更新
$("#flipbook .paragraph").css({fontSize:newVal.fontSize+"px", lineHeight:newVal.lineHeight*newVal.fontSize+"px"})
@@ -3233,7 +3242,7 @@ import { nextTick } from "vue";
},
updateSimulationText(newVal, oldVal) {
$("#flipbook").turn('pages',1) // 内容变化时保留1页
$("#flipbook").turn('pages',1) // 内容变化时保留1页1
$("#flipbook").turn('pages',newVal.SimulationText.length)
// this.onTurn();
// this.SimulationText = newVal
@@ -3242,22 +3251,24 @@ import { nextTick } from "vue";
this.lineHeight = newVal.lineHeight
newVal.background == 1 ? this.containerStyle = "#f7faf9" : this.containerStyle = "#000"
//$(".myPage p").css({backgroundColor:this.containerStyle})
this.devName ? this.letterSpacing = 2 : this.letterSpacing = 1
console.log(this.letterSpacing,'-----------------------------')
for (var i=0; i<newVal.SimulationText.length;i++) {
var tagHtml = "";
var conntentHtml = "";
for (var j=0; j<newVal.SimulationText[i].length; j++) {
var classname = ''
var styleconteent = ''
newVal.SimulationText[i][j].class == 'jushou' ? classname = 'shouhang' : ''
newVal.SimulationText[i][j].class == 'jushou' ? styleconteent = "';text-indent:2em ;font-size:"+newVal.fontSize+"px; color: #5d5d5d; line-height:"+newVal.lineHeight*newVal.fontSize+"px;'": styleconteent = "'font-size:"+newVal.fontSize+"px ; line-height:"+newVal.lineHeight*newVal.fontSize+"px; color: #5d5d5d; text-align:justify'"
newVal.SimulationText[i][j].class == 'jushou' ? classname = 'shouhang' : 'notshouhang'
newVal.SimulationText[i][j].class == 'jushou' ? styleconteent = "'text-indent:2em ;font-size:"+newVal.fontSize+"px; color: #5d5d5d; line-height:"+newVal.lineHeight*newVal.fontSize+"px;'": styleconteent = "'font-size:"+newVal.fontSize+"px ; line-height:"+newVal.lineHeight*newVal.fontSize+"px; color: #5d5d5d;'"
conntentHtml += "<p class='paragraph " + classname + " paragraph" + newVal.SimulationText[i][j].paragraph +"' style="+styleconteent+">" + newVal.SimulationText[i][j].list + "</p>"
}
var page1 = i+1
var btnStyle = "display: block; padding: 20rpx; border: 1px solid #333; text-align: center;"
var tagHtml = "<div style='padding:0 18px; position:relative; background-color:"+this.containerStyle+"; height:inherit'>"+ conntentHtml +"<div style='text-align:center; color:#777 ; position: absolute;bottom: 5px; left: 0;text-align: center; width: 100%;' >"+page1+"/"+ newVal.SimulationText.length +"</div></div>";
var tagHtml = "<div style='padding:0 10px;letter-spacing:"+ this.letterSpacing +"px; position:relative; background-color:"+this.containerStyle+"; height:inherit'>"+ conntentHtml +"<div style='text-align:center; color:#777 ; position: absolute;bottom: 5px; left: 0;text-align: center; width: 100%;' >"+page1+"/"+ newVal.SimulationText.length +"</div></div>";
// $("#flipbook").append(tagHtml);
if (!$("#flipbook").turn('hasPage', i+2)) {
// Create an element for this page
// Create an element for this page.
var element = $('<div />').html('');
// Add the page
$("#flipbook").turn('addPage', element, i+2);
@@ -3266,6 +3277,7 @@ import { nextTick } from "vue";
}
// 如果有阅读缓存
if(newVal.oldReadPage>0){
// alert('读取历史阅读进度')
$("#flipbook").turn('page', newVal.oldReadPage+1)
}else{
$("#flipbook").turn('page', 2)
@@ -3326,7 +3338,7 @@ import { nextTick } from "vue";
} else {
clearTimeout(this.touchTime)
this.touchTime = setTimeout(() => {
//双击或多次点击事件
//双击或多次点击事件
this.touchNum = 0
}, 250)
//console.log('单击')
@@ -3361,6 +3373,11 @@ import { nextTick } from "vue";
</script>
<style>
/* .container1{background-color: #000;} */
.notshouhang:after {
display: inline-block;
width: 100%;
content: '';
}
.buts{width: 100%; display:flex; }
.buts span{display: block; padding: 20rpx; border: 1px solid #333; text-align: center;}
</style>