index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <!-- 菜单悬浮的原理: 通过给菜单添加position:sticky实现, 用法超简单, 仅APP端的低端机不兼容 https://caniuse.com/#feat=css-sticky -->
  2. <template>
  3. <view v-if="XCXIsSelect == '是'">
  4. <view class="sticky-tabs">
  5. <me-tabs v-model="tabIndex" nameKey='name' :tabs="tabs" @change="tabChange"></me-tabs>
  6. </view>
  7. <view>
  8. <view class="box" v-for="(item,index) in goods" :key="index"
  9. @click="goNav('/my/order/pay?postPushId='+item.postPushId)">
  10. <view class="flex align-center justify-between padding-lr padding-tb-sm">
  11. <view style="color: #00B88F;font-size: 28rpx;font-weight: bold;"><text
  12. v-if="item.isOverdue==1">到期</text>{{item.statusName}}</view>
  13. <view class="text-sm" style="color: #999999;">{{item.createTime}}</view>
  14. </view>
  15. <view style="width: 100%;height: 1rpx;background: #EEEEEE;"></view>
  16. <view class="padding-lr padding-tb-sm">
  17. <view class="flex align-center justify-between">
  18. <view class="text-bold" style="color: #1F1F1F;font-size: 38upx;">
  19. {{item.stationName?item.stationName:''}}
  20. </view>
  21. <view class="" style="color: #00B88F;font-size: 38upx;"><text
  22. class="text-lg text-bold">{{item.salaryRange?item.salaryRange:''}}</text></view>
  23. </view>
  24. <view class="flex align-center margin-top-sm flex-wrap">
  25. <view class="argrtn">
  26. {{item.education}}
  27. </view>
  28. <view class="argrtn">
  29. {{item.experience}}
  30. </view>
  31. <view class="argrtn" v-for="(ite,index) in (item.positionWelfare).split(',')" :key="index">
  32. {{ite}}
  33. </view>
  34. </view>
  35. <view class="address flex align-center justify-between">
  36. <view class="" style="color: #999999;">
  37. {{item.company?item.company.companyName:''}}
  38. </view>
  39. <view class="" style="color: #666666;">
  40. {{item.city}} {{item.county}}
  41. </view>
  42. </view>
  43. </view>
  44. <view style="width: 100%;height: 1rpx;background: #EEEEEE;"></view>
  45. <view class="flex align-center padding-tb justify-end padding-lr">
  46. <view class="flex align-center">
  47. <!-- <view class="btn" @click.stop="Changekefu()">联系客服</view> -->
  48. <view class="btn" v-if="item.status == 2" @click.stop="closeJob(item.postPushId,'close')">关闭岗位
  49. </view>
  50. <view class="btn" v-if="item.status == 5 && item.isOverdue == 0"
  51. @click.stop="closeJob(item.postPushId,'open')">开启岗位</view>
  52. <view class="btn" v-if="item.status == 4 || item.isOverdue==1"
  53. @click.stop="updataServeType(item.postPushId,'save')">重新发布</view>
  54. <view class="btn"
  55. v-if="item.status == 2 || item.status==3 || item.status==5 && item.isOverdue==0"
  56. @click.stop="updataServeType(item.postPushId,'updata')">修改内容</view>
  57. <view v-if="item.status==1" class="btn" @click.stop="cancelProject(item.postPushId)">取消招聘</view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <empty v-if="goods.length==0" />
  63. </view>
  64. <view class="" v-else>
  65. 帮助中心,联系我们,为你提供帮助
  66. </view>
  67. </template>
  68. <script>
  69. import meTabs from "@/components/mescroll-uni/me-tabs/me-tabs.vue";
  70. import empty from '@/components/empty.vue'
  71. export default {
  72. components: {
  73. meTabs,
  74. empty
  75. },
  76. data() {
  77. return {
  78. count: 0,
  79. statuss: 'loadmore',
  80. iconType: 'flower',
  81. loadText: {
  82. loadmore: '轻轻上拉',
  83. loading: '努力加载中',
  84. nomore: '实在没有了'
  85. },
  86. goods: [], // 数据列表
  87. game: [],
  88. tabs: [{
  89. name: '全部',
  90. status: 0
  91. }, {
  92. name: '待审核',
  93. status: 1
  94. }, {
  95. name: '招聘中',
  96. status: 2
  97. }, {
  98. name: '已拒绝',
  99. status: 3
  100. }, {
  101. name: '已取消',
  102. status: 4
  103. }, {
  104. name: '已关闭',
  105. status: 5
  106. }],
  107. tabIndex: 0, // tab下标
  108. page: 1,
  109. limit: 10,
  110. userId: 0,
  111. status: 1,
  112. nickName: '',
  113. avatar: '',
  114. customStyle: {
  115. color: '#999999',
  116. border: '2rpx solid #999999',
  117. // backgroundColor: '#1E1F31',
  118. border: "8rpx",
  119. width: '180rpx',
  120. height: '54rpx',
  121. margin: "0 0 0 20rpx"
  122. },
  123. customStyle1: {
  124. color: '#557EFD',
  125. border: '2rpx solid #557EFD',
  126. // backgroundColor: '#1E1F31',
  127. border: "8rpx",
  128. width: '180rpx',
  129. height: '54rpx',
  130. margin: "0 0 0 20rpx"
  131. },
  132. peopleNum: 0,
  133. dayNum: 0,
  134. XCXIsSelect: '是',
  135. }
  136. },
  137. onLoad(option) {
  138. this.XCXIsSelect = uni.getStorageSync('XCXIsSelect')
  139. if (this.XCXIsSelect != '是') {
  140. uni.setNavigationBarTitle({
  141. title: '帮助中心'
  142. })
  143. }
  144. this.$queue.showLoading("加载中...");
  145. if (option.index) {
  146. console.log(option)
  147. this.tabIndex = parseInt(option.index)
  148. console.log(' this.tabIndex this.tabIndex', this.tabIndex)
  149. }
  150. // this.gettype1();
  151. // this.gettype2();
  152. // this.getlist()
  153. this.userId = uni.getStorageSync('userId')
  154. this.nickName = uni.getStorageSync('nickName')
  155. },
  156. onShow() {
  157. this.getlist()
  158. },
  159. methods: {
  160. //关闭岗位
  161. closeJob(postPushId, type) {
  162. let that = this
  163. uni.showModal({
  164. title: '提示',
  165. content: type == 'close' ? '关闭岗位后,该岗位不会再推荐给用户,是否关闭?' : '开启岗位后,该岗位会重新推荐给用户,是否开启?',
  166. complete(ret) {
  167. if (ret.confirm) {
  168. that.$Request.getT('/app/postPush/closeOrOpen', {
  169. postPushId: postPushId
  170. }).then(res => {
  171. if (res.code == 0) {
  172. uni.showToast({
  173. title: type == 'close' ? '已关闭' : '已开启',
  174. duration: 1500,
  175. complete() {
  176. that.page = 1
  177. that.getlist()
  178. }
  179. })
  180. } else {
  181. uni.showToast({
  182. title: res.msg,
  183. icon: 'none'
  184. })
  185. }
  186. })
  187. }
  188. }
  189. })
  190. },
  191. //修改岗位
  192. updataServeType(postPushId, type) {
  193. let companyStatus = uni.getStorageSync('companyStatus')
  194. if (companyStatus == 1) {
  195. uni.showToast({
  196. title: '企业认证审核中,请审核通过后操作!',
  197. icon: 'none'
  198. })
  199. return
  200. }
  201. if (companyStatus == 3) {
  202. uni.showToast({
  203. title: '企业认证审核未通过,请重新认证!',
  204. icon: 'none'
  205. })
  206. return
  207. }
  208. uni.navigateTo({
  209. url: '/package/addJob/addJob?postPushId=' + postPushId + '&type=' + type
  210. })
  211. },
  212. //取消招聘
  213. cancelProject(postPushId) {
  214. let that = this
  215. uni.showModal({
  216. content: '确认取消该招聘?',
  217. title: '提示',
  218. confirmColor: '#00B88F',
  219. success(iet) {
  220. if (iet.confirm) {
  221. let data = {
  222. postPushId: postPushId
  223. }
  224. that.$Request.postT('/app/postPush/cancelPostPush', data).then(res => {
  225. if (res.code == 0) {
  226. uni.showToast({
  227. title: '取消成功',
  228. duration: 1500,
  229. complete() {
  230. that.page = 1
  231. that.getlist()
  232. }
  233. })
  234. } else {
  235. uni.showToast({
  236. title: res.msg,
  237. icon: 'none'
  238. })
  239. }
  240. uni.hideLoading()
  241. })
  242. }
  243. }
  244. })
  245. },
  246. //联系客服
  247. Changekefu() {
  248. let that = this
  249. if (uni.getStorageSync('userType') == 1) { //用户端
  250. // #ifdef MP-WEIXIN
  251. wx.openCustomerServiceChat({
  252. extInfo: {
  253. url: that.$queue.getData('kefu')
  254. },
  255. corpId: that.$queue.getData('kefuAppid'),
  256. success(res) {
  257. console.log(res)
  258. },
  259. })
  260. // #endif
  261. // #ifdef H5
  262. window.location.href = that.$queue.getData('kefu');
  263. // #endif
  264. // #ifdef APP
  265. let kefu = that.$queue.getData('kefu')
  266. console.log(kefu)
  267. plus.runtime.openURL(kefu, function(res) {});
  268. // #endif
  269. } else { //企业端
  270. // #ifdef MP-WEIXIN
  271. wx.openCustomerServiceChat({
  272. extInfo: {
  273. url: that.$queue.getData('kefuq')
  274. },
  275. corpId: that.$queue.getData('kefuAppidq'),
  276. success(res) {
  277. console.log(res)
  278. },
  279. })
  280. // #endif
  281. // #ifdef H5
  282. window.location.href = that.$queue.getData('kefuq');
  283. // #endif
  284. // #ifdef APP
  285. let kefu = that.$queue.getData('kefuq')
  286. console.log(kefu)
  287. plus.runtime.openURL(kefu, function(res) {});
  288. // #endif
  289. }
  290. },
  291. getlist() {
  292. let data = {
  293. status: this.tabIndex == 0 ? '' : this.tabIndex,
  294. page: this.page,
  295. limit: this.limit,
  296. companyId: uni.getStorageSync('companyId')
  297. }
  298. this.$Request.getT('/app/postPush/getPostPushList', data).then(res => {
  299. if (res.code == 0) {
  300. if (this.page == 1) this.goods = []; //如果是第一页需手动制空列表
  301. res.data.records.forEach(ret => {
  302. ret.showpeop = false
  303. if (ret.status == 1) {
  304. ret.statusName = '待审核'
  305. } else if (ret.status == 2) {
  306. ret.statusName = '招聘中'
  307. } else if (ret.status == 3) {
  308. ret.statusName = '已拒绝'
  309. } else if (ret.status == 4) {
  310. ret.statusName = '已取消'
  311. } else if (ret.status == 5) {
  312. ret.statusName = '已关闭'
  313. }
  314. this.goods.push(ret)
  315. })
  316. this.count = res.data.total
  317. }
  318. uni.hideLoading()
  319. })
  320. },
  321. // 切换菜单
  322. tabChange(e) {
  323. console.log(e)
  324. this.tabIndex = e
  325. this.goods = []; // 置空列表,显示加载进度条
  326. this.getlist()
  327. },
  328. goNav(url) {
  329. uni.navigateTo({
  330. url
  331. })
  332. }
  333. },
  334. onReachBottom: function() {
  335. if (this.goods.length == this.count) {
  336. uni.showToast({
  337. title: '已经到底了',
  338. icon: 'none'
  339. })
  340. } else {
  341. this.page = this.page + 1;
  342. this.getlist()
  343. }
  344. },
  345. onPullDownRefresh: function() {
  346. this.page = 1;
  347. this.getlist()
  348. }
  349. }
  350. </script>
  351. <style lang="scss">
  352. /*
  353. sticky生效条件:
  354. 1、父元素不能overflow:hidden或者overflow:auto属性。(mescroll-body设置:sticky="true"即可, mescroll-uni本身没有设置overflow)
  355. 2、必须指定top、bottom、left、right4个值之一,否则只会处于相对定位
  356. 3、父元素的高度不能低于sticky元素的高度
  357. 4、sticky元素仅在其父元素内生效,所以父元素必须是 mescroll
  358. */
  359. .sticky-tabs {
  360. z-index: 990;
  361. position: sticky;
  362. top: var(--window-top);
  363. // background-color: #fff;
  364. }
  365. page {
  366. background-color: #F7F7F7;
  367. }
  368. .bg {
  369. background-color: #FFFFFF;
  370. }
  371. .box {
  372. background: #FFFFFF;
  373. border-radius: 24upx;
  374. margin: 30upx;
  375. }
  376. .argrtn {
  377. background: #F6F6F6;
  378. color: #666666;
  379. font-size: 24upx;
  380. border-radius: 8upx;
  381. padding: 5upx 20upx;
  382. margin-right: 20upx;
  383. margin-bottom: 20upx;
  384. }
  385. .btn {
  386. border: 1px solid #00B88F;
  387. border-radius: 30px;
  388. color: #00B88F;
  389. padding: 14upx 35upx;
  390. margin-left: 20upx;
  391. }
  392. </style>