B2BÍøÂçÈí¼þ

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á ÉóºËÍøÕ¾ºÅ:QQ:896757558
ËÑË÷
²é¿´: 2|»Ø¸´: 0
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ

AIWROKÆ»¹û½Å±¾ÊµÀý1½çÃæUIÊäÈë¿òÀà[Input]

[¸´ÖÆÁ´½Ó]

1051

Ö÷Ìâ

1056

Ìû×Ó

7481

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

»ý·Ö
7481
Ìø×ªµ½Ö¸¶¨Â¥²ã
Â¥Ö÷

AIWROKÆ»¹û½Å±¾ÊµÀý1½çÃæUIÊäÈë¿òÀà[Input]
AIWROKÆ»¹û½Å±¾ÊµÀý1½çÃæUIÊäÈë¿òÀà[Input] B2BÍøÂçÈí¼þ
AIWROKÆ»¹û½Å±¾ÊµÀý1½çÃæUIÊäÈë¿òÀà[Input] B2BÍøÂçÈí¼þ
AIWROKÆ»¹û½Å±¾ÊµÀý1½çÃæUIÊäÈë¿òÀà[Input] B2BÍøÂçÈí¼þ




  1. // =============================================================================
  2. // 🎨 UI-ÊäÈë¿òÀà[Input]È«ÐÂϵͳ»¯Ê¾Àý
  3. // 📱 ÊÊÓÃÓÚÆ»¹ûiOSϵͳ - AIWROK IDE
  4. //🍎½»Á÷QQȺ711841924Ⱥһ£¬Æ»¹ûÄÚ²âȺ£¬528816639
  5. // =============================================================================
  6. //
  7. // ±¾Ê¾ÀýÈ«ÃæÕ¹Ê¾Input¿Ø¼þµÄËùÓй¦ÄÜ£¬²ÉÓÃTabView¶àÒ³Ãæ¼Ü¹¹£¬
  8. // ϵͳ»¯µØÑÝʾÿ¸ö·½·¨µÄʹÓó¡¾°ºÍ×î¼Ñʵ¼ù¡£
  9. //
  10. // Input¿Ø¼þ·½·¨Çåµ¥£º
  11. // 1. setText(text) - ÉèÖÃÊäÈë¿òÎı¾ÄÚÈÝ
  12. // 2. getText() - »ñÈ¡ÊäÈë¿òÎı¾ÄÚÈÝ
  13. // 3. setID(id) - ÉèÖÿؼþΨһ±êʶ·û
  14. // 4. setDefultText(text) - ÉèÖÃĬÈÏÎı¾£¨ÅäºÏconfigʹÓã©
  15. // 5. setTextColor(r, g, b) - ÉèÖÃÎı¾ÑÕÉ«
  16. // 6. setFontSize(size) - ÉèÖÃ×ÖÌå´óС
  17. // 7. setBackgroundColor(r, g, b) - ÉèÖñ³¾°ÑÕÉ«
  18. // 8. setWidth(width) - ÉèÖÿؼþ¿í¶È
  19. // 9. setHeight(height) - ÉèÖÿؼþ¸ß¶È
  20. // 10. setPlaceholder(text) - ÉèÖÃռλÌáʾÎı¾
  21. // 11. setTextAlignment(align) - ÉèÖÃÎı¾¶ÔÆë·½Ê½
  22. // 12. setInputStyle(isLineStyle) - ÉèÖÃÊäÈë¿òÑùʽ
  23. // =============================================================================

  24. printl("=== InputÊäÈë¿ò¿Ø¼þÈ«ÐÂϵͳ»¯Ê¾ÀýÆô¶¯ ===");

  25. // ´´½¨TabViewÖ÷ÈÝÆ÷
  26. var tab = new TabView();

  27. // ÉèÖÃTabÒ³Ãæ±êÌâ
  28. var tabTitles = [
  29.     "»ù´¡",
  30.     "Ñùʽ",
  31.     "¸ß¼¶",
  32.     "×ÛºÏ",
  33.     "¹ØÓÚ"
  34. ];
  35. tab.setTitles(tabTitles);

  36. // ÏÔʾTabView²¢³õʼ»¯ËùÓÐÒ³Ãæ
  37. tab.show(function() {
  38.     // ¹¹½¨¸÷¸öÒ³Ãæ
  39.     buildBasicPage();
  40.     buildStylePage();
  41.     buildAdvancedPage();
  42.     buildApplicationPage();
  43.     buildAboutPage();
  44. });

  45. // =============================================================================
  46. // µÚÒ»Ò³£º»ù´¡·½·¨ÑÝʾ
  47. // =============================================================================
  48. function buildBasicPage() {
  49.     var page = new Vertical();
  50.     page.setSpacing(0);
  51.     page.setBackgroundColor(245, 245, 250);

  52.     // ·½·¨1£ºsetText - ÉèÖÃÎı¾
  53.     var section1 = createMethodSection(
  54.         "·½·¨1£ºsetText",
  55.         "ÉèÖÃÊäÈë¿òµÄÎı¾ÄÚÈÝ",
  56.         "input.setText(\"Hello World\");"
  57.     );
  58.    
  59.     var input1 = new Input();
  60.     input1.setText("Ô¤ÉèµÄÎı¾ÄÚÈÝ");
  61.     input1.setWidth(280);
  62.     input1.setHeight(42);
  63.     input1.setBackgroundColor(255, 255, 255);
  64.     section1.addView(input1);
  65.    
  66.     var btn1 = createActionButton("ÐÞ¸ÄÎı¾", function() {
  67.         input1.setText("Îı¾Òѱ»Ð޸ģ¡");
  68.         printl("setText·½·¨ÑÝʾ£ºÎı¾ÒÑÐÞ¸Ä");
  69.     });
  70.     section1.addView(btn1);
  71.     page.addView(section1);
  72.    
  73.     // ·½·¨2£ºgetText - »ñÈ¡Îı¾
  74.     var section2 = createMethodSection(
  75.         "·½·¨2£ºgetText",
  76.         "»ñÈ¡ÊäÈë¿òµ±Ç°Îı¾ÄÚÈÝ",
  77.         "var text = input.getText();"
  78.     );
  79.    
  80.     var input2 = new Input();
  81.     input2.setPlaceholder("ÔÚ´ËÊäÈëÄÚÈݺóµã»÷»ñÈ¡");
  82.     input2.setWidth(280);
  83.     input2.setHeight(42);
  84.     input2.setBackgroundColor(255, 255, 255);
  85.     section2.addView(input2);
  86.    
  87.     var resultLabel2 = createResultLabel("µÈ´ý»ñÈ¡...");
  88.    
  89.     var btn2 = createActionButton("»ñÈ¡Îı¾", function() {
  90.         var text = input2.getText();
  91.         resultLabel2.setText("»ñÈ¡½á¹û: \"" + text + "\"");
  92.         printl("getText·½·¨ÑÝʾ£º»ñÈ¡µ½Îı¾ \"" + text + "\"");
  93.     });
  94.     section2.addView(btn2);
  95.     section2.addView(resultLabel2);
  96.     page.addView(section2);
  97.    
  98.     // ·½·¨3£ºsetID - ÉèÖÿؼþID
  99.     var section3 = createMethodSection(
  100.         "·½·¨3£ºsetID",
  101.         "ÉèÖÿؼþΨһ±êʶ·û£¬ÓÃÓÚÅäÖô洢",
  102.         "input.setID(\"username\");"
  103.     );
  104.    
  105.     var input3 = new Input();
  106.     input3.setID("demo_input_id");
  107.     input3.setPlaceholder("ÒÑÉèÖÃID: demo_input_id");
  108.     input3.setWidth(280);
  109.     input3.setHeight(42);
  110.     input3.setBackgroundColor(255, 255, 255);
  111.     section3.addView(input3);
  112.    
  113.     var btn3 = createActionButton("¶ÁÈ¡ÅäÖÃ", function() {
  114.         var configValue = config.getConfig("demo_input_id");
  115.         printl("setID·½·¨ÑÝʾ£º´Óconfig¶ÁÈ¡µ½Öµ \"" + configValue + "\"");
  116.     });
  117.     section3.addView(btn3);
  118.     page.addView(section3);
  119.    
  120.     // ·½·¨4£ºsetDefultText - ÉèÖÃĬÈÏÎı¾
  121.     var section4 = createMethodSection(
  122.         "·½·¨4£ºsetDefultText",
  123.         "ÉèÖÃÊäÈë¿òµÄĬÈÏÎı¾Öµ",
  124.         "input.setDefultText(\"ĬÈÏÖµ\");"
  125.     );
  126.    
  127.     var input4 = new Input();
  128.     input4.setID("default_text_demo");
  129.     input4.setDefultText("ÕâÊÇĬÈÏÎı¾");
  130.     input4.setWidth(280);
  131.     input4.setHeight(42);
  132.     input4.setBackgroundColor(255, 255, 255);
  133.     section4.addView(input4);
  134.    
  135.     var infoLabel4 = createInfoLabel("ÅäºÏsetIDʹÓ㬿Éͨ¹ýconfig±£´æ/¶ÁȡĬÈÏÖµ");
  136.     section4.addView(infoLabel4);
  137.     page.addView(section4);
  138.    
  139.     // Ìí¼Óµ½TabView
  140.     tab.addView(0, page);
  141.     printl("»ù´¡·½·¨Ò³Ãæ¹¹½¨Íê³É");
  142. }

  143. // =============================================================================
  144. // µÚ¶þÒ³£ºÑùʽÉèÖÃÑÝʾ
  145. // =============================================================================
  146. function buildStylePage() {
  147.     var page = new Vertical();
  148.     page.setSpacing(0);
  149.     page.setBackgroundColor(250, 245, 245);

  150.     // ·½·¨5£ºsetTextColor - Îı¾ÑÕÉ«
  151.     var section5 = createMethodSection(
  152.         "·½·¨5£ºsetTextColor",
  153.         "ÉèÖÃÊäÈë¿òÎı¾ÑÕÉ« (R, G, B)",
  154.         "input.setTextColor(255, 0, 0); // ºìÉ«"
  155.     );
  156.    
  157.     var colorContainer = new Horizontal();
  158.     colorContainer.setSpacing(10);
  159.    
  160.     var redInput = new Input();
  161.     redInput.setText("ºìÉ«Îı¾");
  162.     redInput.setTextColor(255, 0, 0);
  163.     redInput.setWidth(85);
  164.     redInput.setHeight(40);
  165.     redInput.setBackgroundColor(255, 235, 235);
  166.     colorContainer.addView(redInput);
  167.    
  168.     var greenInput = new Input();
  169.     greenInput.setText("ÂÌÉ«Îı¾");
  170.     greenInput.setTextColor(0, 150, 0);
  171.     greenInput.setWidth(85);
  172.     greenInput.setHeight(40);
  173.     greenInput.setBackgroundColor(235, 255, 235);
  174.     colorContainer.addView(greenInput);
  175.    
  176.     var blueInput = new Input();
  177.     blueInput.setText("À¶É«Îı¾");
  178.     blueInput.setTextColor(0, 100, 255);
  179.     blueInput.setWidth(85);
  180.     blueInput.setHeight(40);
  181.     blueInput.setBackgroundColor(235, 235, 255);
  182.     colorContainer.addView(blueInput);
  183.    
  184.     section5.addView(colorContainer);
  185.     page.addView(section5);
  186.    
  187.     // ·½·¨6£ºsetFontSize - ×ÖÌå´óС
  188.     var section6 = createMethodSection(
  189.         "·½·¨6£ºsetFontSize",
  190.         "ÉèÖÃÊäÈë¿ò×ÖÌå´óС",
  191.         "input.setFontSize(18);"
  192.     );
  193.    
  194.     var fontContainer = new Vertical();
  195.     fontContainer.setSpacing(8);
  196.    
  197.     var smallInput = new Input();
  198.     smallInput.setText("С×ÖÌå (12px)");
  199.     smallInput.setFontSize(12);
  200.     smallInput.setWidth(280);
  201.     smallInput.setHeight(35);
  202.     smallInput.setBackgroundColor(255, 255, 255);
  203.     fontContainer.addView(smallInput);
  204.    
  205.     var mediumInput = new Input();
  206.     mediumInput.setText("ÖÐ×ÖÌå (16px)");
  207.     mediumInput.setFontSize(16);
  208.     mediumInput.setWidth(280);
  209.     mediumInput.setHeight(40);
  210.     mediumInput.setBackgroundColor(255, 255, 255);
  211.     fontContainer.addView(mediumInput);
  212.    
  213.     var largeInput = new Input();
  214.     largeInput.setText("´ó×ÖÌå (20px)");
  215.     largeInput.setFontSize(20);
  216.     largeInput.setWidth(280);
  217.     largeInput.setHeight(45);
  218.     largeInput.setBackgroundColor(255, 255, 255);
  219.     fontContainer.addView(largeInput);
  220.    
  221.     section6.addView(fontContainer);
  222.     page.addView(section6);
  223.    
  224.     // ·½·¨7£ºsetBackgroundColor - ±³¾°ÑÕÉ«
  225.     var section7 = createMethodSection(
  226.         "·½·¨7£ºsetBackgroundColor",
  227.         "ÉèÖÃÊäÈë¿ò±³¾°ÑÕÉ«",
  228.         "input.setBackgroundColor(240, 240, 240);"
  229.     );
  230.    
  231.     var bgContainer = new Horizontal();
  232.     bgContainer.setSpacing(10);
  233.    
  234.     var yellowBg = new Input();
  235.     yellowBg.setText("»ÆÉ«±³¾°");
  236.     yellowBg.setWidth(85);
  237.     yellowBg.setHeight(40);
  238.     yellowBg.setBackgroundColor(255, 255, 200);
  239.     bgContainer.addView(yellowBg);
  240.    
  241.     var cyanBg = new Input();
  242.     cyanBg.setText("ÇàÉ«±³¾°");
  243.     cyanBg.setWidth(85);
  244.     cyanBg.setHeight(40);
  245.     cyanBg.setBackgroundColor(200, 255, 255);
  246.     bgContainer.addView(cyanBg);
  247.    
  248.     var pinkBg = new Input();
  249.     pinkBg.setText("·ÛÉ«±³¾°");
  250.     pinkBg.setWidth(85);
  251.     pinkBg.setHeight(40);
  252.     pinkBg.setBackgroundColor(255, 220, 230);
  253.     bgContainer.addView(pinkBg);
  254.    
  255.     section7.addView(bgContainer);
  256.     page.addView(section7);
  257.    
  258.     // ·½·¨8&9£ºsetWidth & setHeight - ³ß´çÉèÖÃ
  259.     var section8 = createMethodSection(
  260.         "·½·¨8&9£ºsetWidth & setHeight",
  261.         "ÉèÖÃÊäÈë¿òµÄ¿í¶ÈºÍ¸ß¶È",
  262.         "input.setWidth(300);\ninput.setHeight(50);"
  263.     );
  264.    
  265.     var sizeContainer = new Vertical();
  266.     sizeContainer.setSpacing(8);
  267.    
  268.     var smallSize = new Input();
  269.     smallSize.setText("С³ß´ç (200x35)");
  270.     smallSize.setWidth(200);
  271.     smallSize.setHeight(35);
  272.     smallSize.setBackgroundColor(255, 255, 255);
  273.     sizeContainer.addView(smallSize);
  274.    
  275.     var mediumSize = new Input();
  276.     mediumSize.setText("Öгߴç (250x42)");
  277.     mediumSize.setWidth(250);
  278.     mediumSize.setHeight(42);
  279.     mediumSize.setBackgroundColor(255, 255, 255);
  280.     sizeContainer.addView(mediumSize);
  281.    
  282.     var largeSize = new Input();
  283.     largeSize.setText("´ó³ß´ç (300x50)");
  284.     largeSize.setWidth(300);
  285.     largeSize.setHeight(50);
  286.     largeSize.setBackgroundColor(255, 255, 255);
  287.     sizeContainer.addView(largeSize);
  288.    
  289.     section8.addView(sizeContainer);
  290.     page.addView(section8);
  291.    
  292.     // Ìí¼Óµ½TabView
  293.     tab.addView(1, page);
  294.     printl("ÑùʽÉèÖÃÒ³Ãæ¹¹½¨Íê³É");
  295. }

  296. // =============================================================================
  297. // µÚÈýÒ³£º¸ß¼¶¹¦ÄÜÑÝʾ
  298. // =============================================================================
  299. function buildAdvancedPage() {
  300.     var page = new Vertical();
  301.     page.setSpacing(0);
  302.     page.setBackgroundColor(245, 250, 245);

  303.     // ·½·¨10£ºsetPlaceholder - ռλ·û
  304.     var section10 = createMethodSection(
  305.         "·½·¨10£ºsetPlaceholder",
  306.         "ÉèÖÃռλÌáʾÎı¾£¨ÊäÈë¿òΪ¿ÕʱÏÔʾ£©",
  307.         "input.setPlaceholder(\"ÇëÊäÈëÓû§Ãû...\");"
  308.     );
  309.    
  310.     var placeholderInput = new Input();
  311.     placeholderInput.setPlaceholder("ÕâÊÇÒ»¸öռλÌáʾÎı¾...");
  312.     placeholderInput.setWidth(280);
  313.     placeholderInput.setHeight(42);
  314.     placeholderInput.setBackgroundColor(255, 255, 255);
  315.     section10.addView(placeholderInput);
  316.     page.addView(section10);
  317.    
  318.     // ·½·¨11£ºsetTextAlignment - Îı¾¶ÔÆë
  319.     var section11 = createMethodSection(
  320.         "·½·¨11£ºsetTextAlignment",
  321.         "ÉèÖÃÎı¾¶ÔÆë·½Ê½ (left/center/right)",
  322.         "input.setTextAlignment(\"center\");"
  323.     );
  324.    
  325.     var alignContainer = new Vertical();
  326.     alignContainer.setSpacing(8);
  327.    
  328.     var leftAlign = new Input();
  329.     leftAlign.setText("×ó¶ÔÆë (left)");
  330.     leftAlign.setTextAlignment("left");
  331.     leftAlign.setWidth(280);
  332.     leftAlign.setHeight(40);
  333.     leftAlign.setBackgroundColor(255, 240, 240);
  334.     alignContainer.addView(leftAlign);
  335.    
  336.     var centerAlign = new Input();
  337.     centerAlign.setText("¾ÓÖÐ¶ÔÆë (center)");
  338.     centerAlign.setTextAlignment("center");
  339.     centerAlign.setWidth(280);
  340.     centerAlign.setHeight(40);
  341.     centerAlign.setBackgroundColor(240, 255, 240);
  342.     alignContainer.addView(centerAlign);
  343.    
  344.     var rightAlign = new Input();
  345.     rightAlign.setText("ÓÒ¶ÔÆë (right)");
  346.     rightAlign.setTextAlignment("right");
  347.     rightAlign.setWidth(280);
  348.     rightAlign.setHeight(40);
  349.     rightAlign.setBackgroundColor(240, 240, 255);
  350.     alignContainer.addView(rightAlign);
  351.    
  352.     section11.addView(alignContainer);
  353.     page.addView(section11);
  354.    
  355.     // ·½·¨12£ºsetInputStyle - ÊäÈë¿òÑùʽ
  356.     var section12 = createMethodSection(
  357.         "·½·¨12£ºsetInputStyle",
  358.         "ÉèÖÃÊäÈë¿òÑùʽ (true=µ×²¿ÏßÌõÑùʽ)",
  359.         "input.setInputStyle(true); // µ×²¿ÏßÌõÑùʽ"
  360.     );
  361.    
  362.     var styleContainer = new Vertical();
  363.     styleContainer.setSpacing(15);
  364.    
  365.     var normalStyle = new Input();
  366.     normalStyle.setText("ÆÕͨÑùʽ (ĬÈÏ)");
  367.     normalStyle.setWidth(280);
  368.     normalStyle.setHeight(42);
  369.     normalStyle.setBackgroundColor(255, 255, 255);
  370.     styleContainer.addView(normalStyle);
  371.    
  372.     var lineStyle = new Input();
  373.     lineStyle.setText("µ×²¿ÏßÌõÑùʽ");
  374.     lineStyle.setInputStyle(true);
  375.     lineStyle.setWidth(280);
  376.     lineStyle.setHeight(42);
  377.     styleContainer.addView(lineStyle);
  378.    
  379.     section12.addView(styleContainer);
  380.     page.addView(section12);
  381.    
  382.     // ¶¯Ì¬ÑùʽÇл»ÑÝʾ
  383.     var sectionDynamic = createMethodSection(
  384.         "¶¯Ì¬ÑùʽÇл»",
  385.         "ʵʱÐÞ¸ÄÊäÈë¿òµÄ¸÷ÖÖÊôÐÔ",
  386.         "ͨ¹ý°´Å¥½»»¥¶¯Ì¬¸Ä±äÑùʽ"
  387.     );
  388.    
  389.     var dynamicInput = new Input();
  390.     dynamicInput.setText("¶¯Ì¬ÑùʽÊäÈë¿ò");
  391.     dynamicInput.setWidth(280);
  392.     dynamicInput.setHeight(45);
  393.     dynamicInput.setBackgroundColor(255, 255, 255);
  394.     sectionDynamic.addView(dynamicInput);
  395.    
  396.     var btnContainer = new Horizontal();
  397.     btnContainer.setSpacing(8);
  398.    
  399.     var colorBtn = createSmallButton("±äÉ«", function() {
  400.         var colors = [
  401.             [255, 200, 200], [200, 255, 200], [200, 200, 255],
  402.             [255, 255, 200], [255, 200, 255], [200, 255, 255]
  403.         ];
  404.         var randomColor = colors[Math.floor(Math.random() * colors.length)];
  405.         dynamicInput.setBackgroundColor(randomColor[0], randomColor[1], randomColor[2]);
  406.         printl("¶¯Ì¬Ñùʽ£º±³¾°É«Òѱä¸ü");
  407.     });
  408.     btnContainer.addView(colorBtn);
  409.    
  410.     var alignBtn = createSmallButton("Çл»¶ÔÆë", function() {
  411.         var aligns = ["left", "center", "right"];
  412.         var currentText = dynamicInput.getText();
  413.         var currentAlign = "left";
  414.         if (currentText.indexOf("¾ÓÖÐ") !== -1) currentAlign = "center";
  415.         if (currentText.indexOf("ÓÒ¶ÔÆë") !== -1) currentAlign = "right";
  416.         
  417.         var nextIndex = (aligns.indexOf(currentAlign) + 1) % 3;
  418.         var nextAlign = aligns[nextIndex];
  419.         
  420.         var alignLabels = { "left": "×ó¶ÔÆë", "center": "¾ÓÖÐ¶ÔÆë", "right": "ÓÒ¶ÔÆë" };
  421.         dynamicInput.setText(alignLabels[nextAlign]);
  422.         dynamicInput.setTextAlignment(nextAlign);
  423.         printl("¶¯Ì¬Ñùʽ£º¶ÔÆë·½Ê½ÒÑÇл»Îª " + nextAlign);
  424.     });
  425.     btnContainer.addView(alignBtn);
  426.    
  427.     var sizeBtn = createSmallButton("µ÷Õû´óС", function() {
  428.         var sizes = [[200, 35], [250, 42], [300, 50]];
  429.         var currentWidth = dynamicInput.getWidth ? 250 : 250; // ĬÈÏÖгߴç
  430.         var nextSize = sizes[Math.floor(Math.random() * sizes.length)];
  431.         dynamicInput.setWidth(nextSize[0]);
  432.         dynamicInput.setHeight(nextSize[1]);
  433.         printl("¶¯Ì¬Ñùʽ£º³ß´çÒѵ÷ÕûΪ " + nextSize[0] + "x" + nextSize[1]);
  434.     });
  435.     btnContainer.addView(sizeBtn);
  436.    
  437.     sectionDynamic.addView(btnContainer);
  438.     page.addView(sectionDynamic);
  439.    
  440.     // Ìí¼Óµ½TabView
  441.     tab.addView(2, page);
  442.     printl("¸ß¼¶¹¦ÄÜÒ³Ãæ¹¹½¨Íê³É");
  443. }

  444. // =============================================================================
  445. // µÚËÄÒ³£º×ÛºÏÓ¦ÓÃÑÝʾ
  446. // =============================================================================
  447. function buildApplicationPage() {
  448.     var page = new Vertical();
  449.     page.setSpacing(0);
  450.     page.setBackgroundColor(250, 250, 245);

  451.     // Ó¦Óó¡¾°1£ºµÇ¼±íµ¥
  452.     var loginSection = createAppSection("³¡¾°1£ºÓû§µÇ¼±íµ¥");
  453.    
  454.     // Óû§ÃûÊäÈë
  455.     var usernameLabel = new Label();
  456.     usernameLabel.setText("Óû§Ãû:");
  457.     usernameLabel.setFontSize(14);
  458.     usernameLabel.setTextColor(60, 60, 60);
  459.     loginSection.addView(usernameLabel);
  460.    
  461.     var usernameInput = new Input();
  462.     usernameInput.setID("login_username");
  463.     usernameInput.setPlaceholder("ÇëÊäÈëÓû§Ãû");
  464.     usernameInput.setWidth(280);
  465.     usernameInput.setHeight(42);
  466.     usernameInput.setBackgroundColor(255, 255, 255);
  467.     usernameInput.setTextColor(50, 50, 50);
  468.     loginSection.addView(usernameInput);
  469.    
  470.     // ÃÜÂëÊäÈë
  471.     var passwordLabel = new Label();
  472.     passwordLabel.setText("ÃÜÂë:");
  473.     passwordLabel.setFontSize(14);
  474.     passwordLabel.setTextColor(60, 60, 60);
  475.     loginSection.addView(passwordLabel);
  476.    
  477.     var passwordInput = new Input();
  478.     passwordInput.setID("login_password");
  479.     passwordInput.setPlaceholder("ÇëÊäÈëÃÜÂë");
  480.     passwordInput.setWidth(280);
  481.     passwordInput.setHeight(42);
  482.     passwordInput.setBackgroundColor(255, 255, 255);
  483.     passwordInput.setInputStyle(true); // ʹÓõײ¿ÏßÌõÑùʽ
  484.     loginSection.addView(passwordInput);
  485.    
  486.     // µÇ¼½á¹û±êÇ©
  487.     var loginResult = createResultLabel("µÈ´ý²Ù×÷...");
  488.     loginSection.addView(loginResult);
  489.    
  490.     // °´Å¥ÇøÓò
  491.     var loginBtnContainer = new Horizontal();
  492.     loginBtnContainer.setSpacing(15);
  493.    
  494.     var loginBtn = createActionButton("µÇ¼", function() {
  495.         var username = usernameInput.getText();
  496.         var password = passwordInput.getText();
  497.         
  498.         if (username === "" || password === "") {
  499.             loginResult.setText("❌ ÇëÌîдÍêÕûÐÅÏ¢£¡");
  500.             loginResult.setTextColor(255, 0, 0);
  501.         } else {
  502.             loginResult.setText("✅ µÇ¼³É¹¦£¡»¶Ó­ " + username);
  503.             loginResult.setTextColor(0, 150, 0);
  504.             printl("µÇ¼ÑÝʾ£ºÓû§Ãû=" + username + ", ÃÜÂ볤¶È=" + password.length);
  505.         }
  506.     });
  507.     loginBtnContainer.addView(loginBtn);
  508.    
  509.     var resetBtn = createSecondaryButton("ÖØÖÃ", function() {
  510.         usernameInput.setText("");
  511.         passwordInput.setText("");
  512.         loginResult.setText("ÒÑÖØÖã¬ÇëÖØÐÂÊäÈë");
  513.         loginResult.setTextColor(100, 100, 100);
  514.         printl("µÇ¼ÑÝʾ£º±íµ¥ÒÑÖØÖÃ");
  515.     });
  516.     loginBtnContainer.addView(resetBtn);
  517.    
  518.     loginSection.addView(loginBtnContainer);
  519.     page.addView(loginSection);
  520.    
  521.     // Ó¦Óó¡¾°2£º¸öÈËÐÅÏ¢±à¼­
  522.     var profileSection = createAppSection("³¡¾°2£º¸öÈËÐÅÏ¢±à¼­");
  523.    
  524.     // êdzÆ
  525.     var nicknameRow = createInputRow("êdzÆ", "nickname_field", "ÇëÊäÈëêdzÆ");
  526.     profileSection.addView(nicknameRow);
  527.    
  528.     // ÓÊÏä
  529.     var emailRow = createInputRow("ÓÊÏä", "email_field", "ÇëÊäÈëÓÊÏ䵨ַ");
  530.     profileSection.addView(emailRow);
  531.    
  532.     // µç»°
  533.     var phoneRow = createInputRow("µç»°", "phone_field", "ÇëÊäÈëµç»°ºÅÂë");
  534.     profileSection.addView(phoneRow);
  535.    
  536.     // ±£´æ°´Å¥
  537.     var saveBtn = createActionButton("±£´æÐÅÏ¢", function() {
  538.         var nickname = config.getConfig("nickname_field");
  539.         var email = config.getConfig("email_field");
  540.         var phone = config.getConfig("phone_field");
  541.         
  542.         printl("±£´æÐÅÏ¢£ºêdzÆ=" + nickname + ", ÓÊÏä=" + email + ", µç»°=" + phone);
  543.         
  544.         var saveResult = createResultLabel("✅ ÐÅÏ¢Òѱ£´æµ½ÅäÖã¡");
  545.         saveResult.setTextColor(0, 150, 0);
  546.         profileSection.addView(saveResult);
  547.         
  548.         // 3ÃëºóÒÆ³ý½á¹ûÌáʾ
  549.         sleep(3000);
  550.         // ×¢Ò⣺ʵ¼ÊÓ¦ÓÃÖпÉÄÜÐèҪʹÓö¨Ê±Æ÷
  551.     });
  552.     profileSection.addView(saveBtn);
  553.    
  554.     page.addView(profileSection);
  555.    
  556.     // Ó¦Óó¡¾°3£ºËÑË÷¹¦ÄÜ
  557.     var searchSection = createAppSection("³¡¾°3£ºËÑË÷¹¦ÄÜ");
  558.    
  559.     var searchContainer = new Horizontal();
  560.     searchContainer.setSpacing(10);
  561.    
  562.     var searchInput = new Input();
  563.     searchInput.setPlaceholder("ÇëÊäÈëËÑË÷¹Ø¼ü´Ê...");
  564.     searchInput.setWidth(200);
  565.     searchInput.setHeight(42);
  566.     searchInput.setBackgroundColor(255, 255, 255);
  567.     searchInput.setTextAlignment("left");
  568.     searchContainer.addView(searchInput);
  569.    
  570.     var searchBtn = new Button();
  571.     searchBtn.setText("🔍 ËÑË÷");
  572.     searchBtn.setColor(0, 122, 255);
  573.     searchBtn.setTextColor(255, 255, 255);
  574.     searchBtn.setWidth(80);
  575.     searchBtn.setHeight(42);
  576.    
  577.     var searchResult = createResultLabel("ÊäÈë¹Ø¼ü´Êºóµã»÷ËÑË÷");
  578.    
  579.     searchBtn.onClick(function() {
  580.         var keyword = searchInput.getText();
  581.         if (keyword === "") {
  582.             searchResult.setText("⚠️ ÇëÊäÈëËÑË÷¹Ø¼ü´Ê");
  583.             searchResult.setTextColor(255, 150, 0);
  584.         } else {
  585.             searchResult.setText("🔍 ÕýÔÚËÑË÷: \"" + keyword + "\"...");
  586.             searchResult.setTextColor(0, 100, 200);
  587.             printl("ËÑË÷ÑÝʾ£º¹Ø¼ü´Ê=\"" + keyword + "\"");
  588.         }
  589.     });
  590.     searchContainer.addView(searchBtn);
  591.    
  592.     searchSection.addView(searchContainer);
  593.     searchSection.addView(searchResult);
  594.     page.addView(searchSection);
  595.    
  596.     // Ìí¼Óµ½TabView
  597.     tab.addView(3, page);
  598.     printl("×ÛºÏÓ¦ÓÃÒ³Ãæ¹¹½¨Íê³É");
  599. }

  600. // =============================================================================
  601. // µÚÎåÒ³£º¹ØÓÚÒ³Ãæ
  602. // =============================================================================
  603. function buildAboutPage() {
  604.     var page = new Vertical();
  605.     page.setSpacing(0);
  606.     page.setBackgroundColor(240, 248, 255);
  607.     page.setAlignment("center");

  608.     // Ó¦ÓÃͼ±êÇøÓò£¨Ê¹ÓÃLabelÄ£Ä⣩
  609.     var iconLabel = new Label();
  610.     iconLabel.setText("⌨️");
  611.     iconLabel.setFontSize(40);
  612.     page.addView(iconLabel);
  613.    
  614.     // ±êÌâ
  615.     var appTitle = new Label();
  616.     appTitle.setText("Input¿Ø¼þϵͳ»¯Ê¾Àý");
  617.     appTitle.setFontSize(22);
  618.     appTitle.setTextColor(0, 100, 150);
  619.     appTitle.setTextAlignment("center");
  620.     page.addView(appTitle);
  621.    
  622.     // °æ±¾ÐÅÏ¢
  623.     var versionLabel = new Label();
  624.     versionLabel.setText("°æ±¾: 2.0.0");
  625.     versionLabel.setFontSize(14);
  626.     versionLabel.setTextColor(100, 100, 100);
  627.     versionLabel.setTextAlignment("center");
  628.     page.addView(versionLabel);
  629.    
  630.     // ·Ö¸ôÏß
  631.     var line = new Label();
  632.     line.setText("©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥");
  633.     line.setTextAlignment("center");
  634.     line.setTextColor(200, 200, 200);
  635.     page.addView(line);
  636.    
  637.     // ·½·¨Áбí
  638.     var methodListLabel = new Label();
  639.     methodListLabel.setText("📋 Input¿Ø¼þ·½·¨Çåµ¥");
  640.     methodListLabel.setFontSize(16);
  641.     methodListLabel.setTextColor(50, 50, 50);
  642.     methodListLabel.setTextAlignment("center");
  643.     page.addView(methodListLabel);
  644.    
  645.     var methodsInfo = new Label();
  646.     methodsInfo.setText(
  647.         "1. setText(text) - ÉèÖÃÎı¾\n" +
  648.         "2. getText() - »ñÈ¡Îı¾\n" +
  649.         "3. setID(id) - ÉèÖÿؼþID\n" +
  650.         "4. setDefultText(text) - ÉèÖÃĬÈÏÎı¾\n" +
  651.         "5. setTextColor(r,g,b) - ÉèÖÃÎı¾ÑÕÉ«\n" +
  652.         "6. setFontSize(size) - ÉèÖÃ×ÖÌå´óС\n" +
  653.         "7. setBackgroundColor(r,g,b) - ÉèÖñ³¾°É«\n" +
  654.         "8. setWidth(width) - ÉèÖÿí¶È\n" +
  655.         "9. setHeight(height) - ÉèÖø߶È\n" +
  656.         "10. setPlaceholder(text) - ÉèÖÃռλ·û\n" +
  657.         "11. setTextAlignment(align) - ÉèÖÃ¶ÔÆë\n" +
  658.         "12. setInputStyle(bool) - ÉèÖÃÑùʽ"
  659.     );
  660.     methodsInfo.setFontSize(11);
  661.     methodsInfo.setTextColor(80, 80, 80);
  662.     methodsInfo.setTextAlignment("left");
  663.     methodsInfo.setBackgroundColor(255, 255, 255);
  664.     methodsInfo.setWidth(300);
  665.     methodsInfo.setHeight(180);
  666.     page.addView(methodsInfo);
  667.    
  668.     // ·Ö¸ôÏß
  669.     var line2 = new Label();
  670.     line2.setText("©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥");
  671.     line2.setTextAlignment("center");
  672.     line2.setTextColor(200, 200, 200);
  673.     page.addView(line2);
  674.    

  675.    
  676.     // Í˳ö°´Å¥
  677.     var exitBtn = new Button();
  678.     exitBtn.setText("Í˳öʾÀý");
  679.     exitBtn.setColor(255, 59, 48);
  680.     exitBtn.setTextColor(255, 255, 255);
  681.     exitBtn.setWidth(150);
  682.     exitBtn.setHeight(45);
  683.     exitBtn.onClick(function() {
  684.         printl("Óû§Í˳öʾÀý");
  685.         tab.dismiss();
  686.     });
  687.     page.addView(exitBtn);
  688.    
  689.     // Ìí¼Óµ½TabView
  690.     tab.addView(4, page);
  691.     printl("¹ØÓÚÒ³Ãæ¹¹½¨Íê³É");
  692. }

  693. // =============================================================================
  694. // ¸¨Öúº¯Êý - UI×é¼þ´´½¨
  695. // =============================================================================

  696. // ´´½¨Õ½ڱêÌâ
  697. function createSectionTitle(text) {
  698.     var title = new Label();
  699.     title.setText(text);
  700.     title.setFontSize(18);
  701.     title.setTextColor(0, 100, 150);
  702.     title.setTextAlignment("center");
  703.     title.setWidth(350);
  704.     title.setHeight(30);
  705.     return title;
  706. }

  707. // ´´½¨·½·¨ÑÝÊ¾Çø¿é
  708. function createMethodSection(methodName, description, codeExample) {
  709.     var section = new Vertical();
  710.     section.setSpacing(0);
  711.     section.setBackgroundColor(255, 255, 255);
  712.    
  713.     // ·½·¨Ãû³Æ
  714.     var nameLabel = new Label();
  715.     nameLabel.setText(methodName);
  716.     nameLabel.setFontSize(15);
  717.     nameLabel.setTextColor(0, 122, 255);
  718.     nameLabel.setTextAlignment("left");
  719.     section.addView(nameLabel);
  720.    
  721.     // ·½·¨ÃèÊö
  722.     var descLabel = new Label();
  723.     descLabel.setText(description);
  724.     descLabel.setFontSize(12);
  725.     descLabel.setTextColor(80, 80, 80);
  726.     section.addView(descLabel);
  727.    
  728.     // ´úÂëʾÀý
  729.     var codeLabel = new Label();
  730.     codeLabel.setText(codeExample);
  731.     codeLabel.setFontSize(11);
  732.     codeLabel.setTextColor(50, 50, 150);
  733.     codeLabel.setBackgroundColor(245, 245, 255);
  734.     codeLabel.setWidth(280);
  735.     codeLabel.setHeight(35);
  736.     section.addView(codeLabel);
  737.    
  738.     return section;
  739. }

  740. // ´´½¨Ó¦Óó¡¾°Çø¿é
  741. function createAppSection(title) {
  742.     var section = new Vertical();
  743.     section.setSpacing(2);
  744.     section.setBackgroundColor(255, 255, 255);
  745.    
  746.     var titleLabel = new Label();
  747.     titleLabel.setText(title);
  748.     titleLabel.setFontSize(16);
  749.     titleLabel.setTextColor(80, 80, 80);
  750.     section.addView(titleLabel);
  751.    
  752.     return section;
  753. }

  754. // ´´½¨ÊäÈëÐУ¨±êÇ©+ÊäÈë¿ò£©
  755. function createInputRow(labelText, inputId, placeholder) {
  756.     var row = new Vertical();
  757.     row.setSpacing(5);
  758.    
  759.     var label = new Label();
  760.     label.setText(labelText + ":");
  761.     label.setFontSize(13);
  762.     label.setTextColor(60, 60, 60);
  763.     row.addView(label);
  764.    
  765.     var input = new Input();
  766.     input.setID(inputId);
  767.     input.setPlaceholder(placeholder);
  768.     input.setWidth(280);
  769.     input.setHeight(40);
  770.     input.setBackgroundColor(250, 250, 250);
  771.     row.addView(input);
  772.    
  773.     return row;
  774. }

  775. // ´´½¨²Ù×÷°´Å¥
  776. function createActionButton(text, onClickHandler) {
  777.     var btn = new Button();
  778.     btn.setText(text);
  779.     btn.setColor(0, 122, 255);
  780.     btn.setTextColor(255, 255, 255);
  781.     btn.setWidth(120);
  782.     btn.setHeight(40);
  783.     btn.onClick(onClickHandler);
  784.     return btn;
  785. }

  786. // ´´½¨´ÎÒª°´Å¥
  787. function createSecondaryButton(text, onClickHandler) {
  788.     var btn = new Button();
  789.     btn.setText(text);
  790.     btn.setColor(150, 150, 150);
  791.     btn.setTextColor(255, 255, 255);
  792.     btn.setWidth(100);
  793.     btn.setHeight(40);
  794.     btn.onClick(onClickHandler);
  795.     return btn;
  796. }

  797. // ´´½¨Ð¡°´Å¥
  798. function createSmallButton(text, onClickHandler) {
  799.     var btn = new Button();
  800.     btn.setText(text);
  801.     btn.setColor(100, 150, 200);
  802.     btn.setTextColor(255, 255, 255);
  803.     btn.setWidth(85);
  804.     btn.setHeight(35);
  805.     btn.onClick(onClickHandler);
  806.     return btn;
  807. }

  808. // ´´½¨½á¹û±êÇ©
  809. function createResultLabel(text) {
  810.     var label = new Label();
  811.     label.setText(text);
  812.     label.setFontSize(12);
  813.     label.setTextColor(100, 100, 100);
  814.     label.setBackgroundColor(245, 245, 245);
  815.     label.setWidth(280);
  816.     label.setHeight(30);
  817.     return label;
  818. }

  819. // ´´½¨ÐÅÏ¢±êÇ©
  820. function createInfoLabel(text) {
  821.     var label = new Label();
  822.     label.setText(text);
  823.     label.setFontSize(11);
  824.     label.setTextColor(120, 120, 120);
  825.     label.setTextAlignment("center");
  826.     return label;
  827. }

  828. // =============================================================================
  829. // ³ÌÐòÈë¿Ú
  830. // =============================================================================
  831. printl("=== Input¿Ø¼þÈ«ÐÂϵͳ»¯Ê¾ÀýÒÑÆô¶¯ ===");
  832. printl("±¾Ê¾Àý°üº¬5¸öTabÒ³Ãæ£¬È«ÃæÕ¹Ê¾Input¿Ø¼þµÄ12¸ö·½·¨");
