Specifications.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view>
  3. <view v-for="(item, index) in formList" :key="index">
  4. <view class="flex_c_s">
  5. <view class="flex_c_l certification-title">
  6. <text class="text-red" v-if="viewStatus">*</text>请填写规格信息({{index + 1}}/5)
  7. </view>
  8. <view @click="clickMenu" class="flex_c_l" v-if="index === 0 && viewStatus">
  9. <view :class="[status ? 'icon-complete' : 'icon-manage']"></view>
  10. <view :class="[status ? 'complete-font' : 'manage-font']">{{ status ? '完成' : '管理' }}</view>
  11. </view>
  12. <view @click="clickDelete(index)" class="flex_c_l" v-if="index !== 0 && status ">
  13. <view class="icon-delete"></view>
  14. <view class="manage-font">删除</view>
  15. </view>
  16. </view>
  17. <Form :form="item"></Form>
  18. </view>
  19. <view class="footer-add flex_c_c" @click="addForm" v-if="status && (formList.length < 5)">
  20. <view class="icon-add"></view>
  21. <view class="manage-font">添加</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script setup>
  26. import { computed, ref } from 'vue';
  27. import { provide, inject } from 'vue'
  28. import Form from './Form.vue';
  29. const formData = inject('formData');
  30. const viewStatus = inject('viewStatus');
  31. const status = ref(false);//true:完成 false:管理
  32. const formList = computed(() => {
  33. return formData.volunteerServiceSpecList ;
  34. });
  35. const clickMenu = () => {
  36. status.value = !status.value;
  37. }
  38. const addForm = () => {
  39. formData.volunteerServiceSpecList.push({});
  40. }
  41. const clickDelete = (index) => {
  42. formData.volunteerServiceSpecList.splice(index, 1);
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. @import "./index.scss";
  47. .complete-font {
  48. font-family: 思源黑体;
  49. font-size: 30rpx;
  50. font-weight: 500;
  51. line-height: 30rpx;
  52. text-align: right;
  53. letter-spacing: normal;
  54. color: #FA5700;
  55. }
  56. .manage-font {
  57. font-family: Source Han Sans;
  58. font-size: 30rpx;
  59. font-weight: normal;
  60. line-height: 30rpx;
  61. text-align: right;
  62. letter-spacing: normal;
  63. color: rgba(19, 15, 38, 0.5);
  64. }
  65. .footer-add {
  66. padding: 30rpx 0;
  67. }
  68. </style>
  69. <style>
  70. .form-input {
  71. font-family: PingFang SC;
  72. font-size: 32rpx;
  73. line-height: 44rpx;
  74. color: #130F26;
  75. width: 100% !important;
  76. }
  77. .form-placeholder {
  78. color: #C9CDD4;
  79. }
  80. .skillDescribe-conten {
  81. padding: 32rpx;
  82. }
  83. </style>