Преглед на файлове

feat: 微信上传简历

L преди 3 месеца
родител
ревизия
eabc3358d7
променени са 1 файла, в които са добавени 23 реда и са изтрити 0 реда
  1. 23 0
      pages/my/attachment.vue

+ 23 - 0
pages/my/attachment.vue

@@ -33,6 +33,7 @@
 			</scroll-view>
 		</view>
 		<view class="footer-btn">
+			<view class="white-btn" @click="handleWeChatUpload">微信上传</view>
 			<view class="white-btn" @click="handlUploadFile">附件简历一键识别</view>
 			<fileSelector title="简历上传" allowType=".doc,.docx,.xls,.xlsx,.pdf" @fileSelected="uploadResumes"
 				@filesChanged="onFilesChanged" />
@@ -359,6 +360,28 @@ export default {
 				},
 			});
 		},
+		handleWeChatUpload() {
+			plus.share.getServices(res => {
+			let weixinService = null;
+			for (let i in res) {
+				if (res[i].id === 'weixin') {
+				weixinService = res[i];
+				break;
+				}
+			}
+			console.log('weixinService :>> ', weixinService);
+			const userId =  uni.getStorageSync('userId')
+			if (weixinService) {
+				weixinService.launchMiniProgram({
+				id: 'gh_854ab5288c2d', 
+				path: `/pages/index/index?userId=${userId}`,
+				type: 2 // 小程序版本类型:0-正式版;1-测试版;2-体验版
+				});
+			} else {
+				console.log('未安装微信或获取微信服务失败');
+			}
+			});
+		},
 		deleteAttachment(id) {
 			var that = this;
 			uni.showModal({