agreement.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="agreement-box" @touchmove.stop.prevent="moveHandle">
  3. <view class="input-agreement animate__animated" :class="{'animate__shakeX':consentShake}" @click="setIsConsent">
  4. <image class="agreement-agree" v-if="isConsent"
  5. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/login/Checked1@3x.png"
  6. mode="aspectFill"></image>
  7. <image class="agreement-agree" v-else
  8. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/login/Checked2@3x.png"
  9. mode="aspectFill"></image>
  10. <view class="agreement-text text-color-666 sys-size-24">已阅读并同意</view>
  11. <view class="agreement-text text-color-dominant sys-size-24" @click.stop="showContent(1)">《隐私政策》</view>
  12. <view class="agreement-text text-color-dominant sys-size-24" @click.stop="showContent(2)">《使用说明》</view>
  13. </view>
  14. <view>
  15. <uni-popup ref="consentObj">
  16. <view class="iPhone-padding agreement-data sys-background-fff">
  17. <image class="data-title"
  18. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/login/consent_bg.png"
  19. mode="widthFix"></image>
  20. <view class="data-content">
  21. <scroll-view class="content-box" scroll-y="true" scroll-left="120">
  22. <rich-text :nodes="content" v-if="type===1"></rich-text>
  23. <rich-text :nodes="contentLogin" v-else></rich-text>
  24. </scroll-view>
  25. </view>
  26. <view
  27. class="data-but text-color-fff sys-background-dominant sys-size-30 sys-weight-500 sys-radius-100"
  28. @click.stop="setConsent()">{{type===1?'同意':'确认'}}</view>
  29. </view>
  30. </uni-popup>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import tools from "@/service/tools";
  36. import {
  37. getMessage
  38. } from "@/api/common";
  39. export default {
  40. name: 'agreement',
  41. data() {
  42. return {
  43. isConsent: false,
  44. consentShake: false,
  45. content: '',
  46. contentLogin: '<div>1、当前小程序为大连中山万汇小额贷款有限公司(一下均使用本公司)项目管理应用</div><div>2、此应用为本公司提供项目流程进度管理及流程监管</div><div>3、使用用户为授权的本公司员工,外部人员均无访问权限</div>',
  47. type: 1
  48. };
  49. },
  50. mounted() {},
  51. methods: {
  52. setConsent() {
  53. this.isConsent = true
  54. this.$emit('input', this.isConsent)
  55. this.$refs.consentObj.close('bottom')
  56. },
  57. async getMessage() {
  58. const res = await getMessage({
  59. type: 2
  60. })
  61. if (res.code === 0) {
  62. this.content = tools.imgDeal(res.data)
  63. }
  64. },
  65. showContent(type) {
  66. this.type = type
  67. this.$refs.consentObj.open('bottom')
  68. },
  69. moveHandle() {
  70. return false
  71. },
  72. setIsConsent() {
  73. this.isConsent = !this.isConsent
  74. this.$emit('input', this.isConsent)
  75. },
  76. setConsentShake() {
  77. this.consentShake = true
  78. console.log('consentShake:' + this.consentShake)
  79. setTimeout(() => {
  80. this.consentShake = false
  81. }, 500)
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. .agreement-box {
  88. margin-top: 25rpx;
  89. height: 32rpx;
  90. .input-agreement {
  91. display: flex;
  92. justify-content: flex-start;
  93. align-items: center;
  94. .agreement-agree {
  95. width: 32rpx;
  96. height: 32rpx;
  97. transition: .5s ease;
  98. }
  99. .agreement-text {
  100. margin-left: 18rpx;
  101. }
  102. }
  103. .agreement-data {
  104. border-radius: 30rpx 30rpx 0 0;
  105. .data-title {
  106. width: 100%;
  107. border-radius: 30rpx 30rpx 0 0;
  108. }
  109. .data-content {
  110. padding: 20rpx 40rpx;
  111. .content-box {
  112. height: 600rpx;
  113. }
  114. }
  115. .data-but {
  116. height: 96rpx;
  117. line-height: 96rpx;
  118. text-align: center;
  119. margin: 0 75rpx;
  120. }
  121. }
  122. }
  123. </style>