<template>
  <Cupopup mode="bottom" v-model:visible="ruleShow" title="请阅读并同意以下条款" @cancel="handleClick('cancel')"
           @confirm="handleClick('confirm')">
    <view @click="ruleClick">
      登录即代表同意《用户协议》、《隐私政策》 登录即代表同意《用户协议》、《隐私政策》及《第三方SDK类服务商说明》
    </view>
  </Cupopup>
</template>

<script setup>
import Cupopup from "@/components/CuPopup/index.vue";
import {ref, watch, watchEffect} from "vue";

const props = defineProps({
  visible: {
    type: Boolean,
    default: false,
  }
})

const ruleShow = ref(props.visible)
const emit = defineEmits(['update:visible', 'onClick','ruleClick'])
const handleClick = (e) => {
  emit('onClick', e)
}

const ruleClick = () => {
  emit('ruleClick')
}

watchEffect(() => {
  ruleShow.value = props.visible
})

watch(() => ruleShow.value, (val) => {
  emit('update:visible', val)
})
</script>

<style scoped lang="scss">

</style>