first commit
This commit is contained in:
105
unpackage/dist/dev/mp-weixin/pages/area/management.js
vendored
Normal file
105
unpackage/dist/dev/mp-weixin/pages/area/management.js
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_input2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "management",
|
||||
setup(__props) {
|
||||
const showEditPopup = common_vendor.ref(false);
|
||||
const areaData = common_vendor.reactive({
|
||||
name: "区域名称",
|
||||
color: "#ef4444"
|
||||
});
|
||||
const formData = common_vendor.reactive({
|
||||
name: "",
|
||||
color: "#ef4444"
|
||||
});
|
||||
const presetColors = [
|
||||
"#2563eb",
|
||||
"#ef4444",
|
||||
"#10b981",
|
||||
"#f59e0b",
|
||||
"#6366f1",
|
||||
"#ec4899",
|
||||
"#06b6d4",
|
||||
"#84cc16",
|
||||
"#f97316",
|
||||
"#4f46e5",
|
||||
"#dc2626",
|
||||
"#f59e0b",
|
||||
"#d97706",
|
||||
"#8b5cf6",
|
||||
"#db2777"
|
||||
];
|
||||
const openEditPopup = () => {
|
||||
formData.name = areaData.name;
|
||||
formData.color = areaData.color;
|
||||
showEditPopup.value = true;
|
||||
};
|
||||
const selectColor = (color) => {
|
||||
formData.color = color;
|
||||
};
|
||||
const handleEdit = () => {
|
||||
if (!formData.name) {
|
||||
common_vendor.index.showToast({ title: "请输入区域名称", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.color) {
|
||||
common_vendor.index.showToast({ title: "请选择区域颜色", icon: "none" });
|
||||
return;
|
||||
}
|
||||
areaData.name = formData.name;
|
||||
areaData.color = formData.color;
|
||||
showEditPopup.value = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "编辑成功",
|
||||
icon: "success"
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.t(areaData.name || "区域名称"),
|
||||
b: areaData.color,
|
||||
c: common_vendor.t(areaData.color),
|
||||
d: common_vendor.o(openEditPopup),
|
||||
e: common_vendor.o(($event) => showEditPopup.value = false),
|
||||
f: common_vendor.o(($event) => formData.name = $event),
|
||||
g: common_vendor.p({
|
||||
placeholder: "请输入区域名称",
|
||||
modelValue: formData.name
|
||||
}),
|
||||
h: common_vendor.o(($event) => formData.color = $event),
|
||||
i: common_vendor.p({
|
||||
placeholder: "#ef4444",
|
||||
modelValue: formData.color
|
||||
}),
|
||||
j: formData.color,
|
||||
k: common_vendor.f(presetColors, (color, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: color,
|
||||
c: common_vendor.o(($event) => selectColor(color), index)
|
||||
};
|
||||
}),
|
||||
l: common_vendor.o(($event) => showEditPopup.value = false),
|
||||
m: common_vendor.o(handleEdit),
|
||||
n: common_vendor.o(($event) => showEditPopup.value = false),
|
||||
o: common_vendor.p({
|
||||
show: showEditPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-847f15e8"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
7
unpackage/dist/dev/mp-weixin/pages/area/management.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/area/management.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "区域管理",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/area/management.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/area/management.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-847f15e8', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-847f15e8"><view class="flex justify-between data-v-847f15e8"><view class="data-v-847f15e8"><view class="text-bold text-black data-v-847f15e8">{{a}}</view><view class="margin-top flex align-center data-v-847f15e8"><text class="data-v-847f15e8">颜色:</text><view class="color-dot data-v-847f15e8" style="{{'background-color:' + b}}"></view><text class="margin-left-xs data-v-847f15e8">{{c}}</text></view></view><view class="data-v-847f15e8"><button class="bg-blue cu-btn data-v-847f15e8" bindtap="{{d}}">编辑</button><button class="bg-red cu-btn margin-left data-v-847f15e8">删除</button></view></view></view><button class="cuIcon-add bg-blue round margin-top-xl data-v-847f15e8">新增公司区域</button><u-popup wx:if="{{o}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" u-s="{{['d']}}" bindclose="{{n}}" u-i="847f15e8-0" bind:__l="__l" u-p="{{o}}"><view class="popup-content data-v-847f15e8"><view class="popup-header data-v-847f15e8"><view class="popup-title text-bold data-v-847f15e8">编辑区域</view><view class="popup-close data-v-847f15e8" bindtap="{{e}}">×</view></view><view class="popup-body data-v-847f15e8"><view class="flex margin-bottom-sm data-v-847f15e8"><view class="data-v-847f15e8">区域名称</view><view class="text-red data-v-847f15e8">*</view></view><up-input wx:if="{{g}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" u-i="847f15e8-1,847f15e8-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-input><view class="flex margin-bottom-sm margin-top data-v-847f15e8"><view class="data-v-847f15e8">区域颜色</view><view class="text-red data-v-847f15e8">*</view></view><view class="flex align-center data-v-847f15e8"><up-input wx:if="{{i}}" class="flex-sub data-v-847f15e8" virtualHostClass="flex-sub data-v-847f15e8" u-i="847f15e8-2,847f15e8-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-input><view class="color-preview data-v-847f15e8" style="{{'background-color:' + j}}"></view></view><view class="margin-top margin-bottom-sm text-gray data-v-847f15e8">预设颜色</view><view class="color-grid data-v-847f15e8"><view wx:for="{{k}}" wx:for-item="color" wx:key="a" class="color-item data-v-847f15e8" style="{{'background-color:' + color.b}}" bindtap="{{color.c}}"></view></view></view><view class="popup-footer data-v-847f15e8"><button class="btn-cancel data-v-847f15e8" bindtap="{{l}}">取消</button><button class="btn-confirm bg-blue data-v-847f15e8" bindtap="{{m}}">确定</button></view></view></u-popup></view>
|
||||
105
unpackage/dist/dev/mp-weixin/pages/area/management.wxss
vendored
Normal file
105
unpackage/dist/dev/mp-weixin/pages/area/management.wxss
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-847f15e8 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.popup-content.data-v-847f15e8 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-847f15e8 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-title.data-v-847f15e8 {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.popup-close.data-v-847f15e8 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
}
|
||||
.popup-body.data-v-847f15e8 {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.popup-footer.data-v-847f15e8 {
|
||||
display: flex;
|
||||
padding: 20rpx 30rpx 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-847f15e8 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 30rpx;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
.popup-footer button.data-v-847f15e8::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-847f15e8 {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-847f15e8 {
|
||||
color: #fff;
|
||||
}
|
||||
.color-preview.data-v-847f15e8 {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-left: 20rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.color-grid.data-v-847f15e8 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.color-item.data-v-847f15e8 {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 12rpx;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.color-item.data-v-847f15e8:active {
|
||||
transform: scale(0.9);
|
||||
}
|
||||
.color-dot.data-v-847f15e8 {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 6rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user