add.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <view>
  3. <!-- 顶部占位区域 -->
  4. <view :style="{ height: statusBarHeight + 'px' }"></view>
  5. <!-- 表单 -->
  6. <view class="list flex justify-center">
  7. <view class="list-box">
  8. <view class="list-box-job flex justify-between align-center">
  9. <view class="list-box-job-l" @click="gotoJob('/package/jobIntention/jobList')">
  10. <view class="list-box-job-l-label" @click="gotoJob('/package/jobIntention/jobList')">
  11. 期望岗位
  12. </view>
  13. <view class="" @click="gotoJob('/package/jobIntention/jobList')" style="width: 100%;">
  14. <u-input @click="gotoJob('/package/jobIntention/jobList')" disabled
  15. v-model="ruleClassifyName" :clearable="false" input-align="left" type="text"
  16. placeholder="请选择" />
  17. </view>
  18. </view>
  19. <view class="list-box-job-r" @click="gotoJob('/package/jobIntention/jobList')">
  20. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  21. </view>
  22. </view>
  23. <view class="list-box-line"></view>
  24. <view class="list-box-job flex justify-between align-center"
  25. @click="gotoJob('/package/jobIntention/city')">
  26. <view class="list-box-job-l" @click="gotoJob('/package/jobIntention/city')">
  27. <view class="list-box-job-l-label" @click="gotoJob('/package/jobIntention/city')">
  28. 期望地点
  29. </view>
  30. <view class="" style="width: 100%;">
  31. <u-input disabled v-model="city" @click="gotoJob('/package/jobIntention/city')"
  32. :clearable="false" input-align="left" type="text" placeholder="如:北京" />
  33. </view>
  34. </view>
  35. <view class="list-box-job-r" @click="gotoJob('/package/jobIntention/city')">
  36. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  37. </view>
  38. </view>
  39. <view class="list-box-line"></view>
  40. <view class="list-box-job flex justify-between align-center"
  41. @click="gotoJob('/package/jobIntention/industry')">
  42. <view class="list-box-job-l" @click="gotoJob('/package/jobIntention/industry')">
  43. <view class="list-box-job-l-label" @click="gotoJob('/package/jobIntention/industry')">
  44. 期望行业
  45. </view>
  46. <view class="" @click="gotoJob('/package/jobIntention/industry')" style="width: 100%;">
  47. <u-input @click="gotoJob('/package/jobIntention/industry')" disabled v-model="industry"
  48. :clearable="false" input-align="left" type="text" placeholder="如:互联网/电子商务" />
  49. </view>
  50. </view>
  51. <view class="list-box-job-r" @click="gotoJob('/package/jobIntention/industry')">
  52. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  53. </view>
  54. </view>
  55. <view class="list-box-line"></view>
  56. <view class="list-box-job flex justify-between align-center" @click="getMonyList()">
  57. <view class="list-box-job-l" @click="getMonyList()">
  58. <view class="list-box-job-l-label" @click="getMonyList()">
  59. 期望薪资
  60. </view>
  61. <view class="" style="width: 100%;">
  62. <u-input disabled v-model="resumesCompensation" @click="getMonyList()" :clearable="false"
  63. input-align="left" type="text" placeholder="如:1W-2W" />
  64. </view>
  65. </view>
  66. <view class="list-box-job-r" @click="getMonyList()">
  67. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  68. </view>
  69. </view>
  70. <view class="list-box-line"></view>
  71. <view class="list-box-job flex justify-between align-center" @click="getPostType()">
  72. <view class="list-box-job-l" @click="getPostType()">
  73. <view class="list-box-job-l-label" @click="getPostType()">
  74. 工作性质
  75. </view>
  76. <view class="" style="width: 100%;">
  77. <u-input disabled v-model="workType" @click="getPostType()" :clearable="false"
  78. input-align="left" type="text" placeholder="如:全职" />
  79. </view>
  80. </view>
  81. <view class="list-box-job-r" @click="getPostType()">
  82. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- 确认 -->
  88. <view class="subbtn flex justify-center" @click="addjob()">
  89. <view class="subbtn-box flex justify-center align-center">
  90. 保存
  91. </view>
  92. </view>
  93. <!-- 薪资 -->
  94. <u-select v-model="monyShow" :list="monyList" @confirm="moneyConfirm"></u-select>
  95. <!-- 工作性质 -->
  96. <u-select v-model="workShow" :list="workTypes" @confirm="workConfirm"></u-select>
  97. </view>
  98. </template>
  99. <script>
  100. export default {
  101. data() {
  102. return {
  103. statusBarHeight: 0,
  104. monyShow: false,
  105. monyList: [], //薪资列表
  106. resumesCompensation: '', //薪资
  107. workShow: false,
  108. workType: '', //工作性质
  109. workTypes: [],
  110. city: '', //城市
  111. ruleClassifyId: '', //岗位id
  112. ruleClassifyName: '', //岗位名称
  113. industry: '',
  114. classifyOneId: '', //岗位一级
  115. classifyTwoId: '', //岗位二级id
  116. isDefault: 0,
  117. };
  118. },
  119. onLoad() {
  120. // 获取状态栏高度
  121. const systemInfo = uni.getSystemInfoSync()
  122. this.statusBarHeight = systemInfo.statusBarHeight || 0
  123. },
  124. onShow() {
  125. let that = this
  126. //选择的岗位
  127. uni.$on('jobs', (info) => {
  128. that.ruleClassifyId = info.ruleClassifyId
  129. that.ruleClassifyName = info.ruleClassifyName
  130. // that.classifyOneId = info.ruleClassifyId1
  131. // that.classifyTwoId = info.ruleClassifyId2
  132. })
  133. //选择的城市
  134. uni.$on('city', (info) => {
  135. that.city = info.city
  136. })
  137. //选择的行业
  138. uni.$on('industry', (info) => {
  139. that.industry = info.industry
  140. })
  141. },
  142. methods: {
  143. /**
  144. * 提交求职期望
  145. */
  146. addjob() {
  147. if (!this.ruleClassifyId) {
  148. uni.showToast({
  149. title: '请选择期望岗位',
  150. icon: 'none'
  151. })
  152. return
  153. }
  154. if (!this.city) {
  155. uni.showToast({
  156. title: '请选择期望城市',
  157. icon: 'none'
  158. })
  159. return
  160. }
  161. if (!this.industry) {
  162. uni.showToast({
  163. title: '请选择期望行业',
  164. icon: 'none'
  165. })
  166. return
  167. }
  168. if (!this.resumesCompensation) {
  169. uni.showToast({
  170. title: '请选择期望薪资',
  171. icon: 'none'
  172. })
  173. return
  174. }
  175. if (!this.workType) {
  176. uni.showToast({
  177. title: '请选择工作性质',
  178. icon: 'none'
  179. })
  180. return
  181. }
  182. let data = {
  183. ruleClassifyId: this.ruleClassifyId, //岗位id
  184. ruleClassifyName: this.ruleClassifyName, //岗位名称
  185. citys: this.city, //工作城市
  186. salaryRange: this.resumesCompensation, //薪资范围
  187. industry: this.industry, //行业
  188. postType: this.workType, //工作性质
  189. isDefault: this.isDefault
  190. // classifyOneId:this.classifyOneId,
  191. // classifyTwoId:this.classifyTwoId
  192. }
  193. this.$Request.postT('/app/intention/saveUpdate', data).then(res => {
  194. if (res.code == 0) {
  195. uni.showToast({
  196. title: '添加成功'
  197. })
  198. setTimeout(() => {
  199. uni.navigateBack()
  200. }, 1000)
  201. } else {
  202. uni.showToast({
  203. title: res.msg,
  204. icon: 'none'
  205. })
  206. }
  207. })
  208. },
  209. workConfirm(e) {
  210. this.workType = e[0].value
  211. },
  212. moneyConfirm(e) {
  213. this.resumesCompensation = e[0].value
  214. },
  215. /**
  216. * 工作性质
  217. */
  218. getPostType() {
  219. this.$Request.get('/app/dict/list', {
  220. type: '工作性质'
  221. }).then(res => {
  222. if (res.code == 0) {
  223. let arr = res.data
  224. arr = JSON.parse(JSON.stringify(arr).replace(/code/g, 'label'))
  225. this.workTypes = arr
  226. this.workShow = true
  227. }
  228. })
  229. },
  230. /**
  231. * 薪资列表
  232. */
  233. getMonyList() {
  234. this.$Request.get('/app/dict/list', {
  235. type: '薪资'
  236. }).then(res => {
  237. if (res.code == 0) {
  238. let arr = res.data
  239. arr = JSON.parse(JSON.stringify(arr).replace(/code/g, 'label'))
  240. this.monyList = arr
  241. this.monyShow = true
  242. }
  243. })
  244. },
  245. gotoJob(url) {
  246. uni.navigateTo({
  247. url: url
  248. })
  249. },
  250. }
  251. }
  252. </script>
  253. <style lang="scss">
  254. page {
  255. background-color: #F2F2F7;
  256. }
  257. .list {
  258. width: 100%;
  259. // height: 795rpx;
  260. margin-top: 30rpx;
  261. .list-box {
  262. width: 686rpx;
  263. height: 100;
  264. background-color: #ffffff;
  265. border-radius: 24rpx;
  266. .list-box-job {
  267. width: 606rpx;
  268. height: 164rpx;
  269. margin: 0 auto;
  270. .list-box-job-l {
  271. width: 80%;
  272. }
  273. .list-box-job-r {
  274. width: 30rpx;
  275. }
  276. }
  277. .list-box-line {
  278. width: 650rpx;
  279. height: 1rpx;
  280. border: 1rpx solid #F2F2F2;
  281. }
  282. }
  283. }
  284. .subbtn {
  285. width: 100%;
  286. height: 88rpx;
  287. margin-top: 90rpx;
  288. .subbtn-box {
  289. width: 686rpx;
  290. height: 100%;
  291. background-color: #016BF6;
  292. border-radius: 44rpx;
  293. color: #FFFFFF;
  294. font-size: 32rpx;
  295. font-weight: bold;
  296. }
  297. }
  298. </style>