SuggestionPage.ets 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import { IBestToast, YtAvoid, YtButton, YTHeader, yTRequest } from 'basic'
  2. @Builder
  3. function suggestionBuilder() {
  4. NavDestination() {
  5. SuggestionPage()
  6. }
  7. .hideTitleBar(true)
  8. }
  9. @Component
  10. struct SuggestionPage {
  11. @StorageProp(YtAvoid.safeBottomKey) safeBottom: number = 0
  12. @State description: string = ''
  13. @State contact: string = ''
  14. build() {
  15. Column() {
  16. YTHeader({ title: '意见反馈' })
  17. Row() {
  18. Row() {
  19. Text()
  20. .width(3)
  21. .height(10)
  22. .backgroundColor($r('[basic].color.main_ac_color_dark'))
  23. .margin({ right: 3 })
  24. Text() {
  25. Span('问题描述 ')
  26. .fontColor('#CC000000')
  27. Span('(必填)')
  28. .fontColor('#FFFD4437')
  29. }
  30. .fontSize($r('[basic].float.page_text_font_size_12'))
  31. .fontWeight(500)
  32. }
  33. }
  34. .width('100%')
  35. .alignItems(VerticalAlign.Bottom)
  36. .margin({ bottom: 4, top: 26 })
  37. .justifyContent(FlexAlign.SpaceBetween)
  38. .padding({ left: 16, right: 20 })
  39. Text('请尽量将问题描述详细')
  40. .fontSize($r('[basic].float.page_text_font_size_10'))
  41. .fontColor('#4D000000')
  42. .margin({ bottom: 8 })
  43. .width('100%')
  44. .textAlign(TextAlign.Start)
  45. .padding({ left: 22 })
  46. Column() {
  47. TextArea({ text: $$this.description })
  48. .width('100%')
  49. .padding(5)
  50. .fontSize($r('[basic].float.page_text_font_size_12'))
  51. .fontColor('#CC000000')
  52. .borderRadius(4)
  53. .border({ width: 1, color: '#14000000' })
  54. .height(155)
  55. .backgroundColor(Color.White)
  56. }
  57. .padding({ left: 22, right: 22 })
  58. .margin({ bottom: 23 })
  59. Row() {
  60. Row() {
  61. Text()
  62. .width(3)
  63. .height(10)
  64. .backgroundColor($r('[basic].color.main_ac_color_dark'))
  65. .margin({ right: 3 })
  66. Text() {
  67. Span('联系方式 ')
  68. .fontColor('#CC000000')
  69. Span('(选填)')
  70. .fontColor('#CC000000')
  71. }
  72. .fontSize($r('[basic].float.page_text_font_size_12'))
  73. .fontWeight(500)
  74. }
  75. }
  76. .width('100%')
  77. .alignItems(VerticalAlign.Bottom)
  78. .margin({ bottom: 4, top: 26 })
  79. .justifyContent(FlexAlign.SpaceBetween)
  80. .padding({ left: 16, right: 20 })
  81. Text('请输入手机号或QQ号')
  82. .fontSize($r('[basic].float.page_text_font_size_10'))
  83. .fontColor('#4D000000')
  84. .margin({ bottom: 8 })
  85. .width('100%')
  86. .textAlign(TextAlign.Start)
  87. .padding({ left: 22 })
  88. Column() {
  89. TextArea({ text: $$this.contact })
  90. .width('100%')
  91. .borderRadius(4)
  92. .padding(5)
  93. .fontSize($r('[basic].float.page_text_font_size_12'))
  94. .fontColor('#CC000000')
  95. .border({ width: 1, color: '#14000000' })
  96. .height(87)
  97. .backgroundColor(Color.White)
  98. }
  99. .padding({ left: 22, right: 22 })
  100. .margin({ bottom: 160 })
  101. Column() {
  102. YtButton({
  103. btContent: '提交反馈',
  104. click: () => {
  105. if (!this.description) {
  106. IBestToast.show({
  107. type: 'warning',
  108. message: '请输入问题描述'
  109. })
  110. return
  111. }
  112. yTRequest.questionBack(this.description, this.contact)
  113. // //TODO 发请求提交反馈
  114. // YTLog.info(this.description + this.contact + '反馈提交了')
  115. }
  116. })
  117. }
  118. .padding({ left: 18, right: 18 })
  119. }
  120. .padding({ bottom: this.safeBottom })
  121. .height('100%')
  122. .backgroundColor(Color.White)
  123. }
  124. }