更新:ios支付

This commit is contained in:
2025-12-11 17:30:45 +08:00
parent b3d9b0c100
commit d98e1ef024
8 changed files with 176 additions and 32 deletions

View File

@@ -242,7 +242,7 @@ const selectedFirstLevel = ref<number>('医学') // 当前选中的一级分类
*/
const handleFirstLevelClick = (item: string) => {
getPrompt()
if(!userStore.token) return
if(!uni.getStorageSync('token')) return
selectedFirstLevel.value = item
switch (item) {
case '医学':
@@ -332,7 +332,7 @@ const getSociologyCateList = async () => {
*/
const curseClickJump = (item: IMedicalTag) => {
getPrompt()
if(!userStore.token) return
if(!uni.getStorageSync('token')) return
uni.navigateTo({
url: `/pages/course/list/category?id=${item.id}&title=${item.title}&pid=${item.pid}&subject=${selectedFirstLevel.value}`
})
@@ -343,7 +343,7 @@ const curseClickJump = (item: IMedicalTag) => {
*/
const onPageJump = (url: string, id?: number, title?: string) => {
getPrompt()
if(!userStore.token) return
if(!uni.getStorageSync('token')) return
let targetUrl = url
if (id !== undefined) {
targetUrl += `?id=${id}`
@@ -391,7 +391,7 @@ const getNewsList = async () => {
*/
const newsClick = (item: INews) => {
getPrompt()
if(!userStore.token) return
if(!uni.getStorageSync('token')) return
uni.navigateTo({
url: `/pages/news/details?newsId=${item.id}&url=${item.url}&type=${item.type}`
})
@@ -422,7 +422,8 @@ const getTryListenList = async () => {
* 登录提示语
*/
const getPrompt = () => {
if(!userStore.token) {
console.log(userStore.token);
if(!uni.getStorageSync('token')) {
uni.showModal({
title: '提示',
content: '请先登录后访问该页面',
@@ -441,7 +442,7 @@ const getTryListenList = async () => {
* 统一请求所有数据
*/
const requestAll = async () => {
if(userStore.token){
if(uni.getStorageSync('token')){
getLearnCourse()
}
getMedicalTags()
@@ -470,7 +471,6 @@ onMounted(() => {
* 页面显示
*/
onShow(() => {
console.log('进来了1');
// 检查是否有固定的分类选择状态
const fixed = uni.getStorageSync('fixed')
if (fixed && currentItem.value) {