|
|
@@ -1,6 +1,179 @@
|
|
|
-@Component
|
|
|
+import { EmptyComp } from "../components/EmptyComp";
|
|
|
+import { ThirdViewModel } from "../viewModel/ThirdViewModel";
|
|
|
+import text from "@ohos.graphics.text";
|
|
|
+
|
|
|
+@ComponentV2
|
|
|
export struct ThirdView {
|
|
|
+ @Local vm:ThirdViewModel = new ThirdViewModel()
|
|
|
+
|
|
|
build() {
|
|
|
+ Column({space: 28}){
|
|
|
+ // 选择学生
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+ Row().width(58).aspectRatio(1)
|
|
|
+
|
|
|
+ Text('当前被选中的学生')
|
|
|
+ .fontSize(18)
|
|
|
+ .fontWeight(400)
|
|
|
+ .fontColor('#333333')
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ if(this.vm.studentName) {
|
|
|
+ Text('再选一次')
|
|
|
+ .fontSize(14)
|
|
|
+ .borderRadius(29)
|
|
|
+ .fontColor('#5668FC')
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .padding({left: 10, right: 10, top: 10, bottom: 10})
|
|
|
+ .border({width:4, color: '#7186F9'})
|
|
|
+ .onClick(()=>{ this.vm._onRandomStudent() })
|
|
|
+ }
|
|
|
+ }.width(58).aspectRatio(1)
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .padding({top: 8, left: 6, right: 6, bottom: 8})
|
|
|
+ .alignItems(VerticalAlign.Top)
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+
|
|
|
+ Column(){
|
|
|
+ Text(this.vm.studentName)
|
|
|
+ .fontSize(30)
|
|
|
+ .fontWeight(400)
|
|
|
+ .zIndex(999)
|
|
|
+ .fontColor('#333333')
|
|
|
+ .onSizeChange((_o, _n) => {
|
|
|
+ if(this.vm.studentName) {
|
|
|
+ this.vm.studentWidgetLength = _n.width ?? 94
|
|
|
+ } else {
|
|
|
+ this.vm.studentWidgetLength = 94
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ Row()
|
|
|
+ .height(9.5)
|
|
|
+ .offset({y: -10})
|
|
|
+ .borderRadius(999)
|
|
|
+ .backgroundColor('#AFBBFF')
|
|
|
+ .width(this.vm.studentWidgetLength)
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .height(60)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ Column(){
|
|
|
+ Text('回答')
|
|
|
+ .fontSize(16)
|
|
|
+ .fontColor('#5668FC')
|
|
|
+ .opacity(this.vm.studentName ? 1 : 0)
|
|
|
+ if(this.vm.studentName){
|
|
|
+ Row(){
|
|
|
+ Text('正确')
|
|
|
+ .borderRadius(10)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .backgroundColor('#7186F9')
|
|
|
+ .padding({left: 24, top: 8, right: 24, bottom: 8})
|
|
|
+ .onClick(() => { this.vm._onAnswerIsRight(true) })
|
|
|
+
|
|
|
+ Text('错误')
|
|
|
+ .borderRadius(10)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .backgroundColor('#7186F9')
|
|
|
+ .padding({left: 24, top: 8, right: 24, bottom: 8})
|
|
|
+ .onClick(() => { this.vm._onAnswerIsRight(false) })
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .padding({left: 60, right: 60, top: 5})
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ } else {
|
|
|
+ Text('随机抽取')
|
|
|
+ .borderRadius(10)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .backgroundColor('#7186F9')
|
|
|
+ .padding({left: 24, top: 8, right: 24, bottom: 8})
|
|
|
+ .onClick(() => { this.vm._onRandomStudent() })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .padding({top: 32})
|
|
|
+ .alignItems(HorizontalAlign.Center)
|
|
|
+ }
|
|
|
+ .height(250)
|
|
|
+ .width('100%')
|
|
|
+ .borderRadius(15)
|
|
|
+ .border({width: 1, color: '#7186F9'})
|
|
|
+ .linearGradient({
|
|
|
+ colors: [['#E7EAFF', 0.1], ['#F8E8FF', 0.5], ['#F8F9FF', 1]],
|
|
|
+ angle: 35
|
|
|
+ })
|
|
|
+
|
|
|
+ Column({space: 14.5}){
|
|
|
+ Text('答题记录')
|
|
|
+ .fontSize(20)
|
|
|
+ .fontWeight(600)
|
|
|
+
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+ Text('日期')
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#293AC4')
|
|
|
+ Text('姓名')
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#293AC4')
|
|
|
+ Text('表现')
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#293AC4')
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .borderRadius({topLeft: 15, topRight: 15})
|
|
|
+ .padding({ left: 35, right: 35, top: 10, bottom: 10 })
|
|
|
+ .linearGradient({ colors: [['#C0AEFF', 0.2], ['#E3E6FF', 1]], })
|
|
|
+
|
|
|
+ Column(){
|
|
|
+ EmptyComp({isEmpty: false}){
|
|
|
+ List({space: 13}){
|
|
|
+ ForEach(new Array(20).fill(1), (item: number, index) => {
|
|
|
+ ListItem(){
|
|
|
+ Row(){
|
|
|
+ Text('2025/09/09')
|
|
|
+ .fontSize(12)
|
|
|
+ .fontColor('#5467FF')
|
|
|
+
|
|
|
+ Text('一二三一二三')
|
|
|
+ .fontSize(12)
|
|
|
+ .fontColor('#5467FF')
|
|
|
|
|
|
+ Text('正确')
|
|
|
+ .fontSize(12)
|
|
|
+ .fontColor('#5467FF')
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .height("100%")
|
|
|
+ .scrollBar(BarState.Off)
|
|
|
+ .padding({left: 18, right: 38, top: 5, bottom: 5})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .height(300)
|
|
|
+ .width("100%")
|
|
|
+ }
|
|
|
+ .borderRadius(15)
|
|
|
+ .border({width:1, color: '#7186F9'})
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ }
|
|
|
+ .height('100%')
|
|
|
+ .width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ .alignItems(HorizontalAlign.Center)
|
|
|
+ .padding({ top: this.vm.safeTop + 35, left: 16, right: 16 })
|
|
|
}
|
|
|
}
|