agreement.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view>
  3. <view style="color: #fff;">
  4. <tn-nav-bar :bottomShadow="false" backgroundColor="#26B3A0">{{title}}</tn-nav-bar>
  5. <view :style="{height: tobheight+'px'}"></view>
  6. </view>
  7. <view class="gy">
  8. <u-parse :content="content"></u-parse>
  9. </view>
  10. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  11. </view>
  12. </template>
  13. <script>
  14. import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
  15. export default {
  16. data() {
  17. return {
  18. content:'',
  19. type:'',
  20. title:'',
  21. tobheight:45,
  22. platform: this.$platform.get(),
  23. isLoading:true
  24. }
  25. },
  26. computed: {
  27. ...mapGetters(['appInfo'])
  28. },
  29. onLoad(e) {
  30. if(e&&e.type){
  31. this.type = e.type
  32. this.title=e.type == 'privacy'?'隐私政策':e.type == 'aboutus'?'关于我们':'使用协议'
  33. if(this.platform == 'wxMiniProgram'){
  34. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
  35. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
  36. this.tobheight = (menumtop+paddingtop+uni.getMenuButtonBoundingClientRect().height)
  37. }
  38. this.privacyabout()
  39. }
  40. },
  41. methods: {
  42. privacyabout(){
  43. this.$http('conf.getGroupConf',{group:'system.agreement'}).then(res => {
  44. if(res.code == 0){
  45. uni.setNavigationBarTitle({
  46. title: this.appInfo.site_name
  47. })
  48. this.content = this.type == 'privacy'?res.data.privacy:this.type == 'aboutus'?res.data.aboutus:res.data.use
  49. this.isLoading = false
  50. }
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss">
  57. .gy{
  58. margin: 30rpx;
  59. }
  60. </style>