用工小程序前端代码
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.

117 lines
3.5 KiB

  1. <template>
  2. <view class="se-mt-10">
  3. <view class="se-m-20 se-br-20 se-bs-b se-bgc-white se-py-20 se-px-30">
  4. <view class="se-flex se-flex-ai-c se-pb-10">
  5. <view class="line-orange"></view>
  6. <view class="se-ml-10 se-fs-32 se-c-black se-fw-6">
  7. 企业信息
  8. </view>
  9. </view>
  10. <view class="se-py-10 se-pb-30">
  11. <view class="se-mt-30">
  12. <text class="se-fs-28 se-c-black se-fw5">公司名称{{companyData.employAuthenticationCompany && companyData.employAuthenticationCompany.name || companyData.workName || '暂未'}}</text>
  13. <br>
  14. <text class="se-fs-28 se-c-black se-fw5">公司地址{{companyData.employAuthenticationCompany && companyData.employAuthenticationCompany.address || companyData.workAddress || '暂未'}}</text>
  15. <br>
  16. <text class="se-fs-28 se-c-black se-fw5">所属行业{{companyData.employAuthenticationCompany && companyData.employAuthenticationCompany.industryName || '暂未'}}</text>
  17. <br>
  18. <text class="se-fs-28 se-c-black se-fw5">招聘联系人{{companyData.employAuthenticationPerson && companyData.employAuthenticationPerson.name || '暂未'}}</text>
  19. <br>
  20. <text class="se-fs-24 se-c-text-third">联系方式{{companyData.employAuthenticationPerson && companyData.employAuthenticationPerson.phone || '暂未'}}</text>
  21. <view class="se-bgc-orange se-c-white se-fs-20 se-display-ib se-px-10 se-py-5 se-br-10 se-ml-10"
  22. @click="copyText(companyData.employAuthenticationPerson && companyData.employAuthenticationPerson.phone)">
  23. 复制
  24. </view>
  25. </view>
  26. <view class="se-mt-10">
  27. <text class="se-fs-24 se-c-33">工作地址{{companyData.workAddress || '暂未'}}</text>
  28. <view class="se-bgc-orange se-c-white se-fs-20 se-display-ib se-px-10 se-py-5 se-br-10 se-ml-10"
  29. @click="copyText(companyData.workAddress)">
  30. 复制
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 联系企业按钮 -->
  35. <view class="se-px-220 se-pb-30 se-fs-20 se-flex se-flex-h-c" v-if="showContactButton">
  36. <view
  37. @click="callCompany()"
  38. class="se-mx-10 se-w-200 se-br-40 se-flex-h-c se-h-50 se-lh-50 se-ta-c se-fs-24 se-c-white se-bgc-orange">
  39. <text>联系企业</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'CompanyInfo',
  48. props: {
  49. // 企业数据
  50. companyData: {
  51. type: Object,
  52. default: () => ({})
  53. },
  54. // 是否显示联系企业按钮
  55. showContactButton: {
  56. type: Boolean,
  57. default: false
  58. }
  59. },
  60. methods: {
  61. // 复制文本
  62. copyText(text) {
  63. if (!text) {
  64. uni.showToast({
  65. title: '暂无内容可复制',
  66. icon: 'none'
  67. });
  68. return;
  69. }
  70. uni.setClipboardData({
  71. data: text,
  72. success: () => {
  73. uni.showToast({
  74. title: "复制成功",
  75. icon: "none",
  76. });
  77. },
  78. fail: (err) => {
  79. console.error("复制失败", err);
  80. },
  81. });
  82. },
  83. // 拨打企业联系人电话
  84. callCompany() {
  85. const phone = this.companyData.employAuthenticationPerson && this.companyData.employAuthenticationPerson.phone;
  86. if (phone) {
  87. uni.makePhoneCall({
  88. phoneNumber: phone,
  89. fail: (err) => {
  90. console.error('拨打电话失败', err);
  91. uni.showToast({
  92. title: '拨打电话失败',
  93. icon: 'none'
  94. });
  95. }
  96. });
  97. } else {
  98. uni.showToast({
  99. title: '企业联系人电话号码不存在',
  100. icon: 'none'
  101. });
  102. }
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .line-orange {
  109. width: 8rpx;
  110. height: 32rpx;
  111. background: #ff7a31;
  112. border-radius: 4rpx;
  113. }
  114. </style>