基本功能都已完成
This commit is contained in:
@@ -1,184 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _component_TabBar = common_vendor.resolveComponent("TabBar");
|
||||
(_easycom_up_picker2 + _easycom_u_popup2 + _component_TabBar)();
|
||||
}
|
||||
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 list = common_vendor.ref([]);
|
||||
request_api.getMemberList().then((res) => {
|
||||
list.value = res.data;
|
||||
});
|
||||
const showPopup = common_vendor.ref(false);
|
||||
const showDeptPicker = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
username: "",
|
||||
nickname: "",
|
||||
phone: "",
|
||||
password: "",
|
||||
department: ""
|
||||
});
|
||||
const handleSubmit = async () => {
|
||||
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;
|
||||
}
|
||||
const params = {
|
||||
userName: formData.username,
|
||||
nickName: formData.nickname || "",
|
||||
phonenumber: formData.phone || "",
|
||||
password: formData.password,
|
||||
roleType: "common"
|
||||
};
|
||||
try {
|
||||
const res = await request_api.addMember(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "添加成功",
|
||||
icon: "success"
|
||||
});
|
||||
showPopup.value = false;
|
||||
formData.username = "";
|
||||
formData.nickname = "";
|
||||
formData.phone = "";
|
||||
formData.password = "";
|
||||
formData.department = "";
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "添加失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("添加成员失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const Lock = (item) => {
|
||||
const isLocked = item.lockStatus === 1;
|
||||
const actionText = isLocked ? "解锁" : "锁定";
|
||||
const newLockStatus = isLocked ? 0 : 1;
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: `确定要${actionText}该成员吗?`,
|
||||
confirmColor: "#2667E9",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
const result = await request_api.lockOrUnlockMember({
|
||||
userId: item.userId,
|
||||
lockStatus: newLockStatus
|
||||
});
|
||||
if (result.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: `${actionText}成功`,
|
||||
icon: "success"
|
||||
});
|
||||
item.lockStatus = newLockStatus;
|
||||
item.statusName = newLockStatus === 1 ? "已锁定" : "正常";
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: result.msg || `${actionText}失败`,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`${actionText}成员失败:`, error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const show = common_vendor.ref(false);
|
||||
const columns = common_vendor.reactive([
|
||||
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司"]
|
||||
]);
|
||||
const deptColumns = common_vendor.reactive([
|
||||
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司", "研发部门", "深圳总公司", "若依科技"]
|
||||
]);
|
||||
const onDeptConfirm = (e) => {
|
||||
console.log("选择的部门:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
formData.department = e.value[0];
|
||||
}
|
||||
showDeptPicker.value = false;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(list.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => show.value = true, item.id),
|
||||
b: "06d9f81b-0-" + i0,
|
||||
c: common_vendor.t(item.nickName),
|
||||
d: common_vendor.t(item.statusName),
|
||||
e: common_vendor.t(item.phonenumber),
|
||||
f: common_vendor.t(item.lockStatus === 1 ? "解锁" : "锁定"),
|
||||
g: common_vendor.o(($event) => Lock(item), item.id),
|
||||
h: item.id
|
||||
};
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
show: show.value,
|
||||
columns
|
||||
}),
|
||||
c: common_vendor.o(($event) => showPopup.value = true),
|
||||
d: common_vendor.o(($event) => showPopup.value = false),
|
||||
e: formData.username,
|
||||
f: common_vendor.o(($event) => formData.username = $event.detail.value),
|
||||
g: formData.nickname,
|
||||
h: common_vendor.o(($event) => formData.nickname = $event.detail.value),
|
||||
i: formData.phone,
|
||||
j: common_vendor.o(($event) => formData.phone = $event.detail.value),
|
||||
k: formData.password,
|
||||
l: common_vendor.o(($event) => formData.password = $event.detail.value),
|
||||
m: common_vendor.t(formData.department || "请选择主部门"),
|
||||
n: common_vendor.n(formData.department ? "" : "text-gray"),
|
||||
o: common_vendor.o(($event) => showDeptPicker.value = true),
|
||||
p: common_vendor.o(onDeptConfirm),
|
||||
q: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
r: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
s: common_vendor.p({
|
||||
show: showDeptPicker.value,
|
||||
columns: deptColumns
|
||||
}),
|
||||
t: common_vendor.o(($event) => showPopup.value = false),
|
||||
v: common_vendor.o(handleSubmit),
|
||||
w: common_vendor.o(($event) => showPopup.value = false),
|
||||
x: 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);
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "成员管理",
|
||||
"usingComponents": {
|
||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="padding bg-white radius margin-bottom data-v-06d9f81b"><view class="flex justify-between align-center data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-tite data-v-06d9f81b"></view><view class="text-bold margin-left-xs data-v-06d9f81b" bindtap="{{item.a}}">湘西自治州和谐网络科技有限公司</view><up-picker wx:if="{{b}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="{{item.b}}" bind:__l="__l" u-p="{{b}}"></up-picker></view><view class="tag-outline data-v-06d9f81b">负责人</view></view><view class="flex margin-top data-v-06d9f81b"><view class="cu-avatar radius lg data-v-06d9f81b" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg)"></view><view class="margin-left data-v-06d9f81b"><view class="flex data-v-06d9f81b"><view class="data-v-06d9f81b">{{item.c}}</view><view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs data-v-06d9f81b">{{item.d}}</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">手机设置:</view><view class="data-v-06d9f81b">{{item.e}}</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">登录IP:</view><view class="data-v-06d9f81b">45.135.228.172</view></view></view><button class="bg-blue btn-lock data-v-06d9f81b" bindtap="{{item.g}}">{{item.f}}</button></view></view><button class="lg cuIcon-add bg-blue round margin-top-xl data-v-06d9f81b" bindtap="{{c}}">添加成员</button><u-popup wx:if="{{x}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{w}}" u-i="06d9f81b-1" bind:__l="__l" u-p="{{x}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{d}}">×</view></view><view class="popup-body data-v-06d9f81b"><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入用户名" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><input class="form-input data-v-06d9f81b" placeholder="请输入昵称" value="{{g}}" bindinput="{{h}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><input class="form-input data-v-06d9f81b" placeholder="请输入手机号" type="number" value="{{i}}" bindinput="{{j}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入密码(6-16位)" password value="{{k}}" bindinput="{{l}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">主部门<text class="text-red data-v-06d9f81b">*</text></view><view class="form-input form-select data-v-06d9f81b" bindtap="{{o}}"><text class="{{['data-v-06d9f81b', n]}}">{{m}}</text></view><up-picker wx:if="{{s}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{p}}" bindcancel="{{q}}" bindclose="{{r}}" u-i="06d9f81b-2,06d9f81b-1" bind:__l="__l" u-p="{{s}}"></up-picker></view></view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{t}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{v}}">确定</button></view></view></u-popup><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3" bind:__l="__l"/></view>
|
||||
@@ -1,127 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-06d9f81b {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.border-tite.data-v-06d9f81b {
|
||||
width: 8rpx;
|
||||
height: 32rpx;
|
||||
background: #2667E9;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.tag-outline.data-v-06d9f81b {
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #EEF3FF;
|
||||
color: #2E7CF3;
|
||||
font-size: 24rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: -30rpx;
|
||||
border-radius: 24rpx 0rpx 0rpx 24rpx;
|
||||
}
|
||||
.btn-lock.data-v-06d9f81b {
|
||||
width: 112rpx;
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
padding: 0;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.popup-content.data-v-06d9f81b {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.popup-header.data-v-06d9f81b {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.popup-title.data-v-06d9f81b {
|
||||
font-size: 34rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-close.data-v-06d9f81b {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-06d9f81b {
|
||||
max-height: 700rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.form-item.data-v-06d9f81b {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.form-label.data-v-06d9f81b {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.form-input.data-v-06d9f81b {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
padding: 0 24rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-select.data-v-06d9f81b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.popup-footer.data-v-06d9f81b {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 30rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.btn-cancel.data-v-06d9f81b {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border: 2rpx solid #2667E9;
|
||||
border-radius: 40rpx;
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.btn-confirm.data-v-06d9f81b {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user