hldy_xcx/unpackage/dist/dev/mp-weixin/pages/login/phonebumber.js

70 lines
2.1 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const api_loginApi = require("../../api/loginApi.js");
if (!Math) {
huakuai();
}
const huakuai = () => "../../compontent/public/huakuai.js";
const _sfc_main = {
__name: "phonebumber",
setup(__props) {
const huakuaiOpen = common_vendor.ref(false);
const jumpto = () => {
huakuaiOpen.value = true;
};
const codeIsOk = () => {
huakuaiOpen.value = false;
api_loginApi.getHkCode({
mobile: phonenumber.value
}).then((res) => {
if (res.success) {
common_vendor.index.navigateTo({
url: `/pages/login/code?mobile=${phonenumber.value}&hkcode=${res.message}`
});
} else {
common_vendor.index.showToast({
title: res.message,
icon: "none",
// 不显示图标(提示信息)
duration: 2e3
// 显示时长(毫秒)
});
}
});
};
function is11DigitNumber(value) {
return /^\d{11}$/.test(value.toString());
}
const phonenumber = common_vendor.ref("");
const canClick = common_vendor.ref(false);
const isRight = (res) => {
if (is11DigitNumber(res.detail.value)) {
phonenumber.value = res.detail.value;
canClick.value = true;
} else {
canClick.value = false;
}
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(isRight),
b: canClick.value
}, canClick.value ? {
c: common_vendor.o(jumpto)
} : {}, {
d: !canClick.value
}, !canClick.value ? {} : {}, {
e: huakuaiOpen.value
}, huakuaiOpen.value ? {
f: common_vendor.o(() => {
}),
g: common_vendor.o(codeIsOk),
h: common_vendor.o(($event) => huakuaiOpen.value = false)
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-94511ff7"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/phonebumber.js.map