Category.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view>
  3. <view class="certification-card serve-main ">
  4. <view class="serve-box flex_c_s" @click="goModifyIt">
  5. <view class="font-32-1D">{{viewStatus?'服务类目':'已选服务类目'}}</view>
  6. <view class="flex_c_r" v-if="viewStatus">
  7. <view class="font-32-05">{{ project && project.length >0 ? '去修改':'选择' }}</view>
  8. <up-icon name="arrow-right" color="#C9CDD4" size="16"></up-icon>
  9. </view>
  10. </view>
  11. <view class="hr-solid-top serve-box-contnt" v-if="project && project.length > 0">
  12. <view class="serve-item" v-for="item in project" :key="item.id">{{ item.businessName }}</view>
  13. </view>
  14. </view>
  15. <view v-for="item in project" :key="item.id" class="serve-img-boxs">
  16. <Certificate :data="item" v-if="item.isFiles"/>
  17. </view>
  18. <view class="certification-card whether-or-not flex_c_s" v-if="project && project.length > 0">
  19. <view class="font-32-1D">是否展示资质</view>
  20. <view class="radio-box flex_c_c" v-if="viewStatus">
  21. <view v-for="item in radoiList" :key="item.value" @click="racioClick(item)" class="radio-item flex_c_c">
  22. <view class="font-32-1D radio-name">{{ item.name }}</view>
  23. <view :class="formData.whether === item.value ? 'whether-radio-active' : 'whether-radio'"></view>
  24. </view>
  25. </view>
  26. <view class="radio-box flex_c_c" v-else>
  27. <view class="radio-item flex_c_c">
  28. <view class="font-32-1D radio-name">{{ project.whether === '1'?'是':'否' }}</view>
  29. <view class="whether-radio-active"></view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup>
  36. import { inject } from 'vue';
  37. import Certificate from './Certificate.vue';
  38. import { computed } from 'vue';
  39. const formData = inject('formData');
  40. // const { project } = formData;
  41. const project = computed(() => formData.project || []);
  42. console.log("TCL: project=============", project)
  43. const props=defineProps({
  44. viewStatus: {
  45. type: Boolean,
  46. default: true
  47. },
  48. })
  49. const radoiList = [
  50. {
  51. name: '是',
  52. value: '1'
  53. },
  54. {
  55. name: '否',
  56. value: '2'
  57. },
  58. ];
  59. const goModifyIt = async() => {
  60. try {
  61. uni.navigateTo({
  62. url: `/pages_home/pages/certification/Class?data=${encodeURIComponent(JSON.stringify(project.value))}`
  63. });
  64. } catch (error) {
  65. console.log("TCL: goModifyIt -> error", error)
  66. }
  67. }
  68. const racioClick = (item) => {
  69. try {
  70. Object.assign(formData, { whether: item.value });
  71. } catch (error) {
  72. console.log("TCL: racioClick -> error", error)
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. @import "./index.scss";
  78. </style>