From 8e295b918bbe717fe791e5af02ee930ba50ad710 Mon Sep 17 00:00:00 2001 From: bayanxing Date: Tue, 8 Feb 2022 14:26:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bayanxing --- ace/ace_standard/Test.json | 4 +- ace/ace_standard/src/main/config.json | 11 +- .../main/js/default/pages/option/index.css | 80 +++++++ .../main/js/default/pages/option/index.hml | 20 ++ .../src/main/js/default/pages/option/index.js | 34 +++ .../main/js/default/pages/picker/index.css | 67 ++++++ .../main/js/default/pages/picker/index.hml | 22 ++ .../src/main/js/default/pages/picker/index.js | 83 +++++++ .../js/default/pages/pickerView/index.css | 56 +++++ .../js/default/pages/pickerView/index.hml | 7 + .../main/js/default/pages/pickerView/index.js | 41 ++++ .../src/main/js/default/pages/piece/index.css | 33 +++ .../src/main/js/default/pages/piece/index.hml | 4 + .../src/main/js/default/pages/piece/index.js | 24 ++ .../main/js/default/pages/progress/index.css | 39 ++++ .../main/js/default/pages/progress/index.hml | 13 ++ .../main/js/default/pages/progress/index.js | 20 ++ .../main/js/default/pages/qrcode/index.css | 15 ++ .../main/js/default/pages/qrcode/index.hml | 14 ++ .../src/main/js/default/pages/qrcode/index.js | 41 ++++ .../main/js/default/pages/select/index.css | 64 ++++++ .../main/js/default/pages/select/index.hml | 46 ++++ .../src/main/js/default/pages/select/index.js | 28 +++ .../src/main/js/default/pages/span/index.css | 110 +++++++++ .../src/main/js/default/pages/span/index.hml | 30 +++ .../src/main/js/default/pages/span/index.js | 18 ++ .../main/js/default/pages/switch/index.css | 111 +++++++++ .../main/js/default/pages/switch/index.hml | 24 ++ .../src/main/js/default/pages/switch/index.js | 32 +++ .../main/js/default/pages/toggle/index.css | 113 ++++++++++ .../main/js/default/pages/toggle/index.hml | 43 ++++ .../src/main/js/default/pages/toggle/index.js | 41 ++++ .../default/test/commonComponentJsApi.test.js | 212 +++++++++++++++++- 33 files changed, 1496 insertions(+), 4 deletions(-) create mode 100644 ace/ace_standard/src/main/js/default/pages/option/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/option/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/option/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/piece/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/piece/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/piece/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/qrcode/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/qrcode/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/qrcode/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/select/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/select/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/select/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/span/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/span/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/span/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/switch/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/switch/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/switch/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/toggle/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/toggle/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/toggle/index.js diff --git a/ace/ace_standard/Test.json b/ace/ace_standard/Test.json index f0b72b181f9..004ab0ff63b 100755 --- a/ace/ace_standard/Test.json +++ b/ace/ace_standard/Test.json @@ -2,9 +2,9 @@ "description": "Configuration for aceceshi Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "80000", + "test-timeout": "100000", "package": "com.example.aceceshi", - "shell-timeout": "80000" + "shell-timeout": "100000" }, "kits": [ { diff --git a/ace/ace_standard/src/main/config.json b/ace/ace_standard/src/main/config.json index 9f5bd3de290..6a1f981c048 100755 --- a/ace/ace_standard/src/main/config.json +++ b/ace/ace_standard/src/main/config.json @@ -65,7 +65,16 @@ "pages/toolbar/index", "pages/textarea/index", "pages/menu/index", - "pages/search/index" + "pages/span/index", + "pages/switch/index", + "pages/toggle/index", + "pages/option/index", + "pages/picker/index", + "pages/pickerView/index", + "pages/piece/index", + "pages/progress/index", + "pages/qrcode/index", + "pages/select/index" ], "name": "default", "window": { diff --git a/ace/ace_standard/src/main/js/default/pages/option/index.css b/ace/ace_standard/src/main/js/default/pages/option/index.css new file mode 100644 index 00000000000..83e590100d7 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/index.css @@ -0,0 +1,80 @@ + +.container { + flex-direction: column; + align-items: flex-start; + justify-content: center; +} +.title-text { + margin: 20px; +} +.menu-option1 { + color:red; + font-size:40px; + allow-scale:true; + letter-spacing:5px; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 100px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + text-decoration: line-through; +} +.menu-option2 { + color:pink; + font-size:30px; + allow-scale:true; + letter-spacing:5px; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + text-decoration: underline; +} +.menu-option3 { + color:cadetblue; + font-size:20px; + allow-scale:true; + letter-spacing:5px; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + text-decoration: none; +} +.select-option1 { + color:red; + font-size:40px; + allow-scale:true; + letter-spacing:5px; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + text-decoration: line-through; +} + +.select-option2 { + color:yellow; + font-size:40px; + allow-scale:true; + letter-spacing:5px; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + text-decoration: underline; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/option/index.hml b/ace/ace_standard/src/main/js/default/pages/option/index.hml new file mode 100644 index 00000000000..8de807e358d --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/index.hml @@ -0,0 +1,20 @@ +
+ Click show popup menu1. + + + + + + Select Option + +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/option/index.js b/ace/ace_standard/src/main/js/default/pages/option/index.js new file mode 100644 index 00000000000..28718fd1a21 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/index.js @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; +export default { + data: { + testArray:['item1', 'item2', 'item3'] + }, + onMenuSelected(e) { + prompt.showToast({ + message: e.value + }) + }, + onTextClick() { + this.$element("apiMenu").show({x:280,y:120}); + }, + changeFruit(e) { + prompt.showToast({ + message: e.newValue + }) + } +} diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.css b/ace/ace_standard/src/main/js/default/pages/picker/index.css new file mode 100644 index 00000000000..fc2ec14e547 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/index.css @@ -0,0 +1,67 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} +picker{ + width:60%; + height:80px; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 100px; + margin: 10px; + padding: 20px; + border-radius:20px; + text-color:white; + font-size:15px; + margin-left:20%; + background-color: pink; +} +select{ + background-color: #efecec; + height: 50px; + width: 60%; + margin-left: 20%; + margin-top: 30px; + margin-bottom: 50px; + font-size: 22px; +} +#picker0{ + text-color: plum; + font-size: 30px; + allow-scale: true; + letter-spacing: 2px; + text-decoration: underline; + font-style: normal; + font-family: sans-serif; + line-height: 30px; + column-height: 300px; + background-color:#4747e3; + border: 3px dotted brown; +} +#picker1{ + text-color: pink; + font-size: 30px; + allow-scale: true; + letter-spacing: 5px; + text-decoration: line-through; + font-style: normal; + font-family: sans-serif; + line-height: 30px; + column-height: 300px; + border: 3px solid brown; + background-color:deepskyblue; +} +#picker2{ + text-color: gray; + font-size: 20px; + allow-scale: true; + letter-spacing: 10px; + text-decoration: underline; + font-style: normal; + font-family: sans-serif; + line-height: 30px; + column-height: 300px; + background-color: orange; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.hml b/ace/ace_standard/src/main/js/default/pages/picker/index.hml new file mode 100644 index 00000000000..acc7c4eb1f1 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/index.hml @@ -0,0 +1,22 @@ + +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.js b/ace/ace_standard/src/main/js/default/pages/picker/index.js new file mode 100644 index 00000000000..76202558d80 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/index.js @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; +export default { + data: { + selectList:["text","data","time","datetime","multitext"], + rangetext:['15', "20", "25"], + multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"], ["k", "l", "m"]], + textvalue:'default textvalue', + datevalue:'default datevalue', + timevalue:'default timevalue', + datetimevalue:'default datetimevalue', + multitextvalue:'default multitextvalue', + containsecond:true, + multitextselect:[1,2,0], + datetimeselect:'2012-5-6-11-25', + timeselect:'11:22:30', + dateselect:'2021-3-2', + textselect:'2' + }, + selectChange(e){ + for(let i = 0;i + + Selected:{{time}} + + + + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/index.js b/ace/ace_standard/src/main/js/default/pages/pickerView/index.js new file mode 100644 index 00000000000..76b95651a23 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/index.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + defaultTime: "", + time: "", + }, + onInit() { + this.defaultTime = this.now(); + }, + handleChange(data) { + this.time = this.concat(data.hour, data.minute); + }, + now() { + const date = new Date(); + const hours = date.getHours(); + const minutes = date.getMinutes(); + return this.concat(hours, minutes); + }, + + fill(value) { + return (value > 9 ? "" : "0") + value; + }, + + concat(hours, minutes) { + return `${this.fill(hours)}:${this.fill(minutes)}`; + }, +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/piece/index.css b/ace/ace_standard/src/main/js/default/pages/piece/index.css new file mode 100644 index 00000000000..25e51edab04 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/piece/index.css @@ -0,0 +1,33 @@ +.container { + width: 100%; + height: 100%; + align-items: center; + justify-content: center; +} +.piece1 { + width: 100px; + height: 50; + margin: 20px; + padding: 5px; + min-width: 60px; + min-height: 40px; + max-width: 200px; + max-height: 80px; + background-color: pink; + border: 3px solid green; + box-shadow :1px 2px 1px 2px #888888; + opacity: 0.8; +} +.piece2 { + width: 100px; + height: 50; + margin: 10px; + min-width: 60px; + min-height: 40px; + max-width: 200px; + max-height: 80px; + background-color: darksalmon; + border: 3px dotted green; + box-shadow :2px 1px 2px 1px #888888; + opacity: 0.5; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/piece/index.hml b/ace/ace_standard/src/main/js/default/pages/piece/index.hml new file mode 100644 index 00000000000..dab6896ca4a --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/piece/index.hml @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/piece/index.js b/ace/ace_standard/src/main/js/default/pages/piece/index.js new file mode 100644 index 00000000000..4c79b6eff71 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/piece/index.js @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + first: true, + second: true + }, + closeSecond(e) { + this.second = false; + } +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/index.css b/ace/ace_standard/src/main/js/default/pages/progress/index.css new file mode 100644 index 00000000000..fa6decbf08c --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/index.css @@ -0,0 +1,39 @@ +.container { + flex-direction: column; +/* height: 100%;*/ + width: 100%; + align-items: center; +} +.min-progress { + width: 250px; + height: 250px; +} +.progress2{ + color:red; + secondary-color:red; + scale-width:20; + scale-number:60; + +} + +.progress4{ + color: red; + stroke-width:10px; + secondary-color:red +} +.arc1{ + color:red; + stroke-width:30px; +} +.arc2{ + color:yellow; + stroke-width:30px; + total-angle:360; +/* center-x:10;*/ +/* center-y:10;*/ +/* radius:5;*/ +} +.eclipse{ + color:crimson; + background-color: antiquewhite; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/index.hml b/ace/ace_standard/src/main/js/default/pages/progress/index.hml new file mode 100644 index 00000000000..72013851f8b --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/index.hml @@ -0,0 +1,13 @@ +
+ + + + + + + + + + + +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/index.js b/ace/ace_standard/src/main/js/default/pages/progress/index.js new file mode 100644 index 00000000000..6de413880e2 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/index.js @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + title: "World" + }, +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.css b/ace/ace_standard/src/main/js/default/pages/qrcode/index.css new file mode 100644 index 00000000000..96658284980 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.css @@ -0,0 +1,15 @@ +.container { + width: 100%; + height: 100%; + flex-direction: column; + justify-content: center; + align-items: center; +} +.txt { + font-size: 24px; + color: orangered; +} +select{ + margin-top: 40px; + margin-bottom: 40px; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml b/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml new file mode 100644 index 00000000000..6f482f8bba6 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml @@ -0,0 +1,14 @@ +
+ + Type + + Color + + Background Color + +
diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.js b/ace/ace_standard/src/main/js/default/pages/qrcode/index.js new file mode 100644 index 00000000000..066a1c42c24 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + qr_type: 'rect', + qr_size: '300px', + qr_col: '#87ceeb', + col_list: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'], + qr_bcol: '#f0ffff', + bcol_list: ['#f0ffff','#ffffe0','#d8bfd8'] + }, + settype(e) { + if (e.checked) { + this.qr_type = 'rect' + } else { + this.qr_type = 'circle' + } + }, + setvalue(e) { + this.qr_value = e.newValue + }, + setcol(e) { + this.qr_col = e.newValue + }, + setbcol(e) { + this.qr_bcol = e.newValue + } +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/select/index.css b/ace/ace_standard/src/main/js/default/pages/select/index.css new file mode 100644 index 00000000000..7b09cdff0ea --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/select/index.css @@ -0,0 +1,64 @@ +.container { + flex-direction: column; + align-items: flex-start; + justify-content: center; +} + +.select1{ + color:red; + font-size:20px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + min-width: 25px; + min-height: 10px; + max-width: 600px; + max-height: 150px; + padding-left: 10px; + padding-top: 20px; + padding-right: 15px; + padding-bottom: 5px; + margin-left: 10px; + margin-top: 20px; + margin-right: 15px; + margin-bottom: 5px; + +} +.select2{ + color:rebeccapurple; + font-size:30px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:300; + font-family:sans-serif; + margin: 20px; + +} +.select3{ + color:beige; + font-size:30px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + margin: 20px; + background-color: black; + padding:10px; +} + +.select4{ + color:aqua; + font-size:40px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin: 20px; + background-color: red; + padding:10px; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/select/index.hml b/ace/ace_standard/src/main/js/default/pages/select/index.hml new file mode 100644 index 00000000000..d01ac94ca6a --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/select/index.hml @@ -0,0 +1,46 @@ +
+ + + + +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/select/index.js b/ace/ace_standard/src/main/js/default/pages/select/index.js new file mode 100644 index 00000000000..49432a494d8 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/select/index.js @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; +export default { + data: { + title: 'World' + }, + changeFruit(e){ + console.log(JSON.stringify(e)) + prompt.showToast({ + message: e.newValue + }); + + } +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/span/index.css b/ace/ace_standard/src/main/js/default/pages/span/index.css new file mode 100644 index 00000000000..398440bb8b6 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/span/index.css @@ -0,0 +1,110 @@ +.container { + flex-direction: column; + align-items: flex-start; + justify-content: center; +} + +.title { + font-size: 30px; + text-align: center; + width: 100%; + height: 10%; +} + +.spanTxt1{ + text-color:red; + font-size:30px; + allow-scale:true; + text-decoration:underline; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + padding-left: 10px; + padding-top: 20px; + padding-right: 15px; + padding-bottom: 5px; + margin-left: 10px; + margin-top: 20px; + margin-right: 15px; + margin-bottom: 5px; +} + +.spanTxt2{ + text-color:yellow; + font-size:30px; + allow-scale:false; + text-decoration:line-through; + text-decoration:none; + letter-spacing:5px; + font-style:italic; + font-weight:300; + font-family:sans-serif; + margin: 5px; +} + +.spanTxt3{ + text-color:beige; + font-size:30px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + margin: 5px; +} + +.spanTxt4{ + text-color:aqua; + font-size:30px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin: 5px; +} + +.contain1{ + width: 100%; + height: 100px; + margin-left: 28%; + flex-direction: column; +} + +.spanTxt5{ + text-color:saddlebrown; + font-size:30px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:300; + font-family:sans-serif; + margin: 5px; +} + +.spanTxt6{ + text-color:darkcyan; + font-size:30px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin: 10px; +} + +.spanTxt7 { + text-color:navajowhite; + font-size:30px; + allow-scale:true; + letter-spacing:10px; + font-style:normal; + font-weight:500; + font-family:sans-serif; + margin: 5px; +} diff --git a/ace/ace_standard/src/main/js/default/pages/span/index.hml b/ace/ace_standard/src/main/js/default/pages/span/index.hml new file mode 100644 index 00000000000..89f9f2de77a --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/span/index.hml @@ -0,0 +1,30 @@ + +
+ + + span1 + + + + span2 + + + + span3 + + + + span4 + + + + + span5 + + span6 + + + + span7 + +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/span/index.js b/ace/ace_standard/src/main/js/default/pages/span/index.js new file mode 100644 index 00000000000..340173be1a6 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/span/index.js @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/switch/index.css b/ace/ace_standard/src/main/js/default/pages/switch/index.css new file mode 100644 index 00000000000..5bd7bb73ed2 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/switch/index.css @@ -0,0 +1,111 @@ +.container { + flex-direction: column; + align-items: flex-start; + justify-content: center; +} + +switch{ + texton-color:#002aff; + textoff-color:silver; + text-padding:5px; +} + +.switch1{ + text-color:red; + font-size:20px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + min-width: 25px; + min-height: 10px; + max-width: 600px; + max-height: 50px; + padding-left: 10px; + padding-top: 5px; + padding-right: 15px; + padding-bottom: 5px; + margin-left: 10px; + margin-top: 3%; + margin-right: 15px; + margin-bottom: 3%; + texton-color:red; + textoff-color:blue; +} + +.switch2{ + text-color:yellow; + max-height: 50px; + font-size:20px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:300; + font-family:sans-serif; + margin: 3%; + texton-color:yellow; + textoff-color:aqua; +} + +.switch3{ + text-color:beige; + max-height: 50px; + font-size:20px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + margin: 3%; +} + +.switch4{ + text-color:aqua; + max-height: 50px; + font-size:20px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin: 3%; +} + +.container1{ + height: 24%; + flex-direction: column; +} + +.switch5{ + text-color:saddlebrown; + font-size:22px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:300; + font-family:sans-serif; + margin: 3%; +} + +.switch6{ + text-color:darkcyan; + font-size:25px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin-left: 8%; +} + +.switch7 { + text-color:navajowhite; + font-size:30px; + allow-scale:true; + letter-spacing:10px; + font-style:normal; + font-weight:500; + font-family:sans-serif; + margin: 3%; +} diff --git a/ace/ace_standard/src/main/js/default/pages/switch/index.hml b/ace/ace_standard/src/main/js/default/pages/switch/index.hml new file mode 100644 index 00000000000..e497f0cd529 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/switch/index.hml @@ -0,0 +1,24 @@ + +
+ + + + + + + + +
+ + + + +
+ + +
+ + + + + diff --git a/ace/ace_standard/src/main/js/default/pages/switch/index.js b/ace/ace_standard/src/main/js/default/pages/switch/index.js new file mode 100644 index 00000000000..560c0796dd6 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/switch/index.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; +export default { + data: { + title: 'World' + }, + switchChange(e){ + if(e.checked){ + prompt.showToast({ + message: "打开开关" + }); + }else{ + prompt.showToast({ + message: "关闭开关" + }); + } + } +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.css b/ace/ace_standard/src/main/js/default/pages/toggle/index.css new file mode 100644 index 00000000000..4143bf05757 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.css @@ -0,0 +1,113 @@ + +.container { + flex-direction: column; + align-items: flex-start; + justify-content: center; + padding: 10px; +} + +.margin { + margin-right: 8%; + font-size: 15px; +} +.margin1 { + font-size: 15px; + margin-top: 2%; +} +.toggle1{ + text-color:red; + font-size:15px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + padding-left: 10px; + padding-top: 2px; + padding-right: 15px; + padding-bottom: 1px; + margin-left: 10px; + margin-top: 5px; + margin-right: 15px; + margin-bottom: 2%; +} + +.toggle2{ + text-color:yellow; + font-size:15px; + max-height: 50px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:300; + font-family:sans-serif; + margin: 2%; +} + +.toggle3{ + text-color:beige; + font-size:15px; + max-height: 50px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:200; + font-family:sans-serif; + margin: 2%; +} + +.toggle4{ + text-color:aqua; + font-size:15px; + max-height: 50px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin: 2%; +} + +.container1{ + flex-direction: column; + +} + +.toggle5{ + text-color:saddlebrown; + max-height: 50px; + font-size:15px; + allow-scale:true; + letter-spacing:5px; + font-style:normal; + font-weight:300; + font-family:sans-serif; +} + +.toggle6{ + text-color:darkcyan; + max-height: 50px; + font-size:15px; + allow-scale:false; + letter-spacing:5px; + font-style:italic; + font-weight:200; + font-family:sans-serif; + margin-left: 2%; +} + +.toggle7 { + text-color:navajowhite; + max-height: 50px; + font-size:15px; + allow-scale:true; + letter-spacing:10px; + font-style:normal; + font-weight:500; + font-family:sans-serif; + margin: 5px; +} diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.hml b/ace/ace_standard/src/main/js/default/pages/toggle/index.hml new file mode 100644 index 00000000000..046d1be6cea --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.hml @@ -0,0 +1,43 @@ +
+ + 1. Multiple choice example +
+ {{$item}} +
+ + 2. Single choice example +
+ +
+ + 3. Multiple choice example +
+ {{$item}} +
+ + 4. Single choice example +
+ +
+ +
+ 5. Multiple +
+ {{$item}} +
+ + 6. Single +
+ +
+
+ + 7. Multiple choice example +
+ {{$item}} +
+ +
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.js b/ace/ace_standard/src/main/js/default/pages/toggle/index.js new file mode 100644 index 00000000000..ac4c07ba364 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data: { + toggle_list: [ + { "id":"1001", "name":"Living room", "checked":true }, + { "id":"1002", "name":"Bedroom", "checked":false }, + { "id":"1003", "name":"Second bedroom", "checked":false }, + { "id":"1004", "name":"Study", "checked":false }, + ], + toggles: ["Living room","Bedroom","Study"], + idx: "" + }, + allclick(arg) { + this.idx = arg + }, + allchange(e) { + if (e.checked === true) { + for (var i = 0; i < this.toggle_list.length; i++) { + if (this.toggle_list[i].id === this.idx) { + this.toggle_list[i].checked = true + } else { + this.toggle_list[i].checked = false + } + } + } + } +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js index 15b10c2eb2d..5668b2b0592 100644 --- a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js +++ b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js @@ -337,9 +337,219 @@ describe('aceJsTest', function () { } catch (err) { result = err } - await sleep(5000) + await sleep(1000) let pages = router.getState(); expect("pages/textarea/").assertEqual(pages.path); done(); }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSpanComponent + * @tc.desc ACE + */ + it('testSpanComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/span/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/span/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSwitchComponent + * @tc.desc ACE + */ + it('testSwitchComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/switch/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/switch/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testToggleComponent + * @tc.desc ACE + */ + it('testToggleComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/toggle/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/toggle/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionComponent + * @tc.desc ACE + */ + it('testOptionComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/option/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/option/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerComponent + * @tc.desc ACE + */ + it('testPickerComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/picker/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/picker/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewComponent + * @tc.desc ACE + */ + it('testPickerViewComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/pickerView/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/pickerView/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPieceViewComponent + * @tc.desc ACE + */ + it('testPieceViewComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/piece/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/piece/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressComponent + * @tc.desc ACE + */ + it('testProgressComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/progress/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/progress/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testQrcodeComponent + * @tc.desc ACE + */ + it('testQrcodeComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/qrcode/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(1000) + let pages = router.getState(); + expect("pages/qrcode/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testSelectComponent + * @tc.desc ACE + */ + it('testSelectComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/select/index' + } + try { + result = router.push(options) + } catch (err) { + result = err + } + await sleep(5000) + let pages = router.getState(); + expect("pages/select/").assertEqual(pages.path); + done(); + }); }); -- Gitee From c0c37be41fb0ee783e828fb3b324f95329d738b7 Mon Sep 17 00:00:00 2001 From: bayanxing Date: Tue, 8 Feb 2022 15:42:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?codecheck=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bayanxing --- .../main/js/default/pages/qrcode/index.hml | 8 ++-- .../src/main/js/default/pages/qrcode/index.js | 37 ++++++------------- .../main/js/default/pages/toggle/index.hml | 6 +-- .../src/main/js/default/pages/toggle/index.js | 8 ++-- 4 files changed, 22 insertions(+), 37 deletions(-) diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml b/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml index 6f482f8bba6..aaad9991a80 100644 --- a/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml @@ -1,14 +1,14 @@
- + Type Color Background Color
diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.js b/ace/ace_standard/src/main/js/default/pages/qrcode/index.js index 066a1c42c24..f2e83daf8f7 100644 --- a/ace/ace_standard/src/main/js/default/pages/qrcode/index.js +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.js @@ -1,41 +1,26 @@ -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - export default { data: { - qr_type: 'rect', - qr_size: '300px', - qr_col: '#87ceeb', - col_list: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'], - qr_bcol: '#f0ffff', - bcol_list: ['#f0ffff','#ffffe0','#d8bfd8'] + qr_Type: 'rect', + qr_Size: '300px', + qr_Col: '#87ceeb', + col_List: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'], + qr_BCol: '#f0ffff', + bCol_List: ['#f0ffff','#ffffe0','#d8bfd8'] }, settype(e) { if (e.checked) { - this.qr_type = 'rect' + this.qr_Type = 'rect' } else { - this.qr_type = 'circle' + this.qr_Type = 'circle' } }, setvalue(e) { - this.qr_value = e.newValue + this.qr_Value = e.newValue }, setcol(e) { - this.qr_col = e.newValue + this.qr_Col = e.newValue }, setbcol(e) { - this.qr_bcol = e.newValue + this.qr_BCol = e.newValue } } \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.hml b/ace/ace_standard/src/main/js/default/pages/toggle/index.hml index 046d1be6cea..7e98d842a43 100644 --- a/ace/ace_standard/src/main/js/default/pages/toggle/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.hml @@ -7,7 +7,7 @@ 2. Single choice example
-
@@ -18,7 +18,7 @@ 4. Single choice example
-
@@ -30,7 +30,7 @@ 6. Single
-
diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.js b/ace/ace_standard/src/main/js/default/pages/toggle/index.js index ac4c07ba364..5cd03baef1a 100644 --- a/ace/ace_standard/src/main/js/default/pages/toggle/index.js +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.js @@ -15,7 +15,7 @@ export default { data: { - toggle_list: [ + toggle_List: [ { "id":"1001", "name":"Living room", "checked":true }, { "id":"1002", "name":"Bedroom", "checked":false }, { "id":"1003", "name":"Second bedroom", "checked":false }, @@ -30,10 +30,10 @@ export default { allchange(e) { if (e.checked === true) { for (var i = 0; i < this.toggle_list.length; i++) { - if (this.toggle_list[i].id === this.idx) { - this.toggle_list[i].checked = true + if (this.toggle_List[i].id === this.idx) { + this.toggle_List[i].checked = true } else { - this.toggle_list[i].checked = false + this.toggle_List[i].checked = false } } } -- Gitee From 4a43856b21e602bbdefc9592dd05f33b2759100a Mon Sep 17 00:00:00 2001 From: bayanxing Date: Tue, 8 Feb 2022 16:02:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?codecheck=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bayanxing --- .../src/main/js/default/test/commonComponentJsApi.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js index 5668b2b0592..21a4c3ccf54 100644 --- a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js +++ b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js @@ -471,10 +471,10 @@ describe('aceJsTest', function () { /** * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 - * @tc.name testPieceViewComponent + * @tc.name testPieceComponent * @tc.desc ACE */ - it('testPieceViewComponent', 0, async function (done) { + it('testPieceComponent', 0, async function (done) { let result; let options = { uri: 'pages/piece/index' -- Gitee From 84d102b534d7190d930712e48aa42a047027757d Mon Sep 17 00:00:00 2001 From: bayanxing Date: Tue, 8 Feb 2022 16:19:39 +0800 Subject: [PATCH 4/5] =?UTF-8?q?codecheck=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bayanxing --- .../main/js/default/pages/picker/index.hml | 10 ++--- .../src/main/js/default/pages/picker/index.js | 31 ++++++------- .../main/js/default/pages/qrcode/index.hml | 14 +++--- .../src/main/js/default/pages/qrcode/index.js | 43 +++++++++++++------ 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.hml b/ace/ace_standard/src/main/js/default/pages/picker/index.hml index acc7c4eb1f1..e7aa03846ca 100644 --- a/ace/ace_standard/src/main/js/default/pages/picker/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/picker/index.hml @@ -6,17 +6,17 @@ + oncancel="textOnCancel" class="pickertext"> + onchange="dateOnchange" oncancel="dateOnCancel" class="pickerdate" show="true"> + onchange="timeOnchange" oncancel="timeOnCancel" class="pickertime" show="true"> + onchange="datetimeOnchange" oncancel="datetimeOnCancel" class="pickerdatetime" show="true"> + onchange="multiTextOnchange" oncancel="multiTextOnCancel" class="pickermuitl" show="true"> \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.js b/ace/ace_standard/src/main/js/default/pages/picker/index.js index 76202558d80..4a9c975b22a 100644 --- a/ace/ace_standard/src/main/js/default/pages/picker/index.js +++ b/ace/ace_standard/src/main/js/default/pages/picker/index.js @@ -42,17 +42,17 @@ export default { this.textvalue = e.newValue; prompt.showToast({ message:"text:"+e.newValue+",newSelected:"+e.newSelected }) }, - textoncancel(e) { - prompt.showToast({ message:"text: textoncancel" }) + textOnCancel(e) { + prompt.showToast({ message:"text: textOnCancel" }) }, - dateonchange(e) { + dateOnchange(e) { this.datevalue = e.year + "-" + e.month + "-" + e.day; prompt.showToast({ message:"date:"+e.year+"-"+(e.month+1)+"-"+e.day }) }, - dateoncancel() { - prompt.showToast({ message:"date: dateoncancel" }) + dateOnCancel() { + prompt.showToast({ message:"date: dateOnCancel" }) }, - timeonchange(e) { + timeOnchange(e) { if(this.containsecond){ this.timevalue=e.hour+":"+e.minute+":"+e.second; prompt.showToast({ message:"Time:" + e.hour + ":" + e.minute + ":" + e.second }) @@ -60,24 +60,21 @@ export default { this.timevalue=e.hour+":"+e.minute; prompt.showToast({ message:"Time:" + e.hour + ":" + e.minute }) }}, - timeoncancel() { - prompt.showToast({ message:"timeoncancel" }) + timeOnCancel() { + prompt.showToast({ message:"timeOnCancel" }) }, - datetimeonchange(e) { + datetimeOnchange(e) { this.datetimevalue=e.year+"-"+e.month+"-"+e.day+" "+e.hour+":"+e.minute; prompt.showToast({ message:"Time:"+(e.month+1)+"-"+e.day+" "+e.hour+":"+e.minute }) }, - datetimeoncancel() { - prompt.showToast({ message:"datetimeoncancel" }) + datetimeOnCancel() { + prompt.showToast({ message:"datetimeOnCancel" }) }, - multitextonchange(e) { + multiTextOnchange(e) { this.multitextvalue=e.newValue; prompt.showToast({ message:"Multi-column text change" + e.newValue }) }, - multitextoncancel() { - prompt.showToast({ message:"multitextoncancel" }) - }, - popup_picker() { - this.$element("picker_text").show(); + multiTextOnCancel() { + prompt.showToast({ message:"multiTextOnCancel" }) }, } \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml b/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml index aaad9991a80..c6c88b1a337 100644 --- a/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.hml @@ -1,14 +1,14 @@
- + Type - + Color - + Background Color - +
diff --git a/ace/ace_standard/src/main/js/default/pages/qrcode/index.js b/ace/ace_standard/src/main/js/default/pages/qrcode/index.js index f2e83daf8f7..7097ca65e45 100644 --- a/ace/ace_standard/src/main/js/default/pages/qrcode/index.js +++ b/ace/ace_standard/src/main/js/default/pages/qrcode/index.js @@ -1,26 +1,41 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export default { data: { - qr_Type: 'rect', - qr_Size: '300px', - qr_Col: '#87ceeb', - col_List: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'], - qr_BCol: '#f0ffff', - bCol_List: ['#f0ffff','#ffffe0','#d8bfd8'] + qrType: 'rect', + qrSize: '300px', + qrCol: '#87ceeb', + colList: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'], + qrBCol: '#f0ffff', + bColList: ['#f0ffff','#ffffe0','#d8bfd8'] }, - settype(e) { + setType(e) { if (e.checked) { - this.qr_Type = 'rect' + this.qrType = 'rect' } else { - this.qr_Type = 'circle' + this.qrType = 'circle' } }, setvalue(e) { - this.qr_Value = e.newValue + this.qrValue = e.newValue }, - setcol(e) { - this.qr_Col = e.newValue + setCol(e) { + this.qrCol = e.newValue }, - setbcol(e) { - this.qr_BCol = e.newValue + setBCol(e) { + this.qrBCol = e.newValue } } \ No newline at end of file -- Gitee From f468cf2097808f7c7708d0554b016a50e088871e Mon Sep 17 00:00:00 2001 From: bayanxing Date: Tue, 8 Feb 2022 16:24:30 +0800 Subject: [PATCH 5/5] =?UTF-8?q?codecheck=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bayanxing --- .../src/main/js/default/pages/toggle/index.hml | 6 +++--- .../src/main/js/default/pages/toggle/index.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.hml b/ace/ace_standard/src/main/js/default/pages/toggle/index.hml index 7e98d842a43..db80592975a 100644 --- a/ace/ace_standard/src/main/js/default/pages/toggle/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.hml @@ -7,7 +7,7 @@ 2. Single choice example
-
@@ -18,7 +18,7 @@ 4. Single choice example
-
@@ -30,7 +30,7 @@ 6. Single
-
diff --git a/ace/ace_standard/src/main/js/default/pages/toggle/index.js b/ace/ace_standard/src/main/js/default/pages/toggle/index.js index 5cd03baef1a..f4233f4cbd1 100644 --- a/ace/ace_standard/src/main/js/default/pages/toggle/index.js +++ b/ace/ace_standard/src/main/js/default/pages/toggle/index.js @@ -15,7 +15,7 @@ export default { data: { - toggle_List: [ + toggleList: [ { "id":"1001", "name":"Living room", "checked":true }, { "id":"1002", "name":"Bedroom", "checked":false }, { "id":"1003", "name":"Second bedroom", "checked":false }, @@ -30,10 +30,10 @@ export default { allchange(e) { if (e.checked === true) { for (var i = 0; i < this.toggle_list.length; i++) { - if (this.toggle_List[i].id === this.idx) { - this.toggle_List[i].checked = true + if (this.toggleList[i].id === this.idx) { + this.toggleList[i].checked = true } else { - this.toggle_List[i].checked = false + this.toggleList[i].checked = false } } } -- Gitee