index.uvue 3.0 KB

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