agreement.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="input-agreement" @click="setIsConsent" :class="{'apply-shake':consentShake}">
  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. setTimeout(()=>{
  26. this.consentShake=false
  27. },500)
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss">
  33. .input-agreement{
  34. margin-top: 25rpx;
  35. display: flex;
  36. justify-content: flex-start;
  37. align-items: center;
  38. .agreement-agree{
  39. width: 32rpx;
  40. height: 32rpx;
  41. transition: .5s ease;
  42. }
  43. .agreement-text{
  44. margin-left: 18rpx;
  45. }
  46. }
  47. </style>