Category.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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" v-if="project && project.length >0"></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 props=defineProps({
  42. viewStatus: {
  43. type: Boolean,
  44. default: true
  45. },
  46. })
  47. const radoiList = [
  48. {
  49. name: '是',
  50. value: '1'
  51. },
  52. {
  53. name: '否',
  54. value: '2'
  55. },
  56. ];
  57. const goModifyIt = async() => {
  58. try {
  59. console.log("TCL: formData", project)
  60. uni.navigateTo({
  61. url: `/pages_home/pages/certification/Class?data=${encodeURIComponent(JSON.stringify(project))}`
  62. });
  63. } catch (error) {
  64. console.log("TCL: goModifyIt -> error", error)
  65. }
  66. }
  67. const racioClick = (item) => {
  68. try {
  69. Object.assign(formData, { whether: item.value });
  70. } catch (error) {
  71. console.log("TCL: racioClick -> error", error)
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. @import "./index.scss";
  77. </style>