helpCenterDetial.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="helpcenterDetial">
  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. <view class="helpDetial" v-if="detial.title">
  18. <view class="pageTitle" >{{detial.title}}</view>
  19. <rich-text :nodes="detial.contentHtml"></rich-text>
  20. </view>
  21. <u-toast ref="uToast" />
  22. </view>
  23. </template>
  24. <script>
  25. import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue'
  26. import {getHelpColumnContent} from '@/api/operation/help/helpCenterEntity'
  27. export default {
  28. name:'HelpCenter',
  29. components:{
  30. UNavbar
  31. },
  32. data(){
  33. return {
  34. backtext:'',
  35. questId:'',
  36. title:'',
  37. pageNo:1,
  38. pageSize:10,
  39. totalPage:0,
  40. detial:{},
  41. }
  42. },
  43. onShow:function(){
  44. this.getDetial();
  45. },
  46. onLoad(e){
  47. this.questId=e.questionId;
  48. uni.showLoading({title: this.$i18n.locale == 'zh'? '加载中...': 'Loading...'})
  49. this.title= this.$i18n.locale == 'zh'? '帮助详情': 'Help Center'
  50. this.backtext= this.$i18n.locale == 'zh'? '返回': 'Back'
  51. setTimeout(()=>{uni.hideLoading();},100)
  52. },
  53. onUnload(e){
  54. uni.removeStorageSync('questionItem')
  55. },
  56. methods:{
  57. async getDetial(){
  58. let params = {
  59. pageNo:this.pageNo,
  60. pageSize:this.pageSize,
  61. businessType:'help_center',
  62. businessId:this.questId,
  63. language:this.$i18n.locale.toLocaleUpperCase()
  64. }
  65. let res = await this.$myRequest({
  66. url:'/cms/cmsInformationViews/',
  67. data:params
  68. })
  69. if(res.data.cmsInformationViews){
  70. this.detial=res.data.cmsInformationViews[0];
  71. this.totalPage=parseInt(res.data.page.totalPage)
  72. }else{
  73. let msg = this.$i18n.locale == 'zh'? '暂无详情': 'No Help info'
  74. this.$refs.uToast.show({title:msg,type:'info'})
  75. }
  76. },
  77. //路由后退一步
  78. back(){
  79. // #ifdef H5
  80. history.back()
  81. // #endif
  82. // #ifndef H5
  83. uni.navigateBack()
  84. // #endif
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .helpcenterDetial{
  91. background:#fefefe;
  92. .pageTitle{
  93. height:60rpx;
  94. line-height:60rpx;
  95. font-weight:bold;
  96. text-align:center;
  97. margin-bottom:60rpx;
  98. color:#1777FE;
  99. }
  100. .helpDetial{
  101. position:absolute;
  102. width:92%;
  103. padding:5%;
  104. border-radius:20rpx;
  105. background:#fff;
  106. left:0;
  107. right:0;
  108. margin:60upx auto;
  109. .contentHtml{
  110. .questitle{
  111. text-align:center;
  112. color:#666;
  113. line-height:50rpx;
  114. }
  115. }
  116. }
  117. }
  118. </style>