Commit 1ec44baa by 毛勇泽

物资管理

parent 5169ab68
...@@ -4,3 +4,4 @@ export { GridConstants } from './src/main/ets/constants/GridConstants'; ...@@ -4,3 +4,4 @@ export { GridConstants } from './src/main/ets/constants/GridConstants';
export { StyleConstants } from './src/main/ets/constants/StyleConstants'; export { StyleConstants } from './src/main/ets/constants/StyleConstants';
export { CommonDataSource } from './src/main/ets/utils/CommonDataSource'; export { CommonDataSource } from './src/main/ets/utils/CommonDataSource';
export { Logger } from './src/main/ets/utils/Logger'; export { Logger } from './src/main/ets/utils/Logger';
export { TitleBar } from './src/main/ets/utils/TitleBar';
import router from '@ohos.router';
@Component
export struct TitleBar {
// 左边图标是否显示
private isShowLeft = true
// 左边图标
private leftIcon = $r('app.media.back_white')
// 左边点击事件,默认返回上一页
private leftClickEvent = () => {
router.back()
}
// 标题
private title = '标题'
// 右边图标是否显示
private isShowRight = false
// 右边图标
private rightIcon = $r('app.media.back_white')
// 左边点击事件
private rightClickEvent: () => void
build() {
Column() {
Stack() {
Text(this.title).fontSize(20).fontColor('#ffffff')
Row() {
if (this.isShowLeft) {
Image(this.leftIcon).size({ width: 55, height: 55 }).padding(15)
.onClick(() => this.leftClickEvent())
}
Blank()
if (this.isShowRight) {
Image(this.rightIcon).size({ width: 55, height: 55 }).padding(15)
.onClick(this.rightClickEvent)
}
}.width('100%')
}.width('100%').height(0).layoutWeight(1)
.backgroundColor($r("app.color.title_background"))
Divider().color('#4c9a6b')
}.width('100%').height(55)
}
}
\ No newline at end of file
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
},
{
"name": "white",
"value": "#FFFFFF"
},
{
"name": "rank_first_gradient_start",
"value": "#FFFF9A"
},
{
"name": "rank_first_gradient_end",
"value": "#CCA538"
},
{
"name": "rank_first_border",
"value": "#9E8A24"
},
{
"name": "rank_first_text",
"value": "#9E8A24"
},
{
"name": "rank_secondary_gradient_start",
"value": "#B8B8B8"
},
{
"name": "rank_secondary_gradient_end",
"value": "#9C9C9C"
},
{
"name": "rank_secondary_border",
"value": "#7E7E7E"
},
{
"name": "rank_secondary_text",
"value": "#FFFFFF"
},
{
"name": "rank_third_gradient_start",
"value": "#B9A185"
},
{
"name": "rank_third_gradient_end",
"value": "#AE8659"
},
{
"name": "rank_third_border",
"value": "#775C3E"
},
{
"name": "rank_third_text",
"value": "#FFFFFF"
},
{
"name": "rank_view_color_holder",
"value": "#FFFFFF"
},
{
"name": "item_color",
"value": "#007DFF"
},
{
"name": "item_color_black",
"value": "#182431"
},
{
"name": "home_grid_fontColor",
"value": "#99182431"
},
{
"name": "background",
"value": "#F1F3F5"
},
{
"name": "font_description",
"value": "#989A9C"
},
{
"name": "circle_text_background",
"value": "#007dff"
},
{
"name": "page_background",
"value": "#F1F3F5"
}
,
{
"name": "title_background",
"value": "#4c9a6b"
}
,
{
"name": "disabledColor",
"value": "#dddadc"
}
,
{
"name": "head_title",
"value": "#FFEBCD"
}
]
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Entry
@Component
struct AddConversionPage{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(21)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder VoucherRow(){
Flex({direction:FlexDirection.Column}){
Row(){
}
}.backgroundColor("#fff")
.borderRadius(10)
.margin(10)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资换位" })
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '凭证信息'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '物资信息'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
})
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
struct WzConversionPage{
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("新建换位")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("设置状态")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(80)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资换位" })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入凭证号"})
.enterKeyType(EnterKeyType.Search)
.borderRadius("13vp").width('100%').padding({top:10,bottom:10}
).backgroundColor("#fff")
}.height(60)
}.width("100%")
.padding('15vp')
Row(){
// 底部按钮
this.bottomButtons();
}.width("100%").height(80)
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
struct WzExchangePage{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("设置状态")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(80)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资调号" })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入凭证号"})
.enterKeyType(EnterKeyType.Search)
.borderRadius("13vp").width('100%').padding({top:10,bottom:10}
)
.backgroundColor("#fff")
}.margin("15vp").height(60)
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时调号'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
})
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Entry
@Component
export struct WzInPage {
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资入库" })
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时收物'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
})
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入凭证号"}).borderRadius("12vp").width('65%').padding({top:10,bottom:10})
.backgroundColor("#fff")
Select([{ value: "未完成" }, { value: "已完成" }])
.value('请选择状态')
.borderWidth(1)
.borderRadius(10)
.borderColor("#454545")
.onSelect(async (index: number, value?: string) => {
if(value == '未完成') {
console.log("未完成",'未完成')
} else {
console.log("已完成",'已完成')
}
})
.width(110)
.padding({
right:10
})
}.height(50)
}.width("100%")
.padding('15vp')
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
Flex({justifyContent:FlexAlign.SpaceAround}){
Button("打印面单").width("15%")
Button("扫码取件").width("15%")
Button("手动取件").width("15%")
}
}.backgroundColor("#97c6a6").width("100%").height(80)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
struct WzInvPage{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("设置状态")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(80)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资盘库" })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入凭证号"})
.enterKeyType(EnterKeyType.Search)
.borderRadius("13vp").width('100%').padding({top:10,bottom:10}
)
.backgroundColor("#fff")
}.margin("15vp").height(60)
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '未完成'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '已完成'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
})
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Extend(Button) function bottomBtnSty() {
.borderWidth(2)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
export struct WzOutPage {
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("设置状态")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("导出数据包")
.bottomBtnSty()
.onClick(() => {
}).fontColor("#0fa983") .fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(80)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资出库" })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入凭证号"}).borderRadius("13vp").width('100%').padding({top:10,bottom:10}
)
.backgroundColor("#fff")
}.margin("15vp").height(60)
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '导入'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '临时发物'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
})
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
struct WzPositionPage{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("落位统计")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("扫描落位")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("导出结果数据包")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(80)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资落位" })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入品名名称"})
.enterKeyType(EnterKeyType.Search)
.borderRadius("13vp").width('100%').padding({top:10,bottom:10}
)
.backgroundColor("#fff")
}.height(60)
}.width("100%")
.padding('15vp')
Row(){
// 底部按钮
this.bottomButtons();
}.width("100%").height(80)
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 0.5], [0xc7d799, 1]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
import { TitleBar } from '../../view/title/TitleBar'
import { BasicTable } from '../../view/BasicTable/BasicTable'
@Extend(Button) function bottomBtnSty() {
.borderWidth(1)
.borderColor('#0fa983')
.backgroundColor('#fff')
.fontColor('#0fa983')
.borderRadius(10)
.type(ButtonType.Normal)
.stateEffect(true)
}
@Entry
@Component
struct WzReversePage{
@State fontColor: string = '#182431'
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Builder TabBuilder(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize(16)
.lineHeight(22)
.margin({ top: 17, bottom: 7 })
Divider()
.strokeWidth(2)
.color('#fff')
.width(50)
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
@Builder bottomButtons() {
Row() {
Flex({ justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) {
Button("设置状态")
.bottomBtnSty()
.onClick(async () => {
})
.fontColor("#0fa983")
.fontSize("14vp")
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
Button("清空选择")
.bottomBtnSty()
.onClick(async () =>{
}).fontColor("#0fa983") .fontSize("14vp")
}
}.height(80)
}
build(){
Column() {
Flex({direction:FlexDirection.Column}){
TitleBar({ title:"物资倒库" })
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
TextInput({placeholder:"请输入凭证号"})
.enterKeyType(EnterKeyType.Search)
.borderRadius("13vp").width('100%').padding({top:10,bottom:10}
)
.backgroundColor("#fff")
}.margin("15vp").height(60)
}.width("100%")
.padding('15vp')
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#00CB87')
}.tabBar(this.TabBuilder(0, '未完成'))
TabContent() {
// Column().width('100%').height('100%').backgroundColor('#007DFF')
}.tabBar(this.TabBuilder(1, '已完成'))
}
.height(80)
.onChange((index: number) => {
this.currentIndex = index
})
Column(){
BasicTable({dataSource:[]})
}.flexGrow(1)
Row(){
// 底部按钮
this.bottomButtons();
}.backgroundColor("#97c6a6").width("100%").height(80)
}
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
}
\ No newline at end of file
...@@ -39,7 +39,7 @@ export struct BasicTable { ...@@ -39,7 +39,7 @@ export struct BasicTable {
Flex({justifyContent:FlexAlign.Center,alignItems:ItemAlign.Center}) { Flex({justifyContent:FlexAlign.Center,alignItems:ItemAlign.Center}) {
Column() { Column() {
Image($r("app.media.empty")).width("30%") Image($r("app.media.empty")).width("30%")
Text("暂无数据").fontSize(22) Text("暂无数据").fontSize(22).fontColor("#fff")
} }
}.height('100%') }.height('100%')
} }
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
"pages/SplashPage", "pages/SplashPage",
"pages/MainPage", "pages/MainPage",
"pages/package/Pick", "pages/package/Pick",
"pages/package/Pack" "pages/package/Pack",
"pages/metailmange/WzInPage",
"pages/metailmange/WzOutPage",
"pages/metailmange/WzExchangePage",
"pages/metailmange/WzConversionPage",
"pages/metailmange/WzInvPage",
"pages/metailmange/WzPositionPage",
"pages/metailmange/WzReversePage"
] ]
} }
import router from '@ohos.router'; import router from '@ohos.router';
import ItemData from '../viewmodel/ItemData'; import ItemData from '../viewmodel/ItemData';
import gridWordModel from '../viewmodel/GridWordViewModel'; import gridWordModel from '../viewmodel/GridWordViewModel';
@Entry import {
BreakpointSystem,
Logger,
StyleConstants,
BreakpointConstants
} from '@ohos/common';
@Component @Component
export struct MaterialManagement { export struct MaterialManagement {
build(){ build(){
...@@ -27,20 +32,21 @@ export struct MaterialManagement { ...@@ -27,20 +32,21 @@ export struct MaterialManagement {
GridItem() { GridItem() {
Column() { Column() {
Image(secondItem.img).borderRadius(12) Image(secondItem.img).borderRadius(12)
.height("62%") .height("72%")
.onClick(() => { .onClick(() => {
// router.pushUrl({ url: CommonConstants.PLAY_PAGE }); // router.pushUrl({ url: CommonConstants.PLAY_PAGE });
this.onGridItemClick(secondItem.others); this.onGridItemClick(secondItem.others);
}) })
Text(secondItem.title).width('94.4%') Text(secondItem.title).width('94.4%')
.fontSize(14) .fontSize(21)
.fontWeight(500) .fontWeight(500)
.fontColor('#fff') .fontColor('#fff')
.textAlign(TextAlign.Center) .textAlign(TextAlign.Center)
.margin({ top: 8 }) .margin({ top: 5 })
}.backgroundColor('#0fa983') }.backgroundColor('#0fa983')
.borderRadius($r('app.float.home_list_padding')) .borderRadius($r('app.float.home_list_padding'))
.padding(10) .padding(10)
.width("100%")
.height('100%') .height('100%')
} }
.padding({ top: $r('app.float.home_list_padding'), left: $r('app.float.home_list_padding') }) .padding({ top: $r('app.float.home_list_padding'), left: $r('app.float.home_list_padding') })
...@@ -52,21 +58,58 @@ export struct MaterialManagement { ...@@ -52,21 +58,58 @@ export struct MaterialManagement {
}, (secondItem: ItemData) => JSON.stringify(secondItem)) }, (secondItem: ItemData) => JSON.stringify(secondItem))
} }
.width("100%") .width("100%")
.height('40%') .height('70%')
.columnsTemplate('1fr 1fr') .columnsTemplate('2fr 2fr')
.rowsTemplate('1fr 1fr 1fr 1fr') .rowsTemplate('1fr 1fr 1fr 1fr')
.columnsGap($r('app.float.home_grid_columnsGap')) .columnsGap($r('app.float.home_grid_columnsGap'))
.rowsGap($r('app.float.home_grid_rowGap')) .rowsGap($r('app.float.home_grid_rowGap'))
.margin({ bottom: $r('app.float.setting_account_fontSize') }) .margin({ bottom: $r('app.float.setting_account_fontSize') })
} }.margin({
}.backgroundColor("#c7d799") left:20,
right:20
})
}.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [[0x36a3c0, 0.0], [0x97c6a6, 1], [0xc7d799, 0.0]] // 数组末尾元素占比小于1时满足重复着色效果
})
} }
} }
onGridItemClick(type?:string):void { onGridItemClick(type?:string):void {
switch (type) { switch (type) {
case "in": case "in":
router.pushUrl({ router.pushUrl({
url: 'pages/in_out/InWorkPage', url: "pages/metailmange/WzInPage",
})
break;
case "out":
router.pushUrl({
url: "pages/metailmange/WzOutPage",
})
break;
case "exchange":
router.pushUrl({
url: "pages/metailmange/WzExchangePage",
})
break;
case "reverse":
router.pushUrl({
url: "pages/metailmange/WzReversePage",
})
break;
case "inv":
router.pushUrl({
url: "pages/metailmange/WzInvPage",
})
break;
case "conversion":
router.pushUrl({
url: "pages/metailmange/WzConversionPage",
})
break;
case "position":
router.pushUrl({
url: "pages/metailmange/WzPositionPage",
}) })
break; break;
} }
......
...@@ -8,8 +8,8 @@ export class GridWordViewModel { ...@@ -8,8 +8,8 @@ export class GridWordViewModel {
*/ */
getGridWorkData(): Array<ItemData> { getGridWorkData(): Array<ItemData> {
let secondGridData: ItemData[] = [ let secondGridData: ItemData[] = [
new ItemData($r('app.string.wz_out'), $r('app.media.font'), 'in'), new ItemData($r('app.string.wz_out'), $r('app.media.font'), 'out'),
new ItemData($r('app.string.wz_in'), $r('app.media.font'), 'out'), new ItemData($r('app.string.wz_in'), $r('app.media.font'), 'in'),
new ItemData($r('app.string.wz_exchange'), $r('app.media.font'), 'exchange'), new ItemData($r('app.string.wz_exchange'), $r('app.media.font'), 'exchange'),
new ItemData($r('app.string.wz_reverse'), $r('app.media.font'), 'reverse'), new ItemData($r('app.string.wz_reverse'), $r('app.media.font'), 'reverse'),
new ItemData($r('app.string.wz_inv'), $r('app.media.font'), 'inv'), new ItemData($r('app.string.wz_inv'), $r('app.media.font'), 'inv'),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论