v1.1.1-修改Bug
This commit is contained in:
2
app.js
2
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
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user