const _my = require("../../__antmove/api/index.js")(my); const wx = _my; const util = require("../func/request"); //检测是否获取手机号 const isGetPhone = e => { if (e.detail.errMsg == "getPhoneNumber:ok") { return true; } else { return false; } }; //获取手机号 const getPhone = e => { if (!isGetPhone(e)) { return { state: false, msg: "我们需要获取您的手机号才能进行实名登录哦!" }; } var code = wx.getStorageSync("wxCode"); return util .request_rlxf({ url: "/api/next/doGetPhone", data: { code: code, iv: e.detail.iv, encryptedData: e.detail.encryptedData, type: 3 }, method: "post", type: "application/json" }) .then(suc => { return { state: true, msg: suc }; }) .catch(err => { return { state: false, msg: err }; }); }; module.exports = getPhone;