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

393 lines
8.4 KiB

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