binding.js
3.88 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
"use strict";
const common_vendor = require("../../common/vendor.js");
const config = require("../../config.js");
const common_login = require("../../common/login.js");
require("../../common/request.js");
require("../../common/aes.js");
if (!Array) {
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uni_easyinput2 + _easycom_uni_popup2)();
}
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uni_easyinput + _easycom_uni_popup)();
}
const _sfc_main = {
__name: "binding",
setup(__props) {
const popup = common_vendor.ref(null);
common_vendor.ref(true);
common_vendor.ref(false);
const showAgree = common_vendor.ref(false);
const form = common_vendor.ref({});
const codeUrl = common_vendor.ref("");
const inputstyle = common_vendor.ref({
borderColor: "transparent",
fontSize: "30rpx"
});
const app = getApp();
let path = "/pages/index/index";
common_vendor.onLoad((option) => {
if (option.path) {
path = decodeURIComponent(option.path);
}
getCode();
});
function getCode() {
common_login.getCodeImg().then((res) => {
codeUrl.value = "data:image/gif;base64," + res.data.img;
form.value.uuid = res.data.uuid;
});
}
function handleLogin() {
if (!form.value.username) {
common_vendor.index.showToast({
title: "账号不能为空",
icon: "none"
});
return;
}
if (!form.value.password) {
common_vendor.index.showToast({
title: "密码不能为空",
icon: "none"
});
return;
}
if (!form.value.code) {
common_vendor.index.showToast({
title: "验证码不能为空",
icon: "none"
});
return;
}
common_login.pcLogin(form.value).then((res) => {
app.globalData.isLogin = true;
common_vendor.index.redirectTo({
url: path
});
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(config.config).baseUrl_api + "/fs/static/login/logo@2x.png",
b: common_vendor.unref(config.config).baseUrl_api + "/fs/static/login/tag01@2x.png",
c: common_vendor.o(($event) => form.value.username = $event),
d: common_vendor.p({
styles: inputstyle.value,
placeholder: "会员号",
modelValue: form.value.username
}),
e: common_vendor.unref(config.config).baseUrl_api + "/fs/static/login/tag02@2x.png",
f: common_vendor.o(($event) => form.value.password = $event),
g: common_vendor.p({
styles: inputstyle.value,
placeholder: "密码",
type: "password",
modelValue: form.value.password
}),
h: common_vendor.unref(config.config).baseUrl_api + "/fs/static/login/tag03@2x.png",
i: common_vendor.o(($event) => form.value.code = $event),
j: common_vendor.p({
styles: inputstyle.value,
placeholder: "图形验证码",
modelValue: form.value.code
}),
k: codeUrl.value,
l: common_vendor.o(getCode),
m: common_vendor.o(handleLogin),
n: showAgree.value
}, showAgree.value ? {
o: common_vendor.sr(popup, "ad0ee6b7-3", {
"k": "popup"
}),
p: common_vendor.p({
["background-color"]: "#fff"
})
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ad0ee6b7"], ["__file", "/Users/yangyang/ztx_wx_minapp/pages/index/binding.vue"]]);
wx.createPage(MiniProgramPage);