index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 :list="tab" :current="current"></u-tabs>
  20. </view>
  21. <view class="jobs">
  22. <view class="full_time" v-for="(item, index) in jobs" :key="index">
  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>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. ip: this.http.ip,
  44. current: 0,
  45. tab: [{ name: '你的工作' }, { name: '身边工作' }, { name: '现结工作' }],
  46. user: {},
  47. jobs: [{
  48. name: '广西龙坚贸易有限公司',
  49. job: '装卸搬运工',
  50. price: '4000',
  51. url: 'http://47.104.228.216/prod-api/profile/upload/2024/04/29/1714401904451.jpg'
  52. },
  53. {
  54. name: '韵达速递',
  55. job: '快递装卸工',
  56. price: '4700',
  57. url: 'http://47.104.228.216/prod-api/profile/upload/2024/04/29/1714401871968.jpg'
  58. },
  59. {
  60. name: '北京滴滴有限公司',
  61. job: '滴滴快车专车司机',
  62. price: '4200',
  63. url: 'http://47.104.228.216/prod-api/profile/upload/2024/04/29/1714401886712.jpg'
  64. },
  65. {
  66. name: '北京美团外卖有限公司',
  67. job: '美团骑手送餐员',
  68. price: '3700',
  69. url: 'http://47.104.228.216/prod-api/profile/upload/2024/04/29/1714401895824.jpg'
  70. },
  71. {
  72. name: '字节跳动有限公司',
  73. job: '女主播',
  74. price: '5500',
  75. url: 'http://47.104.228.216/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
  76. },
  77. {
  78. name: '广西龙坚贸易有限公司',
  79. job: '装卸搬运工',
  80. price: '4000',
  81. url: 'http://47.104.228.216/prod-api/profile/upload/2024/04/29/1714402008141.jpg'
  82. }
  83. ],
  84. bannerList: [],
  85. noticeList: []
  86. };
  87. },
  88. onShow() {
  89. if (this.hasLogin()) {
  90. //this.getUserInfo();
  91. }
  92. },
  93. onLoad() {
  94. this.getData();
  95. },
  96. methods: {
  97. getUserInfo() {
  98. this.http.request({
  99. url: '/app/user/info',
  100. success: (res) => {
  101. this.user = res.data.data;
  102. }
  103. });
  104. },
  105. getData() {
  106. this.http.request({
  107. url: '/app/home/index',
  108. success: (res) => {
  109. this.contract = res.data.data.contract;
  110. this.bannerList = res.data.data.bannerList;
  111. res.data.data.noticeList.forEach((item) => {
  112. this.noticeList.push(item.title);
  113. });
  114. }
  115. });
  116. },
  117. go(url) {
  118. if (this.hasLogin()) {
  119. uni.navigateTo({
  120. url: '/pages/index/index'
  121. })
  122. } else {
  123. uni.navigateTo({ url: '/pages/user/login' });
  124. }
  125. }
  126. }
  127. };
  128. </script>
  129. <style lang="scss">
  130. @import './index.scss';
  131. </style>