Files
threeonecheck_web/unpackage/dist/dev/mp-weixin/pages/membermanagemen/membermanagemen.js
2025-12-29 14:59:44 +08:00

96 lines
3.6 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_picker2 + _easycom_u_popup2)();
}
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_picker + _easycom_u_popup)();
}
const _sfc_main = {
__name: "membermanagemen",
setup(__props) {
const showPopup = common_vendor.ref(false);
const showDeptPicker = common_vendor.ref(false);
const formData = common_vendor.reactive({
username: "",
nickname: "",
phone: "",
password: "",
department: ""
});
const handleSubmit = () => {
if (!formData.username) {
common_vendor.index.showToast({ title: "请输入用户名", icon: "none" });
return;
}
if (!formData.password || formData.password.length < 6 || formData.password.length > 16) {
common_vendor.index.showToast({ title: "请输入6-16位密码", icon: "none" });
return;
}
if (!formData.department) {
common_vendor.index.showToast({ title: "请选择主部门", icon: "none" });
return;
}
console.log("提交数据:", formData);
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
showPopup.value = false;
};
const Lock = () => {
common_vendor.index.showModal({
title: "提示",
content: "确定要锁定该成员吗?",
confirmColor: "#2667E9",
success: (res) => {
if (res.confirm) {
console.log("用户点击确定");
common_vendor.index.showToast({ title: "锁定成功", icon: "success" });
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
};
const show = common_vendor.ref(false);
const columns = common_vendor.reactive([
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司"]
]);
return (_ctx, _cache) => {
return {
a: common_vendor.o(($event) => show.value = true),
b: common_vendor.p({
show: show.value,
columns
}),
c: common_vendor.o(($event) => Lock()),
d: common_vendor.o(($event) => showPopup.value = true),
e: common_vendor.o(($event) => showPopup.value = false),
f: formData.username,
g: common_vendor.o(($event) => formData.username = $event.detail.value),
h: formData.nickname,
i: common_vendor.o(($event) => formData.nickname = $event.detail.value),
j: formData.phone,
k: common_vendor.o(($event) => formData.phone = $event.detail.value),
l: formData.password,
m: common_vendor.o(($event) => formData.password = $event.detail.value),
n: common_vendor.t(formData.department || "请选择主部门"),
o: common_vendor.n(formData.department ? "" : "text-gray"),
p: common_vendor.o(($event) => showDeptPicker.value = true),
q: common_vendor.o(($event) => showPopup.value = false),
r: common_vendor.o(handleSubmit),
s: common_vendor.o(($event) => showPopup.value = false),
t: common_vendor.p({
show: showPopup.value,
mode: "center",
round: "20"
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-06d9f81b"]]);
wx.createPage(MiniProgramPage);