Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c2ba810a02 | |||
| 3f1239c35e | |||
| 1be5b34906 | |||
| c58bb27575 |
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "宇之然AI磁场",
|
||||
"appid": "__UNI__DEV__",
|
||||
"versionName": "1.0.12",
|
||||
"versionCode": "112",
|
||||
"versionName": "1.0.15",
|
||||
"versionCode": "115",
|
||||
"description": "职引 - 宇之然AI磁场旗下AI模拟面试平台,提供AI面试官模拟练习、简历智能优化、大厂面经题库,助你轻松应对校招面试。",
|
||||
"h5": {
|
||||
"title": "职引 - AI模拟面试 | 宇之然AI磁场",
|
||||
|
||||
@@ -393,7 +393,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ref, computed, onMounted, reactive } from 'vue'
|
||||
import { api, API_ENDPOINTS } from '../../config'
|
||||
|
||||
const verified = ref(false)
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { api } from '../../config'
|
||||
import UQRCode from 'uqrcodejs'
|
||||
|
||||
@@ -112,13 +113,16 @@ const sprintFeatures = ref(['成长版全部权益', 'AI 语音分析(语气
|
||||
|
||||
const token = () => uni.getStorageSync('token') || ''
|
||||
|
||||
onMounted(async () => {
|
||||
const refreshState = async () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
isMp.value = true
|
||||
// #endif
|
||||
|
||||
const t = token()
|
||||
if (!t) return
|
||||
if (!t) {
|
||||
isLoggedIn.value = false
|
||||
return
|
||||
}
|
||||
isLoggedIn.value = true
|
||||
|
||||
try {
|
||||
@@ -146,7 +150,10 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => { refreshState() })
|
||||
onShow(() => { refreshState() })
|
||||
|
||||
const goLogin = () => uni.navigateTo({ url: '/pages/login/login' })
|
||||
|
||||
@@ -183,6 +190,7 @@ const startPay = async (selectedPlan) => {
|
||||
url: api('/payment/jsapi'), method: 'POST',
|
||||
data: { plan: planLabel },
|
||||
header: { 'Authorization': `Bearer ${t}`, 'Content-Type': 'application/json' },
|
||||
timeout: 30000,
|
||||
})
|
||||
payLoading.value = false
|
||||
|
||||
@@ -203,10 +211,16 @@ const startPay = async (selectedPlan) => {
|
||||
},
|
||||
fail: (err) => { payError.value = '支付取消或失败'; uni.showToast({ title: '支付取消', icon: 'none' }) },
|
||||
})
|
||||
} else if (!res.statusCode || res.statusCode === 0) {
|
||||
payLoading.value = false
|
||||
const errMsg = '网络连接失败,请检查网络后重试'
|
||||
payError.value = errMsg
|
||||
uni.showToast({ title: errMsg, icon: 'none' })
|
||||
} else {
|
||||
payLoading.value = false
|
||||
payError.value = res.data?.message || '创建订单失败'
|
||||
uni.showToast({ title: '创建订单失败', icon: 'none' })
|
||||
const errMsg = res.data?.message || '创建订单失败'
|
||||
payError.value = errMsg
|
||||
uni.showToast({ title: errMsg, icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
payLoading.value = false
|
||||
@@ -241,9 +255,14 @@ const startPay = async (selectedPlan) => {
|
||||
})
|
||||
// 轮询支付结果
|
||||
pollPayResult(res.data.outTradeNo, planLabel)
|
||||
} else if (!res.statusCode || res.statusCode === 0) {
|
||||
payLoading.value = false
|
||||
const errMsg = '网络连接失败,请检查网络后重试'
|
||||
payError.value = errMsg
|
||||
uni.showToast({ title: errMsg, icon: 'none' })
|
||||
} else {
|
||||
payError.value = res.data?.message || '支付服务暂不可用'
|
||||
uni.showToast({ title: '支付服务暂不可用', icon: 'none' })
|
||||
uni.showToast({ title: res.data?.message || '支付服务暂不可用', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
payLoading.value = false
|
||||
|
||||
Reference in New Issue
Block a user