loginAgreement.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. mounted() {
  38. this.isCheck=this.value
  39. },
  40. methods: {
  41. setIsCheck(){
  42. this.isCheck=!this.isCheck
  43. this.$emit('input',this.isCheck)
  44. }
  45. }
  46. }
  47. </script>
  48. <style scoped lang="scss">
  49. .data-agreement{
  50. display: flex;
  51. flex-direction:row;
  52. justify-content: flex-start;
  53. align-items: center;
  54. }
  55. .agreement-img{
  56. width: 24rpx;
  57. height: 24rpx;
  58. border-radius: 4rpx;
  59. margin-right: 6rpx;
  60. /*border: 2rpx solid #FFFFFF;*/
  61. }
  62. .agreement-text{
  63. line-height: 24rpx;
  64. margin-left: 6rpx;
  65. }
  66. </style>