agreement.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/login/Checked1@3x.png" mode="aspectFill"></image>
  5. <image class="agreement-agree" v-else src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/login/Checked2@3x.png" mode="aspectFill"></image>
  6. <view class="agreement-text text-color-666 sys-size-24">已阅读并同意</view>
  7. <view class="agreement-text text-color-dominant sys-size-24" @click.stop="showContent">《隐私政策》</view>
  8. </view>
  9. <view >
  10. <uni-popup ref="consentObj">
  11. <view class="iPhone-padding agreement-data sys-background-fff">
  12. <image class="data-title" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/login/consent_bg.png" mode="widthFix"></image>
  13. <view class="data-content">
  14. <scroll-view class="content-box" scroll-y="true" scroll-left="120">
  15. <rich-text :nodes="content"></rich-text>
  16. </scroll-view>
  17. </view>
  18. <view class="data-but text-color-fff sys-background-dominant sys-size-30 sys-weight-500 sys-radius-100" @click.stop="setConsent()">同意</view>
  19. </view>
  20. </uni-popup>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import tools from "@/service/tools";
  26. import {getMessage} from "@/api/common";
  27. export default {
  28. name:'agreement',
  29. data() {
  30. return {
  31. isConsent:false,
  32. consentShake:false,
  33. content:''
  34. };
  35. },
  36. mounted() {
  37. this.getMessage()
  38. },
  39. methods:{
  40. setConsent(){
  41. this.isConsent=true
  42. this.$emit('input', this.isConsent)
  43. this.$refs.consentObj.close('bottom')
  44. },
  45. async getMessage() {
  46. const res = await getMessage({
  47. type: 2
  48. })
  49. if (res.code === 1) {
  50. this.content = tools.imgDeal(res.data)
  51. }
  52. },
  53. showContent(){
  54. this.$refs.consentObj.open('bottom')
  55. },
  56. moveHandle() {
  57. console.log('--------------------------------hhhhhhhhhhhhhh')
  58. return false
  59. },
  60. setIsConsent(){
  61. this.isConsent=!this.isConsent
  62. this.$emit('input', this.isConsent)
  63. },
  64. setConsentShake(){
  65. this.consentShake=true
  66. console.log('consentShake:'+this.consentShake)
  67. setTimeout(()=>{
  68. this.consentShake=false
  69. },500)
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. .agreement-box{
  76. margin-top: 25rpx;
  77. height: 32rpx;
  78. .input-agreement{
  79. display: flex;
  80. justify-content: flex-start;
  81. align-items: center;
  82. .agreement-agree{
  83. width: 32rpx;
  84. height: 32rpx;
  85. transition: .5s ease;
  86. }
  87. .agreement-text{
  88. margin-left: 18rpx;
  89. }
  90. }
  91. .agreement-data{
  92. border-radius: 30rpx 30rpx 0 0;
  93. .data-title{
  94. width: 100%;
  95. border-radius: 30rpx 30rpx 0 0;
  96. }
  97. .data-content{
  98. padding: 20rpx 40rpx;
  99. .content-box{
  100. height: 600rpx;
  101. }
  102. }
  103. .data-but{
  104. height: 96rpx;
  105. line-height: 96rpx;
  106. text-align: center;
  107. margin: 0 75rpx;
  108. }
  109. }
  110. }
  111. </style>