index.uvue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="help-container my-page">
  3. <view v-for="(item, findex) in list" :key="findex" class="list-title">
  4. <view class="text-title uni-row">
  5. <view :class="item.icon"></view>
  6. <text>{{ item.title }}</text>
  7. </view>
  8. <view class="childList">
  9. <view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover"
  10. @click="handleText(child)">
  11. <view class="text-item">{{ child.title }}</view>
  12. <view class="line" v-if="zindex !== item.childList.length - 1"></view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script lang="uts">
  19. type ChildItem={
  20. title:string,
  21. content:string
  22. }
  23. type Item={
  24. icon:string,
  25. title:string,
  26. childList:ChildItem[]
  27. }
  28. export default {
  29. data() {
  30. return {
  31. list: [{
  32. icon: 'iconfont icon-github',
  33. title: '若依问题',
  34. childList: [{
  35. title: '若依开源吗?',
  36. content: '开源'
  37. }, {
  38. title: '若依可以商用吗?',
  39. content: '可以'
  40. }, {
  41. title: '若依官网地址多少?',
  42. content: 'http://ruoyi.vip'
  43. }, {
  44. title: '若依文档地址多少?',
  45. content: 'http://doc.ruoyi.vip'
  46. }]
  47. },
  48. {
  49. icon: 'iconfont icon-help' as string,
  50. title: '其他问题' as string,
  51. childList: [{
  52. title: '如何退出登录?' as string,
  53. content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录' as string,
  54. }, {
  55. title: '如何修改用户头像?' as string,
  56. content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像' as string,
  57. }, {
  58. title: '如何修改登录密码?',
  59. content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码' as string,
  60. }]
  61. }
  62. ] as Item[]
  63. }
  64. },
  65. methods: {
  66. handleText(item: ChildItem) {
  67. uni.navigateTo({
  68. url: `/pages/common/textview/index?title=${item.title}&content=${item.content}`
  69. });
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .my-page {
  76. background-color: #f8f8f8;
  77. width: 100%;
  78. height: 100%;
  79. }
  80. .help-container {
  81. margin-bottom: 100rpx;
  82. padding: 30rpx;
  83. }
  84. .list-title {
  85. margin-bottom: 30rpx;
  86. }
  87. .childList {
  88. background: #ffffff;
  89. box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
  90. border-radius: 16rpx;
  91. margin-top: 10rpx;
  92. }
  93. .line {
  94. width: 100%;
  95. height: 1rpx;
  96. background-color: #F5F5F5;
  97. }
  98. .text-title {
  99. color: #303133;
  100. font-size: 32rpx;
  101. font-weight: bold;
  102. margin-left: 10rpx;
  103. .iconfont {
  104. font-size: 16px;
  105. margin-right: 10rpx;
  106. }
  107. }
  108. .text-item {
  109. font-size: 28rpx;
  110. padding: 24rpx;
  111. }
  112. .question {
  113. color: #606266;
  114. font-size: 28rpx;
  115. }
  116. </style>