B2B网络软件

标题: 苹果脚本现代深色UI设计风格 [打印本页]

作者: YYPOST群发软件    时间: 2 小时前
标题: 苹果脚本现代深色UI设计风格
苹果脚本现代深色UI设计风格
苹果脚本现代深色UI设计风格 B2B网络软件

  1. // 🎯 智能个人助手 - 全新UI界面设计
  2. // 🍎腾711841924,腾528816639
  3. // 特色功能: 任务管理、快捷操作、数据监控、个性化设置

  4. printl("=== 智能个人助手启动 ===");

  5. var tab = new TabView();
  6. tab.setTitles(["首页", "任务", "工具", "数据"]);

  7. tab.show(function() {
  8.     printl("智能个人助手界面加载完成");
  9.    
  10.     // ====================== 第一页:智能首页 ======================
  11.     var homePage = createHomePage();
  12.     tab.addView(0, homePage);
  13.    
  14.     // ====================== 第二页:任务管理 ======================
  15.     var taskPage = createTaskPage();
  16.     tab.addView(1, taskPage);
  17.    
  18.     // ====================== 第三页:快捷工具 ======================
  19.     var toolPage = createToolPage();
  20.     tab.addView(2, toolPage);
  21.    
  22.     // ====================== 第四页:数据监控 ======================
  23.     var dataPage = createDataPage();
  24.     tab.addView(3, dataPage);
  25.    
  26.     printl("所有页面初始化完成");
  27. });

  28. // ====================== 创建智能首页 ======================
  29. function createHomePage() {
  30.     var page = new Vertical();
  31.     page.setSpacing(12);
  32.     page.setBackgroundColor(248, 250, 252);
  33.    
  34.     // 顶部欢迎卡片
  35.     var welcomeCard = new Vertical();
  36.     welcomeCard.setBackgroundColor(255, 255, 255);
  37.     welcomeCard.setContainerSize(380, 140);
  38.    
  39.     var timeLabel = new Label();
  40.     var now = new Date();
  41.     var hour = now.getHours();
  42.     var greeting = "";
  43.     if (hour < 6) greeting = "夜深了";
  44.     else if (hour < 9) greeting = "早上好";
  45.     else if (hour < 12) greeting = "上午好";
  46.     else if (hour < 14) greeting = "中午好";
  47.     else if (hour < 18) greeting = "下午好";
  48.     else greeting = "晚上好";
  49.    
  50.     timeLabel.setText(greeting + "!\n" + (now.getMonth() + 1) + "月" + now.getDate() + "日");
  51.     timeLabel.setTextColor(50, 50, 50);
  52.     timeLabel.setFontSize(22);
  53.     timeLabel.setTextAlignment("center");
  54.     welcomeCard.addView(timeLabel);
  55.    
  56.     var quoteLabel = new Label();
  57.     quoteLabel.setText("✨ 每一天都是新的开始");
  58.     quoteLabel.setTextColor(120, 120, 120);
  59.     quoteLabel.setFontSize(13);
  60.     quoteLabel.setTextAlignment("center");
  61.     welcomeCard.addView(quoteLabel);
  62.    
  63.     page.addView(welcomeCard);
  64.    
  65.     // 快速统计区域
  66.     var statsRow = new Horizontal();
  67.     statsRow.setSpacing(10);
  68.    
  69.     var statItems = [
  70.         {icon: "&#128203;", label: "待办", value: "5", color: [66, 133, 244]},
  71.         {icon: "✅", label: "完成", value: "12", color: [52, 168, 83]},
  72.         {icon: "⏰", label: "提醒", value: "3", color: [251, 188, 5]}
  73.     ];
  74.    
  75.     // 统计卡片添加点击交互
  76.     for (var i = 0; i < statItems.length; i++) {
  77.         var statCard = createStatCard(statItems[i]);
  78.         // 为统计卡片添加点击按钮
  79.         var clickBtn = new Button();
  80.         clickBtn.setText("查看");
  81.         clickBtn.setColor(statItems[i].color[0], statItems[i].color[1], statItems[i].color[2]);
  82.         clickBtn.setTextColor(255, 255, 255);
  83.         clickBtn.setWidth(115);
  84.         clickBtn.setHeight(25);
  85.         clickBtn.onClick(function() {
  86.             printl("查看" + statItems[i].label + "详情");
  87.             showToast(statItems[i].label + "详细数据");
  88.         });
  89.         statsRow.addView(statCard);
  90.     }
  91.    
  92.     page.addView(statsRow);
  93.    
  94.     // 常用功能区
  95.     var sectionTitle = new Label();
  96.     sectionTitle.setText("常用功能");
  97.     sectionTitle.setTextColor(80, 80, 80);
  98.     sectionTitle.setFontSize(16);
  99.     page.addView(sectionTitle);
  100.    
  101.     var quickActions = new Vertical();
  102.     quickActions.setBackgroundColor(255, 255, 255);
  103.     quickActions.setSpacing(8);
  104.    
  105.     var actions = [
  106.         {icon: "&#128221;", text: "新建笔记", color: [66, 133, 244]},
  107.         {icon: "&#128197;", text: "添加日程", color: [52, 168, 83]},
  108.         {icon: "&#128276;", text: "设置提醒", color: [251, 188, 5]},
  109.         {icon: "&#128202;", text: "查看报告", color: [156, 39, 176]},
  110.         {icon: "&#127968;", text: "返回桌面", color: [244, 67, 54]}
  111.     ];
  112.    
  113.     for (var i = 0; i < actions.length; i++) {
  114.         var actionBtn = createActionButton(actions[i]);
  115.         quickActions.addView(actionBtn);
  116.     }
  117.    
  118.     page.addView(quickActions);
  119.    
  120.     return page;
  121. }

  122. // 创建统计卡片
  123. function createStatCard(item) {
  124.     var card = new Vertical();
  125.     card.setAlignment("center");
  126.     card.setBackgroundColor(255, 255, 255);
  127.     card.setContainerSize(115, 90);
  128.    
  129.     var iconLabel = new Label();
  130.     iconLabel.setText(item.icon);
  131.     iconLabel.setFontSize(28);
  132.     card.addView(iconLabel);
  133.    
  134.     var valueLabel = new Label();
  135.     valueLabel.setText(item.value);
  136.     valueLabel.setTextColor(item.color[0], item.color[1], item.color[2]);
  137.     valueLabel.setFontSize(20);
  138.     card.addView(valueLabel);
  139.    
  140.     var label = new Label();
  141.     label.setText(item.label);
  142.     label.setTextColor(150, 150, 150);
  143.     label.setFontSize(12);
  144.     card.addView(label);
  145.    
  146.     return card;
  147. }

  148. // 创建操作按钮
  149. function createActionButton(item) {
  150.     var btn = new Button();
  151.     btn.setText(item.icon + "  " + item.text);
  152.     btn.setColor(item.color[0], item.color[1], item.color[2]);
  153.     btn.setTextColor(255, 255, 255);
  154.     btn.setHeight(50);
  155.     btn.onClick(function() {
  156.         printl("点击: " + item.text);
  157.         
  158.         // 如果是"新建笔记"按钮,执行主脚本的功能
  159.         if (item.text === "新建笔记") {
  160.             try {
  161.                 showToast("正在启动主脚本...");
  162.                 printl("=== 开始执行主脚本功能 ===");
  163.                
  164.                 // 使用 Import() 函数导入并运行主脚本.js
  165.                 printl("尝试导入主脚本.js...");
  166.                 Import("主脚本.js");
  167.                 toast.show("已导入主脚本.js");
  168.                 printl("✓ 主脚本已导入");
  169.                
  170.             } catch(e) {
  171.                 printl("导入主脚本失败: " + e.message);
  172.                 showToast("导入失败: " + e.message);
  173.             }
  174.         }
  175.         // 如果是"返回桌面"按钮,直接返回桌面
  176.         else if (item.text === "返回桌面") {
  177.             showToast("正在返回桌面...");
  178.             try {
  179.                 hid.home();
  180.                 printl("已按下Home键返回桌面");
  181.             } catch(e) {
  182.                 printl("返回桌面失败: " + e.message);
  183.                 showToast("返回失败: " + e.message);
  184.             }
  185.         } else {
  186.             showToast(item.text + " 功能开发中");
  187.         }
  188.     });
  189.     return btn;
  190. }

  191. // ====================== 创建任务管理页 ======================
  192. function createTaskPage() {
  193.     var page = new Vertical();
  194.     page.setSpacing(15);
  195.     page.setBackgroundColor(248, 250, 252);
  196.    
  197.     // 标题栏
  198.     var header = new Horizontal();
  199.     header.setBackgroundColor(255, 255, 255);
  200.    
  201.     var titleLabel = new Label();
  202.     titleLabel.setText("&#128203; 任务管理");
  203.     titleLabel.setTextColor(50, 50, 50);
  204.     titleLabel.setFontSize(20);
  205.     header.addView(titleLabel);
  206.    
  207.     page.addView(header);
  208.    
  209.     // 任务分类标签
  210.     var categoryRow = new Horizontal();
  211.     categoryRow.setSpacing(10);
  212.    
  213.     var categories = ["全部", "进行中", "已完成", "已延期"];
  214.     for (var i = 0; i < categories.length; i++) {
  215.         var catBtn = new Button();
  216.         catBtn.setText(categories[i]);
  217.         catBtn.setColor(i === 0 ? 66 : 200, i === 0 ? 133 : 200, i === 0 ? 244 : 200);
  218.         catBtn.setTextColor(255, 255, 255);
  219.         catBtn.setWidth(80);
  220.         catBtn.setHeight(35);
  221.         catBtn.onClick(function() {
  222.             printl("筛选任务: " + this.getText());
  223.             showToast("已筛选: " + this.getText());
  224.         });
  225.         categoryRow.addView(catBtn);
  226.     }
  227.    
  228.     page.addView(categoryRow);
  229.    
  230.     // 任务列表
  231.     var taskList = new Vertical();
  232.     taskList.setSpacing(10);
  233.    
  234.     var tasks = [
  235.         {title: "完成项目文档", priority: "高", status: "进行中", time: "今天 18:00"},
  236.         {title: "回复客户邮件", priority: "中", status: "待处理", time: "明天 10:00"},
  237.         {title: "整理会议纪要", priority: "低", status: "已完成", time: "昨天"}
  238.     ];
  239.    
  240.     for (var i = 0; i < tasks.length; i++) {
  241.         var taskCard = createTaskCard(tasks[i]);
  242.         taskList.addView(taskCard);
  243.     }
  244.    
  245.     page.addView(taskList);
  246.    
  247.     // 添加任务按钮
  248.     var addBtn = new Button();
  249.     addBtn.setText("+ 新建任务");
  250.     addBtn.setColor(66, 133, 244);
  251.     addBtn.setTextColor(255, 255, 255);
  252.     addBtn.setHeight(50);
  253.     addBtn.onClick(function() {
  254.         printl("新建任务");
  255.         showToast("新建任务功能");
  256.     });
  257.     page.addView(addBtn);
  258.    
  259.     return page;
  260. }

  261. // 创建任务卡片
  262. function createTaskCard(task) {
  263.     var card = new Vertical();
  264.     card.setBackgroundColor(255, 255, 255);
  265.    
  266.     // 添加点击事件
  267.     card.onClick = function() {
  268.         printl("查看任务: " + task.title);
  269.         showToast("任务: " + task.title);
  270.     };
  271.    
  272.     var titleRow = new Horizontal();
  273.    
  274.     var priorityColor = task.priority === "高" ? [244, 67, 54] :
  275.                        task.priority === "中" ? [255, 152, 0] : [76, 175, 80];
  276.    
  277.     var priorityBadge = new Label();
  278.     priorityBadge.setText(task.priority);
  279.     priorityBadge.setTextColor(priorityColor[0], priorityColor[1], priorityColor[2]);
  280.     priorityBadge.setFontSize(12);
  281.     priorityBadge.setBackgroundColor(priorityColor[0], priorityColor[1], priorityColor[2]);
  282.     titleRow.addView(priorityBadge);
  283.    
  284.     var space = new Label();
  285.     space.setWidth(10);
  286.     titleRow.addView(space);
  287.    
  288.     var titleLabel = new Label();
  289.     titleLabel.setText(task.title);
  290.     titleLabel.setTextColor(50, 50, 50);
  291.     titleLabel.setFontSize(15);
  292.     titleRow.addView(titleLabel);
  293.    
  294.     card.addView(titleRow);
  295.    
  296.     var infoRow = new Horizontal();
  297.    
  298.     var statusLabel = new Label();
  299.     statusLabel.setText(task.status);
  300.     statusLabel.setTextColor(120, 120, 120);
  301.     statusLabel.setFontSize(12);
  302.     infoRow.addView(statusLabel);
  303.    
  304.     var timeLabel = new Label();
  305.     timeLabel.setText("⏰ " + task.time);
  306.     timeLabel.setTextColor(150, 150, 150);
  307.     timeLabel.setFontSize(12);
  308.     infoRow.addView(timeLabel);
  309.    
  310.     card.addView(infoRow);
  311.    
  312.     return card;
  313. }

  314. // ====================== 创建快捷工具页 ======================
  315. function createToolPage() {
  316.     var page = new Vertical();
  317.     page.setSpacing(15);
  318.     page.setBackgroundColor(248, 250, 252);
  319.    
  320.     // 标题
  321.     var header = new Horizontal();
  322.     header.setBackgroundColor(255, 255, 255);
  323.    
  324.     var titleLabel = new Label();
  325.     titleLabel.setText("&#128736;️ 快捷工具");
  326.     titleLabel.setTextColor(50, 50, 50);
  327.     titleLabel.setFontSize(20);
  328.     header.addView(titleLabel);
  329.    
  330.     page.addView(header);
  331.    
  332.     // 工具网格
  333.     var toolsGrid = new Vertical();
  334.     toolsGrid.setSpacing(15);
  335.    
  336.     var toolRows = [
  337.         [
  338.             {icon: "&#129518;", name: "计算器", color: [66, 133, 244]},
  339.             {icon: "&#128207;", name: "单位转换", color: [52, 168, 83]},
  340.             {icon: "&#128177;", name: "汇率", color: [251, 188, 5]}
  341.         ],
  342.         [
  343.             {icon: "&#128221;", name: "记事本", color: [156, 39, 176]},
  344.             {icon: "&#128269;", name: "搜索", color: [233, 30, 99]},
  345.             {icon: "&#128247;", name: "扫码", color: [0, 150, 136]}
  346.         ],
  347.         [
  348.             {icon: "&#127760;", name: "翻译", color: [33, 150, 243]},
  349.             {icon: "&#128197;", name: "日历", color: [255, 87, 34]},
  350.             {icon: "⏱️", name: "计时器", color: [121, 85, 72]}
  351.         ]
  352.     ];
  353.    
  354.     for (var i = 0; i < toolRows.length; i++) {
  355.         var row = new Horizontal();
  356.         row.setSpacing(10);
  357.         
  358.         for (var j = 0; j < toolRows[i].length; j++) {
  359.             var toolBtn = createToolButton(toolRows[i][j]);
  360.             row.addView(toolBtn);
  361.         }
  362.         
  363.         toolsGrid.addView(row);
  364.     }
  365.    
  366.     page.addView(toolsGrid);
  367.    
  368.     return page;
  369. }

  370. // 创建工具按钮
  371. function createToolButton(tool) {
  372.     var btn = new Button();
  373.     btn.setText(tool.icon + "\n" + tool.name);
  374.     btn.setColor(tool.color[0], tool.color[1], tool.color[2]);
  375.     btn.setTextColor(255, 255, 255);
  376.     btn.setWidth(115);
  377.     btn.setHeight(100);
  378.     btn.onClick(function() {
  379.         printl("打开工具: " + tool.name);
  380.         showToast(tool.name + " 工具");
  381.     });
  382.     return btn;
  383. }

  384. // ====================== 创建数据监控页 ======================
  385. function createDataPage() {
  386.     var page = new Vertical();
  387.     page.setSpacing(15);
  388.     page.setBackgroundColor(248, 250, 252);
  389.    
  390.     // 标题
  391.     var header = new Horizontal();
  392.     header.setBackgroundColor(255, 255, 255);
  393.    
  394.     var titleLabel = new Label();
  395.     titleLabel.setText("&#128202; 数据监控");
  396.     titleLabel.setTextColor(50, 50, 50);
  397.     titleLabel.setFontSize(20);
  398.     header.addView(titleLabel);
  399.    
  400.     page.addView(header);
  401.    
  402.     // 数据概览卡片
  403.     var overviewCard = new Vertical();
  404.     overviewCard.setBackgroundColor(255, 255, 255);
  405.    
  406.     var overviewTitle = new Label();
  407.     overviewTitle.setText("本周概览");
  408.     overviewTitle.setTextColor(80, 80, 80);
  409.     overviewTitle.setFontSize(16);
  410.     overviewCard.addView(overviewTitle);
  411.    
  412.     var dataItems = [
  413.         {label: "完成任务", value: "28", unit: "个", color: [66, 133, 244]},
  414.         {label: "工作时长", value: "35.5", unit: "小时", color: [52, 168, 83]},
  415.         {label: "效率评分", value: "92", unit: "分", color: [251, 188, 5]}
  416.     ];
  417.    
  418.     // 数据项添加点击交互
  419.     for (var i = 0; i < dataItems.length; i++) {
  420.         var dataRow = new Horizontal();
  421.         var itemData = dataItems[i]; // 保存当前数据到局部变量,避免闭包问题
  422.         
  423.         var label = new Label();
  424.         label.setText(itemData.label);
  425.         label.setTextColor(100, 100, 100);
  426.         label.setFontSize(14);
  427.         dataRow.addView(label);
  428.         
  429.         var valueLabel = new Label();
  430.         valueLabel.setText(itemData.value + itemData.unit);
  431.         valueLabel.setTextColor(itemData.color[0], itemData.color[1], itemData.color[2]);
  432.         valueLabel.setFontSize(18);
  433.         dataRow.addView(valueLabel);
  434.         
  435.         // 为每个数据行添加点击按钮
  436.         var clickBtn = new Button();
  437.         clickBtn.setText("详情");
  438.         clickBtn.setColor(itemData.color[0], itemData.color[1], itemData.color[2]);
  439.         clickBtn.setTextColor(255, 255, 255);
  440.         clickBtn.setWidth(60);
  441.         clickBtn.setHeight(30);
  442.         clickBtn.onClick(function() {
  443.             printl("查看" + itemData.label + "详情");
  444.             showToast(itemData.label + "详细信息");
  445.         });
  446.         dataRow.addView(clickBtn);
  447.         
  448.         overviewCard.addView(dataRow);
  449.     }
  450.    
  451.     page.addView(overviewCard);
  452.    
  453.     // 趋势图表占位
  454.     var chartCard = new Vertical();
  455.     chartCard.setBackgroundColor(255, 255, 255);
  456.     chartCard.setContainerSize(380, 200);
  457.    
  458.     var chartTitle = new Label();
  459.     chartTitle.setText("任务完成趋势");
  460.     chartTitle.setTextColor(80, 80, 80);
  461.     chartTitle.setFontSize(16);
  462.     chartCard.addView(chartTitle);
  463.    
  464.     var chartPlaceholder = new Label();
  465.     chartPlaceholder.setText("&#128200; 图表区域\n(数据可视化)");
  466.     chartPlaceholder.setTextColor(180, 180, 180);
  467.     chartPlaceholder.setFontSize(14);
  468.     chartPlaceholder.setTextAlignment("center");
  469.     chartCard.addView(chartPlaceholder);
  470.    
  471.     page.addView(chartCard);
  472.    
  473.     return page;
  474. }

  475. // ====================== 账号配置函数 ======================
  476. function openAccountConfig() {
  477.     printl("打开账号配置界面");
  478.    
  479.     // 获取当前配置的账号密码
  480.     var currentAccount = config.getConfig("panda_account") || "";
  481.     var currentPassword = config.getConfig("panda_password") || "";
  482.    
  483.     printl("当前账号: " + currentAccount);
  484.     printl("当前密码: " + currentPassword);
  485.    
  486.     // 显示配置提示
  487.     toast.show("账号配置说明:\n\n请在脚本中运行以下代码设置账号密码:\n\nconfig.setConfig('panda_account', '您的账号')\nconfig.setConfig('panda_password', '您的密码')\n\n或者直接在'新建笔记'按钮使用时自动提示配置");
  488.    
  489.     // 如果有配置,显示当前值
  490.     if (currentAccount != "" && currentPassword != "") {
  491.         toast.show("当前已配置:\n账号: " + currentAccount + "\n密码: " + currentPassword);
  492.     }
  493. }

  494. // Toast提示函数
  495. function showToast(message) {
  496.     printl("[提示] " + message);
  497.     // 在手机上显示吐司弹窗
  498.     try {
  499.         toast.show(message); // 直接使用全局toast对象
  500.     } catch(e) {
  501.         printl("Toast显示失败: " + e.message);
  502.     }
  503. }

  504. printl("智能个人助手已启动");
复制代码







欢迎光临 B2B网络软件 (http://bbs.niubt.cn/) Powered by Discuz! X3.2