1/** 2 * Copyright (c) 2021-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 { SubItemArrow } from '../components/SubItemArrow' 17import { SubItemToggle } from '../components/SubItemToggle' 18import { ItemGroup } from '../components/ItemGroup' 19import { ItemDescription } from '../components/ItemDescription' 20 21@Component 22export struct WlanMoreSettingItem { 23 @State itemTitle: string = '' 24 @LocalStorageLink('selectedLabel') selectedLabel: string = '' 25 26 aboutToAppear() { 27 this.itemTitle = getContext().resourceManager.getStringSync($r('app.string.moreWlanSettings').id) 28 } 29 30 build() { 31 NavRouter() { 32 SubItemArrow({ title: $r('app.string.moreWlanSettings') }) 33 34 NavDestination() { 35 WlanMoreSetting() 36 } 37 .title(this.itemTitle) 38 .backgroundColor($r('sys.color.ohos_id_color_sub_background')) 39 } 40 .onStateChange((isActivated: boolean) => { 41 if (isActivated) { 42 this.selectedLabel = 'WLAN' 43 } 44 }) 45 } 46} 47 48@Component 49export struct WlanMoreSetting { 50 build() { 51 Scroll() { 52 Column() { 53 ItemGroup() { 54 SubItemArrow({ 55 title: $r('app.string.wlanPlus'), 56 tag: $r('app.string.enabled') 57 }) 58 } 59 60 ItemDescription({description: $r('app.string.wlanPlusTip')}) 61 .margin({ 62 top: 8, 63 bottom: 24, 64 left: 12, 65 right: 12 66 }) 67 68 ItemGroup() { 69 SubItemArrow({ title: $r('app.string.wlanDirect') }) 70 } 71 72 Blank().height(12) 73 74 ItemGroup() { 75 SubItemToggle({title: $r('app.string.wlanSecurityCheck')}) 76 } 77 78 ItemDescription({description: $r('app.string.wlanSecurityCheckTip')}) 79 .margin({ 80 top: 8, 81 bottom: 24, 82 left: 12, 83 right: 12 84 }) 85 86 ItemGroup() { 87 SubItemArrow({title: $r('app.string.savedWlan')}) 88 Divider() 89 .strokeWidth('1px') 90 .color($r('sys.color.ohos_id_color_list_separator')) 91 .margin({left: 12, right: 8}) 92 SubItemArrow({title: $r('app.string.installCertificates')}) 93 } 94 } 95 .backgroundColor($r('sys.color.ohos_id_color_sub_background')) 96 .padding({left: 12, right: 12}) 97 } 98 .scrollBar(BarState.Off) 99 .width('100%') 100 } 101} 102