gangw.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="flex align-center justify-between margin-bottom" @click="getPost">
  5. <view class=" text-bold">岗位</view>
  6. <view class="text-right flex align-center ">
  7. <view class="">{{postName?postName:'请选择岗位'}}</view>
  8. <view class="margin-left-sm">
  9. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  14. <view class="flex align-center justify-between" @click="getPostlist">
  15. <view class=" text-bold">专业</view>
  16. <view class="text-right flex align-center padding-tb-sm">
  17. <view>{{rulePostName? rulePostName:'请选择专业'}}</view>
  18. <view class="margin-left-sm">
  19. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  24. <view class="flex align-center justify-between" @click="getMonyList">
  25. <view class=" text-bold">工资</view>
  26. <view class="text-right flex align-center padding-tb-sm">
  27. <view>{{postPrice? postPrice:'请选择薪资'}}</view>
  28. <view class="margin-left-sm">
  29. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  30. </view>
  31. </view>
  32. <!-- <view class="text-right flex align-center ">
  33. <u-input v-model="postPrice" placeholder="请填写工资" placeholder-style="color:#999999;"
  34. :clearable="false" />
  35. <view class="margin-left-sm">
  36. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  37. </view>
  38. </view> -->
  39. </view>
  40. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  41. <view class="flex align-center justify-between">
  42. <view class=" text-bold">人数</view>
  43. <view class="text-right flex align-center ">
  44. <u-input v-model="postPeopleNum" type="number" placeholder="请填写人数" placeholder-style="color:#999999;"
  45. @input="input" :clearable="false" />
  46. <view class="margin-left-sm">
  47. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  52. <view class="flex align-center justify-between" @click="SexShow=true">
  53. <view class=" text-bold">性别</view>
  54. <view class="text-right flex align-center margin-tb-sm">
  55. <view v-if="postSex">{{postSex}}</view>
  56. <view v-else style="color:#999999;">请选择性别</view>
  57. <view class="margin-left-sm">
  58. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  63. <view class="flex align-center justify-between" @click="getAgeList">
  64. <view class=" text-bold">年龄</view>
  65. <view class="text-right flex align-center padding-tb-sm">
  66. <view>{{postAge? postAge:'请选择年龄'}}</view>
  67. <view class="margin-left-sm">
  68. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="margin-lr " style="color: #82A9FE;" v-if="offlinePrice">
  74. 当前岗位线下需要支付{{offlinePrice?offlinePrice:'0'}}元,支付后保证金会退回账户。</view>
  75. <!-- 求职岗位 -->
  76. <u-select v-model="postShow" :list="postlist" @confirm="postConfirm"></u-select>
  77. <!-- 专业 -->
  78. <u-select v-model="show" :list="ErjiList" @confirm="postlistConfirm"></u-select>
  79. <u-select v-model="SexShow" :list="list" @confirm="SexConfirm"></u-select>
  80. <!-- 薪资 -->
  81. <u-select v-model="monyShow" :list="monyList" @confirm="moneyConfirm"></u-select>
  82. <!-- 年龄 -->
  83. <u-select v-model="ageShow" :list="ageList" @confirm="ageConfirm"></u-select>
  84. <view class="subbtn" @click="save">
  85. <view class="padding-left flex align-center" style="color: red;" v-if="classify==2">
  86. <!-- <view class="text-df">¥</view> -->
  87. <view style="font-size: 48upx;">{{totalPrice?totalPrice:'0'}}<span style="font-size:24rpx;margin-left: 5rpx;margin-right: 5rpx;">积分</span></view>
  88. <view class=" margin-left-xs" style="color:#82A9FE;font-size: 22rpx;">*发布当前岗位需支付的价格</view>
  89. </view>
  90. <view class="btn">保存</view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. ageShow:false,
  99. ageList:[],
  100. monyShow:false,
  101. monyList:[],//薪资列表
  102. postName: '', //岗位名称
  103. rulePostName: '', //岗位职称
  104. rulePostId: '',
  105. postMajor: [], //岗位专业
  106. postPeopleNum: '', //岗位人数
  107. postSex: '', //性别
  108. postAge: '', //年龄段
  109. postPrice: '', //岗位工资
  110. postShow: false, //一级岗位
  111. postlist: [],
  112. show: false, //二级岗位
  113. ErjiList: [],
  114. price: '',
  115. totalPrice: '',
  116. member: '', //1 会员
  117. SexShow: false, //性别
  118. list: [{
  119. value: '1',
  120. label: '男'
  121. }, {
  122. value: '2',
  123. label: '女'
  124. }, {
  125. value: '3',
  126. label: '男女不限'
  127. }],
  128. postDetailsList: [],
  129. postDetailsIndex: '',
  130. classify: '', //1.定制化 2.精准推送
  131. offlinePrice: '', //线下价格
  132. customizationPrice: '', //保证金价格
  133. }
  134. },
  135. onLoad(e) {
  136. this.classify = e.classify
  137. this.member = uni.getStorageSync('member') ? uni.getStorageSync('member') : '0'
  138. if (e.index) {
  139. this.postDetailsIndex = e.index
  140. let option = JSON.parse(e.postDetailsList)
  141. if (option) {
  142. console.log(option)
  143. this.postName = option.postName //岗位名称
  144. this.ruleClassifyId = option.ruleClassifyId
  145. this.rulePostName = option.rulePostName //专业名称
  146. this.rulePostId = option.rulePostId
  147. this.postPeopleNum = option.postPeopleNum //岗位人数
  148. this.postSex = option.postSex //性别
  149. this.postAge = option.postAge //年龄段
  150. this.postPrice = option.postPrice //岗位工资
  151. this.price = option.price
  152. this.totalPrice = (parseInt(this.price) * parseInt(this.postPeopleNum)).toFixed(0)
  153. }
  154. }
  155. if (e.classify) { //1.定制化 2.精准推送
  156. this.classify = e.classify
  157. }
  158. if (uni.getStorageSync('postDetailsList')) {
  159. this.postDetailsList = uni.getStorageSync('postDetailsList')
  160. }
  161. // console.log(this.postDetailsList)
  162. },
  163. onShow() {
  164. },
  165. methods: {
  166. ageConfirm(e){
  167. console.log(e)
  168. this.postAge = e[0].value
  169. },
  170. getAgeList(){
  171. this.$Request.get('/app/dict/list', {
  172. type:'年龄'
  173. }).then(res => {
  174. if (res.code == 0) {
  175. let arr = res.data
  176. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  177. this.ageList = arr
  178. this.ageShow = true
  179. }
  180. })
  181. },
  182. moneyConfirm(e){
  183. console.log(e)
  184. this.postPrice = e[0].value
  185. },
  186. //薪资列表
  187. getMonyList(){
  188. this.$Request.get('/app/dict/list', {
  189. type:'薪资'
  190. }).then(res => {
  191. if (res.code == 0) {
  192. let arr = res.data
  193. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  194. this.monyList = arr
  195. this.monyShow = true
  196. }
  197. })
  198. },
  199. input(e) {
  200. // console.log('人数:', e)
  201. this.totalPrice = parseInt(this.price * e).toFixed(0)
  202. this.customizationPrice = parseInt(this.price * e).toFixed(0)
  203. },
  204. SexConfirm(e) { //选择性别
  205. this.postSex = e[0].label
  206. },
  207. //获取一级岗位
  208. getPost() {
  209. this.getClassifyList()
  210. },
  211. //获取求职岗位
  212. getClassifyList() {
  213. let data = {
  214. status: 1
  215. }
  216. this.$Request.get('/app/rule/selectRuleClassifyList', data).then(res => {
  217. if (res.code == 0) {
  218. var arr = []
  219. res.data.forEach((d, index) => {
  220. var data = {}
  221. data.label = d.ruleClassifyName
  222. data.value = d.ruleClassifyId
  223. data.price = d.accuratePrice//普通价格
  224. data.memberPrice = d.accurateMemberPrice//会员价格
  225. arr.push(data)
  226. })
  227. this.postlist = arr
  228. this.postShow = true
  229. }
  230. })
  231. },
  232. postConfirm(e) {
  233. this.postName = e[0].label
  234. this.ruleClassifyId = e[0].value
  235. this.postlist.map(item=>{
  236. if(item.value == this.ruleClassifyId){
  237. if (this.member == 0 || this.member == null ) { //普通用户
  238. this.price = item.price
  239. if(this.postPeopleNum){
  240. this.totalPrice = item.price * this.postPeopleNum
  241. }else{
  242. this.totalPrice = item.price
  243. }
  244. } else{//会员
  245. this.price = item.memberPrice
  246. if(this.postPeopleNum){
  247. this.totalPrice = item.memberPrice * this.postPeopleNum
  248. }else{
  249. this.totalPrice = item.memberPrice
  250. }
  251. }
  252. }
  253. })
  254. this.getPostList()
  255. },
  256. getPostlist() {
  257. if(this.postName!=''){
  258. this.show = true
  259. }else{
  260. uni.showToast({
  261. title:'请选择岗位',
  262. icon:'none'
  263. })
  264. }
  265. },
  266. //获取专业
  267. getPostList() {
  268. let data = {
  269. ruleClassifyId: this.ruleClassifyId
  270. }
  271. this.$Request.post('/app/rule/selectRulePostList', data).then(res => {
  272. if (res.code == 0) {
  273. var arr = []
  274. res.data.forEach((d, index) => {
  275. var data = {}
  276. data.label = d.rulePostName
  277. data.value = d.rulePostId
  278. arr.push(data)
  279. })
  280. this.ErjiList = arr
  281. }
  282. })
  283. },
  284. postlistConfirm(e) {//11111111111111111111
  285. this.rulePostName = e[0].label
  286. this.rulePostId = e[0].value
  287. },
  288. save() {
  289. if (!this.postName) {
  290. uni.showToast({
  291. title: '请选择岗位',
  292. icon: 'none',
  293. duration: 1000
  294. })
  295. return
  296. }
  297. if (!this.rulePostName) {
  298. uni.showToast({
  299. title: '请选择专业',
  300. icon: 'none',
  301. duration: 1000
  302. })
  303. return
  304. }
  305. if (!this.postPrice) {
  306. uni.showToast({
  307. title: '请选择工资',
  308. icon: 'none',
  309. duration: 1000
  310. })
  311. return
  312. }
  313. if (!this.postPeopleNum) {
  314. uni.showToast({
  315. title: '请填写人数',
  316. icon: 'none',
  317. duration: 1000
  318. })
  319. return
  320. }
  321. if (!this.postSex) {
  322. uni.showToast({
  323. title: '请选择性别',
  324. icon: 'none',
  325. duration: 1000
  326. })
  327. return
  328. }
  329. if (!this.postAge) {
  330. uni.showToast({
  331. title: '请填写年龄',
  332. icon: 'none',
  333. duration: 1000
  334. })
  335. return
  336. }
  337. if (!this.postPrice) {
  338. uni.showToast({
  339. title: '请填写工资',
  340. icon: 'none',
  341. duration: 1000
  342. })
  343. return
  344. }
  345. if(this.postDetailsIndex){
  346. this.postDetailsList.splice(this.postDetailsIndex, 1)
  347. }
  348. if (this.classify == 1) {
  349. let data = {
  350. postName: this.postName, //岗位名称
  351. ruleClassifyId: this.ruleClassifyId,
  352. rulePostName: this.rulePostName, //岗位职称
  353. rulePostId: this.rulePostId,
  354. postPeopleNum: this.postPeopleNum, //岗位人数
  355. postSex: this.postSex, //性别
  356. postAge: this.postAge, //年龄段
  357. // postPrice: this.postPrice, //岗位工资
  358. // price:this.price,//发布价格
  359. offlinePrice: this.offlinePrice, //线下价格
  360. customizationPrice: this.customizationPrice, //保证金价格
  361. }
  362. this.postDetailsList.push(data)
  363. uni.setStorageSync('postDetailsList', this.postDetailsList)
  364. uni.navigateBack()
  365. } else if (this.classify == 2) {
  366. let data = {
  367. postName: this.postName, //岗位名称
  368. ruleClassifyId: this.ruleClassifyId,
  369. rulePostName: this.rulePostName, //岗位职称
  370. rulePostId: this.rulePostId,
  371. postPeopleNum: this.postPeopleNum, //岗位人数
  372. postSex: this.postSex, //性别
  373. postAge: this.postAge, //年龄段
  374. postPrice: this.postPrice, //岗位工资
  375. price: this.price, //发布价格
  376. }
  377. this.postDetailsList.push(data)
  378. uni.setStorageSync('postDetailsList', this.postDetailsList)
  379. uni.navigateBack()
  380. }
  381. }
  382. }
  383. }
  384. </script>
  385. <style lang="less">
  386. page {
  387. background: #F2F2F7;
  388. }
  389. .box {
  390. background: #FFFFFF;
  391. border-radius: 24upx;
  392. margin: 30upx;
  393. padding: 30upx;
  394. }
  395. .u-input__input {
  396. text-align: right !important;
  397. }
  398. .subbtn {
  399. width: 100%;
  400. display: flex;
  401. align-items: center;
  402. justify-content: space-between;
  403. background: #fff;
  404. border-radius: 10upx;
  405. height: 90upx;
  406. // padding: 30upx 0upx;
  407. color: #000;
  408. position: fixed;
  409. left: 0;
  410. right: 0;
  411. bottom: 0;
  412. z-index: 99;
  413. }
  414. .btn {
  415. background: #82A9FE;
  416. color: #FFFFFF;
  417. width: 30%;
  418. height: 90upx;
  419. line-height: 90upx;
  420. text-align: center;
  421. }
  422. </style>