金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
1.7 KiB

  1. <template>
  2. <div class="agreement_index">
  3. <div class="item mx-1px-bottom" @tap="chageAgreement('privite')">
  4. <div class="txt">
  5. 隐私协议
  6. </div>
  7. <div class="rigth iconfont icon--xiangyoujiantou">
  8. </div>
  9. </div>
  10. <div class="item" @tap="chageAgreement('serve')">
  11. <div class="txt">
  12. 服务协议
  13. </div>
  14. <div class="rigth iconfont icon--xiangyoujiantou">
  15. </div>
  16. </div>
  17. <view class="mask" v-if="showAgreement">
  18. </view>
  19. <view class="greement-box" v-if="showAgreement">
  20. <view class="title mx-1px-bottom">
  21. {{message}}
  22. </view>
  23. <view class="content">
  24. <u-parse :content="contents" />
  25. </view>
  26. <view class="btn mx-1px-top" @tap="chageAgreement">
  27. 确定
  28. </view>
  29. </view>
  30. </div>
  31. </template>
  32. <script>
  33. import {
  34. pageLogin,
  35. getUrl,
  36. config,
  37. is
  38. } from '@/common/js/utils.js';
  39. import uParse from '@/components/gaoyia-parse/parse.vue';
  40. export default{
  41. components: {
  42. uParse
  43. },
  44. data() {
  45. return{
  46. showAgreement:false,
  47. message:'隐私协议',
  48. contents:''
  49. }
  50. },
  51. onLoad(){
  52. this.getGreementInfo();
  53. },
  54. methods:{
  55. chageAgreement(type) {
  56. if(type == 'privite'){
  57. this.message = '隐私协议';
  58. this.contents = this.agreement.privacy_agreement
  59. } else{
  60. this.message = '服务协议';
  61. this.contents = this.agreement.service_agreement
  62. }
  63. this.showAgreement = !this.showAgreement
  64. },
  65. // 获取用户协议
  66. getGreementInfo() {
  67. this.$http.get({
  68. api: 'api/user/agreement'
  69. }).then(res => {
  70. res = res.data;
  71. if (res.status) {
  72. this.agreement = res.data;
  73. }
  74. });
  75. },
  76. }
  77. }
  78. </script>
  79. <style rel="stylesheet/less" lang="less">
  80. @import "agreement";
  81. </style>