|
@@ -4,6 +4,8 @@
|
|
|
<meta charset="UTF-8" />
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
<title>朗读小咖秀</title>
|
|
|
+ <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.js"></script>
|
|
|
+ <script src="https://g.tbcdn.cn/mtb/lib-flexible/0.3.2/??flexible_css.js,flexible.js"></script>
|
|
|
</head>
|
|
|
<style>
|
|
|
* {
|
|
@@ -69,7 +71,7 @@
|
|
|
left: 0;
|
|
|
bottom: 0;
|
|
|
width: 100%;
|
|
|
- padding: 15px 18px;
|
|
|
+ padding: 0.4rem 0.48rem;
|
|
|
background: white;
|
|
|
}
|
|
|
.payBox .left {
|
|
@@ -115,15 +117,15 @@
|
|
|
height: 1.7867rem;
|
|
|
}
|
|
|
.t1 {
|
|
|
- margin: .52rem 1.3333rem;
|
|
|
- font-size: 18px;
|
|
|
+ margin: 0.8rem 0;
|
|
|
+ font-size: 0.48rem;
|
|
|
}
|
|
|
.goXkx {
|
|
|
- padding: .1rem 1.3333rem;
|
|
|
- font-size: .4267rem;
|
|
|
+ padding: 0.1rem 1.3333rem;
|
|
|
+ font-size: 0.4267rem;
|
|
|
color: white;
|
|
|
background: linear-gradient(180deg, #66d751 0%, #65d952 100%);
|
|
|
- border-radius: .4rem;
|
|
|
+ border-radius: 0.4rem;
|
|
|
}
|
|
|
</style>
|
|
|
<body>
|
|
@@ -147,17 +149,16 @@
|
|
|
</div>
|
|
|
<div class="pay" @click="pay">立即支付</div>
|
|
|
</div>
|
|
|
- <div class="mask">
|
|
|
+ <div class="mask" v-if="mask">
|
|
|
<div class="payTips">
|
|
|
<img src="https://reader-wx.ai160.com/images/reader/v3/right.webp" class="simg" />
|
|
|
<div class="t1">支付成功</div>
|
|
|
- <div class="goXkx">去使用</div>
|
|
|
+ <div class="goXkx" @click="closeMask">确认</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</body>
|
|
|
- <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.js"></script>
|
|
|
- <script src="https://g.tbcdn.cn/mtb/lib-flexible/0.3.2/??flexible_css.js,flexible.js"></script>
|
|
|
+
|
|
|
<script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.min.js"></script>
|
|
|
<script>
|
|
|
let app = new Vue({
|
|
@@ -167,26 +168,28 @@
|
|
|
product: {},
|
|
|
active: '',
|
|
|
uid: '',
|
|
|
- code: ''
|
|
|
+ code: '',
|
|
|
+ mask: false
|
|
|
},
|
|
|
mounted() {
|
|
|
// 原始URL
|
|
|
var url = location.search
|
|
|
// 创建URLSearchParams对象
|
|
|
- console.log(url, 'zzzzzzzzzzzzzzzzz')
|
|
|
var searchParams = new URLSearchParams(url)
|
|
|
// 获取code参数的值
|
|
|
var code = searchParams.get('code')
|
|
|
var uid = searchParams.get('uid')
|
|
|
- console.log(uid, '=======', code)
|
|
|
- if (code) {
|
|
|
+ if (uid) {
|
|
|
this.uid = uid
|
|
|
+ }
|
|
|
+ if (code) {
|
|
|
this.code = code
|
|
|
axios({
|
|
|
method: 'get',
|
|
|
- url: 'https://reader-api.efunbox.cn/wx/v3/product/learn',
|
|
|
+ url: 'https://reader-api.ai160.com/wx/v3/product/learn',
|
|
|
headers: {
|
|
|
- uid: 'd83d947655f6455a96f4197d31afa6d4',
|
|
|
+ uid: this.uid,
|
|
|
+ // uid: 'd83d947655f6455a96f4197d31afa6d4',
|
|
|
channelCode: '3001'
|
|
|
}
|
|
|
}).then(res => {
|
|
@@ -195,7 +198,7 @@
|
|
|
this.product = res.data.data.productList[0]
|
|
|
})
|
|
|
} else {
|
|
|
- // this.getWxCode()
|
|
|
+ this.getWxCode()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -206,19 +209,19 @@
|
|
|
pay() {
|
|
|
axios({
|
|
|
method: 'post',
|
|
|
- url: 'https://reader-api.efunbox.cn/order/create',
|
|
|
+ url: 'https://reader-api.ai160.com/order/create',
|
|
|
headers: {
|
|
|
- uid: 'd83d947655f6455a96f4197d31afa6d4',
|
|
|
+ uid: this.uid,
|
|
|
+ // uid: 'd83d947655f6455a96f4197d31afa6d4',
|
|
|
channelCode: '3001'
|
|
|
},
|
|
|
data: {
|
|
|
productId: this.active
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
axios({
|
|
|
method: 'post',
|
|
|
- url: 'https://reader-api.efunbox.cn/wx/pay/efun',
|
|
|
+ url: 'https://reader-api.ai160.com/wx/pay/efun',
|
|
|
headers: {
|
|
|
uid: this.uid,
|
|
|
channelCode: '3001'
|
|
@@ -230,7 +233,6 @@
|
|
|
}
|
|
|
}).then(res => {
|
|
|
let options = res.data.data
|
|
|
- console.log(options, 'rrrses')
|
|
|
WeixinJSBridge.invoke(
|
|
|
'getBrandWCPayRequest',
|
|
|
{
|
|
@@ -243,7 +245,7 @@
|
|
|
},
|
|
|
async res => {
|
|
|
if (res.err_msg == 'get_brand_wcpay_request:ok') {
|
|
|
- console.log('支付成功')
|
|
|
+ this.mask = true
|
|
|
} else {
|
|
|
this.getWxCode()
|
|
|
}
|
|
@@ -252,9 +254,14 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ closeMask() {
|
|
|
+ this.mask = false
|
|
|
+ this.getWxCode()
|
|
|
+ },
|
|
|
getWxCode() {
|
|
|
const appId = 'wxf05800eea975a68b'
|
|
|
- const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios?uid=d83d947655f6455a96f4197d31afa6d4')
|
|
|
+ const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios/index.html?uid=' + this.uid)
|
|
|
+ // const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios?uid=d83d947655f6455a96f4197d31afa6d4')
|
|
|
const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appId + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_base#wechat_redirect'
|
|
|
location.href = url
|
|
|
}
|