improvePrompt.vue 7.0 KB

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