index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="main">
  3. <!--搜索-->
  4. <view class="search">
  5. <view class="usearch">
  6. <u-search placeholder="请输入职位名称" bgColor="white" :showAction="false"></u-search>
  7. </view>
  8. <view class="address">
  9. <text class="icon">&#xe62e;</text>
  10. <text>南宁市</text>
  11. </view>
  12. </view>
  13. <!--轮播图-->
  14. <view class="banner">
  15. <u-swiper circular :radius="5" :indicator="true" keyName="pic" :list="bannerList" :height="150" class="uni-swiper" @click="click"></u-swiper>
  16. </view>
  17. <!--找工作-->
  18. <view class="tab">
  19. <u-tabs :scrollable="false" :inactiveStyle="{fontSize:'17px'}" :activeStyle="{color:'#3c9cff',fontSize:'17px'}" :list="tab" :current="current" @click="click"></u-tabs>
  20. </view>
  21. <view class="jobs" v-if="current==0">
  22. <view class="full_time" v-for="(item, index) in jobs" :key="index" @click="detail(item)">
  23. <view class="out">
  24. <view class="int">
  25. <image :src="item.url" mode="aspectFill"></image>
  26. <view class="title omit">{{ item.name }}</view>
  27. <view class="desc">{{ item.job }}</view>
  28. <view class="price">{{ item.price }}/月</view>
  29. <view class="address">
  30. <text class="icon">&#xe62e;</text>
  31. <text>南宁青秀山</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="jobs" v-if="current==1">
  38. <view class="full_time" v-for="(item, index) in jobs" :key="index" @click="detail(item)">
  39. <view class="out">
  40. <view class="int">
  41. <image :src="item.url" mode="aspectFill"></image>
  42. <view class="title omit">{{ item.name }}</view>
  43. <view class="desc">{{ item.job }}</view>
  44. <view class="price">{{ item.price }}元/月</view>
  45. <view class="address">
  46. <text class="icon">&#xe62e;</text>
  47. <text>距你2km</text>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="jobs" v-if="current==2">
  54. <view class="part_time" v-for="(item, index) in jobs" :key="index" @click="detail(item)">
  55. <view class="title omit">兼职{{ item.job }}</view>
  56. <view class="price">300/天<text class="icon">&#xe619;</text>日结</view>
  57. <text class="date">4.16-4.17</text>
  58. <view class="address">
  59. <text @click.stop="company()">{{ item.name }}</text>
  60. <text class="add">申请</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. data() {
  69. return {
  70. ip: this.http.ip,
  71. current: 0,
  72. tab: [{ name: '你的工作' }, { name: '身边工作' }, { name: '现结工作' }],
  73. user: {},
  74. jobs: [{
  75. name: '广西龙坚贸易有限公司',
  76. job: '装卸搬运工',
  77. price: '4000',
  78. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401904451.jpg'
  79. },
  80. {
  81. name: '韵达速递',
  82. job: '快递装卸工',
  83. price: '4700',
  84. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401871968.jpg'
  85. },
  86. {
  87. name: '北京滴滴有限公司',
  88. job: '滴滴快车专车司机',
  89. price: '4200',
  90. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401886712.jpg'
  91. },
  92. {
  93. name: '北京美团外卖有限公司',
  94. job: '美团骑手送餐员',
  95. price: '3700',
  96. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401895824.jpg'
  97. },
  98. {
  99. name: '字节跳动有限公司',
  100. job: '女主播',
  101. price: '5500',
  102. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
  103. },
  104. {
  105. name: '广西龙坚贸易有限公司',
  106. job: '装卸搬运工',
  107. price: '4000',
  108. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
  109. }
  110. ],
  111. bannerList: [],
  112. noticeList: []
  113. };
  114. },
  115. onShow() {
  116. if (this.hasLogin()) {
  117. //this.getUserInfo();
  118. }
  119. },
  120. onLoad() {
  121. this.getData();
  122. },
  123. methods: {
  124. detail() {
  125. uni.navigateTo({
  126. url: '/pages/clsd/job/detail'
  127. })
  128. },
  129. company() {
  130. uni.navigateTo({
  131. url: '/pages/clsd/job/company'
  132. })
  133. },
  134. click(e) {
  135. this.current = e.index;
  136. },
  137. getUserInfo() {
  138. this.http.request({
  139. url: '/app/user/info',
  140. success: (res) => {
  141. this.user = res.data.data;
  142. }
  143. });
  144. },
  145. getData() {
  146. this.http.request({
  147. url: '/app/home/index',
  148. success: (res) => {
  149. this.contract = res.data.data.contract;
  150. this.bannerList = res.data.data.bannerList;
  151. res.data.data.noticeList.forEach((item) => {
  152. this.noticeList.push(item.title);
  153. });
  154. }
  155. });
  156. },
  157. go(url) {
  158. if (this.hasLogin()) {
  159. uni.navigateTo({
  160. url: '/pages/index/index'
  161. })
  162. } else {
  163. uni.navigateTo({ url: '/pages/user/login' });
  164. }
  165. }
  166. }
  167. };
  168. </script>
  169. <style lang="scss">
  170. @import './index.scss';
  171. </style>