93 lines
2.5 KiB
JavaScript
93 lines
2.5 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
const request_api = require("../../../request/api.js");
|
|
const common_assets = require("../../../common/assets.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
contentTop: "",
|
|
mobile: "",
|
|
//手机号
|
|
code: ""
|
|
//验证码
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.contentTop = common_vendor.inject("navHeight") + 230 / 750 * common_vendor.inject("windowWidth");
|
|
},
|
|
methods: {
|
|
/**
|
|
* 点击获取验证码
|
|
*/
|
|
clickGetCode() {
|
|
},
|
|
/**
|
|
* 点击立即登录
|
|
*/
|
|
clickLoginAtOnce() {
|
|
if (!this.mobile) {
|
|
common_vendor.index.showToast({
|
|
title: "请输入手机号",
|
|
icon: "none"
|
|
});
|
|
return;
|
|
}
|
|
if (!this.code) {
|
|
common_vendor.index.showToast({
|
|
title: "请输入验证码",
|
|
icon: "none"
|
|
});
|
|
return;
|
|
}
|
|
let param = { phone: this.mobile, code: this.code, isJson: 1 };
|
|
request_api.loginByPhone(param).then((res) => {
|
|
if (res.code == 200)
|
|
;
|
|
else
|
|
common_vendor.index.showToast({
|
|
title: res.message,
|
|
icon: "none"
|
|
});
|
|
}).catch((error) => {
|
|
});
|
|
},
|
|
/**
|
|
* 点击一键登录
|
|
*/
|
|
clickOneClickLogin() {
|
|
common_vendor.index.navigateBack();
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_navBar2 = common_vendor.resolveComponent("navBar");
|
|
_easycom_navBar2();
|
|
}
|
|
const _easycom_navBar = () => "../../../components/navBar/navBar.js";
|
|
if (!Math) {
|
|
_easycom_navBar();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: common_vendor.p({
|
|
leftText: "登录",
|
|
hideNavBg: true,
|
|
backBlack: true
|
|
}),
|
|
b: common_vendor.s("margin-top:" + $data.contentTop + "px;"),
|
|
c: common_assets._imports_0$1,
|
|
d: common_assets._imports_1$7,
|
|
e: $data.mobile,
|
|
f: common_vendor.o(($event) => $data.mobile = $event.detail.value),
|
|
g: common_assets._imports_2$8,
|
|
h: $data.code,
|
|
i: common_vendor.o(($event) => $data.code = $event.detail.value),
|
|
j: common_vendor.o(($event) => $options.clickGetCode()),
|
|
k: common_vendor.o(($event) => $options.clickLoginAtOnce()),
|
|
l: common_vendor.o(($event) => $options.clickOneClickLogin())
|
|
};
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/login/codeLogin/codeLogin.js.map
|