Commit f555208b by 程默

手动绑定

parent cfe72829
......@@ -137,7 +137,7 @@ export default {
);
this.unionId = data.unionId || "";
this.userInfo = JSON.parse(e.target.rawData);
console.log(this.unionId, "this.unionId");
console.log(this.userInfo, "this.userInfo");
if (this.unionId) {
login
.checkUnionid({ unionId: this.unionId, openId: this.openid })
......@@ -201,6 +201,9 @@ export default {
headImgUrl: this.userInfo.avatarUrl,
gender: this.userInfo.gender,
nickname: this.userInfo.nickName,
country:this.userInfo.country,
province:this.userInfo.province,
city:this.userInfo.city,
otherPhone:0
})
.then(res => {
......@@ -237,9 +240,19 @@ export default {
});
},
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({
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) {
//对象转querystring
export function serialize(obj) {
var str = [];
if (typeof obj == "string") {
obj = JSON.parse(obj);
}
for (var p in obj) {
if (obj.hasOwnProperty(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