|
|
@@ -25,10 +25,7 @@
|
|
|
<text style="margin-top: 8rpx;">已选择 PDF</text>
|
|
|
<view class="delete-btn" @click="deletePDF">×</view>
|
|
|
</view>
|
|
|
- <view v-else class="text-item" @click="choosePDF">
|
|
|
- <u-icon name="plus" color="#999" size="40" style="margin-bottom: 8rpx;"></u-icon>
|
|
|
- 上传在职证明
|
|
|
- </view>
|
|
|
+ <fileSelector v-else :isShowStyle="false" title="上传在职证明" allowType=".pdf" @fileSelected="choosePDF" />
|
|
|
</view>
|
|
|
<view class="warning-title">注意事项</view>
|
|
|
<view class="warning-desc">1.请上传加盖公章的在职证明(仅限 PDF 文件)</view>
|
|
|
@@ -56,6 +53,8 @@
|
|
|
<script>
|
|
|
import navBar from "@/components/nav-bar/index.vue";
|
|
|
import configdata from '../../common/config.js';
|
|
|
+ // 引入组件
|
|
|
+ import fileSelector from '@/uni_modules/zhouquan-fileSelector/components/zhouquan-fileSelector/file-selector.vue';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -74,7 +73,7 @@
|
|
|
action: configdata.APIHOST1 + '/alioss/upload'
|
|
|
};
|
|
|
},
|
|
|
- components: { navBar },
|
|
|
+ components: { navBar,fileSelector},
|
|
|
onLoad(options) {
|
|
|
if (options.companyName) this.companyName = decodeURIComponent(options.companyName);
|
|
|
if (options.companyId) this.companyId = options.companyId;
|
|
|
@@ -133,27 +132,28 @@
|
|
|
},
|
|
|
|
|
|
// ======= 在职证明上传 (PDF) =======
|
|
|
- async choosePDF() {
|
|
|
- uni.chooseFile({
|
|
|
- count: 1,
|
|
|
- type: 'file',
|
|
|
- extension: ['pdf'],
|
|
|
- success: async (res) => {
|
|
|
- const path = res.tempFiles[0].path;
|
|
|
- this.pdfFilePath = path;
|
|
|
-
|
|
|
- uni.showLoading({ title: '上传PDF中...' });
|
|
|
- try {
|
|
|
- this.employmentVerification = await this.uploadSingleFile(path);
|
|
|
- uni.showToast({ title: 'PDF上传成功', icon: 'success' });
|
|
|
- } catch (e) {
|
|
|
- uni.showToast({ title: '上传失败', icon: 'none' });
|
|
|
- } finally {
|
|
|
- uni.hideLoading();
|
|
|
- }
|
|
|
+ async choosePDF(e) {
|
|
|
+ var that = this
|
|
|
+ const validExtensions = ['pdf', 'doc', 'docx'];
|
|
|
+ const ext = e.name.split('.').pop().toLowerCase();
|
|
|
+ if (!validExtensions.includes(ext)) {
|
|
|
+ this.$queue.showToast('仅支持PDF/DOC/DOCX格式')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.getFileInfo({
|
|
|
+ filePath: e.path,
|
|
|
+ success: (info) => {
|
|
|
+ let attachment_size = (info.size / 1024).toFixed(1)
|
|
|
+ that.$queue.uploadFile(e.path, function (path) {
|
|
|
+ if (path){
|
|
|
+ that.pdfFilePath = path;
|
|
|
+ that.employmentVerification = path;
|
|
|
+ }else
|
|
|
+ that.$queue.showToast('文件上传失败')
|
|
|
+ })
|
|
|
},
|
|
|
- fail: () => {
|
|
|
- uni.showToast({ title: '请选择PDF文件', icon: 'none' });
|
|
|
+ fail: (err) => {
|
|
|
+ console.error('获取失败', err);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -226,7 +226,6 @@
|
|
|
employmentVerification: this.employmentVerification,
|
|
|
companyVerification: this.companyProofUrls.join(',')
|
|
|
};
|
|
|
-
|
|
|
uni.showLoading({ title: '提交中...' });
|
|
|
try {
|
|
|
const res = await this.$Request.postJson("/app/company/updateCompany", data);
|