|
@@ -7,6 +7,22 @@ Page({
|
|
|
lng: '', // 经度
|
|
|
lat: '', // 纬度
|
|
|
visitLocation: '',
|
|
|
+ info: '', //老人锕
|
|
|
+ },
|
|
|
+ oldClick(e) {
|
|
|
+ let fid = e.currentTarget.dataset.infos.fid;
|
|
|
+ let name = e.currentTarget.dataset.infos.name;
|
|
|
+ const app = getApp()
|
|
|
+ app.globalData.id = fid
|
|
|
+ app.globalData.name = name
|
|
|
+ wx.switchTab({
|
|
|
+ url: `/pages/collectInfo/collectInfo`,
|
|
|
+ success: function (e) {
|
|
|
+ var page = getCurrentPages().pop();
|
|
|
+ if (page == undefined || page == null) return;
|
|
|
+ page.onLoad();
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
time() {
|
|
|
var timestamp = Date.parse(new Date());
|
|
@@ -60,39 +76,45 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
- setTimeout(function () { //需要用户授权获取位置
|
|
|
- wx.getSetting({
|
|
|
- success: (res) => {
|
|
|
- if (!res.authSetting['scope.userLocation']) {
|
|
|
- wx.openSetting({
|
|
|
- success: (response) => {
|
|
|
- wx.showModal({
|
|
|
- title: '请重新授权',
|
|
|
- content: '需要获取您的地址信息',
|
|
|
- success: function (data) {
|
|
|
- wx.getLocation({
|
|
|
- success: function (res) {
|
|
|
- var latitude = res.latitude;
|
|
|
- var longitude = res.longitude;
|
|
|
- that.setData({
|
|
|
- selfLongitude: longitude, //经度
|
|
|
- selfLatitude: latitude, //纬度
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取老人详情
|
|
|
+ oldsInfo(id) {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/info/one',
|
|
|
+ method: "GET",
|
|
|
+ header: {
|
|
|
+ appletsId: wx.getStorageSync('openId')
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ id: id
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res, "777777");
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.setData({
|
|
|
+ info: res.data.data
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: '查询失败,当前二维码过期或失效',
|
|
|
+ success() {
|
|
|
+ wx.switchTab({
|
|
|
+ url: '/pages/index/index',
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
- }, 1000);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
- onLoad: function () {
|
|
|
+ onLoad: function (opotions) {
|
|
|
this.time();
|
|
|
this.getSelfLocation();
|
|
|
+ this.oldsInfo(opotions.id);
|
|
|
},
|
|
|
})
|