不应该push这么多次的,只是发现忘记commit了
This commit is contained in:
1 parent
89c70bcb2a
commit
3b2d536880
2 files changed
+12
-30
No files matched your search
@@ -185,7 +185,7 @@ Page({
|
||||
arr: ["山梨酸钾"],
|
||||
},
|
||||
|
||||
sessionKey: "",
|
||||
session_key: "",
|
||||
userInfo: {},
|
||||
hasUserInfo: false,
|
||||
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
||||
@@ -195,15 +195,13 @@ Page({
|
||||
|
||||
// 启动时获取session
|
||||
async onLoad() {
|
||||
// wx.authorize()
|
||||
await this.updateSession()
|
||||
setInterval(()=>{
|
||||
this.updateSession()
|
||||
},60*1000*5)
|
||||
// console.log(this.data.sessionKey)
|
||||
this.readStorageData()
|
||||
this.updateLib()
|
||||
this.updateHistory()
|
||||
this.readStorageData()
|
||||
},
|
||||
|
||||
//开始界面的按钮相关动画
|
||||
@@ -682,7 +680,7 @@ Page({
|
||||
wx.request({
|
||||
url: 'http://' + serverAddr + '/getLib', //仅为示例,并非真实的接口地址
|
||||
data: {
|
||||
sessionKey:this.data.sessionKey
|
||||
session_key:this.data.session_key
|
||||
},
|
||||
method: "GET",
|
||||
header: {
|
||||
@@ -741,7 +739,7 @@ Page({
|
||||
wx.request({
|
||||
url: 'http://' + serverAddr + '/getHistory', //仅为示例,并非真实的接口地址
|
||||
data: {
|
||||
sessionKey:this.data.sessionKey
|
||||
session_key:this.data.session_key
|
||||
},
|
||||
method: "POST",
|
||||
header: {
|
||||
@@ -779,7 +777,7 @@ Page({
|
||||
console.log(res)
|
||||
var data = res.data
|
||||
this.setData(
|
||||
{ "sessionKey": data }
|
||||
{ "session_key": data }
|
||||
)
|
||||
resolve()
|
||||
// setTimeout(this.updateSession,1000*60*5)
|
||||
@@ -794,7 +792,7 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 上传照片并
|
||||
// 上传照片并展示收到的结果
|
||||
uploadImg(tempImagePath: any) {
|
||||
wx.getFileSystemManager().readFile({
|
||||
filePath: tempImagePath,
|
||||
@@ -806,7 +804,7 @@ Page({
|
||||
url: 'http://' + serverAddr + '/rcvImg', //仅为示例,并非真实的接口地址
|
||||
data: {
|
||||
imgBase64: imgBase64,
|
||||
sessionKey:this.data.sessionKey
|
||||
session_key:this.data.session_key
|
||||
},
|
||||
method: "POST",
|
||||
header: {
|
||||
@@ -853,7 +851,7 @@ Page({
|
||||
data: {
|
||||
history : this.data.data_history,
|
||||
collection:this.data.data_collect,
|
||||
sessionKey:this.data.sessionKey
|
||||
session_key:this.data.session_key
|
||||
},
|
||||
method: "POST",
|
||||
header: {
|
||||
@@ -1017,7 +1015,7 @@ Page({
|
||||
var list = ['data_history', 'data_collect', 'data_lib']
|
||||
for (var k of list) {
|
||||
this.data[k]=wx.getStorageSync(k)
|
||||
console.log(wx.getStorageSync(k))
|
||||
// console.log(wx.getStorageSync(k))
|
||||
}
|
||||
this.setData(
|
||||
{
|
||||
@@ -1114,7 +1112,7 @@ Page({
|
||||
m1 = parseInt(date1[1]),
|
||||
d0 = parseInt(date0[2]),
|
||||
d1 = parseInt(date1[2])
|
||||
console.log(date0, date1, y0, y1, m0, m1, d0, d1)
|
||||
// console.log(date0, date1, y0, y1, m0, m1, d0, d1)
|
||||
var res = 0
|
||||
if (y1 != y0) {
|
||||
if (y1 > y0) {
|
||||
@@ -1136,7 +1134,7 @@ Page({
|
||||
}
|
||||
}
|
||||
res = -res
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
return res
|
||||
},
|
||||
|
||||
@@ -1185,22 +1183,6 @@ Page({
|
||||
})
|
||||
}
|
||||
})
|
||||
// wx.request({
|
||||
// url: 'http://'+serverAddr+'/rcvImg', //仅为示例,并非真实的接口地址
|
||||
// data: {
|
||||
// a:123212
|
||||
// },
|
||||
// method:"POST",
|
||||
// header: {
|
||||
// 'content-type': 'application/json' // 默认值
|
||||
// },
|
||||
// success (res) {
|
||||
// console.log(res)
|
||||
// },
|
||||
// fail(res){
|
||||
// console.log(res)
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user