mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt some
This commit is contained in:
parent
0a35665fc4
commit
5a7e8fece5
@ -42,21 +42,21 @@ App({
|
|||||||
wx.downloadFile({url: app.conf.serve+"/"+cmd, data: data, success: cb})
|
wx.downloadFile({url: app.conf.serve+"/"+cmd, data: data, success: cb})
|
||||||
},
|
},
|
||||||
usercode: function(cb) { var app = this
|
usercode: function(cb) { var app = this
|
||||||
wx.login({success: function(res) { app.request("mp/login/code", {code: res.code}, function(msg) {
|
wx.login({success: function(res) { app.request("mp/login/sess", {code: res.code}, function(msg) {
|
||||||
wx.setStorage({key: "sessid", data: msg.Result()})
|
wx.setStorage({key: "sessid", data: msg.Result()})
|
||||||
app.conf.sessid = msg.Result(), typeof cb == "function" && cb()
|
app.conf.sessid = msg.Result(), typeof cb == "function" && cb()
|
||||||
})}})
|
})}})
|
||||||
},
|
},
|
||||||
userinfo: function(cb) { var app = this
|
userinfo: function(cb) { var app = this
|
||||||
if (app.conf.userInfo) {
|
if (app.conf.userInfo) {
|
||||||
app.request("mp/login/info", app.conf.userInfo, function(msg) {
|
app.request("mp/login/user", app.conf.userInfo, function(msg) {
|
||||||
typeof cb == "function" && cb(app.conf.userInfo)
|
typeof cb == "function" && cb(app.conf.userInfo)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
app.usercode(function() {
|
app.usercode(function() {
|
||||||
wx.getSetting({ success: function(res) { res.authSetting['scope.userInfo'] && wx.getUserInfo({success: function(res) {
|
wx.getSetting({ success: function(res) { res.authSetting['scope.userInfo'] && wx.getUserInfo({success: function(res) {
|
||||||
app.request("mp/login/info", res.userInfo, function(msg) { app.conf.userInfo = res.userInfo
|
app.request("mp/login/user", res.userInfo, function(msg) { app.conf.userInfo = res.userInfo
|
||||||
typeof cb == "function" && cb(res.userInfo)
|
typeof cb == "function" && cb(res.userInfo)
|
||||||
})
|
})
|
||||||
}})}})
|
}})}})
|
||||||
|
@ -59,7 +59,14 @@ Page({
|
|||||||
onReachBottom: function () {},
|
onReachBottom: function () {},
|
||||||
|
|
||||||
plugin: {
|
plugin: {
|
||||||
scan: function(page) { app.scans(function(res) {
|
getLocation: function(page, data) { app.location({success: function(res) {
|
||||||
|
res.latitude = parseInt(res.latitude * 100000)
|
||||||
|
res.longitude = parseInt(res.longitude * 100000)
|
||||||
|
kit.List(page.data.insert, function(item) {
|
||||||
|
res[item.name] && (item.value = res[item.name])
|
||||||
|
}), page.setData(page.data)
|
||||||
|
}}) },
|
||||||
|
scanQRCode: function(page) { app.scans(function(res) {
|
||||||
kit.List(page.data.insert, function(item) {
|
kit.List(page.data.insert, function(item) {
|
||||||
res[item.name] && (item.value = res[item.name])
|
res[item.name] && (item.value = res[item.name])
|
||||||
}), page.setData(page.data)
|
}), page.setData(page.data)
|
||||||
@ -69,12 +76,5 @@ Page({
|
|||||||
res[item.name] && (item.value = res[item.name])
|
res[item.name] && (item.value = res[item.name])
|
||||||
}), page.setData(page.data)
|
}), page.setData(page.data)
|
||||||
}}) },
|
}}) },
|
||||||
location: function(page, data) { app.location({success: function(res) {
|
|
||||||
res.latitude = parseInt(res.latitude * 100000)
|
|
||||||
res.longitude = parseInt(res.longitude * 100000)
|
|
||||||
kit.List(page.data.insert, function(item) {
|
|
||||||
res[item.name] && (item.value = res[item.name])
|
|
||||||
}), page.setData(page.data)
|
|
||||||
}}) },
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user