login.js
4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
if (!Array) {
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_form_item2 = common_vendor.resolveComponent("up-form-item");
const _easycom_up_form2 = common_vendor.resolveComponent("up-form");
(_easycom_up_input2 + _easycom_up_form_item2 + _easycom_up_form2)();
}
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_form_item = () => "../../uni_modules/uview-plus/components/u-form-item/u-form-item.js";
const _easycom_up_form = () => "../../uni_modules/uview-plus/components/u-form/u-form.js";
if (!Math) {
(_easycom_up_input + _easycom_up_form_item + _easycom_up_form)();
}
const _sfc_main = {
__name: "login",
setup(__props) {
const logForm = common_vendor.ref({
name: "",
identificationNumber: ""
});
const logFormRef = common_vendor.ref(null);
const rules = {
name: [
{ required: true, message: "请输入姓名", trigger: ["blur", "change"] },
{ min: 2, max: 6, message: "名字应在2到6个字", trigger: ["blur", "change"] },
{
validator: (rule, value, callback) => {
return common_vendor.index.$u.test.chinese(value);
},
message: "请输入中文",
// 触发器可以同时用blur和change
trigger: ["change", "blur"]
}
],
identificationNumber: [
{ required: true, message: "请输入身份证号", trigger: ["blur", "change"] },
{
validator: (rule, value, callback) => {
return common_vendor.index.$u.test.idCard(value);
},
message: "身份证号码不正确",
// 触发器可以同时用blur和change
trigger: ["change", "blur"]
}
]
};
const customStyle = {
height: "80rpx",
backgroundColor: "#F9F9F9",
paddingLeft: "40rpx"
};
const placeholderStyle = {
color: "#bbb",
fontSize: "28rpx"
};
common_vendor.onReady(() => {
logFormRef.value.setRules(rules);
});
const goPrivacy = () => {
common_vendor.index.navigateTo({
url: "/pages/privacy/privacy"
});
};
const submit = () => {
logFormRef.value.validate().then(async (valid) => {
if (valid) {
common_vendor.index.$u.toast("登录成功");
common_vendor.index.navigateTo({
url: "/pages/companyHome/companyHome"
});
} else {
common_vendor.index.$u.toast("校验失败");
}
}).catch(() => {
common_vendor.index.$u.toast("校验失败");
});
};
return (_ctx, _cache) => {
return {
a: common_assets._imports_0,
b: common_vendor.o(($event) => logForm.value.name = $event),
c: common_vendor.p({
shape: "circle",
border: "none",
fontSize: "28rpx",
color: "#bbb",
placeholderStyle,
customStyle,
placeholder: "请输入真实姓名",
modelValue: logForm.value.name
}),
d: common_vendor.p({
prop: "name"
}),
e: common_assets._imports_1,
f: common_vendor.o(($event) => logForm.value.identificationNumber = $event),
g: common_vendor.p({
shape: "circle",
border: "none",
fontSize: "28rpx",
color: "#bbb",
placeholderStyle,
customStyle,
placeholder: "请输入身份证号",
modelValue: logForm.value.identificationNumber
}),
h: common_vendor.p({
prop: "identificationNumber"
}),
i: common_vendor.sr(logFormRef, "e4e4508d-0", {
"k": "logFormRef"
}),
j: common_vendor.p({
model: logForm.value
}),
k: common_vendor.o(goPrivacy),
l: common_vendor.o(submit)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e4e4508d"]]);
wx.createPage(MiniProgramPage);