improvePrompt.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view class="container">
  3. <view>
  4. <image src="/static/images/slogan.png" class="slogan"></image>
  5. <view class="content">
  6. <image src="/static/images/logo-long.png" class="logo"></image>
  7. <view class="tip">温馨提示</view>
  8. <view class="tip-text">
  9. <template v-if="scene == 1">
  10. <view class="text">如果您的简历完善度不足80%</view>
  11. <view class="text">我们将无法进行推荐</view>
  12. <view class="text">为更好地求职机会,请充分填写简历</view>
  13. </template>
  14. <template v-else>
  15. <view class="text">如果您的求职期望至少有一条,</view>
  16. <view class="text">且完善总分数大于等于60分</view>
  17. <view class="text">我们将进行简历推荐,请充分填写简历</view>
  18. </template>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="buttons">
  23. <template v-if="scene == 1">
  24. <view class="white-btn" @click="toOnlineResume">完善在线简历</view>
  25. </template>
  26. <template v-else>
  27. <view class="link-btn" @click="handleSubmit">手动完善简历</view>
  28. <view class="white-btn" @click="showTipPopup = true">附件简历一键识别</view>
  29. </template>
  30. </view>
  31. <view class="load-container" v-if="showLoadCard">
  32. <image src="@/static/loading.gif" class="loading-image" mode="aspectFit"></image>
  33. </view>
  34. <!-- 简历解析确认弹窗 -->
  35. <view class="popup-container" v-if="showTipPopup" @click="showTipPopup = false">
  36. <view class="popup-content">
  37. <view class="popup-title">温馨提示</view>
  38. <view class="tip-container">
  39. <view>1-2页简历识别预计耗时1分钟;</view>
  40. <view>3-5页简历识别预计耗时1-3分钟;</view>
  41. <view>5页简历以上耗时将会超过5分;</view>
  42. <view>请您耐心等待!</view>
  43. </view>
  44. <image src="@/static/upload-tip.png" class="upload-tip"></image>
  45. <view class="button-primary" @click.stop="handlUploadFile">知道了</view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. // #ifdef APP-PLUS
  52. import { chooseFileFromModule } from '@/uni_modules/sr-file-choose'
  53. // #endif
  54. import config from '@/common/config'
  55. export default {
  56. data() {
  57. return {
  58. scene: 0, // 0正常进入 1邀请进入
  59. progress: 0,
  60. showLoadCard: false,
  61. timer: null,
  62. showTipPopup: false
  63. };
  64. },
  65. onLoad(options) {
  66. if (options.scene) {
  67. this.scene = options.scene
  68. }
  69. },
  70. // onUnload() {
  71. // if (this.timer) {
  72. // clearInterval(this.timer)
  73. // }
  74. // },
  75. methods: {
  76. toOnlineResume() {
  77. uni.navigateTo({
  78. url: `/pages/my/onlineResume?scene=${this.scene}`
  79. })
  80. },
  81. // 手动完善
  82. handleSubmit() {
  83. uni.navigateTo({
  84. url: `/pages/my/onlineResume?scene=${this.scene}`
  85. })
  86. },
  87. // 附件一键识别
  88. handlUploadFile() {
  89. // #ifdef APP-PLUS
  90. chooseFileFromModule({
  91. complete: res => {
  92. let path = res.path
  93. let name = res.name
  94. let fileType = ''
  95. // 如果没有name,默认为:截取最后一个/之后的内容
  96. if (!name) {
  97. let lastIndex = path.lastIndexOf('/');
  98. if (lastIndex !== -1) {
  99. name = path.substring(lastIndex + 1);
  100. } else {
  101. name = Math.random().toString(36).substr(2) + Date.now();
  102. }
  103. }
  104. // 使用 lastIndexOf 方法找到最后一个 . 的位置
  105. let lastDotIndex = name.lastIndexOf('.');
  106. if (lastDotIndex !== -1) {
  107. fileType = name.substring(lastDotIndex + 1);
  108. } else {
  109. console.log('文件路径中没有 .');
  110. }
  111. let file = {
  112. size: res.size,
  113. path,
  114. fileType,
  115. name
  116. }
  117. this.uploadAndAnalysisResumes(file)
  118. }
  119. })
  120. // #endif
  121. // #ifdef H5
  122. uni.chooseFile({
  123. count: 1,
  124. success: res => {
  125. this.uploadAndAnalysisResumes({
  126. path: res.tempFilePaths[0],
  127. name: 'file'
  128. })
  129. }
  130. })
  131. // #endif
  132. },
  133. // 上传解析简历
  134. uploadAndAnalysisResumes(file) {
  135. this.showTipPopup = false
  136. this.showLoadCard = true
  137. this.$queue.uploadFiles({
  138. url: '/app/resumes/resumesAnalysisPlus',
  139. path: file.path,
  140. name: 'file',
  141. timeout: 480000,
  142. hideUploadTask: true
  143. }, (res) => {
  144. if (!res) {
  145. this.showModal('解析失败,请稍后重试')
  146. this.stopLoadStatus()
  147. return
  148. }
  149. if (res.code == 0 && res.data) {
  150. this.$queue.setData('AI_Resume_Data', res.data)
  151. uni.reLaunch({
  152. url: '/pages/my/onlineResume?fileId=AI_Resume_Data'
  153. })
  154. } else {
  155. this.showModal(res?.msg || '解析失败,请稍后重试')
  156. }
  157. this.stopLoadStatus()
  158. })
  159. },
  160. stopLoadStatus() {
  161. this.showLoadCard = false
  162. // this.progress = 0
  163. // clearInterval(this.timer)
  164. },
  165. showModal(content) {
  166. uni.showModal({
  167. title: '提示',
  168. content,
  169. showCancel: false
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss">
  176. .container {
  177. position: relative;
  178. display: flex;
  179. flex-direction: column;
  180. justify-content: space-between;
  181. min-height: 100vh;
  182. background-color: #016bf6;
  183. background-image: url('/static/images/bg1.png');
  184. background-size: 100%;
  185. background-repeat: repeat;
  186. .slogan {
  187. display: block;
  188. width: 634rpx;
  189. height: 358rpx;
  190. margin: 80rpx auto;
  191. }
  192. .content {
  193. width: 654rpx;
  194. padding: 64rpx;
  195. background-color: #fff;
  196. border-radius: 64rpx;
  197. margin: 0 auto;
  198. text-align: center;
  199. .logo {
  200. display: block;
  201. width: 166rpx;
  202. height: 46rpx;
  203. margin: 0 auto;
  204. }
  205. .tip {
  206. font-size: 40rpx;
  207. font-weight: bold;
  208. line-height: 64rpx;
  209. color: #016bf6;
  210. margin: 48rpx auto 15rpx;
  211. }
  212. .text {
  213. font-size: 32rpx;
  214. line-height: 50rpx;
  215. color: #999;
  216. }
  217. }
  218. .buttons {
  219. margin-bottom: 40rpx;
  220. .white-btn {
  221. width: 600rpx;
  222. height: 88rpx;
  223. font-size: 32rpx;
  224. line-height: 88rpx;
  225. text-align: center;
  226. color: #016bf6;
  227. background-color: #fff;
  228. border-radius: 88rpx;
  229. margin: 32rpx auto 0;
  230. }
  231. .link-btn {
  232. text-align: center;
  233. color: #fff;
  234. }
  235. }
  236. }
  237. .load-container {
  238. position: fixed;
  239. left: 0;
  240. top: 0;
  241. width: 100%;
  242. height: 100%;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. background: rgba(0, 0, 0, 1);
  247. .loading-image {
  248. width: 100%;
  249. height: 100%;
  250. }
  251. }
  252. // 简历解析提示弹窗
  253. .popup-container {
  254. position: fixed;
  255. left: 0;
  256. top: 0;
  257. width: 100vw;
  258. height: 100vh;
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. background: rgba(0, 0, 0, 0.4);
  263. .popup-content {
  264. padding: 40rpx 0;
  265. border-radius: 20rpx;
  266. background: #fff;
  267. .popup-title {
  268. font-size: 32rpx;
  269. font-weight: 600;
  270. line-height: 56rpx;
  271. color: rgba(16, 24, 40, 1);
  272. text-align: center;
  273. margin-bottom: 20rpx;
  274. }
  275. .tip-container {
  276. padding: 0 130rpx;
  277. color: rgba(96, 96, 96, 1);
  278. font-size: 28rpx;
  279. line-height: 36rpx;
  280. }
  281. .upload-tip {
  282. display: block;
  283. width: 654rpx;
  284. height: 802rpx;
  285. }
  286. .button-primary {
  287. height: 80rpx;
  288. border-radius: 80rpx;
  289. text-align: center;
  290. color: #fff;
  291. font-size: 32rpx;
  292. line-height: 80rpx;
  293. margin: 0 40rpx;
  294. background: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
  295. }
  296. }
  297. }
  298. </style>