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.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!-- 选择车牌颜色弹窗 -->
  2. <template>
  3. <view class="main">
  4. <view class="title">车牌颜色</view>
  5. <view class="center">
  6. <numberplate-color @numberplateResult="checkNumberplateColor" :numberplateCor="numberplateCor" :numberplate="numberplate"></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. numberplate:{
  26. type:String,
  27. default:'贵A12345'
  28. },
  29. })
  30. const state = reactive({
  31. colorItem:props.numberplateCor,
  32. })
  33. const checkNumberplateColor = (item) => {
  34. state.colorItem = item;
  35. }
  36. const submit = () => {
  37. if(state.colorItem.id === -1){
  38. msg('请选择车牌颜色!');
  39. return;
  40. }
  41. emit('numberplateResult',state.colorItem);
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .main{
  46. padding: 30rpx 40rpx 0rpx;
  47. background-color: white;
  48. .title{
  49. font-size: 32rpx;
  50. color: #000000;
  51. text-align: center;
  52. margin-bottom: 60rpx;
  53. }
  54. .center{
  55. margin-left: 70rpx;
  56. }
  57. }
  58. .btn{
  59. margin: 30rpx 40rpx 20px;
  60. }
  61. </style>