const _my = require("../../__antmove/api/index.js")(my);
const wx = _my;
//若填写的身份证号为330821199603150212，则直接进入rlxf_pass界面并携带填写的姓名，身份证号和手机号
const weixinTestFuncAdmin = ({
    inputName,
    inputIdcard,
    phoneNumber,
    orgId
}) => {
    if (inputIdcard == "330821199603150212") {
        my.alert({
            title: "提示",
            content: "登录成功！",
            success() {
                wx.reLaunch({
                    url: `/pages/wx_airport/rlxf_pass/rlxf_pass?name=${inputName}&idNumber=${inputIdcard}&phone=${phoneNumber}`
                });
            }
        });
        return true;
    } else {
        return false;
    }
};

//解除未扫码进入的限制
const weixinTestFuncSloveOrgId = function(inputIdcard) {
    if (inputIdcard == "330821199603150212") {
        this.setData({
            disableSubmit: true
        });
    } else {
        console.log("00");
    }
};

//创建一个虚拟的userInfo信息
const weixinTestMakeUserInfo = function(name, phone, idNumber) {
    let userInfoTest = {
        username: name,
        phone: phone,
        idNumber: idNumber,
        org: "公司试验区",
        createTime: "2023-04-15 20:16:00"
    };
    return userInfoTest;
};
module.exports = {
    weixinTestFuncAdmin,
    weixinTestFuncSloveOrgId,
    weixinTestMakeUserInfo
};
