agreement.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="input-agreement animate__animated" :class="{'animate__shakeX':consentShake}" @click="setIsConsent" >
  3. <image class="agreement-agree" v-if="isConsent" src="/static/img/login/Checked1@3x.png" mode="aspectFill"></image>
  4. <image class="agreement-agree" v-else src="/static/img/login/Checked2@3x.png" mode="aspectFill"></image>
  5. <view class="agreement-text text-color-666 sys-size-24">已阅读并同意</view>
  6. <view class="agreement-text text-color-dominant sys-size-24">《隐私政策》</view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name:'agreement',
  12. data() {
  13. return {
  14. isConsent:false,
  15. consentShake:false
  16. };
  17. },
  18. methods:{
  19. setIsConsent(){
  20. this.isConsent=!this.isConsent
  21. this.$emit('input', this.isConsent)
  22. },
  23. setConsentShake(){
  24. this.consentShake=true
  25. console.log('consentShake:'+this.consentShake)
  26. setTimeout(()=>{
  27. this.consentShake=false
  28. },500)
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. .input-agreement{
  35. margin-top: 25rpx;
  36. display: flex;
  37. justify-content: flex-start;
  38. align-items: center;
  39. .agreement-agree{
  40. width: 32rpx;
  41. height: 32rpx;
  42. transition: .5s ease;
  43. }
  44. .agreement-text{
  45. margin-left: 18rpx;
  46. }
  47. }
  48. </style>