|
|
@@ -0,0 +1,956 @@
|
|
|
+import { RouterPage, YTHeader, yTRouter } from "basic"
|
|
|
+import { BuilderHeader } from "../components/maincomponent/BuilderHeader"
|
|
|
+import { SwiperCom } from "../components/maincomponent/SwiperCom"
|
|
|
+import { OrderDetailBean, TimeLineNode } from "../components/maincomponent/TimeLineNode"
|
|
|
+import { DateFrequency, EditGreenPlantPageModel } from "../viewmodels/EditGreenPlantPageModel"
|
|
|
+import { LengthMetrics } from "@kit.ArkUI"
|
|
|
+import { DiaryTimePicker } from "../components/maincomponent/DiaryTimePicker"
|
|
|
+import { DiaryDatePicker } from "../components/maincomponent/DiaryDatePicker"
|
|
|
+
|
|
|
+
|
|
|
+@ComponentV2
|
|
|
+@RouterPage
|
|
|
+struct EditGreenPlantPage{
|
|
|
+ @Local title:string=""
|
|
|
+ @Local currentSelectIndex:number=0
|
|
|
+ @Local timeLineList: OrderDetailBean[] = [
|
|
|
+ {
|
|
|
+ nodeTime:'2025/06/30',
|
|
|
+ nodeState:0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeName:'扣款',
|
|
|
+ nodeMessage:'xxxxxx',
|
|
|
+ nodeTime:'17:18',
|
|
|
+ nodeImg:$r('app.media.app_icon'),
|
|
|
+ nodeState:1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeName:'扣款',
|
|
|
+ nodeMessage:'xxxxxx',
|
|
|
+ nodeTime:'17:18',
|
|
|
+ nodeImg:$r('app.media.app_icon'),
|
|
|
+ nodeState:1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeTime:'2025/06/29',
|
|
|
+ nodeState:0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeName:'扣款',
|
|
|
+ nodeMessage:'xxxxxx',
|
|
|
+ nodeTime:'17:18',
|
|
|
+ nodeImg:$r('app.media.app_icon'),
|
|
|
+ nodeState:1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeName:'扣款',
|
|
|
+ nodeMessage:'xxxxxx',
|
|
|
+ nodeTime:'17:18',
|
|
|
+ nodeImg:$r('app.media.app_icon'),
|
|
|
+ nodeState:1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeTime:'2025/06/01',
|
|
|
+ nodeState:0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeName:'扣款',
|
|
|
+ nodeMessage:'xxxxxx',
|
|
|
+ nodeTime:'17:18',
|
|
|
+ nodeImg:$r('app.media.app_icon'),
|
|
|
+ nodeState:1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ nodeName:'扣款',
|
|
|
+ nodeMessage:'xxxxxx',
|
|
|
+ nodeTime:'17:18',
|
|
|
+ nodeImg:$r('app.media.app_icon'),
|
|
|
+ nodeState:1
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ @Local totalSize: number = 9
|
|
|
+ private frequencyList:string[]=['仅提醒一次','每天','每周','每月','自定义间隔天数']
|
|
|
+ private weekList:string[]=['周一','周二','周三','周四','周五','周六','周日']
|
|
|
+ private monthList:string[]=['1号','2号','3号','4号','5号','6号','7号','8号','9号','10号',
|
|
|
+ '11号','12号','13号','14号','15号','16号','17号','18号','19号','20号',
|
|
|
+ '21号','22号','23号','24号','25号','26号','27号','28号','29号','30号']
|
|
|
+ private currentSelectFrequencyIndex:number=0
|
|
|
+ private currentSelectWeekIndex:number=0
|
|
|
+ private currentSelectMonthIndex:number=0
|
|
|
+ @Local vm:EditGreenPlantPageModel=new EditGreenPlantPageModel()
|
|
|
+ //提醒设置
|
|
|
+ @Local isShowRemindClockBuilder:boolean=false
|
|
|
+ aboutToAppear(): void {
|
|
|
+ this.title=yTRouter.getParamByName('EditGreenPlantPage').pop() as string
|
|
|
+
|
|
|
+ }
|
|
|
+ onBackPressUpdateData(ans:string='false'){
|
|
|
+ yTRouter.pop(ans,true)
|
|
|
+ }
|
|
|
+ build() {
|
|
|
+ NavDestination(){
|
|
|
+ Column({space:20}) {
|
|
|
+ YTHeader({
|
|
|
+ leftComp: () => {
|
|
|
+ this.leftComBuilder()
|
|
|
+ },
|
|
|
+ title: this.title,
|
|
|
+
|
|
|
+ rightComp: () => {
|
|
|
+ this.rightBuilder()
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+ Text('基本信息').fontSize(14).fontColor('#333333')
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ Image($r('app.media.startIcon'))
|
|
|
+ }.width(106)
|
|
|
+ .height(136)
|
|
|
+ .padding(12)
|
|
|
+ .backgroundColor('#E8EBF0')
|
|
|
+ .borderRadius(12)
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ Text('名称').fontSize(14).fontColor('#333333')
|
|
|
+ Text('龟背竹').fontSize(14).fontColor('#206D43')
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({right:16})
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .borderRadius(12)
|
|
|
+ .height(195)
|
|
|
+ .padding({top:9,bottom:5,left:13})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .shadow({
|
|
|
+ // 模糊半径
|
|
|
+ radius: 10,
|
|
|
+ // 阴影类型
|
|
|
+ type: ShadowType.COLOR,
|
|
|
+ // 阴影颜色
|
|
|
+ color: '#1A000000',
|
|
|
+ // X 轴偏移
|
|
|
+ offsetX: 1,
|
|
|
+ // Y 轴偏移
|
|
|
+ offsetY: 1,
|
|
|
+ // 是否内部填充,值为布尔型,默认为flase
|
|
|
+ fill: false
|
|
|
+ })
|
|
|
+ Row(){
|
|
|
+ Column(){
|
|
|
+ Text('养护记录').fontSize(this.currentSelectIndex==0?16:14)
|
|
|
+ Row()
|
|
|
+ .width(20)
|
|
|
+ .height(3)
|
|
|
+ .backgroundColor(this.currentSelectIndex==0?'#206d43':Color.Transparent)
|
|
|
+ }.margin({right:22}).onClick(()=>{
|
|
|
+ this.currentSelectIndex=0
|
|
|
+ })
|
|
|
+ Column(){
|
|
|
+ Text('提醒设置').fontSize(this.currentSelectIndex==1?16:14)
|
|
|
+ Row()
|
|
|
+ .width(20)
|
|
|
+ .height(3)
|
|
|
+ .backgroundColor(this.currentSelectIndex==1?'#206d43':Color.Transparent)
|
|
|
+ }.onClick(()=>{
|
|
|
+ this.currentSelectIndex=1
|
|
|
+
|
|
|
+ })
|
|
|
+ }.width('100%')
|
|
|
+ Column() {
|
|
|
+ if (this.currentSelectIndex == 0) {
|
|
|
+ List() {
|
|
|
+ ForEach(this.timeLineList, (item: object, index: number) => {
|
|
|
+ TimeLineNode({ bean: item, index: index, totalSize: this.totalSize })
|
|
|
+ }, (item: object) => JSON.stringify(item))
|
|
|
+ }.margin({ left: 30 }).scrollBar(BarState.Off)
|
|
|
+ }else{
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+
|
|
|
+ Column({space:6}){
|
|
|
+ Image($r('app.media.app_icon')).width(50)
|
|
|
+ Text('xxx')
|
|
|
+ }
|
|
|
+ Blank()
|
|
|
+
|
|
|
+ Column({space:17}){
|
|
|
+ Row({space:15}){
|
|
|
+ Text('下次提醒')
|
|
|
+ .fontSize(14)
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#206D43')
|
|
|
+ Text('2023-09-11 15:30')
|
|
|
+ .fontSize(12)
|
|
|
+ }
|
|
|
+ Row({space:15}){
|
|
|
+ Text('提醒间隔')
|
|
|
+ .fontSize(14)
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#206D43')
|
|
|
+ Text('每天')
|
|
|
+ .fontSize(12)
|
|
|
+ }
|
|
|
+ }.height('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .margin({top:20,right:15})
|
|
|
+
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ }.width(45)
|
|
|
+ .height(20)
|
|
|
+ .backgroundColor(Color.Gray)
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height(100)
|
|
|
+ .padding({left:15,right:15,top:11,bottom:11})
|
|
|
+ .backgroundColor('#fff')
|
|
|
+ .borderRadius(12)
|
|
|
+
|
|
|
+ Button('xxxx').onClick(()=>{
|
|
|
+ this.isShowRemindClockBuilder=!this.isShowRemindClockBuilder
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ .backgroundColor(Color.Pink)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .layoutWeight(1)
|
|
|
+ .bindSheet($$this.isShowRemindClockBuilder,this.RemindClockBuilder(),{
|
|
|
+ height:530,
|
|
|
+ showClose:false,
|
|
|
+ backgroundColor:Color.Transparent
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }.padding({left:16,right:16}).backgroundColor('#FAFAFA')
|
|
|
+
|
|
|
+ }.hideTitleBar(true)
|
|
|
+
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ leftComBuilder(){
|
|
|
+ Image($r('app.media.startIcon')).width(18).height(18).onClick(()=>{
|
|
|
+ this.onBackPressUpdateData()
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ rightBuilder(){
|
|
|
+ Text('确认').fontSize(16).fontColor('#206D43').onClick(()=>{
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ RemindClockBuilder(){
|
|
|
+ Column(){
|
|
|
+ Swiper(this.vm.swiperController){
|
|
|
+ Column(){
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ Text('取消').fontColor('#333333')
|
|
|
+ Text('提醒设置')
|
|
|
+ Text('设置').fontColor('#206D43')
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .margin({bottom:16})
|
|
|
+
|
|
|
+ Column({space:20}) {
|
|
|
+ Column() {
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text('提醒事项')
|
|
|
+ Image($r('app.media.startIcon')).width(18)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({ top: 16, bottom: 16 })
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(1,true)
|
|
|
+ })
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text('提醒植物')
|
|
|
+ Image($r('app.media.startIcon')).width(18)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({ top: 16, bottom: 16 })
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(2,true)
|
|
|
+
|
|
|
+ })
|
|
|
+ }.backgroundColor('#F8F8F8')
|
|
|
+ .padding({left:10,right:10})
|
|
|
+ .borderRadius(12)
|
|
|
+
|
|
|
+ Column() {
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text('多久提醒一次')
|
|
|
+ Image($r('app.media.startIcon')).width(18)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({ top: 16, bottom: 16 })
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(3,true)
|
|
|
+ })
|
|
|
+
|
|
|
+ if(this.vm.frequency==DateFrequency.DAY){
|
|
|
+ Row() {
|
|
|
+ Text('时间')
|
|
|
+ Image($r('app.media.startIcon')).width(18)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({ top: 16, bottom: 16 })
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(4,true)
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ Row() {
|
|
|
+ if(this.vm.frequency==DateFrequency.NONE){
|
|
|
+ Text('日期')
|
|
|
+ }else if(this.vm.frequency==DateFrequency.WEEK){
|
|
|
+ Text('每周几提醒')
|
|
|
+ }else if(this.vm.frequency==DateFrequency.MONTH){
|
|
|
+ Text('每月几号提醒')
|
|
|
+ }else{
|
|
|
+ Text('间隔天数')
|
|
|
+ }
|
|
|
+
|
|
|
+ Image($r('app.media.startIcon')).width(18)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({ top: 16, bottom: 16 })
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(4,true)
|
|
|
+ })
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text('时间')
|
|
|
+ Image($r('app.media.startIcon')).width(18)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .padding({ top: 16, bottom: 16 })
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(5,true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }.backgroundColor('#F8F8F8')
|
|
|
+ .padding({left:10,right:10})
|
|
|
+ .borderRadius(12)
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperController.changeIndex(4,true)
|
|
|
+
|
|
|
+ })
|
|
|
+ }.width('100%')
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:16,left:16,right:16})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }.width('100%').height('100%')
|
|
|
+ //打卡事项swiper
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ this.SelectRemindTask()
|
|
|
+ },
|
|
|
+ swiperBuilder2:()=>{this.CreateRemindTask()},
|
|
|
+ swiperBuilder3: () => {this.SelectRemindTaskIcon()},
|
|
|
+ swiperComController:this.vm.swiperComController[0]
|
|
|
+ })
|
|
|
+
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //选择打卡植物
|
|
|
+ this.SelectRemindGreenPlant()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[1]
|
|
|
+ })
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //选择打卡频率
|
|
|
+ this.SelectRemindFrequency()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[2]
|
|
|
+ })
|
|
|
+ if(this.vm.frequency==DateFrequency.DAY){
|
|
|
+ //如果时每天的话,那就只有一个时间
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //时间
|
|
|
+ this.SelectRemindTime()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[3]
|
|
|
+ })
|
|
|
+ }else if(this.vm.frequency==DateFrequency.FREE){
|
|
|
+ //如果是自定义,第一行就是自定义
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //自定义
|
|
|
+ //自定义
|
|
|
+ this.FreeDay()
|
|
|
+ },
|
|
|
+ swiperBuilder2:()=>{
|
|
|
+ //日期
|
|
|
+ this.SelectRemindDate()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[3]
|
|
|
+ })
|
|
|
+ //第二行就是时间
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //时间
|
|
|
+ this.SelectRemindTime()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[4]
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if(this.vm.frequency==DateFrequency.NONE){
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ this.SelectRemindDate()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[3]
|
|
|
+ })
|
|
|
+ }else if (this.vm.frequency==DateFrequency.WEEK){
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //周
|
|
|
+ this.SelectRemindWeek()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[3]
|
|
|
+ })
|
|
|
+ }else if(this.vm.frequency==DateFrequency.MONTH){
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //月
|
|
|
+ this.SelectRemindMonth()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[3]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ SwiperCom({
|
|
|
+ swiperBuilder1:()=>{
|
|
|
+ //时间
|
|
|
+ this.SelectRemindTime()
|
|
|
+ },
|
|
|
+ swiperComController:this.vm.swiperComController[4]
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height(530)
|
|
|
+ .autoPlay(false)
|
|
|
+ .indicator(false)
|
|
|
+ .disableSwipe(true)
|
|
|
+ .curve(Curve.EaseIn)
|
|
|
+ .duration(100)
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%').backgroundColor(Color.Transparent)
|
|
|
+
|
|
|
+ }
|
|
|
+ //选择提醒事项
|
|
|
+ @Builder
|
|
|
+ SelectRemindTask(){
|
|
|
+ Column({space:24}){
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'取消',
|
|
|
+ centerTitle:'选择提醒事项',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ //取消就返回到swiper[0]
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ //确定也需要返回,不过打卡事项确定了
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ Column({space:24}) {
|
|
|
+ Row() {
|
|
|
+ Text('基本事项')
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+
|
|
|
+ Scroll() {
|
|
|
+ Grid() {
|
|
|
+ ForEach([1, 2, 3, 4, 5, 6,7,8,8,8], () => {
|
|
|
+ GridItem() {
|
|
|
+ Column({space:16}) {
|
|
|
+ Image($r('app.media.startIcon')).width(45).height(45)
|
|
|
+ Text('xxxx').fontSize(14)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.height('100%').columnsTemplate('1fr 1fr 1fr').scrollBar(BarState.Off)
|
|
|
+ }.layoutWeight(1).scrollBar(BarState.Off)
|
|
|
+ }.height(300)
|
|
|
+
|
|
|
+ Column({space:24}) {
|
|
|
+ Row() {
|
|
|
+ Text('自定义')
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ Scroll() {
|
|
|
+ Grid() {
|
|
|
+ ForEach([1], () => {
|
|
|
+ GridItem() {
|
|
|
+ Column() {
|
|
|
+ Image($r('app.media.startIcon')).width(45).height(45)
|
|
|
+ Text('xxxx')
|
|
|
+ }.onClick(()=>{
|
|
|
+ this.vm.swiperComController[0].changeIndex(1,true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.columnsTemplate('1fr 1fr 1fr')
|
|
|
+ }.layoutWeight(1).scrollBar(BarState.Off)
|
|
|
+ }.layoutWeight(1)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:16,left:16,right:16})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建事项
|
|
|
+ @Builder
|
|
|
+ CreateRemindTask(){
|
|
|
+ Column(){
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'创建提醒事项',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperComController[0].changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperComController[0].changeIndex(0,true)
|
|
|
+ //确定之后也返回,创建打卡事项成功
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ }.width(123)
|
|
|
+ .height(123)
|
|
|
+ .backgroundColor(Color.Green)
|
|
|
+ .onClick(()=>{
|
|
|
+ //选择图标
|
|
|
+ this.vm.swiperComController[0].changeIndex(2,true)
|
|
|
+ })
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:16,left:16,right:16})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }.width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ SelectRemindTaskIcon(){
|
|
|
+ Column(){
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'选择事项图标',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperComController[0].changeIndex(1,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperComController[0].changeIndex(1,true)
|
|
|
+ //选择事项图标成功,返回
|
|
|
+ }
|
|
|
+ })
|
|
|
+ Column({space:24}) {
|
|
|
+ Scroll() {
|
|
|
+ Grid() {
|
|
|
+ ForEach([1,1,1,1,1,1,1,1,1,1,1,1,1], () => {
|
|
|
+ GridItem() {
|
|
|
+ Column() {
|
|
|
+ Image($r('app.media.startIcon')).width(45).height(45)
|
|
|
+ Text('xxxx')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.columnsTemplate('1fr 1fr 1fr')
|
|
|
+ }.layoutWeight(1).scrollBar(BarState.Off)
|
|
|
+ }.layoutWeight(1)
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:16,left:16,right:16})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ SelectRemindGreenPlant(){
|
|
|
+
|
|
|
+ Column(){
|
|
|
+
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'选择提醒植物',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ //选择植物成功,返回
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ Search({ value:"", placeholder: '搜索植物' })
|
|
|
+ .searchIcon({
|
|
|
+ src: $r('sys.media.ohos_ic_public_search_filled')
|
|
|
+ })
|
|
|
+ .cancelButton({
|
|
|
+ style: CancelButtonStyle.CONSTANT,
|
|
|
+ icon: {
|
|
|
+ src: $r('sys.media.ohos_ic_public_cancel_filled')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .width('100%')
|
|
|
+ .height(48)
|
|
|
+ .maxLength(20)
|
|
|
+ .border({
|
|
|
+ width:1,
|
|
|
+ color:"#1A000000"
|
|
|
+ })
|
|
|
+ .borderRadius(12)
|
|
|
+ .backgroundColor('#fff')
|
|
|
+ .placeholderColor(Color.Grey)
|
|
|
+ .placeholderFont({ size: 16, weight: 400 })
|
|
|
+ .textFont({ size: 16, weight: 400 })
|
|
|
+ .onSubmit((value: string) => {
|
|
|
+
|
|
|
+ })
|
|
|
+ .onChange((value: string) => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ Grid(){
|
|
|
+ ForEach([1,2,3,4,5,6],()=>{
|
|
|
+ GridItem(){
|
|
|
+ Column({space:9}){
|
|
|
+ Column(){
|
|
|
+ Image($r('app.media.app_icon')).width(63).height(92)
|
|
|
+
|
|
|
+ }.width(88)
|
|
|
+ .height(113)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .backgroundColor('#FFE8EBF0')
|
|
|
+ .borderRadius(12)
|
|
|
+ Text('龟背竹').fontSize(14)
|
|
|
+ }.width(107)
|
|
|
+ .height(155)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .border({
|
|
|
+ width:1,
|
|
|
+ color:'#FF206D43'
|
|
|
+ })
|
|
|
+ .borderRadius(12)
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
+ .scrollBar(BarState.Off)
|
|
|
+ .columnsTemplate('1fr 1fr 1fr')
|
|
|
+ .rowsGap(10)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:19,left:8,right:8})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ SelectRemindFrequency(){
|
|
|
+ Column({space:24}){
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'提醒频率',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ //选择植物成功,返回
|
|
|
+ //应该再这里赋值的
|
|
|
+ }
|
|
|
+ })
|
|
|
+ Stack() {
|
|
|
+ Row(){}.width('100%').height(44).backgroundColor('#EAF3F2').borderRadius(12)
|
|
|
+ TextPicker({ range: this.frequencyList,columnWidths: [LengthMetrics.percent(100)]})
|
|
|
+ .width('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
+ .selectedIndex(0)
|
|
|
+ .textStyle({
|
|
|
+ color:'#9C9898',
|
|
|
+ font:{size:16,weight:600}
|
|
|
+ })
|
|
|
+ .selectedTextStyle({
|
|
|
+ color:'#206D43',
|
|
|
+ font:{size:20,weight:600}
|
|
|
+ })
|
|
|
+ .borderRadius(0) //设置平角
|
|
|
+ .divider(null)
|
|
|
+ .gradientHeight(30)
|
|
|
+ .onChange((value,index)=>{
|
|
|
+ if(index==0){
|
|
|
+ this.vm.frequency=DateFrequency.NONE
|
|
|
+ }else if(index==1){
|
|
|
+ this.vm.frequency=DateFrequency.DAY
|
|
|
+ }else if(index==2){
|
|
|
+ this.vm.frequency=DateFrequency.WEEK
|
|
|
+ }else if(index==3){
|
|
|
+ this.vm.frequency=DateFrequency.MONTH
|
|
|
+ }else{
|
|
|
+ this.vm.frequency=DateFrequency.FREE
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:19,left:8,right:8})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ SelectRemindTime(){
|
|
|
+ //时间
|
|
|
+ Column() {
|
|
|
+ DiaryTimePicker({
|
|
|
+ onCancel:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ onConfirm:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ SelectRemindDate(){
|
|
|
+ //日期
|
|
|
+ Column(){
|
|
|
+ DiaryDatePicker({
|
|
|
+ back:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+
|
|
|
+ },
|
|
|
+ selectDateBack:(date: Date)=>{
|
|
|
+ //需要带参数确定
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ SelectRemindWeek(){
|
|
|
+ //周
|
|
|
+ Column({space:24}){
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'选择时间',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ //选择植物成功,返回
|
|
|
+ //应该再这里赋值的
|
|
|
+ }
|
|
|
+ })
|
|
|
+ Stack() {
|
|
|
+ Row(){}.width('100%').height(44).backgroundColor('#EAF3F2').borderRadius(12)
|
|
|
+ TextPicker({ range:this.weekList ,columnWidths: [LengthMetrics.percent(100)]})
|
|
|
+ .width('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
+ .selectedIndex(0)
|
|
|
+ .textStyle({
|
|
|
+ color:'#9C9898',
|
|
|
+ font:{size:16,weight:600}
|
|
|
+ })
|
|
|
+ .selectedTextStyle({
|
|
|
+ color:'#206D43',
|
|
|
+ font:{size:20,weight:600}
|
|
|
+ })
|
|
|
+ .borderRadius(0) //设置平角
|
|
|
+ .divider(null)
|
|
|
+ .gradientHeight(30)
|
|
|
+ .onChange((value,index)=>{
|
|
|
+ })
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ }.width('100%')
|
|
|
+ .height(350)
|
|
|
+ .padding({top:19,left:8,right:8})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ SelectRemindMonth(){
|
|
|
+ //月
|
|
|
+ Column({space:24}){
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'选择时间',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ //选择植物成功,返回
|
|
|
+ //应该再这里赋值的
|
|
|
+ }
|
|
|
+ })
|
|
|
+ Stack() {
|
|
|
+ Row(){}.width('100%').height(44).backgroundColor('#EAF3F2').borderRadius(12)
|
|
|
+ TextPicker({ range: this.monthList,columnWidths: [LengthMetrics.percent(100)]})
|
|
|
+ .width('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
+ .selectedIndex(0)
|
|
|
+ .textStyle({
|
|
|
+ color:'#9C9898',
|
|
|
+ font:{size:16,weight:600}
|
|
|
+ })
|
|
|
+ .selectedTextStyle({
|
|
|
+ color:'#206D43',
|
|
|
+ font:{size:20,weight:600}
|
|
|
+ })
|
|
|
+ .borderRadius(0) //设置平角
|
|
|
+ .divider(null)
|
|
|
+ .gradientHeight(30)
|
|
|
+ .onChange((value,index)=>{
|
|
|
+ })
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:19,left:8,right:8})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ FreeDay(){
|
|
|
+ Column({space:24}){
|
|
|
+ BuilderHeader({
|
|
|
+ leftTitle:'上一步',
|
|
|
+ centerTitle:'自定义',
|
|
|
+ rightTitle:'确定',
|
|
|
+ leftClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ },
|
|
|
+ rightClick:()=>{
|
|
|
+ this.vm.swiperController.changeIndex(0,true)
|
|
|
+ //选择植物成功,返回
|
|
|
+ //应该再这里赋值的
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ Row({space:30}){
|
|
|
+ Text('自')
|
|
|
+ Text('2029-12-12')
|
|
|
+ .fontColor('#206D43')
|
|
|
+ .fontSize(20)
|
|
|
+ .fontWeight(500)
|
|
|
+ .backgroundColor('#EAF3F2')
|
|
|
+ .padding({left:14,right:14,top:13,bottom:13})
|
|
|
+ .borderRadius(20)
|
|
|
+ .onClick(()=>{
|
|
|
+ this.vm.swiperComController[3].changeIndex(1,true)
|
|
|
+ })
|
|
|
+ Text('起')
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .margin({bottom:40})
|
|
|
+ Row({space:30}){
|
|
|
+ Text('每隔')
|
|
|
+ TextInput({text:"12"})
|
|
|
+ .width(80)
|
|
|
+ .maxLength(2)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontColor('#206D43')
|
|
|
+ .fontSize(20)
|
|
|
+ .fontWeight(500)
|
|
|
+ .backgroundColor('#EAF3F2')
|
|
|
+ .padding({left:14,right:14,top:13,bottom:13})
|
|
|
+ .borderRadius(20)
|
|
|
+ .onChange(()=>{
|
|
|
+ //
|
|
|
+ })
|
|
|
+ Text('天')
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height(530)
|
|
|
+ .padding({top:19,left:8,right:8})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({topLeft:20,topRight:20})
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+@Builder
|
|
|
+function EditGreenPlantBuilder() {
|
|
|
+ EditGreenPlantPage()
|
|
|
+}
|