diff --git a/app.js b/app.js index 0e7e691..0bad1a0 100644 --- a/app.js +++ b/app.js @@ -66,7 +66,7 @@ App({ wx.login({ success: res => { if (res.code) { - request.post('/user/wxsignin', { code: res.code }) + request.post('https://api.huashengtec.com/user/wxsignin', { code: res.code }) .then((data) => { if (data.code == 0) { this.globalData.user = data.data.user diff --git a/pages/escort/recordlist.js b/pages/escort/recordlist.js index b5f1245..6f4bdc3 100644 --- a/pages/escort/recordlist.js +++ b/pages/escort/recordlist.js @@ -88,20 +88,24 @@ Page({ return API.escort.getMyRecords(params) .then((res) => { if (res.code === 0) { - const list = res.data.records || [] - const formatted = list.map(item => this.formatRecord(item)) - this.data.statusTabs = this.computeStatusCounts(formatted, this.data.statusTabs) + let list = res.data.records || [] + let formatted = list.map(item => this.formatRecord(item)) + 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({ records: reset ? formatted : this.data.records.concat(formatted), page, hasMore: list.length >= this.data.pageSize, - statusTabs: this.data.statusTabs + statusTabs }) } else { wx.showToast({ title: res.msg || '加载失败', icon: 'none' }) } }) - .catch(() => { + .catch((err) => { wx.showToast({ title: '网络请求失败', icon: 'none' }) }) .finally(() => { diff --git a/utils/request.js b/utils/request.js index 7ae8c04..91a81d0 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,7 +1,7 @@ class Request { 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 }