index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. this.getLocation();
  122. if (this.hasLogin()) {
  123. //this.getUserInfo();
  124. }
  125. },
  126. onLoad() {
  127. this.getData();
  128. this.http.request({
  129. url: '/app/common/column/city/all',
  130. success: (res) => {
  131. uni.setStorageSync('city_all', res.data.data);
  132. }
  133. });
  134. },
  135. methods: {
  136. getLocation() {
  137. uni.authorize({
  138. scope: 'scope.userLocation',
  139. success: (s) => {
  140. uni.getLocation({
  141. type: 'wgs84',
  142. success: (res) => {
  143. uni.setStorageSync('location', res);
  144. }
  145. });
  146. },
  147. fail(res) {
  148. uni.showModal({ title: '提示', content: '定位失败,请检查是否允许定位', showCancel: false });
  149. }
  150. });
  151. },
  152. detail() {
  153. uni.navigateTo({
  154. url: '/pages/clsd/job/detail'
  155. });
  156. },
  157. company() {
  158. uni.navigateTo({
  159. url: '/pages/clsd/job/company'
  160. });
  161. },
  162. click(e) {
  163. this.current = e.index;
  164. },
  165. getUserInfo() {
  166. this.http.request({
  167. url: '/app/user/info',
  168. success: (res) => {
  169. this.user = res.data.data;
  170. }
  171. });
  172. },
  173. getData() {
  174. this.http.request({
  175. url: '/app/home/index',
  176. success: (res) => {
  177. this.contract = res.data.data.contract;
  178. this.bannerList = res.data.data.bannerList;
  179. res.data.data.noticeList.forEach((item) => {
  180. this.noticeList.push(item.title);
  181. });
  182. }
  183. });
  184. },
  185. go(url) {
  186. if (this.hasLogin()) {
  187. uni.navigateTo({
  188. url: '/pages/index/index'
  189. });
  190. } else {
  191. uni.navigateTo({ url: '/pages/user/login' });
  192. }
  193. }
  194. }
  195. };
  196. </script>
  197. <style lang="scss">
  198. @import './index.scss';
  199. </style>