agreement.vue 3.7 KB

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