|
|
@@ -0,0 +1,658 @@
|
|
|
+<template>
|
|
|
+ <div class="service-equipment">
|
|
|
+ <div class="service-equipment__content">
|
|
|
+ <div class="page-header">
|
|
|
+ <div class="page-title">你们拥有哪些农机?</div>
|
|
|
+ <div class="page-subtitle">让调度更精准(可多选)</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="showScopeTabs" class="tab-pills">
|
|
|
+ <div
|
|
|
+ v-for="tab in scopeTabs"
|
|
|
+ :key="tab.key"
|
|
|
+ class="tab-pill"
|
|
|
+ :class="{ active: activeScope === tab.key }"
|
|
|
+ @click="handleScopeChange(tab.key)"
|
|
|
+ >
|
|
|
+ {{ tab.label }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="toolbar">
|
|
|
+ <div class="search-bar">
|
|
|
+ <el-icon class="search-icon">
|
|
|
+ <Search />
|
|
|
+ </el-icon>
|
|
|
+ <input
|
|
|
+ v-model="searchKeyword"
|
|
|
+ class="search-input"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入农机名称"
|
|
|
+ @keyup.enter="handleSearch"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="add-btn" @click="showAddPopup = true">+ 添加农机</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="equipment-list"
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-background="rgba(15, 15, 15, 0.55)"
|
|
|
+ >
|
|
|
+ <div v-for="group in displayGroups" :key="group.name" class="equipment-card">
|
|
|
+ <div class="section-title">
|
|
|
+ <img class="title-icon" src="@/assets/img/home/label-icon.png" alt="" />
|
|
|
+ <span>{{ group.name }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="tag-group">
|
|
|
+ <div
|
|
|
+ v-for="item in group.items"
|
|
|
+ :key="item.id"
|
|
|
+ class="tag-item"
|
|
|
+ :class="{ selected: selectedIds.has(String(item.id)) }"
|
|
|
+ @click="toggleSelect(item)"
|
|
|
+ >
|
|
|
+ <span class="text">{{ item.name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="!loading && !displayGroups.length" class="empty-tip">暂无匹配农机</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="service-equipment__footer">
|
|
|
+ <div class="action-btns">
|
|
|
+ <div class="action-btn secondary" @click="emit('prev')">上一步</div>
|
|
|
+ <div class="action-btn primary" @click="handleConfirm">确认</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <Popup v-model:show="showAddPopup" round closeable class="add-machine-popup">
|
|
|
+ <div class="add-machine-popup__content">
|
|
|
+ <div class="popup-title">添加农机</div>
|
|
|
+ <input v-model="newMachineName" class="popup-input" placeholder="请输入农机名称" />
|
|
|
+ <div class="popup-confirm" @click="handleAddConfirm">确认</div>
|
|
|
+ </div>
|
|
|
+ </Popup>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { computed, onMounted, reactive, ref } from "vue";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
+import { Search } from "@element-plus/icons-vue";
|
|
|
+import { Popup } from "vant";
|
|
|
+
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+// Emits
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+const emit = defineEmits(["prev", "next"]);
|
|
|
+
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+// 常量
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+const SESSION = {
|
|
|
+ EQUIPMENT: "SERVICE_ENTRY_EQUIPMENT",
|
|
|
+ CATEGORY: "SERVICE_ENTRY_CATEGORY",
|
|
|
+};
|
|
|
+const CUSTOM_GROUP_NAME = "我的农机";
|
|
|
+const CUSTOM_MACHINE_ID_START = 9000;
|
|
|
+/** 有两类时:大田类在前,果树类在后 */
|
|
|
+const SCOPE_TABS = [
|
|
|
+ { key: "field", label: "大田类" },
|
|
|
+ { key: "fruit", label: "果树类" },
|
|
|
+];
|
|
|
+
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+// 页面状态
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+const loading = ref(false);
|
|
|
+const searchKeyword = ref("");
|
|
|
+const appliedKeyword = ref("");
|
|
|
+const selectedIds = reactive(new Set());
|
|
|
+const equipmentGroups = ref([]);
|
|
|
+const showAddPopup = ref(false);
|
|
|
+const newMachineName = ref("");
|
|
|
+const hasField = ref(false);
|
|
|
+const hasFruit = ref(false);
|
|
|
+const activeScope = ref("field");
|
|
|
+let customMachineId = CUSTOM_MACHINE_ID_START;
|
|
|
+
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+// 计算属性
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+const showScopeTabs = computed(() => hasField.value && hasFruit.value);
|
|
|
+const scopeTabs = computed(() => {
|
|
|
+ if (!showScopeTabs.value) return [];
|
|
|
+ return SCOPE_TABS;
|
|
|
+});
|
|
|
+
|
|
|
+const allEquipmentItems = computed(() =>
|
|
|
+ equipmentGroups.value.flatMap((group) => group.items)
|
|
|
+);
|
|
|
+
|
|
|
+const displayGroups = computed(() => {
|
|
|
+ const keyword = appliedKeyword.value.trim();
|
|
|
+ if (!keyword) return equipmentGroups.value;
|
|
|
+ return equipmentGroups.value
|
|
|
+ .map((group) => ({
|
|
|
+ ...group,
|
|
|
+ items: group.items.filter((item) => item.name.includes(keyword)),
|
|
|
+ }))
|
|
|
+ .filter((group) => group.items.length);
|
|
|
+});
|
|
|
+
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+// 工具函数
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+function readJson(key) {
|
|
|
+ try {
|
|
|
+ const raw = sessionStorage.getItem(key);
|
|
|
+ return raw ? JSON.parse(raw) : null;
|
|
|
+ } catch {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function isFieldCategory(item) {
|
|
|
+ return item?.firstCrop === "大田" || item?.majorKey === "field";
|
|
|
+}
|
|
|
+
|
|
|
+function isFruitCategory(item) {
|
|
|
+ return item?.firstCrop === "果树" || item?.majorKey === "fruit";
|
|
|
+}
|
|
|
+
|
|
|
+function resolveCategoryScopes() {
|
|
|
+ const list = readJson(SESSION.CATEGORY);
|
|
|
+ const categories = Array.isArray(list) ? list : [];
|
|
|
+ hasField.value = categories.some(isFieldCategory);
|
|
|
+ hasFruit.value = categories.some(isFruitCategory);
|
|
|
+ if (hasField.value) activeScope.value = "field";
|
|
|
+ else if (hasFruit.value) activeScope.value = "fruit";
|
|
|
+ else activeScope.value = "field";
|
|
|
+}
|
|
|
+
|
|
|
+function getCurrentScope() {
|
|
|
+ if (showScopeTabs.value) return activeScope.value;
|
|
|
+ if (hasFruit.value && !hasField.value) return "fruit";
|
|
|
+ if (hasField.value) return "field";
|
|
|
+ return "field";
|
|
|
+}
|
|
|
+
|
|
|
+function getCategoryForScope(scope = getCurrentScope()) {
|
|
|
+ const list = readJson(SESSION.CATEGORY);
|
|
|
+ const categories = Array.isArray(list) ? list : [];
|
|
|
+ if (scope === "fruit") return categories.find(isFruitCategory) || null;
|
|
|
+ return categories.find(isFieldCategory) || categories[0] || null;
|
|
|
+}
|
|
|
+
|
|
|
+function mapMachinesToGroups(machines) {
|
|
|
+ if (!Array.isArray(machines)) return [];
|
|
|
+ return machines
|
|
|
+ .map((group) => ({
|
|
|
+ name: group.stage || "",
|
|
|
+ items: (group.items || []).map((item) => ({
|
|
|
+ id: item.machine_id,
|
|
|
+ name: item.display_name || item.machine_name || "",
|
|
|
+ machineName: item.machine_name || "",
|
|
|
+ })),
|
|
|
+ }))
|
|
|
+ .filter((group) => group.name && group.items.length);
|
|
|
+}
|
|
|
+
|
|
|
+function isScopedCache(cached) {
|
|
|
+ return cached && !Array.isArray(cached) && (cached.field || cached.fruit);
|
|
|
+}
|
|
|
+
|
|
|
+function getScopeList(cached, scope) {
|
|
|
+ if (!cached) return [];
|
|
|
+ if (Array.isArray(cached)) return scope === "fruit" ? [] : cached;
|
|
|
+ return cached[scope] || [];
|
|
|
+}
|
|
|
+
|
|
|
+function findGroupByItemId(itemId) {
|
|
|
+ return equipmentGroups.value.find((group) =>
|
|
|
+ group.items.some((row) => String(row.id) === String(itemId))
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+function ensureCustomGroupTop() {
|
|
|
+ let customGroup = equipmentGroups.value.find((g) => g.name === CUSTOM_GROUP_NAME);
|
|
|
+ if (!customGroup) {
|
|
|
+ customGroup = { name: CUSTOM_GROUP_NAME, items: [] };
|
|
|
+ equipmentGroups.value.unshift(customGroup);
|
|
|
+ return customGroup;
|
|
|
+ }
|
|
|
+ const index = equipmentGroups.value.indexOf(customGroup);
|
|
|
+ if (index > 0) {
|
|
|
+ equipmentGroups.value.splice(index, 1);
|
|
|
+ equipmentGroups.value.unshift(customGroup);
|
|
|
+ }
|
|
|
+ return customGroup;
|
|
|
+}
|
|
|
+
|
|
|
+function buildSelectedPayload() {
|
|
|
+ const scope = getCurrentScope();
|
|
|
+ return allEquipmentItems.value
|
|
|
+ .filter((item) => selectedIds.has(String(item.id)))
|
|
|
+ .map((item) => ({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name,
|
|
|
+ custom: !!item.custom,
|
|
|
+ scope,
|
|
|
+ groupName: findGroupByItemId(item.id)?.name,
|
|
|
+ }));
|
|
|
+}
|
|
|
+
|
|
|
+function saveSelection() {
|
|
|
+ const selected = buildSelectedPayload();
|
|
|
+ if (!showScopeTabs.value) {
|
|
|
+ sessionStorage.setItem(SESSION.EQUIPMENT, JSON.stringify(selected));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const cached = readJson(SESSION.EQUIPMENT);
|
|
|
+ const next = isScopedCache(cached)
|
|
|
+ ? { field: cached.field || [], fruit: cached.fruit || [] }
|
|
|
+ : { field: Array.isArray(cached) ? cached : [], fruit: [] };
|
|
|
+ const scope = getCurrentScope();
|
|
|
+ if (scope === "fruit") next.fruit = selected;
|
|
|
+ else next.field = selected;
|
|
|
+ sessionStorage.setItem(SESSION.EQUIPMENT, JSON.stringify(next));
|
|
|
+}
|
|
|
+
|
|
|
+function restoreSelection() {
|
|
|
+ selectedIds.clear();
|
|
|
+ const cached = readJson(SESSION.EQUIPMENT);
|
|
|
+ const scope = getCurrentScope();
|
|
|
+ const list = showScopeTabs.value
|
|
|
+ ? getScopeList(cached, scope)
|
|
|
+ : Array.isArray(cached)
|
|
|
+ ? cached
|
|
|
+ : [...(cached?.field || []), ...(cached?.fruit || [])];
|
|
|
+
|
|
|
+ list.forEach((item) => {
|
|
|
+ if (item?.id == null) return;
|
|
|
+ selectedIds.add(String(item.id));
|
|
|
+ if (!item.custom) return;
|
|
|
+ const exists = allEquipmentItems.value.some(
|
|
|
+ (row) => String(row.id) === String(item.id)
|
|
|
+ );
|
|
|
+ if (exists) return;
|
|
|
+ const group =
|
|
|
+ equipmentGroups.value.find((g) => g.name === item.groupName) ||
|
|
|
+ ensureCustomGroupTop();
|
|
|
+ group.items.push({ id: item.id, name: item.name, custom: true });
|
|
|
+ if (Number(item.id) >= customMachineId) customMachineId = Number(item.id);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 切到果树:大田已选且果树列表里同 id / 同名的默认勾上 */
|
|
|
+function applyFieldOverlapSelection() {
|
|
|
+ if (getCurrentScope() !== "fruit" || !hasField.value) return;
|
|
|
+ const fieldList = getScopeList(readJson(SESSION.EQUIPMENT), "field");
|
|
|
+ if (!fieldList.length) return;
|
|
|
+
|
|
|
+ const fieldIds = new Set(
|
|
|
+ fieldList.filter((item) => item?.id != null).map((item) => String(item.id))
|
|
|
+ );
|
|
|
+ const fieldNames = new Set(fieldList.map((item) => item?.name).filter(Boolean));
|
|
|
+
|
|
|
+ let changed = false;
|
|
|
+ allEquipmentItems.value.forEach((item) => {
|
|
|
+ const id = String(item.id);
|
|
|
+ if (selectedIds.has(id)) return;
|
|
|
+ const matched =
|
|
|
+ fieldIds.has(id) ||
|
|
|
+ (item.name && fieldNames.has(item.name)) ||
|
|
|
+ (item.machineName && fieldNames.has(item.machineName));
|
|
|
+ if (!matched) return;
|
|
|
+ selectedIds.add(id);
|
|
|
+ changed = true;
|
|
|
+ });
|
|
|
+ if (changed) saveSelection();
|
|
|
+}
|
|
|
+
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+// 业务逻辑
|
|
|
+// ---------------------------------------------------------------------------
|
|
|
+async function fetchEquipmentList() {
|
|
|
+ const category = getCategoryForScope();
|
|
|
+ const cropId = category?.id;
|
|
|
+ if (cropId == null || cropId === "") {
|
|
|
+ equipmentGroups.value = [];
|
|
|
+ ElMessage.warning("请先选择种植品类");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ loading.value = true;
|
|
|
+ try {
|
|
|
+ const res = await VE_API.entry.getMachines({ crop_id: cropId });
|
|
|
+ if (res.code === 200) {
|
|
|
+ equipmentGroups.value = mapMachinesToGroups(res.data?.machines);
|
|
|
+ restoreSelection();
|
|
|
+ applyFieldOverlapSelection();
|
|
|
+ } else {
|
|
|
+ equipmentGroups.value = [];
|
|
|
+ ElMessage.error(res.msg || "获取农机列表失败");
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ equipmentGroups.value = [];
|
|
|
+ ElMessage.error("获取农机列表失败,请稍后再试");
|
|
|
+ } finally {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleScopeChange = async (scope) => {
|
|
|
+ if (scope === activeScope.value) return;
|
|
|
+ saveSelection();
|
|
|
+ activeScope.value = scope;
|
|
|
+ searchKeyword.value = "";
|
|
|
+ appliedKeyword.value = "";
|
|
|
+ await fetchEquipmentList();
|
|
|
+};
|
|
|
+
|
|
|
+const handleSearch = () => {
|
|
|
+ appliedKeyword.value = searchKeyword.value.trim();
|
|
|
+};
|
|
|
+
|
|
|
+const toggleSelect = (item) => {
|
|
|
+ const id = String(item.id);
|
|
|
+ if (selectedIds.has(id)) selectedIds.delete(id);
|
|
|
+ else selectedIds.add(id);
|
|
|
+ saveSelection();
|
|
|
+};
|
|
|
+
|
|
|
+const handleAddConfirm = () => {
|
|
|
+ const machineName = String(newMachineName.value || "").trim();
|
|
|
+ if (!machineName) {
|
|
|
+ ElMessage.warning("请输入农机名称");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const exists = allEquipmentItems.value.find((item) => item.name === machineName);
|
|
|
+ if (exists) {
|
|
|
+ selectedIds.add(String(exists.id));
|
|
|
+ saveSelection();
|
|
|
+ ElMessage.success("已选中该农机");
|
|
|
+ showAddPopup.value = false;
|
|
|
+ newMachineName.value = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const customGroup = ensureCustomGroupTop();
|
|
|
+ const newItem = { id: ++customMachineId, name: machineName, custom: true };
|
|
|
+ customGroup.items.push(newItem);
|
|
|
+ selectedIds.add(String(newItem.id));
|
|
|
+ saveSelection();
|
|
|
+ showAddPopup.value = false;
|
|
|
+ newMachineName.value = "";
|
|
|
+ ElMessage.success("添加成功");
|
|
|
+};
|
|
|
+
|
|
|
+const handleConfirm = () => {
|
|
|
+ saveSelection();
|
|
|
+ // 双类时合并写入扁平列表,方便完成页汇总
|
|
|
+ if (showScopeTabs.value) {
|
|
|
+ const cached = readJson(SESSION.EQUIPMENT);
|
|
|
+ const field = getScopeList(cached, "field");
|
|
|
+ const fruit = getScopeList(cached, "fruit");
|
|
|
+ const merged = [];
|
|
|
+ const seen = new Set();
|
|
|
+ [...field, ...fruit].forEach((item) => {
|
|
|
+ const key = item?.id != null ? String(item.id) : item?.name;
|
|
|
+ if (!key || seen.has(key)) return;
|
|
|
+ seen.add(key);
|
|
|
+ merged.push(item);
|
|
|
+ });
|
|
|
+ sessionStorage.setItem(
|
|
|
+ SESSION.EQUIPMENT,
|
|
|
+ JSON.stringify({ field, fruit, merged })
|
|
|
+ );
|
|
|
+ }
|
|
|
+ emit("next");
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ resolveCategoryScopes();
|
|
|
+ fetchEquipmentList();
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.service-equipment {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ background: #0f0f0f;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ &__content {
|
|
|
+ flex: 1;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 0 16px 0;
|
|
|
+ min-height: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__footer {
|
|
|
+ flex-shrink: 0;
|
|
|
+ padding: 24px 24px calc(22px + env(safe-area-inset-bottom));
|
|
|
+ }
|
|
|
+
|
|
|
+ .page-header {
|
|
|
+ margin-bottom: 16px;
|
|
|
+
|
|
|
+ .page-title {
|
|
|
+ font-size: 20px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .page-subtitle {
|
|
|
+ margin-top: 2px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(255, 255, 255, 0.6);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .tab-pills {
|
|
|
+ display: flex;
|
|
|
+ gap: 10px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tab-pill {
|
|
|
+ flex: 1;
|
|
|
+ height: 32px;
|
|
|
+ border-radius: 6px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(133, 133, 133, 1);
|
|
|
+ background: rgba(255, 255, 255, 0.05);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.12);
|
|
|
+ cursor: pointer;
|
|
|
+ box-sizing: border-box;
|
|
|
+ line-height: 30px;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ color: #000000;
|
|
|
+ background: #ffd489;
|
|
|
+ border-color: #ffd489;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .toolbar {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-bar {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 40px;
|
|
|
+ padding: 0 10px;
|
|
|
+ border-radius: 12px;
|
|
|
+ background: #1c1c1c;
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.12);
|
|
|
+
|
|
|
+ .search-icon {
|
|
|
+ color: rgba(255, 255, 255, 0.45);
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-input {
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 6px;
|
|
|
+ border: none;
|
|
|
+ outline: none;
|
|
|
+ background: transparent;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .add-btn {
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 14px;
|
|
|
+ cursor: pointer;
|
|
|
+ height: 36px;
|
|
|
+ padding: 0 10px;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: rgba(255, 212, 137, 0.1);
|
|
|
+ border: 1px solid rgba(255, 212, 137, 1);
|
|
|
+ color: rgba(255, 212, 137, 1);
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .equipment-card {
|
|
|
+ margin-bottom: 16px;
|
|
|
+ padding: 14px;
|
|
|
+ border-radius: 12px;
|
|
|
+ background: rgba(255, 255, 255, 0.04);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.08);
|
|
|
+ }
|
|
|
+
|
|
|
+ .section-title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 5px;
|
|
|
+ margin-bottom: 2px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FFD489;
|
|
|
+ font-weight: 500;
|
|
|
+
|
|
|
+ .title-icon {
|
|
|
+ width: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .tag-group {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(3, 1fr);
|
|
|
+ gap: 0 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tag-item {
|
|
|
+ margin-top: 10px;
|
|
|
+ position: relative;
|
|
|
+ border-radius: 6px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ min-height: 40px;
|
|
|
+ padding: 6px 4px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ text-align: center;
|
|
|
+ cursor: pointer;
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
+ background: rgba(255, 255, 255, 0.05);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.12);
|
|
|
+
|
|
|
+ &.selected {
|
|
|
+ color: rgba(255, 212, 137, 1);
|
|
|
+ border-color: rgba(255, 212, 137, 1);
|
|
|
+ background: rgba(255, 212, 137, 0.05);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .empty-tip {
|
|
|
+ padding: 24px 0;
|
|
|
+ text-align: center;
|
|
|
+ color: rgba(255, 255, 255, 0.35);
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .action-btns {
|
|
|
+ display: flex;
|
|
|
+ gap: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .action-btn {
|
|
|
+ flex: 1;
|
|
|
+ height: 48px;
|
|
|
+ border-radius: 12px;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &.secondary {
|
|
|
+ background: #2a2a2a;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.primary {
|
|
|
+ background: linear-gradient(90deg, #ffebc9 0%, #ffca6d 100%);
|
|
|
+ color: #1a1a1a;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.add-machine-popup {
|
|
|
+ width: 90%;
|
|
|
+}
|
|
|
+
|
|
|
+.add-machine-popup__content {
|
|
|
+ padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
|
|
|
+ background: #1a1a1a;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ .popup-title {
|
|
|
+ font-size: 17px;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-input {
|
|
|
+ width: 100%;
|
|
|
+ height: 44px;
|
|
|
+ padding: 0 12px;
|
|
|
+ border-radius: 10px;
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
+ background: #0f0f0f;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-confirm {
|
|
|
+ margin-top: 20px;
|
|
|
+ height: 48px;
|
|
|
+ border-radius: 12px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #1a1a1a;
|
|
|
+ background: linear-gradient(90deg, #ffebc9 0%, #ffca6d 100%);
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|