Bläddra i källkod

feat(招聘小程序) 接口对接

xing.li 4 år sedan
förälder
incheckning
305b524294
3 ändrade filer med 23 tillägg och 22 borttagningar
  1. 20 19
      pages/resume/resume.js
  2. 2 2
      pages/resume/resume.wxml
  3. 1 1
      project.config.json

+ 20 - 19
pages/resume/resume.js

@@ -33,9 +33,8 @@ Page({
     nowSalary:0,
     hopeSalary:0,
     resumeFile:'',
-    resumeFileName:'在微信聊天中选择附件',
-    resumeFileNow:'',
-   
+    resumeFileName:'',
+    fileTitle:'在微信聊天中选择附件',
     isChooseFile:false,
   },
 
@@ -218,7 +217,8 @@ Page({
         // tempFilePath可以作为img标签的src属性显示图片
         self.uploadFile(res.tempFiles[0].path)
         self.setData({
-          resumeFileName:res.tempFiles[0].name
+          resumeFileName:res.tempFiles[0].name,
+          fileTitle:res.tempFiles[0].name
         })
         }
     })
@@ -237,7 +237,7 @@ Page({
         console.log(result)
         console.log(result.data.destPath)
         self.setData({
-          resumeFileNow:result.data.destPath,
+          resumeFile:result.data.destPath,
           fileColor:"#000",
         })
         
@@ -270,7 +270,7 @@ Page({
     var learningModality = info.learningModality?info.learningModality:0;
     var birthday = info.birthday?info.birthday:'1990-01-01';
     var fileColor = info.resumeFileName?'#000':'#c2c6da';
-    var resumeFileName = info.resumeFileName?info.resumeFileName:'在微信聊天中选择附件';
+    var fileTitle = info.resumeFileName?info.resumeFileName:'在微信聊天中选择附件';
     this.setData({
       userId:info.userId,
       name:info.name,
@@ -288,8 +288,8 @@ Page({
       nowSalary:nowSalary,
       hopeSalary:hopeSalary,
       resumeFile:info.resumeFile,
-      resumeFileNow:info.resumeFile,
-      resumeFileName:resumeFileName,
+      resumeFileName:info.resumeFileName,
+      fileTitle:fileTitle,
       fileColor:fileColor,
     })
   },
@@ -321,15 +321,16 @@ Page({
       })
       return;
     }
-    // if(!this.data.resumeFileNow){
-    //   wx.showToast({
-    //     title: '请上传附件',
-    //     icon: 'none',
-    //     duration: 1000
-    //   })
-    //   return;
-    // }
-   var resumeFileName = this.data.resumeFileNow?this.data.resumeFileName:''
+    if(!this.data.resumeFile){
+      wx.showToast({
+        title: '请上传附件',
+        icon: 'none',
+        duration: 1000
+      })
+      return;
+    }
+    console.log(this.data.resumeFile);
+   
     var params = {
       userId:this.data.userId,
       name:this.data.name,
@@ -346,8 +347,8 @@ Page({
       hopeProfessionally:this.data.hopeProfessionally,
       nowSalary:this.data.nowSalary,
       hopeSalary:this.data.hopeSalary,
-      resumeFile:this.data.resumeFileNow,
-      resumeFileName:resumeFileName,
+      resumeFile:this.data.resumeFile,
+      resumeFileName:this.data.resumeFileName,
     };
      await recruitApi.saveUser(params);
 

+ 2 - 2
pages/resume/resume.wxml

@@ -154,10 +154,10 @@
   
   <view class="info" style="margin-bottom:100rpx" >
     <view class="info_left">
-      <view class="info_left_1"></view>
+      <view class="info_left_1">*</view>
       <view class="info_left_2">简历附件</view>
     </view>
-    <view  class="info_right placeholder"  style="color:{{fileColor}};white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"  bindtap="chooseEnclosure" >{{resumeFileName}}</view>
+    <view  class="info_right placeholder"  style="color:{{fileColor}};white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"  bindtap="chooseEnclosure" >{{fileTitle}}</view>
     <!-- <view bindtap="downloadFile"  style="width:60rpx;font-size: 24rpx;" data-url ="{{resumeFileNow}}" wx:if="{{resumeFileNow}}">下载</view> -->
   </view>
 

+ 1 - 1
project.config.json

@@ -4,7 +4,7 @@
     "ignore": []
   },
   "setting": {
-    "urlCheck": false,
+    "urlCheck": true,
     "es6": true,
     "enhance": true,
     "postcss": false,