特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

420 lines
9.1 KiB

9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
1 month ago
7 months ago
7 months ago
9 months ago
1 month ago
9 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
1 month ago
9 months ago
7 months ago
1 month ago
9 months ago
1 month ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
7 months ago
9 months ago
7 months ago
1 month ago
9 months ago
7 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
7 months ago
1 month ago
9 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
9 months ago
7 months ago
7 months ago
1 month ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
1 month ago
1 month ago
7 months ago
7 months ago
7 months ago
1 month ago
1 month ago
7 months ago
9 months ago
1 month ago
9 months ago
1 month ago
9 months ago
7 months ago
7 months ago
7 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="在线简历"
  4. leftClick
  5. @leftClick="$utils.navigateBack"/>
  6. <view class="box">
  7. <view class="list">
  8. <view class="item"
  9. v-for="(item, index) in list"
  10. :key="index">
  11. <view class="title">
  12. {{ item.title }}
  13. </view>
  14. <view class="tagList" v-if="!item.useAddressPicker">
  15. <view :class="{act : i == item.index}"
  16. @click="clickTag(item, i)" v-for="(t, i) in item.tag"
  17. :key="t.id">
  18. {{ t.name || t.adress }}
  19. </view>
  20. </view>
  21. <!-- 地址选择器模式 -->
  22. <view class="address-selector" v-else @click="openAddressPicker">
  23. <view class="selected-address">
  24. {{ selectedAddress || '请选择工作地区' }}
  25. </view>
  26. <uv-icon name="arrow-right" size="30rpx"></uv-icon>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="form-sheet-cell">
  31. <view class="label">
  32. 求职岗位
  33. </view>
  34. <input placeholder="请输入求职岗位"
  35. v-model="form.title" />
  36. </view>
  37. <view class="form-sheet-cell">
  38. <view class="label">
  39. 您的年龄
  40. </view>
  41. <input placeholder="请输入年龄"
  42. type="number"
  43. v-model="form.age" />
  44. </view>
  45. <view class="form-sheet-cell">
  46. <view class="label">
  47. 您的性别
  48. </view>
  49. <uv-radio-group v-model="form.sex">
  50. <view style="display: flex;justify-content: center;">
  51. <uv-radio
  52. :customStyle="{margin: '8px'}"
  53. v-for="(item, index) in sexList"
  54. :key="index"
  55. iconSize="30rpx"
  56. size="40rpx"
  57. labelSize="26rpx"
  58. :label="item.name"
  59. :name="item.name">
  60. </uv-radio>
  61. </view>
  62. </uv-radio-group>
  63. </view>
  64. <view class="form-sheet-cell">
  65. <view class="label">
  66. 您的民族
  67. </view>
  68. <input placeholder="请输入民族"
  69. v-model="form.nation" />
  70. </view>
  71. <view class="form-sheet-cell">
  72. <view class="label">
  73. 期望薪资
  74. </view>
  75. <view class="price">
  76. <input placeholder="下限" v-model="form.salaryLow" />
  77. ~
  78. <input placeholder="上限" v-model="form.salaryUp" />
  79. </view>
  80. </view>
  81. <view class="form-sheet-cell"
  82. @click="openPicker('qualification')">
  83. <view class="label">
  84. 您的学历
  85. </view>
  86. <input placeholder="请选择学历"
  87. disabled
  88. v-model="form.qualification" />
  89. </view>
  90. <!-- <view class="form-sheet-cell">
  91. <view class="label">
  92. 您的学历
  93. </view>
  94. <input placeholder="请输入您的学历"
  95. v-model="form.qualification" />
  96. </view> -->
  97. <uv-textarea
  98. v-model="form.brief"
  99. count
  100. :maxlength="300"
  101. autoHeight
  102. placeholder="请输入个人介绍"></uv-textarea>
  103. <view class="uni-color-btn"
  104. @click="submit">
  105. 发布
  106. </view>
  107. </view>
  108. <uv-picker ref="picker"
  109. :columns="columns"
  110. @confirm="pickerConfirm"></uv-picker>
  111. <!-- 地址选择组件 -->
  112. <AddressPicker ref="addressPicker" :multiple="true" :showSelectWholeCity="true" :onlyCity="false" @confirm="onAddressConfirm" />
  113. </view>
  114. </template>
  115. <script>
  116. import { mapState } from 'vuex'
  117. import AddressPicker from '@/components/AddressPicker.vue'
  118. export default {
  119. components: {
  120. AddressPicker
  121. },
  122. data() {
  123. return {
  124. list: [
  125. {
  126. title: '您希望从事的工种',
  127. tag: [],
  128. index: 0,
  129. type : 'typeId',
  130. },
  131. {
  132. title: '您希望从事工作的地区',
  133. tag: [],
  134. index: 0,
  135. type : 'expectAddress',
  136. useAddressPicker: true, // 标记使用地址选择器
  137. },
  138. {
  139. title: '您希望从事工作的性质',
  140. tag: [],
  141. index: 0,
  142. type : 'natureId',
  143. },
  144. ],
  145. form : {
  146. sex : '男',
  147. qulification : '',
  148. title: '',
  149. typeId : '',
  150. expectAddress : '',
  151. natureId : '',
  152. age : '',
  153. nation : '',
  154. salaryLow : '',
  155. salaryUp : '',
  156. qualification : '',
  157. brief: '',
  158. },
  159. sexList : [
  160. {
  161. name : '男',
  162. },
  163. {
  164. name : '女',
  165. },
  166. ],
  167. picker : {
  168. qualification : [
  169. '初中',
  170. '高中',
  171. '专科',
  172. '本科',
  173. '研究生',
  174. '博士',
  175. ],
  176. },
  177. pickerKey : 'workAge',
  178. selectedAddress: '', // 选中的地址文本
  179. }
  180. },
  181. computed : {
  182. ...mapState(['natureList', 'jobTypeList', 'addressList']),
  183. columns(){
  184. return [this.picker[this.pickerKey]]
  185. },
  186. },
  187. onLoad() {
  188. this.list[0].tag = this.jobTypeList
  189. this.list[1].tag = this.addressList
  190. this.list[2].tag = this.natureList
  191. this.queryResumeByUserId()
  192. },
  193. methods: {
  194. clickTag(item, index){
  195. item.index = index
  196. },
  197. openPicker(key, picker){
  198. this.pickerKey = key
  199. if(picker){
  200. picker.open()
  201. }else{
  202. this.$refs.picker.open()
  203. }
  204. },
  205. pickerConfirm(e){
  206. console.log(e);
  207. let data = e.value[0]
  208. if(data && data.id){
  209. this.form[this.pickerKey] = data.id
  210. this.form[this.pickerKey + '_dictText'] = data.name || data.adress
  211. }else{
  212. this.form[this.pickerKey] = data
  213. }
  214. },
  215. // 提交
  216. submit(){
  217. // if(this.fileList.length == 0){
  218. // return uni.showToast({
  219. // title: '请上传图片',
  220. // icon : 'none'
  221. // })
  222. // }
  223. this.list.forEach(n => {
  224. // 如果使用地址选择器,跳过从tag获取值
  225. if(!n.useAddressPicker) {
  226. this.form[n.type] = n.tag[n.index].id
  227. }
  228. })
  229. if (this.$utils.verificationAll(this.form, {
  230. title: '请输入求职岗位',
  231. typeId : '请选择工种',
  232. expectAddress : '请选择工作的地区',
  233. natureId : '请选择工作的性质',
  234. age : '请输入您的年龄',
  235. sex : '请选择性别',
  236. nation : '请输入您的民族',
  237. salaryLow : '请输入期望薪资下限',
  238. salaryUp : '请输入期望薪资上限',
  239. qualification : '请选择您的学历',
  240. brief: '请输入个人介绍',
  241. })) {
  242. return
  243. }
  244. let data = {
  245. title: this.form.title,
  246. typeId : this.form.typeId,
  247. expectAddress : this.form.expectAddress,
  248. natureId : this.form.natureId,
  249. age : this.form.age,
  250. nation : this.form.nation,
  251. salaryLow : this.form.salaryLow,
  252. salaryUp : this.form.salaryUp,
  253. qualification : this.form.qualification,
  254. brief: this.form.brief,
  255. sex: this.form.sex,
  256. }
  257. if(this.form.id){
  258. data.id = this.form.id
  259. }
  260. this.$api('addResume', data, res => {
  261. if(res.code == 200){
  262. uni.showToast({
  263. title: '保存成功!',
  264. icon: 'none'
  265. })
  266. setTimeout(uni.navigateBack, 1000, -1)
  267. }
  268. })
  269. },
  270. queryResumeByUserId(){
  271. this.$api('queryResumeByUserId', res => {
  272. if(res.code == 200 && res.result && res.result.records[0]){
  273. this.form = res.result.records[0]
  274. this.list.forEach((n, i) => {
  275. // 如果是地址选择器,直接显示地址文字
  276. if(n.useAddressPicker && this.form[n.type]) {
  277. // 回显时直接使用存储的地址字符串,与提交格式保持一致
  278. this.selectedAddress = this.form[n.type]
  279. } else {
  280. n.tag.forEach((e, index) => {
  281. if(this.form[n.type] == e.id){
  282. n.index = index
  283. }
  284. })
  285. }
  286. })
  287. }
  288. })
  289. },
  290. // 打开地址选择器
  291. openAddressPicker() {
  292. this.$refs.addressPicker.open()
  293. },
  294. // 地址选择确认回调
  295. onAddressConfirm(addressResult) {
  296. // 直接使用AddressPicker返回的fullAddress,确保格式一致
  297. this.selectedAddress = addressResult.fullAddress
  298. this.form.expectAddress = addressResult.fullAddress
  299. },
  300. },
  301. }
  302. </script>
  303. <style scoped lang="scss">
  304. .page{
  305. background-color: #fff;
  306. min-height: 100vh;
  307. .box{
  308. padding: 30rpx;
  309. .list {
  310. .item {
  311. margin-top: 20rpx;
  312. .title {
  313. font-weight: 900;
  314. font-size: 30rpx;
  315. }
  316. .tagList {
  317. display: flex;
  318. flex-wrap: wrap;
  319. padding: 10rpx 0;
  320. view {
  321. background: rgba($uni-color, 0.1);
  322. padding: 10rpx 20rpx;
  323. margin: 10rpx;
  324. border-radius: 10rpx;
  325. font-size: 26rpx;
  326. }
  327. .act {
  328. color: #fff;
  329. background: $uni-color;
  330. }
  331. }
  332. .address-selector {
  333. display: flex;
  334. justify-content: space-between;
  335. align-items: center;
  336. background: rgba($uni-color, 0.1);
  337. padding: 20rpx;
  338. margin: 10rpx;
  339. border-radius: 10rpx;
  340. font-size: 26rpx;
  341. .selected-address {
  342. flex: 1;
  343. color: #333;
  344. }
  345. }
  346. }
  347. }
  348. .form-sheet-cell{
  349. display: flex;
  350. background-color: #fff;
  351. padding: 20rpx;
  352. align-items: center;
  353. .label{
  354. width: 160rpx;
  355. font-weight: 900;
  356. }
  357. .price{
  358. display: flex;
  359. text-align: center;
  360. input{
  361. width: 150rpx;
  362. border: 1px solid $uni-color;
  363. margin: 0 10rpx;
  364. }
  365. }
  366. input{
  367. flex: 1;
  368. background-color: rgba($uni-color, 0.1);
  369. padding: 10rpx 20rpx;
  370. border-radius: 10rpx;
  371. }
  372. .right-icon{
  373. margin-left: auto;
  374. }
  375. }
  376. /deep/ .uv-textarea{
  377. background-color: rgba($uni-color, 0.1) !important;
  378. min-height: 400rpx;
  379. }
  380. }
  381. }
  382. </style>