helpCenter.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="helpcenter">
  3. <!-- 标题栏 -->
  4. <u-navbar
  5. back-icon-color="#fff"
  6. :back-text="$t('common.Back')"
  7. :is-back="true"
  8. :background="{background:'#1777FE'}"
  9. :back-text-style="{color:'#fff'}"
  10. :border-bottom="true"
  11. title-color="#fff"
  12. :title="title"
  13. :custom-back="back"
  14. >
  15. </u-navbar>
  16. <!-- 问题分类 -->
  17. <!-- <scroll-view class="helpList" :scroll-x="false" :scscroll-y="true" v-if="helpList.length>0">
  18. <view class="item" v-for="(item,index) in helpList" :key="item.id" @click="showItem(item)">
  19. <view class="label">{{item.name}}</view>
  20. <view class="icon">&gt;</view>
  21. </view>
  22. </scroll-view> -->
  23. <tree :list="helpList" @treeItemClick="showQuestionDetial"/>
  24. <!-- <tki-tree ref="tkitree" :range="helpList" :rangeKey="name" confirmColor="#4e8af7" /> -->
  25. <u-toast ref="uToast" />
  26. </view>
  27. </template>
  28. <script>
  29. import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue'
  30. import tree from "@/components/tree/tree.vue"
  31. export default {
  32. name:'HelpCenter',
  33. components:{
  34. UNavbar,
  35. tree
  36. },
  37. data(){
  38. return {
  39. title:'',
  40. backtext:'',
  41. helpList:[],
  42. }
  43. },
  44. onLoad(e){
  45. uni.showLoading({
  46. title: this.$i18n.locale == 'zh'? '加载中...': 'Loading...'
  47. });
  48. this.title= this.$i18n.locale == 'zh'? '帮助中心': 'Help Center'
  49. this.backtext= this.$i18n.locale == 'zh'? '返回': 'Back'
  50. setTimeout(()=>{uni.hideLoading();},100)
  51. },
  52. created(){
  53. this.getHelpColumnTree()
  54. },
  55. onShow(){
  56. },
  57. methods:{
  58. showQuestionDetial(item){
  59. uni.navigateTo({
  60. url:'/pages/service/others/helpCenterDetial?questionId='+item.id
  61. })
  62. },
  63. showItem(item){
  64. if(item.children && item.children.length>0){
  65. uni.setStorageSync('helpItem',item.children);
  66. uni.navigateTo({
  67. url:'/pages/service/others/helpCenterList?pageTitle='+encodeURIComponent(item.name)
  68. })
  69. }else{
  70. this.$refs.uToast.show({title:'暂无数据',type:'info'})
  71. }
  72. },
  73. //获取帮助中心栏目
  74. async getHelpColumnTree(){
  75. let res = await this.$myRequest({
  76. url:'/op/helpCenterEntitys/getColumnTree',
  77. data:{language:this.$i18n.locale}
  78. })
  79. if(res.status=='200' && res.msg=="ok");
  80. this.helpList=res.data;
  81. },
  82. //路由后退一步
  83. back(){
  84. // #ifdef H5
  85. history.back()
  86. // #endif
  87. // #ifndef H5
  88. uni.navigateBack()
  89. // #endif
  90. },
  91. },
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. page {
  96. background-color: #fff;
  97. }
  98. .helpcenter{
  99. background:#fefefe;
  100. .helpList{
  101. position:absolute;
  102. height:93.2%;
  103. background:#fefefe;
  104. .item{
  105. padding:20upx;
  106. height:100upx;
  107. border-bottom:2upx solid #eee;
  108. display:flex;
  109. align-items:center;
  110. .label{
  111. flex:1
  112. }
  113. }
  114. }
  115. }
  116. </style>