¸´ÖÆ´úÂë


»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

±¾°æ»ý·Ö¹æÔò

¹Ø±Õ

QQ|»ÓªÏúÈí¼þ×ÛºÏÌÖÂÛ|»ÓªÏúÈí¼þÓÐÎʱشð|»ÓªÏúÈí¼þ½Ì³Ì×¨Çø|»ÓªÏúÈí¼þPOST½Å±¾·ÖÏí|»ÓªÏúÈí¼þÆÕͨ½Å±¾·ÖÏí|»ÓªÏúÈí¼þÈí¼þ×ÊѶ|»ÓªÏúÈí¼þ¾«Æ·Èí¼þ|»ÓªÏúÈí¼þ¸üй«¸æ|ÓªÏúÈí¼þ|B2BÈí¼þ|B2BÍøÂçÈí¼þ ( ¾©ICP±¸09078825ºÅ )±¾ÍøÕ¾¿ª·¢µÄÓªÏúÈí¼þÊÇÒ»¿îеÄÍøÂçÓªÏúÈí¼þ£¬Õâ¿îÓªÏú¿ÉÒÔÈ¥ÍøÕ¾Èí¼þ£¬²©¿ÍÈí¼þ£¬B2BÈí¼þ£¬·ÖÀàÐÅÏ¢Íø·¢Ìù£¬¿ÉÒÔÇÀɳ·¢£¬¿ÉÒÔµ½°Ù¶ÈÎÄ¿âÉÏ´«WORDÎĵµ£¬¿ÉÒÔµ½Ò»Ð©ÊÇÏà²áÍøÕ¾×Ô¶¯ÉÏ´«Í¼Æ¬£¬Õâ¸ö×Ô¶¯·¢ÌûÈí¼þ×Ô´øÔÆÖ©Ö룬¼Ó¿ìÊÕ¼£¬ÓÐ6ÖÖ¶Ô½Ó´òÂë½Ó¿Ú£¬·½±ã£¬Ð§Âʸߣ¬Ëٶȿ죬¶øÇÒ¶ÔÍ϶¯µÄÑéÖ¤ÂëÈ«ÍøµÚÒ»¼Ò¶À¼ÒÖ§³Ö£¬È«²¿Ô­´´¼¼Êõ£¬¶À¼ÒÑз¢£¬Õý°æÔ­´´´ø°æÈ¨Èí¼þ¡£Ñ¡ÔñÍòÄÜÓªÏúÈí¼þ£¬¾ÍÑ¡ÔñÁËÒ»ÖÖ׬ǮµÄЧÂÊ£¬´ÓûÓб»³¬Ô½¹ý£¬Ò»Ö±ÔÚŬÁ¦Ñз¢Ð¼¼Êõ¡£·Å·ÉÃÎÏ룬½â·ÅË«ÊÖ£¬À´µã´´Ò⣬³É¾ÍÄãµÄÃÎÏ룬¾ÍÔÚÍòÄÜÓªÏúÈí¼þ¿ªÊ¼

map2

GMT+8, 2026-3-4 07:53 , Processed in 0.119864 second(s), 36 queries .

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí