不应该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: ["山梨酸钾"],
|
arr: ["山梨酸钾"],
|
||||||
},
|
},
|
||||||
|
|
||||||
sessionKey: "",
|
session_key: "",
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
hasUserInfo: false,
|
hasUserInfo: false,
|
||||||
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
||||||
@@ -195,15 +195,13 @@ Page({
|
|||||||
|
|
||||||
// 启动时获取session
|
// 启动时获取session
|
||||||
async onLoad() {
|
async onLoad() {
|
||||||
// wx.authorize()
|
|
||||||
await this.updateSession()
|
await this.updateSession()
|
||||||
setInterval(()=>{
|
setInterval(()=>{
|
||||||
this.updateSession()
|
this.updateSession()
|
||||||
},60*1000*5)
|
},60*1000*5)
|
||||||
// console.log(this.data.sessionKey)
|
this.readStorageData()
|
||||||
this.updateLib()
|
this.updateLib()
|
||||||
this.updateHistory()
|
this.updateHistory()
|
||||||
this.readStorageData()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//开始界面的按钮相关动画
|
//开始界面的按钮相关动画
|
||||||
@@ -682,7 +680,7 @@ Page({
|
|||||||
wx.request({
|
wx.request({
|
||||||
url: 'http://' + serverAddr + '/getLib', //仅为示例,并非真实的接口地址
|
url: 'http://' + serverAddr + '/getLib', //仅为示例,并非真实的接口地址
|
||||||
data: {
|
data: {
|
||||||
sessionKey:this.data.sessionKey
|
session_key:this.data.session_key
|
||||||
},
|
},
|
||||||
method: "GET",
|
method: "GET",
|
||||||
header: {
|
header: {
|
||||||
@@ -741,7 +739,7 @@ Page({
|
|||||||
wx.request({
|
wx.request({
|
||||||
url: 'http://' + serverAddr + '/getHistory', //仅为示例,并非真实的接口地址
|
url: 'http://' + serverAddr + '/getHistory', //仅为示例,并非真实的接口地址
|
||||||
data: {
|
data: {
|
||||||
sessionKey:this.data.sessionKey
|
session_key:this.data.session_key
|
||||||
},
|
},
|
||||||
method: "POST",
|
method: "POST",
|
||||||
header: {
|
header: {
|
||||||
@@ -779,7 +777,7 @@ Page({
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
var data = res.data
|
var data = res.data
|
||||||
this.setData(
|
this.setData(
|
||||||
{ "sessionKey": data }
|
{ "session_key": data }
|
||||||
)
|
)
|
||||||
resolve()
|
resolve()
|
||||||
// setTimeout(this.updateSession,1000*60*5)
|
// setTimeout(this.updateSession,1000*60*5)
|
||||||
@@ -794,7 +792,7 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 上传照片并
|
// 上传照片并展示收到的结果
|
||||||
uploadImg(tempImagePath: any) {
|
uploadImg(tempImagePath: any) {
|
||||||
wx.getFileSystemManager().readFile({
|
wx.getFileSystemManager().readFile({
|
||||||
filePath: tempImagePath,
|
filePath: tempImagePath,
|
||||||
@@ -806,7 +804,7 @@ Page({
|
|||||||
url: 'http://' + serverAddr + '/rcvImg', //仅为示例,并非真实的接口地址
|
url: 'http://' + serverAddr + '/rcvImg', //仅为示例,并非真实的接口地址
|
||||||
data: {
|
data: {
|
||||||
imgBase64: imgBase64,
|
imgBase64: imgBase64,
|
||||||
sessionKey:this.data.sessionKey
|
session_key:this.data.session_key
|
||||||
},
|
},
|
||||||
method: "POST",
|
method: "POST",
|
||||||
header: {
|
header: {
|
||||||
@@ -853,7 +851,7 @@ Page({
|
|||||||
data: {
|
data: {
|
||||||
history : this.data.data_history,
|
history : this.data.data_history,
|
||||||
collection:this.data.data_collect,
|
collection:this.data.data_collect,
|
||||||
sessionKey:this.data.sessionKey
|
session_key:this.data.session_key
|
||||||
},
|
},
|
||||||
method: "POST",
|
method: "POST",
|
||||||
header: {
|
header: {
|
||||||
@@ -1017,7 +1015,7 @@ Page({
|
|||||||
var list = ['data_history', 'data_collect', 'data_lib']
|
var list = ['data_history', 'data_collect', 'data_lib']
|
||||||
for (var k of list) {
|
for (var k of list) {
|
||||||
this.data[k]=wx.getStorageSync(k)
|
this.data[k]=wx.getStorageSync(k)
|
||||||
console.log(wx.getStorageSync(k))
|
// console.log(wx.getStorageSync(k))
|
||||||
}
|
}
|
||||||
this.setData(
|
this.setData(
|
||||||
{
|
{
|
||||||
@@ -1114,7 +1112,7 @@ Page({
|
|||||||
m1 = parseInt(date1[1]),
|
m1 = parseInt(date1[1]),
|
||||||
d0 = parseInt(date0[2]),
|
d0 = parseInt(date0[2]),
|
||||||
d1 = parseInt(date1[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
|
var res = 0
|
||||||
if (y1 != y0) {
|
if (y1 != y0) {
|
||||||
if (y1 > y0) {
|
if (y1 > y0) {
|
||||||
@@ -1136,7 +1134,7 @@ Page({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
res = -res
|
res = -res
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
return 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)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||||
"projectname": "wxProject-w4w",
|
"projectname": "wxProject-w4w",
|
||||||
"setting": {
|
"setting": {
|
||||||
"compileHotReLoad": true,
|
"compileHotReLoad": false,
|
||||||
"urlCheck": false
|
"urlCheck": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user