loginAgreement.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="data-agreement">
  3. <image class="agreement-img" @click="setIsCheck" :src="'/static/img/login/check-'+(isCheck?'ok':(type===1?'no':'no-white'))+'.png'" mode="aspectFill"></image>
  4. <view class="agreement-text" @click="setIsCheck">
  5. <text class="text-item sys-size-24" :class="{'sys-color-white':type===1,'sys-color-gray-9':type!==1}">我已阅读并同意</text>
  6. </view>
  7. <view class="agreement-text ">
  8. <text class="text-item sys-size-24 sys-color-green">《用户协议》</text>
  9. </view>
  10. <view class="agreement-text ">
  11. <text class="text-item sys-size-24 " :class="{'sys-color-white':type===1,'sys-color-gray-9':type!==1}">和</text>
  12. </view>
  13. <view class="agreement-text ">
  14. <text class="text-item sys-size-24 sys-color-green">《隐私政策》</text>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "loginAgreement",
  21. components: {},
  22. props: {
  23. type:{
  24. type: Number,
  25. default:1
  26. },
  27. value:{
  28. default: false
  29. }
  30. },
  31. data() {
  32. return {
  33. isCheck:false,
  34. }
  35. },
  36. watch: {
  37. 'value':function (){
  38. if(this.isCheck!==this.value){
  39. this.isCheck=this.value
  40. }
  41. }
  42. },
  43. mounted() {
  44. this.isCheck=this.value
  45. },
  46. methods: {
  47. setIsCheck(){
  48. this.isCheck=!this.isCheck
  49. this.$emit('input',this.isCheck)
  50. }
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .data-agreement{
  56. display: flex;
  57. flex-direction:row;
  58. justify-content: flex-start;
  59. align-items: center;
  60. }
  61. .agreement-img{
  62. width: 24rpx;
  63. height: 24rpx;
  64. border-radius: 4rpx;
  65. margin-right: 6rpx;
  66. /*border: 2rpx solid #FFFFFF;*/
  67. }
  68. .agreement-text{
  69. line-height: 24rpx;
  70. margin-left: 6rpx;
  71. }
  72. </style>