Commit 5f959268 by huangqy

系统通用配置等一些页面

parent bd6f6dc7
import { generalInitList, UniListItem } from '@ohos/system/src/main/ets/model/UniInitList'
import { TitleBar } from '../../view/title/TitleBar'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
export struct General {
build() {
Column() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.SpaceBetween}) {
TitleBar({ title: "通用" })
Column() {
List({ space: 2 }) {
ForEach(generalInitList, (item: UniListItem) => {
ListItem() {
Row() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) {
Text(item.title).fontSize(20).fontColor('#3b4144')
Text(item.description).fontSize(14).fontColor('#999').margin({ top: 3 })
}
.width('60%')
Blank()
.layoutWeight(1)
Text(item.targetValue)
.fontSize(16)
.flexGrow(1)
.align(Alignment.End)
.margin({ right: 8 })
.fontColor('#999')
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 12, right: 18 })
}
.height('8%')
.onClick(() => {
})
})
}
.width('100%')
.backgroundColor('#fff')
.divider({ strokeWidth: 1, color: 'rgb(242,242,242)' }) // 每行之间的分界线
}.margin({ top:5, bottom: 5 })
Row() {
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button("保存").CommonButtonStyle()
Button("重置").CommonButtonStyle()
}
}.height(80).backgroundColor('#97c6a6')
}
}.linearGradient({
direction: GradientDirection.RightBottom,
repeating: true,
colors: [['#97c6a6', 0.0], ['#e8f5c2', 1.0]]
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import router from '@ohos.router';
import { UniListItem, sysInitList } from '@ohos/system/src/main/ets/model/UniInitList';
@Entry
@Component
export struct Setting {
build() {
Column() {
Flex({ direction: FlexDirection.Column }) {
TitleBar({ title: "系统设置" })
Image($rawfile('system/system_header.jpg')).width('100%').height(187)
Column() {
List({ space: 2 }) {
ForEach(sysInitList, (item: UniListItem) => {
ListItem() {
Row() {
Row() {
Image(item?.extraIcon)
.width(24)
.height(24)
.margin({ right: 8 })
Text(item?.title).fontSize(20).fontColor('#3b4144')
}
.width('60%')
Blank()
.layoutWeight(1)
Text(item.targetValue)
.fontSize(16)
.flexGrow(1)
.align(Alignment.End)
.margin({ right: 8 })
.fontColor('#999')
Image($r('app.media.right_grey')).width(8).height(16)
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 12, right: 18 })
}
.height('7%')
.onClick(() => {
router.pushUrl({
url: item.url
})
})
})
}
.width('100%')
.backgroundColor('#fff')
.divider({ strokeWidth: 1, color: 'rgb(242,242,242)' }) // 每行之间的分界线
}.margin({ top:5, bottom: 5 })
}
}.linearGradient({
direction: GradientDirection.RightBottom,
repeating: true,
colors: [['#97c6a6', 0.0], ['#e8f5c2', 1.0]]
})
}
}
\ No newline at end of file
......@@ -16,6 +16,8 @@
"pages/sub_systemMaintenance/Unit",
"pages/sub_systemMaintenance/Warehouse",
"pages/sub_systemMaintenance/GoodsShelf",
"pages/sub_systemMaintenance/Pmhx"
"pages/sub_systemMaintenance/Pmhx",
"pages/sub_systemMaintenance/Setting",
"pages/sub_systemMaintenance/General"
]
}
......@@ -19,7 +19,7 @@ export struct SystemMaintenance {
.margin({ right: 8 })
Text(item?.title).fontSize(20).fontColor('#3b4144')
}
.width('70%')
.width('60%')
Blank()
.layoutWeight(1)
......
export interface UniListItem {
title: string;
showExtraIcon: boolean;
showArrow: boolean;
extraIcon?: Resource;
url: string;
title: string; // 标题
showExtraIcon: boolean; // 是否显示额外的图标
showArrow: boolean; // 右边箭头
extraIcon?: Resource; // 图标本体
url?: string; // 跳转的URL
targetValue?: string; // 右侧的值
description?: string; // 描述
}
export const uniInitList: UniListItem[] = [
......@@ -47,6 +49,77 @@ export const uniInitList: UniListItem[] = [
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
url: 'setting'
url: 'pages/sub_systemMaintenance/Setting'
},
]
export const sysInitList: UniListItem[] = [
{
title: '通用',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
url: 'pages/sub_systemMaintenance/General',
targetValue: '基础设置信息'
},
{
title: '设备',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
url: '/Unit',
targetValue: '应用设备信息'
},
]
export const generalInitList: UniListItem[] = [
{
title: '2.0业务数据服务IP',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
targetValue: '',
description: '2.0业务数据服务IP'
},
{
title: '2.0业务终端IP',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
targetValue: '',
description: '2.0业务终端IP'
},
{
title: '2.0业务终端通讯端口',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
targetValue: '',
description: '通讯端口设置'
},
{
title: '传输方式',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
targetValue: '',
description: '数据传输方式'
},
{
title: '连接模式',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
targetValue: '',
description: '模式连接方式'
},
{
title: '推送模式',
showExtraIcon: true,
showArrow: true,
//extraIcon: '',
targetValue: '',
description: '模式推送方式'
},
]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论