Commit 3f989d03 by shijiuyan

1

parent 6341be4a
...@@ -32,9 +32,7 @@ Page({ ...@@ -32,9 +32,7 @@ Page({
var location = wx.getStorageSync('location'); var location = wx.getStorageSync('location');
var latitude = location.latitude; var latitude = location.latitude;
var longitude = location.longitude; var longitude = location.longitude;
wx.showToast({
title: location,
})
wx.request({ wx.request({
url: app.url + 'ajax_get_user_role.php', url: app.url + 'ajax_get_user_role.php',
data: { data: {
......
...@@ -70,40 +70,53 @@ Page({ ...@@ -70,40 +70,53 @@ Page({
} }
wx.request({ wx.request({
url: app.url + 'ajax_user_register.php', url: app.url +'ajax_get_unionid.php',
data: { data:{
unionId: config.unionId, openid:config.openId,
openId: config.openId, iv:res.iv,
role: that.data.role, encryptedData: res.encryptedData
name: app.globalData.userInfo.nickName,
headerImg: app.globalData.userInfo.avatarUrl,
schoolNo: that.data.schoolNo,
classNo: that.data.classNo,
schoolOwner: that.data.schoolOwner,
classOwner: that.data.classOwner
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}, },
fail: function (res) { success(resp){
wx.showToast({ if(resp.data.status=='OK'){
title: res.data.result.message, wx.request({
icon: 'success', url: app.url + 'ajax_user_register.php',
duration: 2000 data: {
}); unionId: resp.data.result.unionId,
//跳转到首页 openId: config.openId,
wx.switchTab({ role: that.data.role,
url: '../index/index', name: app.globalData.userInfo.nickName,
}); headerImg: app.globalData.userInfo.avatarUrl,
}, schoolNo: that.data.schoolNo,
complete: function (res) { }, classNo: that.data.classNo,
schoolOwner: that.data.schoolOwner,
classOwner: that.data.classOwner
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
},
fail: function (res) {
wx.showToast({
title: res.data.result.message,
icon: 'success',
duration: 2000
});
//跳转到首页
wx.switchTab({
url: '../index/index',
});
},
complete: function (res) { },
})
}
}
}) })
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment