wupengfei
2025-02-17 7ab49073679e738a11c33d0b094fe7308e83fd51
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<template>
  <div class="policy-wrapper">
    <nut-radio-group v-model="innerModelValue">
      <BlRadio :label="true">
        <div class="policy-content">
          {{ props.policyBtnText }}
          <div class="policy-content-btn" @click.stop="goPolicy">《用户协议和隐私政策》</div>
        </div>
      </BlRadio>
    </nut-radio-group>
  </div>
</template>
 
<script setup lang="ts">
import { Radio as BlRadio } from '@12333/components';
import Taro from '@tarojs/taro';
 
defineOptions({
  name: 'Policy',
});
 
const props = defineProps<{
  modelValue: boolean;
  policyBtnText?: string;
}>();
 
const emit = defineEmits<{
  (e: 'update:modelValue', value: boolean): void;
}>();
 
const innerModelValue = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emit('update:modelValue', val);
  },
});
 
function goPolicy() {
  Taro.navigateTo({
    url: RouterPath.userPolicy,
  });
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.policy-wrapper {
  text-align: center;
  padding: 0 64px;
 
  .nut-radio-group {
    vertical-align: middle;
 
    .nutui-iconfont {
      font-size: 12px;
      height: 16px !important;
      width: 16px !important;
    }
 
    .bl-radio {
      align-items: flex-start;
    }
 
    .nut-radio__icon--unchecked {
      color: boleGetCssVar('text-color', 'secondary');
    }
  }
 
  .nut-radio__label {
    margin-left: 2px;
  }
 
  .policy-content {
    font-size: 24px;
    color: boleGetCssVar('text-color', 'secondary');
    line-height: 30px;
    text-align: left;
    word-break: break-all;
 
    .policy-content-btn {
      color: boleGetCssVar('color', 'primary');
      display: inline;
    }
  }
}
</style>