index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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="160" class="uni-swiper" @click="click"></u-swiper>
  16. </view>
  17. <!--菜单-->
  18. <view class="menu">
  19. <view class="cd" @click="go('/pages/job/map')">
  20. <view class="out">
  21. <view class="int">
  22. <view class="icon" style="background-color: #03a9f4">&#xe647;</view>
  23. <view class="title">地图找工</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="cd" @click="go('/pages/job/list?type=0')">
  28. <view class="out">
  29. <view class="int">
  30. <view class="icon" style="background-color: #4581fb">&#xe9d9;</view>
  31. <view class="title">全职</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="cd" @click="go('/pages/job/list?type=1')">
  36. <view class="out">
  37. <view class="int">
  38. <view class="icon" style="background-color: #ff5722">&#xe62a;</view>
  39. <view class="title">兼职</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="cd" @click="go('/pages/index/index')">
  44. <view class="out">
  45. <view class="int">
  46. <view class="icon" style="background-color: #03a9f4">&#xe725;</view>
  47. <view class="title">结算广场</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <!--找工作-->
  53. <!-- <view class="tab">
  54. <u-tabs :inactiveStyle="{ fontSize: '15px' }" :activeStyle="{ color: '#3c9cff', fontSize: '17px' }" :list="tab" :current="current" @click="click"></u-tabs>
  55. </view> -->
  56. <view class="jobs" v-if="current == 0"></view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. ip: this.http.ip,
  64. current: 0,
  65. tab: [{ name: '最新工作' }, { name: '身边工作' }, { name: '现结工作' }],
  66. user: {},
  67. bannerList: [],
  68. noticeList: []
  69. };
  70. },
  71. onShow() {},
  72. onLoad() {
  73. this.initData();
  74. },
  75. methods: {
  76. initData() {
  77. //首页数据
  78. this.http.request({
  79. url: '/app/home/index',
  80. success: (res) => {
  81. this.contract = res.data.data.contract;
  82. this.bannerList = res.data.data.bannerList;
  83. res.data.data.noticeList.forEach((item) => {
  84. this.noticeList.push(item.title);
  85. });
  86. }
  87. });
  88. //初始化所有地区
  89. this.http.request({
  90. url: '/app/common/column/city/all',
  91. success: (res) => {
  92. uni.setStorageSync('city_all', res.data.data);
  93. }
  94. });
  95. //授权获取位置
  96. uni.authorize({
  97. scope: 'scope.userLocation',
  98. success: (s) => {
  99. uni.getLocation({
  100. type: 'wgs84',
  101. success: (res) => {
  102. uni.setStorageSync('location', res);
  103. }
  104. });
  105. },
  106. fail(res) {
  107. uni.showModal({ title: '提示', content: '定位失败,请检查是否允许定位', showCancel: false });
  108. }
  109. });
  110. },
  111. click(e) {
  112. this.current = e.index;
  113. },
  114. go(url) {
  115. uni.navigateTo({ url: url });
  116. }
  117. }
  118. };
  119. </script>
  120. <style lang="scss">
  121. @import './index.scss';
  122. </style>