瑶都万能墙
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.

280 lines
5.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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"
  11. v-model="form.title"
  12. class="title-input"/>
  13. </view>
  14. <uv-cell
  15. title="工作地点"
  16. rightIconStyle="fontSize: 30rpx;"
  17. :value="form.address || '请选择招工地点'"
  18. @click="selectAddr"
  19. isLink
  20. ></uv-cell>
  21. <uv-cell
  22. title="学历要求"
  23. rightIconStyle="fontSize: 30rpx;"
  24. :value="form.school || '请选择学历要求'"
  25. @click="openPicker('school')"
  26. isLink
  27. ></uv-cell>
  28. <uv-cell
  29. title="工龄要求"
  30. rightIconStyle="fontSize: 30rpx;"
  31. :value="form.workYear || '请选择工龄要求'"
  32. @click="openPicker('workYear')"
  33. isLink
  34. ></uv-cell>
  35. <view class="form-sheet-cell">
  36. <view class="label">
  37. 薪资范围
  38. </view>
  39. <view class="price">
  40. <input placeholder="最小薪资" v-model="form.minPrice" />
  41. ~
  42. <input placeholder="最大薪资" v-model="form.maxPrice" />
  43. </view>
  44. </view>
  45. <view class="form-sheet-cell">
  46. <view class="label">
  47. 结算方式
  48. </view>
  49. <uv-radio-group v-model="radiovalue">
  50. <view class="price">
  51. <uv-radio
  52. :customStyle="{margin: '8px'}"
  53. v-for="(item, index) in priceList"
  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. <uv-radio-group v-model="radiovalue">
  69. <view class="price">
  70. <uv-radio
  71. :customStyle="{margin: '8px'}"
  72. v-for="(item, index) in jopList"
  73. :key="index"
  74. iconSize="30rpx"
  75. size="40rpx"
  76. labelSize="26rpx"
  77. :label="item.name"
  78. :name="item.name">
  79. </uv-radio>
  80. </view>
  81. </uv-radio-group>
  82. </view>
  83. <view class="form-sheet-cell">
  84. <view class="label">
  85. 联系电话
  86. </view>
  87. <input placeholder="请输入联系电话" v-model="form.phone" />
  88. </view>
  89. <view class=""
  90. style="margin-top: 20rpx;">
  91. <uv-textarea
  92. v-model="form.jobDetails"
  93. count
  94. :maxlength="300"
  95. autoHeight
  96. placeholder="请输入岗位详细介绍"></uv-textarea>
  97. </view>
  98. <view class="uni-color-btn"
  99. @click="submit">
  100. 发布
  101. </view>
  102. </view>
  103. <uv-picker ref="picker"
  104. :columns="columns"
  105. @confirm="pickerConfirm"></uv-picker>
  106. </view>
  107. </template>
  108. <script>
  109. import Position from '@/utils/position.js'
  110. export default {
  111. data() {
  112. return {
  113. form : {
  114. school : '',
  115. workYear : '',
  116. minPrice : '',
  117. maxPrice : '',
  118. address : '',
  119. },
  120. radiovalue : '',
  121. priceList : [
  122. {
  123. name : '日结',
  124. },
  125. {
  126. name : '月结',
  127. },
  128. ],
  129. jopList : [
  130. {
  131. name : '正式工',
  132. },
  133. {
  134. name : '临时工',
  135. },
  136. ],
  137. picker : {
  138. workYear : [
  139. '不限',
  140. ],
  141. school : [
  142. '不限',
  143. '初中',
  144. '高中',
  145. '专科',
  146. '本科',
  147. '研究生',
  148. '博士',
  149. ],
  150. },
  151. pickerKey : 'workYear',
  152. }
  153. },
  154. onLoad() {
  155. for (var i = 0; i < 30; i++) {
  156. this.picker.workYear.push((i + 1) + '年')
  157. }
  158. },
  159. computed : {
  160. columns(){
  161. return [this.picker[this.pickerKey]]
  162. },
  163. },
  164. methods: {
  165. openPicker(key){
  166. this.pickerKey = key
  167. this.$refs.picker.open()
  168. },
  169. pickerConfirm(e){
  170. this.form[this.pickerKey] = e.value[0]
  171. },
  172. //地图上选择地址
  173. selectAddr() {
  174. Position.selectAddress(res => {
  175. //经纬度信息
  176. this.form.latitude = res.latitude
  177. this.form.longitude = res.longitude
  178. if (res.name) {
  179. return this.form.address = res.name
  180. }
  181. this.form.address = ''
  182. })
  183. },
  184. // 提交
  185. submit(){
  186. // if(this.fileList.length == 0){
  187. // return uni.showToast({
  188. // title: '请上传图片',
  189. // icon : 'none'
  190. // })
  191. // }
  192. if (this.$utils.verificationAll(this.form, {
  193. title: '请输入招工标题',
  194. address : '请选择工作地点',
  195. school : '请选择学历要求',
  196. workYear : '请选择学历要求',
  197. minPrice : '请输入最小薪资',
  198. maxPrice : '请输入最大薪资',
  199. phone: '请输入联系电话',
  200. jobDetails: '请输入岗位详细介绍',
  201. })) {
  202. return
  203. }
  204. this.$api('publishJob', this.form, res => {
  205. if(res.code == 200){
  206. uni.showToast({
  207. title: '发布成功!',
  208. icon: 'none'
  209. })
  210. setTimeout(uni.navigateBack, 1000, -1)
  211. }
  212. })
  213. },
  214. }
  215. }
  216. </script>
  217. <style scoped lang="scss">
  218. .page{
  219. background-color: #fff;
  220. min-height: 100vh;
  221. box-sizing: border-box;
  222. color: #333333;
  223. font-size: 28rpx;
  224. /deep/ text{
  225. font-size: 28rpx !important;
  226. }
  227. .form{
  228. padding: 30rpx;
  229. .help-issue {
  230. margin: 20rpx;
  231. }
  232. .title-input{
  233. border: 1px solid $uni-color;
  234. width: 100%;
  235. border-radius: 10rpx;
  236. padding: 10rpx 20rpx;
  237. box-sizing: border-box;
  238. height: 65rpx;
  239. }
  240. .form-sheet-cell{
  241. display: flex;
  242. background-color: #fff;
  243. padding: 20rpx 30rpx;
  244. align-items: center;
  245. .label{
  246. width: 160rpx;
  247. }
  248. .price{
  249. display: flex;
  250. text-align: center;
  251. input{
  252. width: 150rpx;
  253. border: 1px solid $uni-color;
  254. margin: 0 10rpx;
  255. }
  256. }
  257. .right-icon{
  258. margin-left: auto;
  259. }
  260. }
  261. }
  262. }
  263. </style>