B2B网络软件

标题: 苹果脚本TabView金黄色风格例子 [打印本页]

作者: YYPOST群发软件    时间: 12 小时前
标题: 苹果脚本TabView金黄色风格例子
苹果脚本TabView金黄色风格例子
苹果脚本TabView金黄色风格例子 B2B网络软件
  1. // 🍎                                                                                                                           
  2. // 交流QQ群:711841924(群一),苹果内测群:528816639

  3. // 创建现代化TabView
  4. var mainTab = new TabView();

  5. // 设置标题(精简为2个字)
  6. var tabTitles = ["控制", "任务", "设备", "数据", "系统"];
  7. mainTab.setTitles(tabTitles);

  8. // 启动界面
  9. mainTab.show(() => {
  10.     printl("✨ 金黄色风格界面已启动");
  11.    
  12.     // 为每个标签页添加内容
  13.     for (var i = 0; i < tabTitles.length; i++) {
  14.         mainTab.addView(i, buildTabPage(i, tabTitles[i]));
  15.     }
  16. });

  17. // 创建顶部联系信息栏
  18. function createContactBar() {
  19.     var contactBar = new Vertical();
  20.     contactBar.setBackgroundColor(255, 215, 0); // 亮金黄色
  21.     contactBar.setAlignment("center");
  22.    
  23.     var contactText1 = new Label();
  24.     contactText1.setText("&#128241; 交流QQ群:711841924(群一)");
  25.     contactText1.setTextColor(139, 90, 0); // 深金棕色
  26.     contactText1.setFontSize(13);
  27.     contactBar.addView(contactText1);
  28.    
  29.     var contactText2 = new Label();
  30.     contactText2.setText("&#127822; 苹果内测群:528816639");
  31.     contactText2.setTextColor(139, 90, 0); // 深金棕色
  32.     contactText2.setFontSize(13);
  33.     contactBar.addView(contactText2);
  34.    
  35.     return contactBar;
  36. }

  37. // 构建标签页内容
  38. function buildTabPage(index, title) {
  39.     var container = new Vertical();
  40.     container.setBackgroundColor(255, 248, 220); // 暖黄色背景
  41.    
  42.     // 顶部联系信息栏
  43.     var contactBar = createContactBar();
  44.     container.addView(contactBar);
  45.    
  46.     // 顶部导航栏
  47.     var headerBar = createHeaderBar(title);
  48.     container.addView(headerBar);
  49.    
  50.     // 根据索引创建不同内容
  51.     switch(index) {
  52.         case 0:
  53.             container.addView(createConsolePage());
  54.             break;
  55.         case 1:
  56.             container.addView(createTaskCenterPage());
  57.             break;
  58.         case 2:
  59.             container.addView(createDevicePage());
  60.             break;
  61.         case 3:
  62.             container.addView(createDataPage());
  63.             break;
  64.         case 4:
  65.             container.addView(createSystemPage());
  66.             break;
  67.     }
  68.    
  69.     return container;
  70. }

  71. // 创建顶部导航栏
  72. function createHeaderBar(title) {
  73.     var header = new Horizontal();
  74.     header.setBackgroundColor(255, 223, 100); // 金黄色导航栏
  75.     header.setAlignment("center_vertical");
  76.    
  77.     // 标题
  78.     var titleLabel = new Label();
  79.     titleLabel.setText("&#128081; " + title);
  80.     titleLabel.setTextColor(139, 90, 0); // 深金棕色文字
  81.     titleLabel.setFontSize(20);
  82.     header.addView(titleLabel);
  83.    
  84.     // 状态指示器
  85.     var statusIndicator = new Label();
  86.     statusIndicator.setText("● 在线");
  87.     statusIndicator.setTextColor(0, 150, 50); // 深绿色
  88.     statusIndicator.setFontSize(14);
  89.     header.addView(statusIndicator);
  90.    
  91.     return header;
  92. }

  93. // 控制台页面
  94. function createConsolePage() {
  95.     var page = new Vertical();
  96.     page.setBackgroundColor(255, 248, 220);
  97.    
  98.     // 快速操作卡片
  99.     var quickActions = createCardContainer("快速操作");
  100.    
  101.     var actionBtn1 = createActionButton("▶ 执行脚本", 218, 165, 32, () => {
  102.         printl("开始执行脚本...");
  103.         showToast("脚本执行中");
  104.     });
  105.     quickActions.addView(actionBtn1);
  106.    
  107.     var space1 = new Space();
  108.     space1.setHeight(8);
  109.     quickActions.addView(space1);
  110.    
  111.     var actionBtn2 = createActionButton("⏸ 暂停任务", 218, 165, 32, () => {
  112.         printl("任务已暂停");
  113.         showToast("任务暂停");
  114.     });
  115.     quickActions.addView(actionBtn2);
  116.    
  117.     var space2 = new Space();
  118.     space2.setHeight(8);
  119.     quickActions.addView(space2);
  120.    
  121.     var actionBtn3 = createActionButton("⏹ 停止运行", 220, 50, 50, () => {
  122.         printl("停止所有任务");
  123.         showToast("已停止");
  124.     });
  125.     quickActions.addView(actionBtn3);
  126.    
  127.     page.addView(quickActions);
  128.    
  129.     // 实时日志区域
  130.     var logSection = createCardContainer("实时日志");
  131.     var logDisplay = new Label();
  132.     logDisplay.setText("等待操作...\n\n系统就绪 | 时间: " + getCurrentTime());
  133.     logDisplay.setTextColor(120, 80, 20); // 深棕色文字
  134.     logDisplay.setFontSize(14);
  135.     logSection.addView(logDisplay);
  136.     page.addView(logSection);
  137.    
  138.     return page;
  139. }

  140. // 任务中心页面
  141. function createTaskCenterPage() {
  142.     var page = new Vertical();
  143.     page.setBackgroundColor(255, 248, 220);
  144.    
  145.     // 任务统计卡片
  146.     var statsCard = createCardContainer("任务统计");
  147.     var statsLayout = new Horizontal();
  148.    
  149.     var statItem1 = createStatItem("活跃", "12", 218, 165, 32);
  150.     statsLayout.addView(statItem1);
  151.    
  152.     var statItem2 = createStatItem("完成", "156", 0, 180, 50);
  153.     statsLayout.addView(statItem2);
  154.    
  155.     var statItem3 = createStatItem("失败", "3", 220, 50, 50);
  156.     statsLayout.addView(statItem3);
  157.    
  158.     statsCard.addView(statsLayout);
  159.     page.addView(statsCard);
  160.    
  161.     // 任务列表
  162.     var taskList = createCardContainer("任务列表");
  163.    
  164.     addTaskItem(taskList, "每日签到任务", true, "运行中");
  165.     addTaskItem(taskList, "自动刷视频", false, "待执行");
  166.     addTaskItem(taskList, "宝箱收集", true, "运行中");
  167.     addTaskItem(taskList, "广告跳过", false, "已完成");
  168.     addTaskItem(taskList, "数据同步", false, "待执行");
  169.    
  170.     page.addView(taskList);
  171.    
  172.     return page;
  173. }

  174. // 设备管理页面
  175. function createDevicePage() {
  176.     var page = new Vertical();
  177.     page.setBackgroundColor(255, 248, 220);
  178.    
  179.     // 设备信息卡片
  180.     var deviceInfo = createCardContainer("设备信息");
  181.    
  182.     var infoLayout = new Vertical();
  183.    
  184.     var deviceName = createInfoRow("设备名称", "iPhone 14 Pro");
  185.     infoLayout.addView(deviceName);
  186.    
  187.     var systemVer = createInfoRow("系统版本", "iOS 16.5");
  188.     infoLayout.addView(systemVer);
  189.    
  190.     var batteryLevel = createInfoRow("电池电量", "85%");
  191.     infoLayout.addView(batteryLevel);
  192.    
  193.     var networkStatus = createInfoRow("网络状态", "WiFi连接");
  194.     infoLayout.addView(networkStatus);
  195.    
  196.     deviceInfo.addView(infoLayout);
  197.     page.addView(deviceInfo);
  198.    
  199.     // 设备控制按钮
  200.     var controlCard = createCardContainer("设备控制");
  201.    
  202.     var ctrlBtn1 = createActionButton("&#128241; 截屏", 180, 130, 30, () => {
  203.         printl("执行截屏操作");
  204.         showToast("截屏成功");
  205.     });
  206.     controlCard.addView(ctrlBtn1);
  207.    
  208.     var space1 = new Space();
  209.     space1.setHeight(8);
  210.     controlCard.addView(space1);
  211.    
  212.     var ctrlBtn2 = createActionButton("&#128260; 重启应用", 180, 130, 30, () => {
  213.         printl("重启当前应用");
  214.         showToast("应用重启中");
  215.     });
  216.     controlCard.addView(ctrlBtn2);
  217.    
  218.     var space2 = new Space();
  219.     space2.setHeight(8);
  220.     controlCard.addView(space2);
  221.    
  222.     var ctrlBtn3 = createActionButton("&#127968; 返回桌面", 180, 130, 30, () => {
  223.         printl("返回桌面");
  224.         hid.home();
  225.     });
  226.     controlCard.addView(ctrlBtn3);
  227.    
  228.     page.addView(controlCard);
  229.    
  230.     return page;
  231. }

  232. // 数据中心页面
  233. function createDataPage() {
  234.     var page = new Vertical();
  235.     page.setBackgroundColor(255, 248, 220);
  236.    
  237.     // 数据概览
  238.     var overviewCard = createCardContainer("数据概览");
  239.    
  240.     var chartPlaceholder = new Label();
  241.     chartPlaceholder.setText("&#128202; 数据可视化区域\n\n今日执行: 45次\n成功率: 98.5%\n平均耗时: 2.3s");
  242.     chartPlaceholder.setTextColor(120, 80, 20);
  243.     chartPlaceholder.setFontSize(15);
  244.     overviewCard.addView(chartPlaceholder);
  245.    
  246.     page.addView(overviewCard);
  247.    
  248.     // 数据导出选项
  249.     var exportCard = createCardContainer("数据导出");
  250.    
  251.     var exportBtn1 = createActionButton("&#128196; 导出CSV", 200, 150, 40, () => {
  252.         printl("导出CSV文件");
  253.         showToast("CSV导出成功");
  254.     });
  255.     exportCard.addView(exportBtn1);
  256.    
  257.     var space1 = new Space();
  258.     space1.setHeight(8);
  259.     exportCard.addView(space1);
  260.    
  261.     var exportBtn2 = createActionButton("&#128203; 导出JSON", 200, 150, 40, () => {
  262.         printl("导出JSON文件");
  263.         showToast("JSON导出成功");
  264.     });
  265.     exportCard.addView(exportBtn2);
  266.    
  267.     page.addView(exportCard);
  268.    
  269.     return page;
  270. }

  271. // 系统设置页面
  272. function createSystemPage() {
  273.     var page = new Vertical();
  274.     page.setBackgroundColor(255, 248, 220);
  275.    
  276.     // 系统设置卡片
  277.     var settingsCard = createCardContainer("系统设置");
  278.    
  279.     var notifyCheck = createCheckBox("启用推送通知", true);
  280.     settingsCard.addView(notifyCheck);
  281.    
  282.     var soundCheck = createCheckBox("启用操作音效", false);
  283.     settingsCard.addView(soundCheck);
  284.    
  285.     var vibrationCheck = createCheckBox("启用震动反馈", true);
  286.     settingsCard.addView(vibrationCheck);
  287.    
  288.     var autoUpdateCheck = createCheckBox("自动检查更新", true);
  289.     settingsCard.addView(autoUpdateCheck);
  290.    
  291.     page.addView(settingsCard);
  292.    
  293.     // 关于信息
  294.     var aboutCard = createCardContainer("关于");
  295.    
  296.     var versionInfo = new Label();
  297.     versionInfo.setText("版本: v2.5.0\n构建: 20260409\n授权: 专业版");
  298.     versionInfo.setTextColor(120, 80, 20);
  299.     versionInfo.setFontSize(14);
  300.     aboutCard.addView(versionInfo);
  301.    
  302.     page.addView(aboutCard);
  303.    
  304.     var space = new Space();
  305.     space.setHeight(10);
  306.     page.addView(space);
  307.    
  308.     var saveBtn = createActionButton("&#128190; 保存设置", 180, 130, 30, () => {
  309.         printl("设置已保存");
  310.         showToast("设置保存成功");
  311.     });
  312.     page.addView(saveBtn);
  313.    
  314.     return page;
  315. }

  316. // 创建卡片容器
  317. function createCardContainer(title) {
  318.     var card = new Vertical();
  319.     card.setBackgroundColor(255, 250, 230); // 浅米黄色卡片背景
  320.    
  321.     // 卡片标题
  322.     var cardTitle = new Label();
  323.     cardTitle.setText(title);
  324.     cardTitle.setTextColor(139, 90, 0); // 深金棕色
  325.     cardTitle.setFontSize(16);
  326.     card.addView(cardTitle);
  327.    
  328.     // 分隔线
  329.     var divider = new Label();
  330.     divider.setHeight(1);
  331.     divider.setBackgroundColor(230, 200, 150); // 金棕色分隔线
  332.     card.addView(divider);
  333.    
  334.     return card;
  335. }

  336. // 创建操作按钮
  337. function createActionButton(text, r, g, b, clickHandler) {
  338.     var btn = new Button();
  339.     btn.setText(text);
  340.     btn.setColor(r, g, b);
  341.     btn.setTextColor(255, 255, 255);
  342.     btn.setHeight(45);
  343.     btn.onClick(clickHandler);
  344.     return btn;
  345. }

  346. // 创建统计项
  347. function createStatItem(label, value, r, g, b) {
  348.     var item = new Vertical();
  349.     item.setAlignment("center");
  350.    
  351.     var valueLabel = new Label();
  352.     valueLabel.setText(value);
  353.     valueLabel.setTextColor(r, g, b);
  354.     valueLabel.setFontSize(24);
  355.     item.addView(valueLabel);
  356.    
  357.     var labelTag = new Label();
  358.     labelTag.setText(label);
  359.     labelTag.setTextColor(139, 90, 0);
  360.     labelTag.setFontSize(12);
  361.     item.addView(labelTag);
  362.    
  363.     return item;
  364. }

  365. // 添加任务项
  366. function addTaskItem(container, taskName, isActive, status) {
  367.     var taskRow = new Horizontal();
  368.     taskRow.setAlignment("center_vertical");
  369.    
  370.     // 复选框
  371.     var checkBox = new CheckBox();
  372.     checkBox.setText(taskName);
  373.     if (isActive) {
  374.         checkBox.setDefultSelect();
  375.     }
  376.     taskRow.addView(checkBox);
  377.    
  378.     // 状态标签
  379.     var statusLabel = new Label();
  380.     statusLabel.setText(status);
  381.     if (status === "运行中") {
  382.         statusLabel.setTextColor(0, 150, 50);
  383.     } else if (status === "已完成") {
  384.         statusLabel.setTextColor(139, 90, 0);
  385.     } else {
  386.         statusLabel.setTextColor(150, 150, 150);
  387.     }
  388.     statusLabel.setFontSize(12);
  389.     taskRow.addView(statusLabel);
  390.    
  391.     container.addView(taskRow);
  392. }

  393. // 创建信息行
  394. function createInfoRow(label, value) {
  395.     var row = new Horizontal();
  396.    
  397.     // 左侧间距
  398.     var leftSpace = new Space();
  399.     leftSpace.setWidth(8);
  400.     row.addView(leftSpace);
  401.    
  402.     var labelView = new Label();
  403.     labelView.setText(label + ":");
  404.     labelView.setTextColor(139, 90, 0);
  405.     labelView.setFontSize(14);
  406.     labelView.setWidth(100);
  407.     row.addView(labelView);
  408.    
  409.     var valueView = new Label();
  410.     valueView.setText(value);
  411.     valueView.setTextColor(80, 50, 10);
  412.     valueView.setFontSize(14);
  413.     row.addView(valueView);
  414.    
  415.     // 右侧间距
  416.     var rightSpace = new Space();
  417.     rightSpace.setWidth(8);
  418.     row.addView(rightSpace);
  419.    
  420.     return row;
  421. }

  422. // 创建复选框
  423. function createCheckBox(text, defaultChecked) {
  424.     var checkBox = new CheckBox();
  425.     checkBox.setText(text);
  426.     if (defaultChecked) {
  427.         checkBox.setDefultSelect();
  428.     }
  429.     return checkBox;
  430. }

  431. // 获取当前时间
  432. function getCurrentTime() {
  433.     var now = new Date();
  434.     return now.getHours().toString().padStart(2, '0') + ":" +
  435.            now.getMinutes().toString().padStart(2, '0') + ":" +
  436.            now.getSeconds().toString().padStart(2, '0');
  437. }

  438. // 显示提示消息
  439. function showToast(message) {
  440.     printl("&#128172; " + message);
  441. }

  442. // &#127822; 金黄色风格界面特点:
  443. // 1. 金黄色主题配色方案
  444. // 2. 卡片式布局设计
  445. // 3. 现代化的图标和符号
  446. // 4. 清晰的信息层级
  447. // 5. 响应式交互反馈
  448. // 6. 专业的数据展示方式
复制代码








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