用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

270 lines
6.9 KiB

7 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
4 months ago
4 months ago
6 months ago
4 months ago
4 months ago
6 months ago
4 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
7 months ago
4 months ago
4 months ago
7 months ago
4 months ago
7 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
4 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
7 months ago
4 months ago
7 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
7 months ago
  1. <template>
  2. <view>
  3. <view class="se-bgc-orange se-pos se-pos-lt se-w-vw-100 se-h-vh-30"
  4. style="z-index: -1;border-bottom-left-radius: 120rpx;border-bottom-right-radius: 120rpx;"></view>
  5. <view class="se-flex se-flex-h-sb se-px-40 se-pb-30 se-pt-10 se-bgc-orange se-zi-s">
  6. <view class="se-c-white se-fs-28" @click="getLocation()">
  7. <view class="se-bgc-white se-py-5 se-px-10 se-fw-6 se-br-12 se-c-orange se-fs-24 se-display-ib">
  8. </view>
  9. <text class="se-ml-10 se-fw-6 se-fs-28">智选猎头</text>
  10. </view>
  11. <!-- <view class="se-br-30 se-bgc-white se-fw-6 se-c-orange se-fs-28 se-px-20 se-py-10">
  12. 企业/个人端
  13. </view> -->
  14. </view>
  15. <view class="se-px-20 se-pt-10 se-zi-s">
  16. <u-search height="40" placeholder="搜索" :showAction="false" v-model="keyword"></u-search>
  17. </view>
  18. <view class="se-pb-20 se-pt-40 se-zi-s">
  19. <view class="se-px-20">
  20. <u-swiper height="300rpx" :indicator="true" style="background-color: #f5f5f5;height: 300rpx;"
  21. :list="swiperList" keyName="image" @change="change" @click="click"></u-swiper>
  22. </view>
  23. <swiper :autoplay="true" :interval="3000" :duration="1000" circular class="notice" vertical>
  24. <swiper-item v-for="item in noticeData" :key="item.id">
  25. <view
  26. class="se-pt-10 se-bgc-white se-px-0 se-py-10 se-ta-l se-c-orange se-flex se-flex-ai-c se-fs-26">
  27. <image class="se-a-80" src="@/static/image/aed60x.png" mode=""></image>
  28. <text class="se-ml-10">{{item.title}}</text>
  29. </view>
  30. </swiper-item>
  31. </swiper>
  32. </view>
  33. <view class="se-my-20 se-bgc-white se-grid">
  34. <navigator :url="`/pages_subpack/category/index`+item.id" v-for="(item, index) in tabList" :key="index"
  35. class="se-flex-v-c se-pt-30 se-mb-20">
  36. <image class="se-a-100 se-br-20 se-bgc-f5" :src="item.icon" mode=""></image>
  37. <text
  38. class="se-w-150 se-h-60 se-lh-30 se-c-black se-fs-22 se-ta-c se-mt-10 se-toe-2">{{item.name}}</text>
  39. </navigator>
  40. </view>
  41. <view class="se-my-20 se-bgc-white se-p-20 se-flex">
  42. <view @click="toNavigator(1)"
  43. class="se-flex-1 se-flex-h-c se-flex-ai-c se-c-white se-py-20 se-fw-6 enterprise">
  44. <!-- 找工作 -->
  45. 招聘
  46. </view>
  47. <view @click="toNavigator(2)"
  48. class="se-flex-1 se-ml-20 se-flex-h-c se-flex-ai-c se-c-white se-py-20 se-fw-6 master">
  49. <!-- 找师傅 -->
  50. 求职
  51. </view>
  52. </view>
  53. <u-tabs :current="current" lineWidth="30" lineColor="#FF7A31" :activeStyle="{
  54. color: '#303133',
  55. fontWeight: 'bold',
  56. transform: 'scale(1.05)'
  57. }" :inactiveStyle="{
  58. color: '#606266',
  59. transform: 'scale(1)'
  60. }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" :list="navList" @click="navClick($event)">
  61. </u-tabs>
  62. <!-- 企业端 求职大厅 -->
  63. <enterpriseBox :rolelist="rlist" v-if="current==0" />
  64. <!-- 师傅端 招聘大厅 -->
  65. <masterBox :taskList="tList" v-if="current==1" />
  66. <view class="se-h-80"></view>
  67. </view>
  68. </template>
  69. <script>
  70. import {
  71. bannerList,
  72. taskList,
  73. rolelist,
  74. industryList,
  75. getSysText,
  76. noticeList
  77. } from "@/common/api.js"
  78. import enterpriseBox from "./component/enterprise.vue"
  79. import masterBox from "./component/master.vue"
  80. import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
  81. export default {
  82. components: {
  83. enterpriseBox,
  84. masterBox
  85. },
  86. data() {
  87. return {
  88. status: 1,
  89. list: [
  90. "https://cdn.uviewui.com/uview/swiper/swiper1.png"
  91. ],
  92. tabList: [], //导航栏
  93. swiperList: [], //轮播
  94. current: 0,
  95. navList: [{
  96. name: '求职大厅',
  97. },
  98. {
  99. name: '招聘大厅',
  100. }
  101. ],
  102. rpageNo: 1,
  103. rpageSize: 20,
  104. rlist: [],
  105. latitude: '34.00',
  106. longitude: '134.65',
  107. tpageNo: 1,
  108. tpageSize: 20,
  109. tList: [],
  110. noticeData: [], //公告列表
  111. }
  112. },
  113. mounted() {
  114. this.onBannerList()
  115. this.onTaskList()
  116. this.onRolelist()
  117. this.onIndustryList()
  118. this.getLocation()
  119. this.onSysText()
  120. this.getNotice()
  121. },
  122. onPullDownRefresh() {
  123. let that = this
  124. that.rpageNo = 1
  125. that.rlist = []
  126. that.onRolelist()
  127. },
  128. onReachBottom() {
  129. let that = this
  130. that.rpageNo = that.rpageNo + 1
  131. that.onRolelist()
  132. },
  133. methods: {
  134. // 获取公告列表
  135. async getNotice() {
  136. const {
  137. code,
  138. result
  139. } = await noticeList()
  140. if (code === 200) {
  141. this.noticeData = result || []
  142. }
  143. },
  144. onSysText() {
  145. let that = this
  146. let params = {}
  147. getSysText(params).then(response => {
  148. localStorage.setItem("sysList", response.result)
  149. }).catch(error => {
  150. })
  151. },
  152. getLocation() {
  153. const that = this;
  154. console.log('当前位置的经度:');
  155. wx.getLocation({
  156. type: 'wgs84',
  157. success: function(res) {
  158. console.log('位置', res);
  159. console.log('当前位置的经度:' + res.longitude);
  160. console.log('当前位置的纬度:' + res.latitude);
  161. const qqmapsdk = new QQMapWX({
  162. key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  163. });
  164. qqmapsdk.reverseGeocoder({
  165. location: {
  166. latitude: res.latitude,
  167. longitude: res.longitude
  168. },
  169. success: function(response) {
  170. // that.city = response.result.ad_info.city
  171. console.log('逆地理编码结果:', response);
  172. },
  173. fail: function(error) {
  174. console.error('逆地理编码失败:', error);
  175. }
  176. });
  177. }
  178. })
  179. },
  180. onIndustryList() {
  181. industryList({}).then(response => {
  182. console.info("industryList", response);
  183. this.tabList = response.result
  184. }).catch(error => {
  185. })
  186. },
  187. onBannerList() {
  188. bannerList({}).then(response => {
  189. console.info("banner", response)
  190. this.swiperList = response.result[0]
  191. }).catch(error => {
  192. })
  193. },
  194. onTaskList() {
  195. taskList({
  196. latitude: this.latitude,
  197. longitude: this.longitude,
  198. pageNo: this.tpageNo,
  199. pageSize: this.tpageSize
  200. }).then(response => {
  201. if (this.tpageNo == 1) {
  202. this.tList = response.result.records
  203. } else {
  204. this.tList = this.tList.concat(response.result.records)
  205. }
  206. console.info("taskList", response)
  207. }).catch(error => {
  208. })
  209. },
  210. onRolelist() {
  211. rolelist({
  212. pageNo: this.rpageNo,
  213. pageSize: this.rpageSize
  214. }).then(response => {
  215. if (this.rpageNo == 1) {
  216. this.rlist = response.result.records
  217. } else {
  218. this.rlist = this.rlist.concat(response.result.records)
  219. }
  220. }).catch(error => {
  221. })
  222. },
  223. navClick(event) {
  224. this.current = event.index
  225. },
  226. change(event) {
  227. console.info(event)
  228. },
  229. click(event) {
  230. console.info(event)
  231. },
  232. toNavigator(event) {
  233. uni.navigateTo({
  234. url: "/pages_subpack/release/index?status=" + event
  235. })
  236. },
  237. }
  238. }
  239. </script>
  240. <style scoped>
  241. page {
  242. background-color: #f5f5f5;
  243. }
  244. .enterprise {
  245. background: #ff7a31;
  246. border: 4rpx solid rgba(255, 255, 255, 0.50);
  247. border-radius: 14rpx;
  248. }
  249. .master {
  250. background: #f0b744;
  251. border: 4rpx solid rgba(255, 255, 255, 0.50);
  252. border-radius: 14rpx;
  253. }
  254. .notice {
  255. height: 108rpx;
  256. }
  257. </style>