companyImg.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="company">
  3. <nav-bar title="公司认证" color="#000"></nav-bar>
  4. <view class="company-content">
  5. <view class="company-title">上传公司营业执照</view>
  6. <view class="company-desc">请上传“{{companyName}}”的营业执照</view>
  7. <view class="company-btn">修改公司</view>
  8. <view class="upload-img">
  9. <u-upload :action="action" :max-size="5 * 1024 * 1024" max-count="1" class="upload" ref="uUpload" width="452" height="322"></u-upload>
  10. </view>
  11. <view class="warning-title">注意事项</view>
  12. <view class="warning-desc">1.拍摄与所填公司一致的营业执照上传</view>
  13. <view class="warning-desc">2.最新下发的营业执照</view>
  14. <view class="warning-desc">3.营业执照信息和公章清晰可辨</view>
  15. </view>
  16. <view class="bottom-btn" @click="goUnderReview">确认并提交</view>
  17. </view>
  18. </template>
  19. <script>
  20. import navBar from "@/components/nav-bar/index.vue";
  21. import configdata from '../../common/config.js'
  22. export default {
  23. data() {
  24. return {
  25. address: "",
  26. addressDetail: "",
  27. companyName:"",
  28. companyId:"",
  29. action:configdata.APIHOST1 + '/alioss/upload',
  30. lists: []
  31. };
  32. },
  33. components: {
  34. navBar,
  35. },
  36. onLoad(options) {
  37. // 接收上个页面传递的公司名称参数
  38. if (options.companyName) {
  39. this.companyName = decodeURIComponent(options.companyName);
  40. console.log('接收的公司名称:', this.companyName);
  41. }
  42. if (options.companyId) {
  43. this.companyId = options.companyId;
  44. console.log('接收的公司ID:', this.companyId);
  45. }
  46. },
  47. onReady() {
  48. // 得到整个组件对象,内部图片列表变量为"lists"
  49. this.lists = this.$refs.uUpload.lists;
  50. },
  51. methods: {
  52. goUnderReview(){
  53. console.log(this.lists[0].response.data)
  54. var url=this.lists[0].response.data
  55. const data = {
  56. companyCertification: url, //logo
  57. companyId:(this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId, //ID
  58. };
  59. // 调用接口提交
  60. uni.showLoading({
  61. title: "提交中..."
  62. });
  63. this.$Request.postJson("/app/company/updateCompany", data)
  64. .then((res) => {
  65. uni.hideLoading();
  66. if (res.code === 0) {
  67. uni.showToast({
  68. title: "提交成功",
  69. icon: "success"
  70. });
  71. uni.navigateTo({ url: '/package/jobIntention/underReview' })
  72. } else {
  73. uni.showToast({
  74. title: res.msg || "提交失败",
  75. icon: "none"
  76. });
  77. }
  78. })
  79. .catch((err) => {
  80. uni.hideLoading();
  81. console.error("提交失败:", err);
  82. uni.showToast({
  83. title: "网络异常",
  84. icon: "none"
  85. });
  86. });
  87. }
  88. },
  89. };
  90. </script>
  91. <style scoped lang="scss">
  92. .company {
  93. position: absolute;
  94. left: 0;
  95. right: 0;
  96. top: 0;
  97. bottom: 0;
  98. display: flex;
  99. flex-direction: column;
  100. font-family: DM Sans;
  101. .company-content {
  102. flex: 1;
  103. padding: 40rpx;
  104. box-sizing: border-box;
  105. overflow: hidden;
  106. overflow-y: auto;
  107. .company-title {
  108. color: #333;
  109. font-size: 40rpx;
  110. font-weight: 600;
  111. margin-bottom: 20rpx;
  112. }
  113. .company-desc {
  114. color: rgba(102, 102, 102, 1);
  115. font-family: DM Sans;
  116. font-size: 24rpx;
  117. font-weight: 400;
  118. line-height: 32rpx;
  119. }
  120. .company-btn {
  121. color: #016bf6;
  122. font-family: DM Sans;
  123. font-size: 24rpx;
  124. font-weight: 400;
  125. line-height: 32rpx;
  126. margin-top: 20rpx;
  127. }
  128. .upload-img {
  129. width: 100%;
  130. height: 388rpx;
  131. background: #fce9dc;
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. margin-top: 20rpx;
  136. }
  137. .warning-title {
  138. color: #1f2c37;
  139. font-family: DM Sans;
  140. font-size: 28rpx;
  141. font-weight: 500;
  142. margin-top: 20rpx;
  143. }
  144. .warning-desc {
  145. color: #666666;
  146. font-family: DM Sans;
  147. font-size: 24rpx;
  148. font-weight: 400;
  149. margin-top: 20rpx;
  150. }
  151. }
  152. .bottom-btn {
  153. border-radius: 999px;
  154. background: #016bf6;
  155. flex-shrink: 0;
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. color: rgba(255, 255, 255, 1);
  160. font-family: DM Sans;
  161. font-size: 32rpx;
  162. font-weight: 400;
  163. padding: 16rpx 32rpx;
  164. box-sizing: border-box;
  165. margin: 20rpx;
  166. margin-bottom: 110rpx;
  167. }
  168. }
  169. </style>