updataGangw.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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.money / option.postPeopleNum
  152. console.log(parseInt(this.price),'******************')
  153. console.log(this.postPeopleNum)
  154. this.totalPrice = (parseInt(this.price) * parseInt(this.postPeopleNum)).toFixed(0)
  155. }
  156. }
  157. if (e.classify) { //1.定制化 2.精准推送
  158. this.classify = e.classify
  159. }
  160. if (uni.getStorageSync('postDetailsList')) {
  161. this.postDetailsList = uni.getStorageSync('postDetailsList')
  162. }
  163. // console.log(this.postDetailsList)
  164. },
  165. onShow() {
  166. },
  167. methods: {
  168. ageConfirm(e){
  169. console.log(e)
  170. this.postAge = e[0].value
  171. },
  172. getAgeList(){
  173. this.$Request.get('/app/dict/list', {
  174. type:'年龄'
  175. }).then(res => {
  176. if (res.code == 0) {
  177. let arr = res.data
  178. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  179. this.ageList = arr
  180. this.ageShow = true
  181. }
  182. })
  183. },
  184. moneyConfirm(e){
  185. console.log(e)
  186. this.postPrice = e[0].value
  187. },
  188. //薪资列表
  189. getMonyList(){
  190. this.$Request.get('/app/dict/list', {
  191. type:'薪资'
  192. }).then(res => {
  193. if (res.code == 0) {
  194. let arr = res.data
  195. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  196. this.monyList = arr
  197. this.monyShow = true
  198. }
  199. })
  200. },
  201. input(e) {
  202. // console.log('人数:', e)
  203. this.totalPrice = parseInt(this.price * e).toFixed(0)
  204. this.customizationPrice = parseInt(this.price * e).toFixed(0)
  205. },
  206. SexConfirm(e) { //选择性别
  207. this.postSex = e[0].label
  208. },
  209. //获取一级岗位
  210. getPost() {
  211. this.getClassifyList()
  212. },
  213. //获取求职岗位
  214. getClassifyList() {
  215. let data = {
  216. status: 1
  217. }
  218. this.$Request.get('/app/rule/selectRuleClassifyList', data).then(res => {
  219. if (res.code == 0) {
  220. var arr = []
  221. res.data.forEach((d, index) => {
  222. var data = {}
  223. data.label = d.ruleClassifyName
  224. data.value = d.ruleClassifyId
  225. data.price = d.accuratePrice//普通价格
  226. data.memberPrice = d.accurateMemberPrice//会员价格
  227. arr.push(data)
  228. })
  229. this.postlist = arr
  230. this.postShow = true
  231. }
  232. })
  233. },
  234. postConfirm(e) {
  235. this.postName = e[0].label
  236. this.ruleClassifyId = e[0].value
  237. this.postlist.map(item=>{
  238. if(item.value == this.ruleClassifyId){
  239. if (this.member == 0 || this.member == null ) { //普通用户
  240. this.price = item.price
  241. if(this.postPeopleNum){
  242. this.totalPrice = item.price * this.postPeopleNum
  243. }else{
  244. this.totalPrice = item.price
  245. }
  246. } else{//会员
  247. this.price = item.memberPrice
  248. if(this.postPeopleNum){
  249. this.totalPrice = item.memberPrice * this.postPeopleNum
  250. }else{
  251. this.totalPrice = item.memberPrice
  252. }
  253. }
  254. }
  255. })
  256. this.getPostList()
  257. },
  258. getPostlist() {
  259. if(this.postName!=''){
  260. this.show = true
  261. }else{
  262. uni.showToast({
  263. title:'请选择岗位',
  264. icon:'none'
  265. })
  266. }
  267. },
  268. //获取岗位
  269. getPostList() {
  270. let data = {
  271. ruleClassifyId: this.ruleClassifyId
  272. }
  273. this.$Request.post('/app/rule/selectRulePostList', data).then(res => {
  274. if (res.code == 0) {
  275. var arr = []
  276. res.data.forEach((d, index) => {
  277. var data = {}
  278. data.label = d.rulePostName
  279. data.value = d.rulePostId
  280. arr.push(data)
  281. })
  282. this.ErjiList = arr
  283. }
  284. })
  285. },
  286. postlistConfirm(e) {//11111111111111111111
  287. this.rulePostName = e[0].label
  288. this.rulePostId = e[0].value
  289. },
  290. save() {
  291. if (!this.postName) {
  292. uni.showToast({
  293. title: '请选择岗位',
  294. icon: 'none',
  295. duration: 1000
  296. })
  297. return
  298. }
  299. if (!this.rulePostName) {
  300. uni.showToast({
  301. title: '请选择专业',
  302. icon: 'none',
  303. duration: 1000
  304. })
  305. return
  306. }
  307. if (!this.postPrice) {
  308. uni.showToast({
  309. title: '请选择工资',
  310. icon: 'none',
  311. duration: 1000
  312. })
  313. return
  314. }
  315. if (!this.postPeopleNum) {
  316. uni.showToast({
  317. title: '请填写人数',
  318. icon: 'none',
  319. duration: 1000
  320. })
  321. return
  322. }
  323. if (!this.postSex) {
  324. uni.showToast({
  325. title: '请选择性别',
  326. icon: 'none',
  327. duration: 1000
  328. })
  329. return
  330. }
  331. if (!this.postAge) {
  332. uni.showToast({
  333. title: '请填写年龄',
  334. icon: 'none',
  335. duration: 1000
  336. })
  337. return
  338. }
  339. if (!this.postPrice) {
  340. uni.showToast({
  341. title: '请填写工资',
  342. icon: 'none',
  343. duration: 1000
  344. })
  345. return
  346. }
  347. if(this.postDetailsIndex){
  348. this.postDetailsList.splice(this.postDetailsIndex, 1)
  349. }
  350. if (this.classify == 1) {
  351. let data = {
  352. postName: this.postName, //岗位名称
  353. ruleClassifyId: this.ruleClassifyId,
  354. rulePostName: this.rulePostName, //岗位职称
  355. rulePostId: this.rulePostId,
  356. postPeopleNum: this.postPeopleNum, //岗位人数
  357. postSex: this.postSex, //性别
  358. postAge: this.postAge, //年龄段
  359. // postPrice: this.postPrice, //岗位工资
  360. // price:this.price,//发布价格
  361. offlinePrice: this.offlinePrice, //线下价格
  362. customizationPrice: this.customizationPrice, //保证金价格
  363. }
  364. this.postDetailsList.push(data)
  365. uni.setStorageSync('postDetailsList', this.postDetailsList)
  366. uni.navigateBack()
  367. } else if (this.classify == 2) {
  368. let data = {
  369. postName: this.postName, //岗位名称
  370. ruleClassifyId: this.ruleClassifyId,
  371. rulePostName: this.rulePostName, //岗位职称
  372. rulePostId: this.rulePostId,
  373. postPeopleNum: this.postPeopleNum, //岗位人数
  374. postSex: this.postSex, //性别
  375. postAge: this.postAge, //年龄段
  376. postPrice: this.postPrice, //岗位工资
  377. price: this.price, //发布价格
  378. }
  379. this.postDetailsList.push(data)
  380. uni.setStorageSync('postDetailsList', this.postDetailsList)
  381. uni.navigateBack()
  382. }
  383. }
  384. }
  385. }
  386. </script>
  387. <style lang="less">
  388. page {
  389. background: #F2F2F7;
  390. }
  391. .box {
  392. background: #FFFFFF;
  393. border-radius: 24upx;
  394. margin: 30upx;
  395. padding: 30upx;
  396. }
  397. .u-input__input {
  398. text-align: right !important;
  399. }
  400. .subbtn {
  401. width: 100%;
  402. display: flex;
  403. align-items: center;
  404. justify-content: space-between;
  405. background: #fff;
  406. border-radius: 10upx;
  407. height: 90upx;
  408. // padding: 30upx 0upx;
  409. color: #000;
  410. position: fixed;
  411. left: 0;
  412. right: 0;
  413. bottom: 0;
  414. z-index: 99;
  415. }
  416. .btn {
  417. background: #82A9FE;
  418. color: #FFFFFF;
  419. width: 30%;
  420. height: 90upx;
  421. line-height: 90upx;
  422. text-align: center;
  423. }
  424. </style>