wkw 6 月之前
父节点
当前提交
f4f440f37c
共有 1 个文件被更改,包括 34 次插入0 次删除
  1. 34 0
      package/jobIntention/companyImg.vue

+ 34 - 0
package/jobIntention/companyImg.vue

@@ -27,6 +27,10 @@
 				</view>
 				<fileSelector v-else :isShowStyle="false" title="上传在职证明" allowType=".pdf" @fileSelected="choosePDF" />
 			</view>
+			<!-- 模板下载部分 -->
+			<view class="warning-title" style="margin-top: 20rpx;">
+				<text style="color: #016bf6; margin-left: 8rpx;" @click="downloadTemplate">点击下载模板</text>
+			</view>
 			<view class="warning-title">注意事项</view>
 			<view class="warning-desc">1.请上传加盖公章的在职证明(仅限 PDF 文件)</view>
 
@@ -79,6 +83,36 @@
 			if (options.companyId) this.companyId = options.companyId;
 		},
 		methods: {
+			// 下载模板
+			downloadTemplate() {
+				const url = 'https://h5.bosszan.com/在职证明模板.docx';
+				uni.showLoading({ title: '正在下载模板...' });
+				uni.downloadFile({
+					url,
+					success: (res) => {
+						if (res.statusCode === 200) {
+							uni.openDocument({
+								filePath: res.tempFilePath,
+								showMenu: true,
+								success: () => {
+									uni.hideLoading();
+								},
+								fail: () => {
+									uni.hideLoading();
+									uni.showToast({ title: '打开失败', icon: 'none' });
+								}
+							});
+						} else {
+							uni.hideLoading();
+							uni.showToast({ title: '下载失败', icon: 'none' });
+						}
+					},
+					fail: () => {
+						uni.hideLoading();
+						uni.showToast({ title: '网络异常', icon: 'none' });
+					}
+				});
+			},
 			// 通用上传
 			async uploadSingleFile(path) {
 				return new Promise((resolve, reject) => {