index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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">
  57. 300/天
  58. <text class="icon">&#xe619;</text>
  59. 日结
  60. </view>
  61. <text class="date">4.16-4.17</text>
  62. <view class="address">
  63. <text @click.stop="company()">{{ item.name }}</text>
  64. <text class="add">申请</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. ip: this.http.ip,
  75. current: 0,
  76. tab: [{ name: '你的工作' }, { name: '身边工作' }, { name: '现结工作' }],
  77. user: {},
  78. jobs: [
  79. {
  80. name: '广西龙坚贸易有限公司',
  81. job: '装卸搬运工',
  82. price: '4000',
  83. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401904451.jpg'
  84. },
  85. {
  86. name: '韵达速递',
  87. job: '快递装卸工',
  88. price: '4700',
  89. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401871968.jpg'
  90. },
  91. {
  92. name: '北京滴滴有限公司',
  93. job: '滴滴快车专车司机',
  94. price: '4200',
  95. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401886712.jpg'
  96. },
  97. {
  98. name: '北京美团外卖有限公司',
  99. job: '美团骑手送餐员',
  100. price: '3700',
  101. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714401895824.jpg'
  102. },
  103. {
  104. name: '字节跳动有限公司',
  105. job: '女主播',
  106. price: '5500',
  107. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
  108. },
  109. {
  110. name: '广西龙坚贸易有限公司',
  111. job: '装卸搬运工',
  112. price: '4000',
  113. url: 'https://chenglantimes.com/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
  114. }
  115. ],
  116. bannerList: [],
  117. noticeList: []
  118. };
  119. },
  120. onShow() {
  121. if (this.hasLogin()) {
  122. //this.getUserInfo();
  123. }
  124. },
  125. onLoad() {
  126. this.getData();
  127. this.http.request({
  128. url: '/app/common/column/city/all',
  129. success: (res) => {
  130. uni.setStorageSync('city_all', res.data.data);
  131. }
  132. });
  133. },
  134. methods: {
  135. detail() {
  136. uni.navigateTo({
  137. url: '/pages/clsd/job/detail'
  138. });
  139. },
  140. company() {
  141. uni.navigateTo({
  142. url: '/pages/clsd/job/company'
  143. });
  144. },
  145. click(e) {
  146. this.current = e.index;
  147. },
  148. getUserInfo() {
  149. this.http.request({
  150. url: '/app/user/info',
  151. success: (res) => {
  152. this.user = res.data.data;
  153. }
  154. });
  155. },
  156. getData() {
  157. this.http.request({
  158. url: '/app/home/index',
  159. success: (res) => {
  160. this.contract = res.data.data.contract;
  161. this.bannerList = res.data.data.bannerList;
  162. res.data.data.noticeList.forEach((item) => {
  163. this.noticeList.push(item.title);
  164. });
  165. }
  166. });
  167. },
  168. go(url) {
  169. if (this.hasLogin()) {
  170. uni.navigateTo({
  171. url: '/pages/index/index'
  172. });
  173. } else {
  174. uni.navigateTo({ url: '/pages/user/login' });
  175. }
  176. }
  177. }
  178. };
  179. </script>
  180. <style lang="scss">
  181. @import './index.scss';
  182. </style>