jobList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view>
  3. <!-- 搜索 -->
  4. <view class="search flex justify-center align-center">
  5. <view class="search-box">
  6. <u-search placeholder="搜索岗位" :show-action="false" @change="getSearchList" v-model="keyword"></u-search>
  7. </view>
  8. </view>
  9. <!-- 搜索列表 -->
  10. <view class="searchList flex justify-center" v-if="keyword!=''">
  11. <view class="searchList-box">
  12. <scroll-view scroll-y="true" class="searchList-box-scroll">
  13. <view class="searchList-box-item" @click="selectJob(item)" v-for="(item,index) in searchList" :key="index">
  14. <view class="">
  15. {{item.ruleClassifyName}}
  16. </view>
  17. <view class="" style="font-size: 24rpx;color: #999999;margin-top: 10rpx;">
  18. {{item.title}}
  19. </view>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. </view>
  24. <!-- 列表 -->
  25. <view class="list flex justify-between" v-else>
  26. <!-- 左侧分类 -->
  27. <view class="list-l">
  28. <scroll-view scroll-y="true" style="width: 100%;height: 100%;padding-bottom: 20rpx;">
  29. <view class="list-l-item flex align-center " @click="setRightList(index)" :class="current==index?'active':''" v-for="(item,index) in list" :key="index">
  30. {{item.ruleClassifyName}}
  31. </view>
  32. </scroll-view>
  33. </view>
  34. <!-- 右侧列表 -->
  35. <view class="list-r">
  36. <scroll-view scroll-y="true" style="width: 100%;height: 100%;padding-bottom: 20rpx;">
  37. <view class="list-r-item" v-if="rightList.length>0" v-for="(item,index) in rightList" :key="index">
  38. <view class="list-r-item-title">
  39. {{item.title}}
  40. </view>
  41. <view class="list-r-item-childs flex justify-around align-center flex-wrap">
  42. <view class="list-r-item-childs-i flex justify-center align-center" @click="selectJob(ite)" v-for="(ite,ind) in item.childrens" :key="ind">
  43. {{ite.ruleClassifyName}}
  44. </view>
  45. <view class="list-r-item-childs-i flex justify-center align-center" style="height: 0;padding: 0;">
  46. </view>
  47. </view>
  48. </view>
  49. <empty v-if="rightList.length==0" />
  50. </scroll-view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import empty from '../../components/empty.vue'
  57. export default {
  58. components:{
  59. empty
  60. },
  61. data() {
  62. return {
  63. searchList:[],
  64. keyword:'',
  65. current:0,
  66. rightList:[],
  67. list:[],
  68. };
  69. },
  70. onLoad() {
  71. this.getJobList()
  72. },
  73. methods:{
  74. /**
  75. * 搜索岗位
  76. */
  77. getSearchList(){
  78. let data = {
  79. ruleClassifyName:this.keyword
  80. }
  81. this.$Request.getT('/app/rule/userGetClassify',data).then(res => {
  82. if(res.code==0){
  83. this.searchList = res.data
  84. }
  85. })
  86. },
  87. /**
  88. * @param {Object} info
  89. * 选择岗位并返回
  90. */
  91. selectJob(info){
  92. uni.$emit('jobs',{
  93. ruleClassifyId:info.ruleClassifyId,//岗位分类id
  94. ruleClassifyName:info.ruleClassifyName,//岗位分类名称
  95. price:info.price,//岗位价格
  96. // ruleClassifyId2:topInfo.ruleClassifyId,//上级分类id
  97. // ruleClassifyId1:topInfo.parentId//一级分类id
  98. })
  99. uni.navigateBack()
  100. },
  101. /**
  102. * 切换菜单
  103. */
  104. setRightList(index){
  105. this.current=index
  106. this.rightList = this.list[index].childrens
  107. },
  108. /**
  109. * 获取岗位列表
  110. */
  111. getJobList(){
  112. this.$Request.getT('/app/rule/getClassifyList').then(res => {
  113. if(res.code==0){
  114. if(res.data){
  115. this.list = res.data
  116. this.rightList = this.list[this.current].childrens
  117. }
  118. }
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. page {
  126. background-color: #ffffff;
  127. }
  128. .searchList{
  129. width: 100%;
  130. /* #ifdef MP-WEIXIN */
  131. height: calc(100vh - 100rpx);
  132. /* #endif */
  133. /* #ifndef MP-WEIXIN */
  134. height: calc(100vh - 180rpx);
  135. /* #endif */
  136. position: fixed;
  137. bottom: 0;
  138. .searchList-box{
  139. width: 686rpx;
  140. height: 100%;
  141. .searchList-box-scroll{
  142. width: 100%;
  143. height: 100%;
  144. // background-color: red;
  145. .searchList-box-item{
  146. // margin-bottom: 20rpx;
  147. border-bottom: 1rpx solid #F2F2F2;
  148. padding-top: 20rpx;
  149. padding-bottom: 20rpx;
  150. }
  151. }
  152. }
  153. }
  154. .search{
  155. width: 100%;
  156. height: 100rpx;
  157. border-bottom: 1rpx solid #F2F2F7;
  158. box-sizing: border-box;
  159. .search-box{
  160. width: 686rpx;
  161. height: 60rpx;
  162. border-radius: 44rpx;
  163. background-color: #F2F2F7;
  164. }
  165. }
  166. .active{
  167. border-left: 8rpx solid #00B88F !important;
  168. color: #00B88F !important;
  169. }
  170. .list{
  171. width: 100;
  172. height: calc(100vh - 100rpx);
  173. .list-l{
  174. width: 30%;
  175. height: 100%;
  176. .list-l-item{
  177. margin-top: 40rpx;
  178. font-size: 28rpx;
  179. color: #121212;
  180. padding-left: 20rpx;
  181. border-left: 8rpx solid #ffffff;
  182. }
  183. }
  184. .list-r{
  185. width: 70%;
  186. height: 100%;
  187. border-left: 1rpx solid #F2F2F7;
  188. box-sizing: border-box;
  189. .list-r-item{
  190. width: 100%;
  191. margin-top: 40rpx;
  192. .list-r-item-title{
  193. width: 100%;
  194. color: #121212;
  195. font-size: 32rpx;
  196. font-weight: bold;
  197. padding-left: 30rpx;
  198. }
  199. .list-r-item-childs{
  200. width: 100%;
  201. .list-r-item-childs-i{
  202. width: 200rpx;
  203. margin-top: 20rpx;
  204. padding-top: 16rpx;
  205. padding-bottom: 16rpx;
  206. padding-left: 16rpx;
  207. padding-right: 16rpx;
  208. font-size: 26rpx;
  209. color: #121212;
  210. background-color: #F2F2F7;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>