agreeVip.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <!-- 用户协议勾选 -->
  3. <view class="agree-row mt30">
  4. <u-checkbox
  5. :customStyle="{marginBottom: '8px'}"
  6. label="请阅读并同意"
  7. name="agree"
  8. usedAlone
  9. v-model:checked="aloneChecked"
  10. labelSize="12"
  11. @change="checkboxChange"
  12. >
  13. </u-checkbox>
  14. <text class="agree-text">
  15. <text class="protocol-link" @click="openProtocol()">《VIP会员开通协议》</text>
  16. </text>
  17. </view>
  18. </template>
  19. <script setup>
  20. import { ref } from 'vue';
  21. import { useToast } from "@/hooks/useToast";
  22. const { Toast } = useToast();
  23. const emit = defineEmits(['setAloneChecked']);
  24. // 协议勾选状态
  25. const aloneChecked = ref(false);
  26. function checkboxChange(e){
  27. emit('setAloneChecked', e);
  28. }
  29. // 模拟打开协议逻辑(实际可跳转 webview 或弹窗展示)
  30. const openProtocol = (type) => {
  31. uni.navigateTo({
  32. url: '/pages/policy/vip_policy'
  33. });
  34. };
  35. </script>
  36. <style scoped lang="scss">
  37. /* 协议勾选行 */
  38. .agree-row {
  39. display: flex;
  40. align-items: center;
  41. margin-bottom: 40rpx;
  42. width: 100%;
  43. box-sizing: border-box;
  44. }
  45. .agree-checkbox {
  46. transform: scale(0.8);
  47. margin-right: 10rpx;
  48. }
  49. .agree-text {
  50. font-size: 24rpx;
  51. color: #666;
  52. line-height: 36rpx;
  53. }
  54. .protocol-link {
  55. color: $theme-color;
  56. /* text-decoration: underline; */
  57. }
  58. </style>