1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

api接口baseUrl通过全局变量引入;代码格式化

This commit is contained in:
2022-11-05 16:45:52 +08:00
parent 3e0c182bc9
commit 5cf1ed3a49
22 changed files with 477 additions and 406 deletions

View File

@@ -1,36 +1,35 @@
const app = getApp()
const baseUrl = app.globalData.baseUrl
// console.log("baseUrl", baseUrl)
Page({
data:{
tableInfo: {},
count:''
data: {
tableInfo: {},
count: ''
},
onReady: function () {
// 生命周期函数--监听页面初次渲染完成
var that = this;
wx.request({
url: 'http://127.0.0.1:8080/report/myReport',
data: {
id:wx.getStorageSync('id')
},
success: function (d) {
let item = [];
for (const iterator of d.data.data) {
let item1 = [iterator.name,iterator.time,iterator.normal,iterator.address];
item.push(item1)
}
that.setData({
tableInfo:{
title:["姓名","填报时间","体温状况","位置"],
contentItem: item,
},
count: d.data.data.length
})
// 生命周期函数--监听页面初次渲染完成
var that = this;
wx.request({
url: `${baseUrl}/report/myReport`,
data: {
id: wx.getStorageSync('id')
},
success: function (d) {
let item = [];
for (const iterator of d.data.data) {
let item1 = [iterator.name, iterator.time, iterator.normal, iterator.address];
item.push(item1)
}
})
},
})
that.setData({
tableInfo: {
title: ["姓名", "填报时间", "体温状况", "位置"],
contentItem: item,
},
count: d.data.data.length
})
}
})
},
})