You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

popup-choose-numberplate-color.vue 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!-- 选择车牌颜色弹窗 -->
  2. <template>
  3. <view class="main">
  4. <view class="title">车牌颜色</view>
  5. <view class="center">
  6. <numberplate-color @numberplateResult="checkNumberplateColor" :numberplateCor="numberplateCor"></numberplate-color>
  7. </view>
  8. </view>
  9. <view class="btn">
  10. <submit-button title="确定" @submit="submit"></submit-button>
  11. </view>
  12. </template>
  13. <script setup lang="ts">
  14. import { reactive } from "vue";
  15. import { msg } from "@/utils/utils";
  16. import numberplateColor from "./layout-numberplate-color";
  17. const emit = defineEmits(['numberplateResult'])
  18. const props = defineProps({
  19. //当前选择的车牌
  20. numberplateCor:{
  21. type:Object,
  22. default:()=>{return {id:-1}}
  23. }
  24. })
  25. const state = reactive({
  26. colorItem:props.numberplateCor,
  27. })
  28. const checkNumberplateColor = (item) => {
  29. state.colorItem = item;
  30. }
  31. const submit = () => {
  32. if(state.colorItem.id === -1){
  33. msg('请选择车牌颜色!');
  34. return;
  35. }
  36. emit('numberplateResult',state.colorItem);
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .main{
  41. padding: 30rpx 40rpx 0rpx;
  42. background-color: white;
  43. .title{
  44. font-size: 32rpx;
  45. color: #000000;
  46. text-align: center;
  47. margin-bottom: 60rpx;
  48. }
  49. .center{
  50. margin-left: 70rpx;
  51. }
  52. }
  53. .btn{
  54. margin: 30rpx 40rpx 20px;
  55. }
  56. </style>