v1.1.1-修改Bug

This commit is contained in:
lik
2026-06-04 10:34:25 +08:00
parent 535827b17b
commit c924f84384
3 changed files with 11 additions and 7 deletions

2
app.js
View File

@@ -66,7 +66,7 @@ App({
wx.login({ wx.login({
success: res => { success: res => {
if (res.code) { if (res.code) {
request.post('/user/wxsignin', { code: res.code }) request.post('https://api.huashengtec.com/user/wxsignin', { code: res.code })
.then((data) => { .then((data) => {
if (data.code == 0) { if (data.code == 0) {
this.globalData.user = data.data.user this.globalData.user = data.data.user

View File

@@ -88,20 +88,24 @@ Page({
return API.escort.getMyRecords(params) return API.escort.getMyRecords(params)
.then((res) => { .then((res) => {
if (res.code === 0) { if (res.code === 0) {
const list = res.data.records || [] let list = res.data.records || []
const formatted = list.map(item => this.formatRecord(item)) let formatted = list.map(item => this.formatRecord(item))
this.data.statusTabs = this.computeStatusCounts(formatted, this.data.statusTabs) const statusTabs = this.computeStatusCounts(formatted, this.data.statusTabs)
// 根据this.data.formatted
if (this.data.statusFilter) {
formatted = formatted.filter(item => item.status === this.data.statusFilter)
}
this.setData({ this.setData({
records: reset ? formatted : this.data.records.concat(formatted), records: reset ? formatted : this.data.records.concat(formatted),
page, page,
hasMore: list.length >= this.data.pageSize, hasMore: list.length >= this.data.pageSize,
statusTabs: this.data.statusTabs statusTabs
}) })
} else { } else {
wx.showToast({ title: res.msg || '加载失败', icon: 'none' }) wx.showToast({ title: res.msg || '加载失败', icon: 'none' })
} }
}) })
.catch(() => { .catch((err) => {
wx.showToast({ title: '网络请求失败', icon: 'none' }) wx.showToast({ title: '网络请求失败', icon: 'none' })
}) })
.finally(() => { .finally(() => {

View File

@@ -1,7 +1,7 @@
class Request { class Request {
constructor(baseURL = 'https://api.huashengtec.com') { constructor(baseURL = 'https://api.huashengtec.com') {
//constructor(baseURL = 'http://127.0.0.1:9010') { //constructor(baseURL = 'http://127.0.0.1:9004') {
this.baseURL = baseURL this.baseURL = baseURL
} }