|
@@ -1,177 +1,227 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="company">
|
|
|
|
|
- <nav-bar title="公司认证" color="#000"></nav-bar>
|
|
|
|
|
- <view class="company-content">
|
|
|
|
|
- <view class="company-title">上传公司营业执照</view>
|
|
|
|
|
- <view class="company-desc">请上传“{{companyName}}”的营业执照</view>
|
|
|
|
|
- <view class="company-btn">修改公司</view>
|
|
|
|
|
- <view class="upload-img">
|
|
|
|
|
- <u-upload :action="action" :max-size="5 * 1024 * 1024" max-count="1" class="upload" ref="uUpload" width="452" height="322"></u-upload>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="warning-title">注意事项</view>
|
|
|
|
|
- <view class="warning-desc">1.拍摄与所填公司一致的营业执照上传</view>
|
|
|
|
|
- <view class="warning-desc">2.最新下发的营业执照</view>
|
|
|
|
|
- <view class="warning-desc">3.营业执照信息和公章清晰可辨</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="bottom-btn" @click="goUnderReview">确认并提交</view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="company">
|
|
|
|
|
+ <nav-bar title="公司认证" color="#000"></nav-bar>
|
|
|
|
|
+ <view class="company-content">
|
|
|
|
|
+ <view class="company-title">上传公司营业执照</view>
|
|
|
|
|
+ <view class="company-desc">请上传“{{companyName}}”的营业执照</view>
|
|
|
|
|
+ <view class="company-btn">修改公司</view>
|
|
|
|
|
+ <view class="upload-img">
|
|
|
|
|
+ <u-upload :action="action" :max-size="5 * 1024 * 1024" max-count="1" class="upload" ref="uUpload"
|
|
|
|
|
+ width="452" height="322" :before-upload="handleBeforeUpload"></u-upload>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="warning-title">注意事项</view>
|
|
|
|
|
+ <view class="warning-desc">1.拍摄与所填公司一致的营业执照上传</view>
|
|
|
|
|
+ <view class="warning-desc">2.最新下发的营业执照</view>
|
|
|
|
|
+ <view class="warning-desc">3.营业执照信息和公章清晰可辨</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="bottom-btn" @click="goUnderReview">确认并提交</view>
|
|
|
|
|
+ </view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import navBar from "@/components/nav-bar/index.vue";
|
|
|
|
|
-import configdata from '../../common/config.js'
|
|
|
|
|
-export default {
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- address: "",
|
|
|
|
|
- addressDetail: "",
|
|
|
|
|
- companyName:"",
|
|
|
|
|
- companyId:"",
|
|
|
|
|
- action:configdata.APIHOST1 + '/alioss/upload',
|
|
|
|
|
- lists: []
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- components: {
|
|
|
|
|
- navBar,
|
|
|
|
|
- },
|
|
|
|
|
- onLoad(options) {
|
|
|
|
|
- // 接收上个页面传递的公司名称参数
|
|
|
|
|
- if (options.companyName) {
|
|
|
|
|
-
|
|
|
|
|
- this.companyName = decodeURIComponent(options.companyName);
|
|
|
|
|
- console.log('接收的公司名称:', this.companyName);
|
|
|
|
|
- }
|
|
|
|
|
- if (options.companyId) {
|
|
|
|
|
- this.companyId = options.companyId;
|
|
|
|
|
- console.log('接收的公司ID:', this.companyId);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- onReady() {
|
|
|
|
|
- // 得到整个组件对象,内部图片列表变量为"lists"
|
|
|
|
|
- this.lists = this.$refs.uUpload.lists;
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- goUnderReview(){
|
|
|
|
|
- console.log(this.lists[0].response.data)
|
|
|
|
|
- var url=this.lists[0].response.data
|
|
|
|
|
- const data = {
|
|
|
|
|
- companyCertification: url, //logo
|
|
|
|
|
- companyId:(this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId, //ID
|
|
|
|
|
- };
|
|
|
|
|
- // 调用接口提交
|
|
|
|
|
- uni.showLoading({
|
|
|
|
|
- title: "提交中..."
|
|
|
|
|
- });
|
|
|
|
|
- this.$Request.postJson("/app/company/updateCompany", data)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
|
|
+ import navBar from "@/components/nav-bar/index.vue";
|
|
|
|
|
+ import configdata from '../../common/config.js'
|
|
|
|
|
+ import heic2any from "@/common/heic2any.min.js";
|
|
|
|
|
+ export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ address: "",
|
|
|
|
|
+ addressDetail: "",
|
|
|
|
|
+ companyName: "",
|
|
|
|
|
+ companyId: "",
|
|
|
|
|
+ action: configdata.APIHOST1 + '/alioss/upload',
|
|
|
|
|
+ lists: []
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ components: {
|
|
|
|
|
+ navBar,
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
|
+ // 接收上个页面传递的公司名称参数
|
|
|
|
|
+ if (options.companyName) {
|
|
|
|
|
+
|
|
|
|
|
+ this.companyName = decodeURIComponent(options.companyName);
|
|
|
|
|
+ console.log('接收的公司名称:', this.companyName);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (options.companyId) {
|
|
|
|
|
+ this.companyId = options.companyId;
|
|
|
|
|
+ console.log('接收的公司ID:', this.companyId);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onReady() {
|
|
|
|
|
+ // 得到整个组件对象,内部图片列表变量为"lists"
|
|
|
|
|
+ this.lists = this.$refs.uUpload.lists;
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ // 上传前处理(HEIC 转 JPG)
|
|
|
|
|
+ async handleBeforeUpload(file) {
|
|
|
|
|
+ // 检查是否是 HEIC 文件
|
|
|
|
|
+ const isHeic = file.name.toLowerCase().endsWith('.heic') || file.type === 'image/heic';
|
|
|
|
|
+ if (!isHeic) {
|
|
|
|
|
+ return true; // 非 HEIC 图片直接上传
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: '正在转换HEIC图片...'
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 使用 heic2any 转换
|
|
|
|
|
+ const blob = await heic2any({
|
|
|
|
|
+ blob: file,
|
|
|
|
|
+ toType: 'image/jpeg',
|
|
|
|
|
+ quality: 0.9,
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 把 Blob 转为新的 File 对象
|
|
|
|
|
+ const newFile = new File([blob], file.name.replace(/\.heic$/i, '.jpg'), {
|
|
|
|
|
+ type: 'image/jpeg',
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ uni.hideLoading();
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: "提交成功",
|
|
|
|
|
- icon: "success"
|
|
|
|
|
|
|
+ title: '格式已转换为JPG',
|
|
|
|
|
+ icon: 'none'
|
|
|
});
|
|
});
|
|
|
- // uni.navigateTo({ url: '/package/jobIntention/underReview' })
|
|
|
|
|
- uni.navigateTo({ url: "/package/jobIntention/completeMsg" });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return newFile; // 返回新文件对象,u-upload 会自动上传它
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('HEIC 转换失败:', error);
|
|
|
|
|
+ uni.hideLoading();
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: res.msg || "提交失败",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
|
|
+ title: 'HEIC格式转换失败,请改为JPG/PNG后重试',
|
|
|
|
|
+ icon: 'none',
|
|
|
});
|
|
});
|
|
|
|
|
+ return false; // 阻止上传
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
- .catch((err) => {
|
|
|
|
|
- uni.hideLoading();
|
|
|
|
|
- console.error("提交失败:", err);
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "网络异常",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 你原来的方法
|
|
|
|
|
+ goUnderReview() {
|
|
|
|
|
+ console.log(this.lists[0].response.data);
|
|
|
|
|
+ const url = this.lists[0].response.data;
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ companyCertification: url,
|
|
|
|
|
+ companyId: (this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
|
+ title: "提交中..."
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ this.$Request.postJson("/app/company/updateCompany", data)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "提交成功",
|
|
|
|
|
+ icon: "success"
|
|
|
|
|
+ });
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "/package/jobIntention/completeMsg"
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.msg || "提交失败",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ uni.hideLoading();
|
|
|
|
|
+ console.error("提交失败:", err);
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "网络异常",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
-.company {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- font-family: DM Sans;
|
|
|
|
|
- .company-content {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- padding: 40rpx;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
- .company-title {
|
|
|
|
|
- color: #333;
|
|
|
|
|
- font-size: 40rpx;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
|
- }
|
|
|
|
|
- .company-desc {
|
|
|
|
|
- color: rgba(102, 102, 102, 1);
|
|
|
|
|
- font-family: DM Sans;
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- font-weight: 400;
|
|
|
|
|
- line-height: 32rpx;
|
|
|
|
|
- }
|
|
|
|
|
- .company-btn {
|
|
|
|
|
- color: #016bf6;
|
|
|
|
|
- font-family: DM Sans;
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- font-weight: 400;
|
|
|
|
|
- line-height: 32rpx;
|
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
- }
|
|
|
|
|
- .upload-img {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 388rpx;
|
|
|
|
|
- background: #fce9dc;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
- }
|
|
|
|
|
- .warning-title {
|
|
|
|
|
- color: #1f2c37;
|
|
|
|
|
- font-family: DM Sans;
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- .warning-desc {
|
|
|
|
|
- color: #666666;
|
|
|
|
|
- font-family: DM Sans;
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- font-weight: 400;
|
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- .bottom-btn {
|
|
|
|
|
- border-radius: 999px;
|
|
|
|
|
- background: #016bf6;
|
|
|
|
|
- flex-shrink: 0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
|
|
- font-family: DM Sans;
|
|
|
|
|
- font-size: 32rpx;
|
|
|
|
|
- font-weight: 400;
|
|
|
|
|
- padding: 16rpx 32rpx;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- margin: 20rpx;
|
|
|
|
|
- margin-bottom: 110rpx;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+ .company {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ font-family: DM Sans;
|
|
|
|
|
+
|
|
|
|
|
+ .company-content {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ padding: 40rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+
|
|
|
|
|
+ .company-title {
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ font-size: 40rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .company-desc {
|
|
|
|
|
+ color: rgba(102, 102, 102, 1);
|
|
|
|
|
+ font-family: DM Sans;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ line-height: 32rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .company-btn {
|
|
|
|
|
+ color: #016bf6;
|
|
|
|
|
+ font-family: DM Sans;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ line-height: 32rpx;
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .upload-img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 388rpx;
|
|
|
|
|
+ background: #fce9dc;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .warning-title {
|
|
|
|
|
+ color: #1f2c37;
|
|
|
|
|
+ font-family: DM Sans;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .warning-desc {
|
|
|
|
|
+ color: #666666;
|
|
|
|
|
+ font-family: DM Sans;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .bottom-btn {
|
|
|
|
|
+ border-radius: 999px;
|
|
|
|
|
+ background: #016bf6;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
|
|
+ font-family: DM Sans;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ padding: 16rpx 32rpx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ margin: 20rpx;
|
|
|
|
|
+ margin-bottom: 110rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|