用工小程序前端代码
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.

280 lines
7.1 KiB

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