Commit f555208b by 程默

手动绑定

parent cfe72829
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
); );
this.unionId = data.unionId || ""; this.unionId = data.unionId || "";
this.userInfo = JSON.parse(e.target.rawData); this.userInfo = JSON.parse(e.target.rawData);
console.log(this.unionId, "this.unionId"); console.log(this.userInfo, "this.userInfo");
if (this.unionId) { if (this.unionId) {
login login
.checkUnionid({ unionId: this.unionId, openId: this.openid }) .checkUnionid({ unionId: this.unionId, openId: this.openid })
...@@ -201,6 +201,9 @@ export default { ...@@ -201,6 +201,9 @@ export default {
headImgUrl: this.userInfo.avatarUrl, headImgUrl: this.userInfo.avatarUrl,
gender: this.userInfo.gender, gender: this.userInfo.gender,
nickname: this.userInfo.nickName, nickname: this.userInfo.nickName,
country:this.userInfo.country,
province:this.userInfo.province,
city:this.userInfo.city,
otherPhone:0 otherPhone:0
}) })
.then(res => { .then(res => {
...@@ -237,9 +240,19 @@ export default { ...@@ -237,9 +240,19 @@ export default {
}); });
}, },
handbindHandle() { handbindHandle() {
const query={
openId: this.openid,
unionId: this.unionId,
headImgUrl: this.userInfo.avatarUrl,
gender: this.userInfo.gender,
nickname: this.userInfo.nickName,
country:this.userInfo.country,
province:this.userInfo.province,
city:this.userInfo.city
}
//绑定手机号 //绑定手机号
wx.navigateTo({ wx.navigateTo({
url: `../index/main?from=login&backpath=/login/wxRegister` url: `../index/main?from=login&backpath=/login/wxRegister&params=${encodeURIComponent(serialize(query))}`
}); });
} }
} }
......
...@@ -22,7 +22,9 @@ export function formatTime(date) { ...@@ -22,7 +22,9 @@ export function formatTime(date) {
//对象转querystring //对象转querystring
export function serialize(obj) { export function serialize(obj) {
var str = []; var str = [];
obj = JSON.parse(obj); if (typeof obj == "string") {
obj = JSON.parse(obj);
}
for (var p in obj) { for (var p in obj) {
if (obj.hasOwnProperty(p)) { if (obj.hasOwnProperty(p)) {
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
......
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