1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import Logger from './Logger' 17 18const TAG = '[MyInfoModule]' 19 20@Component 21export default struct MyInfoModule { 22 @State selectContent: Resource = $r("app.string.my_low_mode") 23 @State selectContent1: Resource = $r("app.string.my_ets") 24 25 @Link vibrationIntensity: string 26 @Link php: string 27 28 build() { 29 Column({ space: 30 }) { 30 Column({ space: 10 }) { 31 Row({ space: 10 }) { 32 Image($r("app.media.set")) 33 .height(20) 34 .width(20) 35 Text($r("app.string.my_settings")) 36 .fontColor(Color.White) 37 .fontSize(20) 38 Text(this.selectContent) 39 .fontSize(16) 40 .fontColor("#ffcbc2c2") 41 } 42 .id('intensitySelect') 43 .height("100%") 44 .width("80%") 45 .onClick(() => { 46 ActionSheet.show({ 47 title: $r("app.string.my_settings"), 48 message: $r("app.string.my_select_msg"), 49 autoCancel: true, 50 confirm: { 51 value: $r("app.string.cancel"), 52 action: () => { 53 Logger.info(TAG, 'Get Alert Dialog handled') 54 } 55 }, 56 cancel: () => { 57 Logger.info(TAG, 'actionSheet canceled') 58 }, 59 alignment: DialogAlignment.Bottom, 60 offset: { dx: 0, dy: -10 }, 61 sheets: [ 62 { 63 icon: $r("app.media.app_icon"), 64 title: $r("app.string.my_high_mode"), 65 action: () => { 66 this.selectContent = $r("app.string.my_high_mode") 67 this.vibrationIntensity = 'H' 68 Logger.info(TAG, 'Vibration intensity is high') 69 } 70 }, 71 { 72 icon: $r("app.media.app_icon"), 73 title: $r("app.string.my_middle_mode"), 74 action: () => { 75 this.selectContent = $r("app.string.my_middle_mode") 76 this.vibrationIntensity = 'M' 77 Logger.info(TAG, 'Vibration intensity is middle') 78 } 79 }, 80 { 81 icon: $r("app.media.app_icon"), 82 title: $r("app.string.my_low_mode"), 83 action: () => { 84 this.selectContent = $r("app.string.my_low_mode") 85 this.vibrationIntensity = 'L' 86 Logger.info(TAG, 'Vibration intensity is low') 87 } 88 } 89 ] 90 }) 91 }) 92 .width("80%") 93 94 Row() { 95 } 96 .height(1) 97 .width("85%") 98 .backgroundColor('#ff404048') 99 } 100 101 Column({ space: 10 }) { 102 Row({ space: 10 }) { 103 Image($r("app.media.select")) 104 .height(20) 105 .width(20) 106 Text($r("app.string.my_php")) 107 .fontColor(Color.White) 108 .fontSize(20) 109 Text(this.selectContent1) 110 .fontSize(16) 111 .fontColor("#ffcbc2c2") 112 } 113 .id('phpSelect1') 114 .height("100%") 115 .width("80%") 116 .onClick(() => { 117 ActionSheet.show({ 118 title: $r("app.string.my_php_select"), 119 message: $r("app.string.my_linguistic_type"), 120 autoCancel: true, 121 confirm: { 122 value: $r("app.string.cancel"), 123 action: () => { 124 Logger.info(TAG, 'Get Alert Dialog handled') 125 } 126 }, 127 cancel: () => { 128 Logger.info(TAG, 'actionSheet canceled') 129 }, 130 alignment: DialogAlignment.Bottom, 131 offset: { dx: 0, dy: -10 }, 132 sheets: [ 133 { 134 icon: $r("app.media.app_icon"), 135 title: $r("app.string.my_ets"), 136 action: () => { 137 this.selectContent1 = $r("app.string.my_ets") 138 this.php = 'ets' 139 } 140 }, 141 { 142 icon: $r("app.media.app_icon"), 143 title: $r("app.string.my_capi"), 144 action: () => { 145 this.selectContent1 = $r("app.string.my_capi") 146 this.php = 'capi' 147 } 148 } 149 ] 150 }) 151 }) 152 .width("80%") 153 154 Row() { 155 } 156 .height(1) 157 .width("85%") 158 .backgroundColor('#ff404048') 159 } 160 161 Column({ space: 10 }) { 162 Row({ space: 10 }) { 163 Image($r("app.media.Verison")) 164 .width(20) 165 .height(20) 166 Text($r("app.string.my_version")) 167 .fontColor(Color.White) 168 .fontSize(20) 169 .backgroundColor('#cc191a32') 170 Text('v1.0') 171 .fontSize(20) 172 .fontColor("#ff706666") 173 } 174 .width("80%") 175 176 Row() { 177 } 178 .height(1) 179 .width("85%") 180 .backgroundColor("#ff404048") 181 } 182 183 Column({ space: 10 }) { 184 Row({ space: 10 }) { 185 Image($r("app.media.bangzhu")) 186 .width(20) 187 .height(20) 188 Text($r("app.string.my_help")) 189 .fontColor(Color.White) 190 .fontSize(20) 191 .backgroundColor('#cc191a32') 192 Text('Please Waiting!') 193 .fontSize(20) 194 .fontColor("#ff706666") 195 } 196 .width("80%") 197 198 Row() { 199 } 200 .height(1) 201 .width("85%") 202 .backgroundColor("#ff404048") 203 } 204 205 Column({ space: 10 }) { 206 Row({ space: 10 }) { 207 Image($r("app.media.xinxi")) 208 .width(20) 209 .height(20) 210 Text($r("app.string.my_develop")) 211 .fontColor(Color.White) 212 .fontSize(20) 213 .backgroundColor('#cc191a32') 214 Text('Please Waiting!') 215 .fontSize(20) 216 .fontColor("#ff706666") 217 } 218 .width("80%") 219 220 Row() { 221 } 222 .height(1) 223 .width("85%") 224 .backgroundColor("#ff404048") 225 } 226 } 227 } 228} 229