特易招,招聘小程序
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.

395 lines
8.5 KiB

4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="发布招工" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="form">
  5. <view class="help-issue">
  6. <text>招工标题</text>
  7. <text style="color: #BD3624;">*</text>
  8. </view>
  9. <view class="form-sheet-cell">
  10. <input type="text" class="title-input"
  11. v-model="form.title"/>
  12. </view>
  13. <uv-cell
  14. title="所在城市"
  15. rightIconStyle="fontSize: 30rpx;"
  16. :value="form.areaId_dictText || '请选择所在城市'"
  17. @click="openPicker('areaId',$refs.addressListPicker)"
  18. isLink
  19. ></uv-cell>
  20. <uv-cell
  21. title="工作地点"
  22. rightIconStyle="fontSize: 30rpx;"
  23. :value="form.workAddress||'请选择招工地点'"
  24. @click="selectAddr"
  25. isLink
  26. ></uv-cell>
  27. <uv-cell
  28. title="所属工种"
  29. rightIconStyle="fontSize: 30rpx;"
  30. :value="form.typeId_dictText || '请选择所属工种'"
  31. @click="openPicker('typeId',$refs.jobTypeListPicker)"
  32. isLink
  33. ></uv-cell>
  34. <uv-cell
  35. title="工龄要求"
  36. rightIconStyle="fontSize: 30rpx;"
  37. :value="form.workAge || '请选择工龄要求'"
  38. @click="openPicker('workAge')"
  39. isLink
  40. ></uv-cell>
  41. <uv-cell
  42. title="学历要求"
  43. rightIconStyle="fontSize: 30rpx;"
  44. :value="form.qulification || '请选择学历要求'"
  45. @click="openPicker('qulification')"
  46. isLink
  47. ></uv-cell>
  48. <!-- <view class="form-sheet-cell">
  49. <view class="label">
  50. 工作地点
  51. </view>
  52. <view>
  53. 请选择招工地点
  54. </view>
  55. <view class="right-icon">
  56. <uv-icon
  57. name="arrow-right"
  58. ></uv-icon>
  59. </view>
  60. </view>
  61. <view class="form-sheet-cell">
  62. <view class="label">
  63. 学历要求
  64. </view>
  65. <view>
  66. 请选择学历要求
  67. </view>
  68. <view class="right-icon">
  69. <uv-icon
  70. name="arrow-right"
  71. ></uv-icon>
  72. </view>
  73. </view>
  74. <view class="form-sheet-cell">
  75. <view class="label">
  76. 工龄要求
  77. </view>
  78. <view>
  79. 请选择工龄要求
  80. </view>
  81. <view class="right-icon">
  82. <uv-icon
  83. name="arrow-right"
  84. ></uv-icon>
  85. </view>
  86. </view>
  87. <view class="form-sheet-cell">
  88. <view class="label">
  89. 所属工种
  90. </view>
  91. <view>
  92. 请选择工种
  93. </view>
  94. <view class="right-icon">
  95. <uv-icon
  96. name="arrow-right"
  97. ></uv-icon>
  98. </view>
  99. </view> -->
  100. <view class="form-sheet-cell">
  101. <view class="label">
  102. 薪资范围
  103. </view>
  104. <view class="price">
  105. <input placeholder="最小值" v-model="form.salaryLow" />
  106. ~
  107. <input placeholder="最大值" v-model="form.salaryUp" />
  108. </view>
  109. </view>
  110. <!-- <view class="form-sheet-cell">
  111. <view class="label">
  112. 结算方式
  113. </view>
  114. <uv-radio-group v-model="radiovalue">
  115. <view class="price">
  116. <uv-radio
  117. :customStyle="{margin: '8px'}"
  118. v-for="(item, index) in priceList"
  119. :key="index"
  120. iconSize="30rpx"
  121. size="40rpx"
  122. labelSize="26rpx"
  123. :label="item.name"
  124. :name="item.name">
  125. </uv-radio>
  126. </view>
  127. </uv-radio-group>
  128. </view> -->
  129. <view class="form-sheet-cell">
  130. <view class="label">
  131. 工作性质
  132. </view>
  133. <uv-radio-group v-model="form.natureId">
  134. <view class="price">
  135. <uv-radio
  136. :customStyle="{margin: '8px'}"
  137. v-for="(item, index) in natureList"
  138. :key="index"
  139. iconSize="30rpx"
  140. size="40rpx"
  141. labelSize="26rpx"
  142. :label="item.name"
  143. :name="item.id">
  144. </uv-radio>
  145. </view>
  146. </uv-radio-group>
  147. </view>
  148. <view class="form-sheet-cell">
  149. <view class="label">
  150. 联系电话
  151. </view>
  152. <input placeholder="请输入联系电话" v-model="form.phone" />
  153. </view>
  154. <view class="">
  155. <uv-textarea
  156. v-model="form.workDetail"
  157. count
  158. :maxlength="300"
  159. autoHeight
  160. placeholder="请输入职位详情"></uv-textarea>
  161. </view>
  162. <uv-picker ref="picker"
  163. :columns="columns"
  164. @confirm="pickerConfirm"></uv-picker>
  165. <uv-picker ref="jobTypeListPicker"
  166. :columns="[jobTypeList]"
  167. keyName="name"
  168. @confirm="pickerConfirm"></uv-picker>
  169. <uv-picker ref="addressListPicker"
  170. :columns="[addressList]"
  171. keyName="adress"
  172. @confirm="pickerConfirm"></uv-picker>
  173. <view class="uni-color-btn"
  174. @click="submit">
  175. 发布
  176. </view>
  177. </view>
  178. </view>
  179. </template>
  180. <script>
  181. import { mapState } from 'vuex'
  182. export default {
  183. data() {
  184. return {
  185. form : {
  186. // jobContext : '',
  187. phone : '',
  188. workAddress:'',
  189. title : '',
  190. workAge : '',
  191. natureId : 0,
  192. areaId_dictText : '',
  193. typeId_dictText : '',
  194. qulification : '',
  195. },
  196. radiovalue : '',
  197. priceList : [
  198. {
  199. name : '日结',
  200. },
  201. {
  202. name : '月结',
  203. },
  204. ],
  205. picker : {
  206. workAge : [
  207. '不限经验',
  208. ],
  209. qulification : [
  210. '不限学历',
  211. '初中',
  212. '高中',
  213. '专科',
  214. '本科',
  215. '研究生',
  216. '博士',
  217. ],
  218. jobTypeList : [],
  219. },
  220. pickerKey : 'workAge',
  221. }
  222. },
  223. onLoad() {
  224. for (var i = 0; i < 30; i++) {
  225. this.picker.workAge.push((i + 1) + '年经验')
  226. }
  227. // this.form.addId = this.cityList[0].id
  228. this.form.natureId = this.natureList[0].id
  229. },
  230. computed : {
  231. columns(){
  232. return [this.picker[this.pickerKey]]
  233. },
  234. ...mapState(['natureList', 'jobTypeList', 'addressList']),
  235. },
  236. methods: {
  237. openPicker(key, picker){
  238. this.pickerKey = key
  239. if(picker){
  240. picker.open()
  241. }else{
  242. this.$refs.picker.open()
  243. }
  244. },
  245. pickerConfirm(e){
  246. let data = e.value[0]
  247. if(data && data.id){
  248. this.form[this.pickerKey] = data.id
  249. this.form[this.pickerKey + '_dictText'] = data.name || data.adress
  250. }else{
  251. this.form[this.pickerKey] = data
  252. }
  253. },
  254. // 提交
  255. submit(){
  256. // if(this.fileList.length == 0){
  257. // return uni.showToast({
  258. // title: '请上传图片',
  259. // icon : 'none'
  260. // })
  261. // }
  262. if (this.$utils.verificationAll(this.form, {
  263. title: '请输入招工标题',
  264. workAddress : '请选择工作地点',
  265. workAge : '请选择工龄要求',
  266. // company : '请输入招聘公司',
  267. salaryLow : '请输入薪资范围',
  268. salaryUp : '请输入薪资范围',
  269. // iconText: '请输入标签',
  270. // userName: '请输入联系人',
  271. phone: '请输入联系电话',
  272. // jobContext : '请输入职位描述',
  273. qulification : '请选择学历要求',
  274. workDetail: '请输入职位详情',
  275. // gsContext : '请输入公司介绍',
  276. })) {
  277. return
  278. }
  279. this.$api('addJob', this.form, res => {
  280. if(res.code == 200){
  281. uni.showToast({
  282. title: '发布成功!',
  283. icon: 'none'
  284. })
  285. setTimeout(uni.navigateBack, 1000, -1)
  286. }
  287. })
  288. },
  289. //地图上选择地址
  290. selectAddr() {
  291. uni.chooseLocation({
  292. success: (res) => {
  293. this.setAddress(res)
  294. }
  295. });
  296. },
  297. //提取用户选择的地址信息复制给表单数据
  298. setAddress(res) {
  299. //经纬度信息
  300. this.form.latitude = res.latitude
  301. this.form.longitude = res.longitude
  302. // if (res.name) { //用户直接选择城市的逻辑
  303. if (!res.address && res.name) { //用户直接选择城市的逻辑
  304. return this.form.workAddress = res.name
  305. }
  306. if (res.address || res.name) {
  307. return this.form.workAddress = res.address + res.name
  308. }
  309. this.form.workAddress = '' //用户啥都没选就点击勾选
  310. this.form.latitude = ''
  311. this.form.longitude = ''
  312. },
  313. }
  314. }
  315. </script>
  316. <style scoped lang="scss">
  317. .page{
  318. background-color: #fff;
  319. min-height: 100vh;
  320. box-sizing: border-box;
  321. color: #333333;
  322. font-size: 28rpx;
  323. /deep/ text{
  324. font-size: 28rpx !important;
  325. }
  326. .form{
  327. padding: 30rpx;
  328. .help-issue {
  329. margin: 20rpx;
  330. }
  331. .title-input{
  332. border: 1px solid $uni-color;
  333. width: 100%;
  334. border-radius: 10rpx;
  335. padding: 10rpx 20rpx;
  336. box-sizing: border-box;
  337. height: 65rpx;
  338. }
  339. .form-sheet-cell{
  340. display: flex;
  341. background-color: #fff;
  342. padding: 20rpx 30rpx;
  343. align-items: center;
  344. .label{
  345. width: 160rpx;
  346. }
  347. .price{
  348. display: flex;
  349. text-align: center;
  350. input{
  351. width: 150rpx;
  352. border: 1px solid $uni-color;
  353. margin: 0 10rpx;
  354. }
  355. }
  356. input{
  357. flex: 1;
  358. background-color: rgba($uni-color, 0.1);
  359. padding: 10rpx 20rpx;
  360. border-radius: 10rpx;
  361. }
  362. .right-icon{
  363. margin-left: auto;
  364. }
  365. }
  366. }
  367. /deep/ .uv-textarea{
  368. background-color: rgba($uni-color, 0.1) !important;
  369. min-height: 400rpx;
  370. }
  371. }
  372. </style>