提交
This commit is contained in:
140
pages/mine/aboutUs/agreement.vue
Normal file
140
pages/mine/aboutUs/agreement.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-nav-bar :title="yszcText.title" bgColor="#fff" fontColor="#333"></z-nav-bar>
|
||||
|
||||
<view class="tanchu">
|
||||
|
||||
<!-- <view class="dp_title" v-html="yszcText.title"></view> -->
|
||||
<view class="dp_content" v-html="yszcText.content"></view>
|
||||
<!-- <yhxyPage></yhxyPage> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
options: {},
|
||||
yszcText: {
|
||||
title: "",
|
||||
content: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
//第一次加载
|
||||
onLoad(options) {
|
||||
this.options = options;
|
||||
this.getSettlement(105);
|
||||
|
||||
},
|
||||
|
||||
onReady() {},
|
||||
//方法
|
||||
methods: {
|
||||
async getSettlement(id, type) {
|
||||
console.log('id at line 57:', id)
|
||||
//隐私策略
|
||||
var data = await this.$commonJS.getAgreement(id);
|
||||
if (data.content) {
|
||||
data.content = data.content.replace(
|
||||
/<h5>/g,
|
||||
'<view style="font-weight: bold;font-size: 32rpx;margin-top: 20rpx;margin-bottom: 20rpx;">'
|
||||
);
|
||||
data.content = data.content.replace(/<\/h5>/g, "</view>");
|
||||
}
|
||||
this.yszcText = data
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tanchu {
|
||||
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.popup_box {
|
||||
width: 600upx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.popup_title {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
|
||||
view {
|
||||
align-items: center;
|
||||
font-size: 30upx;
|
||||
display: flex;
|
||||
|
||||
image {
|
||||
width: 50upx;
|
||||
height: 50upx;
|
||||
margin: 0 20rpx 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup_content {
|
||||
padding: 30rpx 40rpx;
|
||||
}
|
||||
|
||||
.popup_footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
view {
|
||||
width: 45%;
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
font-size: 28upx;
|
||||
color: #999;
|
||||
line-height: 70upx;
|
||||
margin: 0 0 30rpx 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.dp_title {
|
||||
font-size: 36rpx;
|
||||
margin-bottom: 10rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dp_content {
|
||||
max-height: 98%;
|
||||
overflow-y: scroll;
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
line-height: 45rpx;
|
||||
|
||||
.dp_con1 {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
// .dp_con2 {
|
||||
// font-size: 30rpx;
|
||||
// margin-top: 10rpx;
|
||||
// margin-bottom: 10rpx;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -249,82 +249,82 @@
|
||||
uni.requestPayment({
|
||||
provider: 'appleiap',
|
||||
orderInfo: orderInfo,
|
||||
success: (res) => {
|
||||
success: (res) => {
|
||||
that.iapCheck(res);
|
||||
resolve(res);
|
||||
resolve(res);
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading()
|
||||
// console.log('其他支付错误', err);
|
||||
that.restoreComplateRequest()
|
||||
if (err.code == 2) {
|
||||
uni.showToast({
|
||||
that.restoreComplateRequest()
|
||||
if (err.code == 2) {
|
||||
uni.showToast({
|
||||
title: '取消支付,内购订单即将关闭',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '支付失败,内购订单即将关闭',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '支付失败,内购订单即将关闭',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
}
|
||||
reject(err);
|
||||
}
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
// 查询未关闭iap订单
|
||||
async restoreComplateRequest() {
|
||||
let that = this
|
||||
console.log('检测未完成订单')
|
||||
console.log('检测未完成订单')
|
||||
// if (!that.checking) {
|
||||
// that.checking = true
|
||||
// that.checking = true
|
||||
// console.log(this.iapChannel, 'this.iapChannel1')
|
||||
await this.iapChannel.restoreCompletedTransactions({
|
||||
manualFinishTransaction: true
|
||||
}, function(results) {
|
||||
// console.log(that.checking)
|
||||
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,通用需将返回的支付凭证传给后端进行二次认证
|
||||
that.ComplateRequestArr = results
|
||||
console.log('未完成订单数组共有:=》',that.ComplateRequestArr.length )
|
||||
if (results && results.length > 0) {
|
||||
results.map((item, index) => {
|
||||
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
||||
if (item.transactionState == '1') {
|
||||
// 已经支付,但是没有走逻辑的内购订单 就发给后台做验证
|
||||
that.iapCheck('未完成订单的验证',item, index)
|
||||
// that.finishTransaction(item)
|
||||
} else if(item.transactionState != '1' || item.transactionState != '0') {
|
||||
// 不是正在支付订单,也不是已经支付订单就关闭掉
|
||||
// 其他状态的内购订单
|
||||
that.finishTransaction(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// console.log(that.checking)
|
||||
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,通用需将返回的支付凭证传给后端进行二次认证
|
||||
that.ComplateRequestArr = results
|
||||
console.log('未完成订单数组共有:=》', that.ComplateRequestArr.length)
|
||||
if (results && results.length > 0) {
|
||||
results.map((item, index) => {
|
||||
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
||||
if (item.transactionState == '1') {
|
||||
// 已经支付,但是没有走逻辑的内购订单 就发给后台做验证
|
||||
that.iapCheck('未完成订单的验证', item, index)
|
||||
// that.finishTransaction(item)
|
||||
} else if (item.transactionState != '1' || item.transactionState != '0') {
|
||||
// 不是正在支付订单,也不是已经支付订单就关闭掉
|
||||
// 其他状态的内购订单
|
||||
that.finishTransaction(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
},
|
||||
async iphonepay() {
|
||||
const that = this;
|
||||
uni.showLoading({
|
||||
title:"检测支付环境"
|
||||
title: "检测支付环境"
|
||||
})
|
||||
console.log("检测支付环境...");
|
||||
this.iapChannel = await this.getProvider()
|
||||
console.log('that.iapChannel',this.iapChannel);
|
||||
if(this.iapChannel){
|
||||
console.log('that.iapChannel', this.iapChannel);
|
||||
if (this.iapChannel) {
|
||||
this.requestOrder();
|
||||
}else{
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title:'不支持内购支付',
|
||||
icon:'none'
|
||||
title: '不支持内购支付',
|
||||
icon: 'none'
|
||||
})
|
||||
console.log("获取iap支付通道失败:" + e.message, that.iapChannel);
|
||||
}
|
||||
console.log("获取iap支付通道失败:" + e.message, that.iapChannel);
|
||||
}
|
||||
},
|
||||
requestOrder() {
|
||||
uni.showLoading({
|
||||
@@ -367,15 +367,15 @@
|
||||
uni.showLoading({
|
||||
title: "正在支付",
|
||||
mask: true,
|
||||
});
|
||||
});
|
||||
let orderInfo = {
|
||||
productid: id,
|
||||
username: that.orderSn, // 用户标识/订单标识
|
||||
quantity:1,
|
||||
manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
|
||||
}
|
||||
productid: id,
|
||||
username: that.orderSn, // 用户标识/订单标识
|
||||
quantity: 1,
|
||||
manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
|
||||
}
|
||||
this.transaction = await this.requestPayment(orderInfo)
|
||||
console.log('支付后的that.transaction',this.transaction);
|
||||
console.log('支付后的that.transaction', this.transaction);
|
||||
},
|
||||
iapCheck(result) {
|
||||
let that = this;
|
||||
@@ -639,7 +639,7 @@
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请勾选 已阅读会员服务协议",
|
||||
title: "请勾选 已阅读增值服务协议",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user