Explorar el Código

feat: 修改小程序上传

L hace 3 meses
padre
commit
05cfd9e867
Se han modificado 4 ficheros con 63 adiciones y 15 borrados
  1. 1 1
      common/config.js
  2. 3 2
      common/httpRequest.js
  3. 3 3
      manifest.json
  4. 56 9
      pages/my/attachment.vue

+ 1 - 1
common/config.js

@@ -6,7 +6,7 @@ const productionChatUrl = 'wss://www.bosszan.com/wss/chatSocket/'
 const testApiUrl = 'https://yizhizan.edccc.cn/sqx_fast'
 const testWssUrl = 'wss://yizhizan.edccc.cn/wss/websocket/'
 const testChatUrl = 'wss://yizhizan.edccc.cn/wss/chatSocket/'
-let isProduction = false // 判断是否是生产环境
+let isProduction = true // 判断是否是生产环境
 if (isProduction) {
 	//正式环境
 	const ROOTPATH = productionApiUrl;

+ 3 - 2
common/httpRequest.js

@@ -289,7 +289,7 @@ module.exports = {
 			}
 		});
 	},
-	getT: function(url, data, header) {
+	getT: function(url, data, header, timeout, hideToast) {
 		header = header || "application/x-www-form-urlencoded";
 		return ensureDomainReady().then(() => {
 			const host = this.config('APIHOST1')
@@ -305,6 +305,7 @@ module.exports = {
 							"content-type": header,
 							"token": token
 						},
+						timeout: timeout ? timeout : 60000,
 						success: function(result) {
 							if (result.data.code == 401) {
 								uni.removeStorageSync("token")
@@ -321,7 +322,7 @@ module.exports = {
 									title: '请先登录,以便更好使用!',
 									icon: 'none'
 								})
-							} else if (result.data.code != 0 && result.data.msg != '未进入公司') {
+							} else if (result.data.code != 0 && result.data.msg != '未进入公司' && !hideToast) {
 								uni.showToast({
 									title: result.data.msg || '查询失败',
 									icon: 'none'

+ 3 - 3
manifest.json

@@ -2,8 +2,8 @@
     "name" : "亿职赞",
     "appid" : "__UNI__0B0096D",
     "description" : "",
-    "versionName" : "1.2.8",
-    "versionCode" : 128,
+    "versionName" : "1.3.0",
+    "versionCode" : 130,
     "transformPx" : false,
     "sassImplementationName" : "node-sass",
     /* 5+App特有相关 */
@@ -196,7 +196,7 @@
                 "JPUSH_GOOGLE_STORAGE_BUCKET" : "",
                 "JPUSH_HONOR_APPID" : "104533692",
                 "JPUSH_HUAWEI_APPID" : "116155907",
-                "JPUSH_ISPRODUCTION_IOS" : "",
+                "JPUSH_ISPRODUCTION_IOS" : "true",
                 "JPUSH_MEIZU_APPID" : "",
                 "JPUSH_MEIZU_APPKEY" : "",
                 "JPUSH_OPPO_APPID" : "36598376",

+ 56 - 9
pages/my/attachment.vue

@@ -32,7 +32,6 @@
 				<empty :isShow="false" v-if="content.length == 0" />
 			</scroll-view>
 		</view>
-
 		<view class="buttons flex align-center">
 			<view class="button pain" @click="showTipPopup = true">Ai一键解析简历</view>
 			<view class="button primary" @click="goResumeUpload">简历上传</view>
@@ -150,7 +149,8 @@ export default {
 				},
 			],
 			loading: false,
-			showTipPopup: false
+			showTipPopup: false,
+			showWXUploadBtn: false
 		};
 	},
 	computed: {
@@ -165,9 +165,10 @@ export default {
 		// 获取状态栏高度
 		let systemInfo = uni.getSystemInfoSync();
 		this.statusBarHeight = systemInfo.statusBarHeight || 0;
-
+	},
+	onShow() {
 		this.getUserInfo()
-		// this.avatar = uni.getStorageSync('avatar')
+		this.getWXUploadConfigData()
 	},
 	methods: {
 		// 返回上一页
@@ -279,13 +280,20 @@ export default {
 
 		},
 		more(id) {
-			var that = this
 			uni.showActionSheet({
-				itemList: ["删除"],
+				itemList: ["AI解析", "删除"],
 				itemColor: "#3273db",
-				success(res) {
-					if (res.tapIndex == 0)
-						that.deleteAttachment(id)
+				success: res => {
+					if (res.tapIndex == 0) {
+						let [resume] = this.content.filter(item => item.resumesAttachmentId == id)
+						if (resume) {
+							this.analyserResumeByUrl(resume?.attachmentAddress)
+						} else {
+							this.$queue.showToast('获取简历失败')
+						}
+					} else if (res.tapIndex == 1) {
+						this.deleteAttachment(id)
+					}
 				},
 				fail(res) {
 					console.log(res.errMsg);
@@ -529,6 +537,45 @@ export default {
 				content,
 				showCancel: false
 			})
+		},
+		
+		// 通过文件地址解析简历
+		analyserResumeByUrl(filePath) {
+			this.showLoadCard = true
+			this.$Request.getT('/app/resumes/resumesAnalysisAttach', {
+				filePath
+			}, null, 480000, true).then(res => {
+				if (!res) {
+					this.showModal('解析失败,请稍后重试')
+					this.stopLoadStatus()
+					return
+				}
+				if (res.code == 0 && res.data) {
+					// 识别前,先清空数据
+					this.clearResumeData()
+					this.setAiResumesAnalysis(JSON.parse(res.data))
+					
+					this.getUserInfo()
+				} else {
+					this.showModal(res?.msg || '解析失败,请稍后重试')
+				}
+				
+				this.stopLoadStatus()
+			}).catch(err => {
+				this.showModal('解析失败,请稍后重试')
+				this.stopLoadStatus()
+			})
+		},
+		
+		// 获取微信上传配置数据
+		getWXUploadConfigData() {
+			this.$Request.getT('/app/dict/list', {
+				type: '小程序入口'
+			}).then(res => {
+				if (res.code == 0 && res.data?.length > 0) {
+					this.showWXUploadBtn = res.data[0].code == '开'
+				}
+			})
 		}
 	},
 	// userphone(){