iotAR小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

57 lines
1.2 KiB

import { post } from "../../getMapData";
Page({
/**
* 页面的初始数据
*/
data: {
agreed: false,
},
toPrivacy() {
wx.navigateTo({
url: "/pages/privacy/index",
});
},
toggleAgreed() {
this.setData({ agreed: !this.data.agreed });
},
toMainPage() {
const app = getApp();
app.globalData.userDeny = true;
return wx.redirectTo({
url: "/pages/h5map/index",
});
},
async ongetphonenumber(e) {
if (!e.detail.code) {
return this.toMainPage();
}
try {
wx.showLoading();
const app = getApp();
const { openid } = app.globalData;
const {
code: resCode,
data: { isShopMember, memberID },
} = await post("/api/ar/v1/applet/MemberRegister", {
code: e.detail.code,
wechatID: openid,
});
if (resCode === "200") {
app.globalData.memberID = memberID;
app.globalData.isShopMember = isShopMember;
wx.reLaunch({
url: "/pages/h5map/index",
});
} else {
this.toMainPage();
}
} catch (error) {
this.toMainPage();
console.log(error);
} finally {
wx.hideLoading();
}
},
});