mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-07 17:53:42 +08:00
finish mobile wechat payment
This commit is contained in:
@@ -242,9 +242,9 @@ export function processPrompt(prompt) {
|
||||
return prompt
|
||||
}
|
||||
|
||||
// 判断是否为 iphone 设备
|
||||
export function isIphone() {
|
||||
return /iPhone/i.test(navigator.userAgent) && !/iPad/i.test(navigator.userAgent);
|
||||
// 判断是否为微信浏览器
|
||||
export function isWeChatBrowser() {
|
||||
return /MicroMessenger/i.test( navigator.userAgent);
|
||||
}
|
||||
|
||||
export function showLoginDialog(router) {
|
||||
|
||||
@@ -99,7 +99,6 @@ import {useSharedStore} from "@/store/sharedata";
|
||||
const inviteURL = ref("")
|
||||
const qrImg = ref("/images/wx.png")
|
||||
const invitePower = ref(0)
|
||||
const inviteImgCalls = ref(0)
|
||||
const hits = ref(0)
|
||||
const regNum = ref(0)
|
||||
const rate = ref(0)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="随机背景">
|
||||
<el-form-item label="动态背景">
|
||||
<el-switch v-model="system['rand_bg']"/>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
|
||||
@@ -154,10 +154,10 @@
|
||||
|
||||
<script setup>
|
||||
import {onMounted, ref} from "vue";
|
||||
import {showFailToast, showNotify, showSuccessToast} from "vant";
|
||||
import {showFailToast, showNotify, showSuccessToast, showToast} from "vant";
|
||||
import {httpGet, httpPost} from "@/utils/http";
|
||||
import Compressor from 'compressorjs';
|
||||
import {dateFormat, showLoginDialog} from "@/utils/libs";
|
||||
import {dateFormat, isWeChatBrowser, showLoginDialog} from "@/utils/libs";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {checkSession} from "@/action/session";
|
||||
import {useRouter} from "vue-router";
|
||||
@@ -299,8 +299,11 @@ const pay = (payWay, item) => {
|
||||
product_id: item.id,
|
||||
user_id: userId.value
|
||||
}).then(res => {
|
||||
// console.log(res.data)
|
||||
location.href = res.data
|
||||
if (isWeChatBrowser() && payWay === 'wechat') {
|
||||
showFailToast("请在系统自带浏览器打开支付页面,或者在 PC 端进行扫码支付")
|
||||
} else {
|
||||
location.href = res.data
|
||||
}
|
||||
}).catch(e => {
|
||||
showFailToast("生成支付订单失败:" + e.message)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user