特性:更新API基础URL并增强标签导航
- 更改了app.js中的API基础URL,以指向用于部署的生产服务器。 - 改进了自定义标签栏功能,可根据审计模式有条件地显示标签。 - 增强了比赛页面逻辑,以处理审核模式检查并动态更新选项卡选择。 - 对我的页面进行了重构,以确保根据当前页面正确选择标签。 此次更新旨在确保API连接正常,并改善用户在应用程序中的导航体验。
This commit is contained in:
@@ -11,12 +11,12 @@ const DEFAULT_APP_ID = 'wxb8bbb2b10dec74aa'
|
||||
const DEFAULT_MCH_ID = '1318592501'
|
||||
const DEFAULT_WITHDRAW_TMPL_ID = 'u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE'
|
||||
// 线上正式 API(真机/体验版/正式版)。永平仓库默认正式域;部署前核对见 .cursor/skills/security-server-ops/SKILL.md
|
||||
// const API_BASE_URL_PROD = 'https://soulapi.quwanzhi.com'
|
||||
const API_BASE_URL_PROD = 'http://127.0.0.1:9100'
|
||||
const API_BASE_URL_PROD = 'https://soulapi.quwanzhi.com'
|
||||
// const API_BASE_URL_PROD = 'http://127.0.0.1:9100'
|
||||
|
||||
// 开发者工具默认与正式一致;若需连测服可改为 https://souldev.quwanzhi.com 或本机 http://127.0.0.1:9100
|
||||
// const API_BASE_URL_DEV = 'https://soulapi.quwanzhi.com'
|
||||
const API_BASE_URL_DEV ='http://127.0.0.1:9100'
|
||||
const API_BASE_URL_DEV = 'https://soulapi.quwanzhi.com'
|
||||
// const API_BASE_URL_DEV ='http://127.0.0.1:9100'
|
||||
|
||||
// 运行时自动判断:非开发工具(真机/体验版/正式版)强制用 PROD,避免 localhost 打进上传包导致白屏
|
||||
const _isDevTools = (typeof __wxConfig !== 'undefined' && __wxConfig.platform === 'devtools')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Soul创业实验 - 自定义 TabBar
|
||||
* 支持:首页 / 目录 / [找伙伴] / [动态,审核模式隐藏] / 我的
|
||||
* 支持:首页 / 目录 / [找伙伴,审核模式隐藏] / [动态,审核模式隐藏] / 我的
|
||||
*/
|
||||
|
||||
const app = getApp()
|
||||
@@ -73,7 +73,7 @@ Component({
|
||||
isSpecial: false,
|
||||
},
|
||||
]
|
||||
if (matchEnabled) {
|
||||
if (matchEnabled && !audit) {
|
||||
tabs.push({
|
||||
pagePath: '/pages/match/match',
|
||||
text: ma,
|
||||
@@ -131,7 +131,8 @@ Component({
|
||||
if (auditMode) {
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
if (currentPage && currentPage.route === 'pages/super-moments/super-moments') {
|
||||
const route = currentPage && currentPage.route
|
||||
if (route === 'pages/super-moments/super-moments' || route === 'pages/match/match') {
|
||||
wx.switchTab({ url: '/pages/index/index' })
|
||||
}
|
||||
}
|
||||
@@ -147,7 +148,8 @@ Component({
|
||||
if (auditMode) {
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
if (currentPage && currentPage.route === 'pages/super-moments/super-moments') {
|
||||
const route = currentPage && currentPage.route
|
||||
if (route === 'pages/super-moments/super-moments' || route === 'pages/match/match') {
|
||||
wx.switchTab({ url: '/pages/index/index' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,9 +94,16 @@ Page({
|
||||
|
||||
async onLoad() {
|
||||
wx.showShareMenu({ withShareTimeline: true })
|
||||
try {
|
||||
await app.getAuditMode()
|
||||
} catch (_) {}
|
||||
if (app.globalData.auditMode) {
|
||||
wx.switchTab({ url: '/pages/index/index' })
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
statusBarHeight: app.globalData.statusBarHeight || 44,
|
||||
auditMode: app.globalData.auditMode || false
|
||||
auditMode: false,
|
||||
})
|
||||
await this.loadMatchConfig()
|
||||
this.loadStoredContact()
|
||||
@@ -104,13 +111,28 @@ Page({
|
||||
await this.refreshMatchQuotaFromServer()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
async onShow() {
|
||||
try {
|
||||
await app.getAuditMode()
|
||||
} catch (_) {}
|
||||
if (app.globalData.auditMode) {
|
||||
wx.switchTab({ url: '/pages/index/index' })
|
||||
return
|
||||
}
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
const tabBar = this.getTabBar()
|
||||
if (tabBar.updateSelected) {
|
||||
tabBar.updateSelected()
|
||||
} else {
|
||||
tabBar.setData({ selected: 2 })
|
||||
const tabList = tabBar.data.tabList || []
|
||||
let sel = 0
|
||||
for (let i = 0; i < tabList.length; i++) {
|
||||
if (tabList[i].pagePath.replace(/^\//, '') === 'pages/match/match') {
|
||||
sel = i
|
||||
break
|
||||
}
|
||||
}
|
||||
tabBar.setData({ selected: sel })
|
||||
}
|
||||
}
|
||||
this.initUserStatus()
|
||||
|
||||
@@ -131,8 +131,15 @@ Page({
|
||||
if (tabBar.updateSelected) {
|
||||
tabBar.updateSelected()
|
||||
} else {
|
||||
const selected = tabBar.data.matchEnabled ? 3 : 2
|
||||
tabBar.setData({ selected })
|
||||
const tabList = tabBar.data.tabList || []
|
||||
let sel = 0
|
||||
for (let i = 0; i < tabList.length; i++) {
|
||||
if (tabList[i].pagePath.replace(/^\//, '') === 'pages/my/my') {
|
||||
sel = i
|
||||
break
|
||||
}
|
||||
}
|
||||
tabBar.setData({ selected: sel })
|
||||
}
|
||||
}
|
||||
this.initUserStatus()
|
||||
|
||||
Reference in New Issue
Block a user