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

282 lines
7.2 KiB

6 months ago
6 months ago
4 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
4 months ago
6 months ago
4 months ago
3 months ago
3 months ago
3 months ago
3 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
4 months ago
6 months ago
4 months ago
3 months ago
3 months ago
4 months ago
6 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
6 months ago
3 months ago
6 months ago
6 months ago
6 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. queryConfigList
  75. } from "@/common/api.js"
  76. import enterpriseBox from "./component/enterprise.vue"
  77. import masterBox from "./component/master.vue"
  78. import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
  79. export default{
  80. components:{
  81. enterpriseBox,
  82. masterBox
  83. },
  84. data(){
  85. return {
  86. notice:[],
  87. noticeList:[],
  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. {
  97. name: '求职大厅',
  98. },
  99. {
  100. name: '招聘大厅',
  101. }
  102. ],
  103. rpageNo:1,
  104. rpageSize:20,
  105. rlist:[],
  106. latitude:'34.00',
  107. longitude:'134.65',
  108. tpageNo:1,
  109. tpageSize:20,
  110. tList:[]
  111. }
  112. },
  113. mounted() {
  114. this.onBannerList()
  115. this.onTaskList()
  116. this.onRolelist()
  117. this.onIndustryList()
  118. this.getLocation()
  119. this.onSysText()
  120. this.onNotice()
  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. onNoticeDetail(index){
  135. uni.navigateTo({
  136. url:"/pages_subpack/notice/index?id="+this.notice[index].id
  137. })
  138. },
  139. onNotice(){
  140. let that = this
  141. let params={}
  142. let arr=[]
  143. noticeList(params).then(response=>{
  144. console.info(response)
  145. response.result.forEach(items=>{
  146. arr.push(items.title)
  147. })
  148. that.noticeList = arr
  149. that.notice = response.result
  150. }).catch(error=>{
  151. })
  152. },
  153. onSysText(){
  154. let that = this
  155. let params={}
  156. getSysText(params).then(response=>{
  157. console.info("onSysText",response.result)
  158. uni.setStorageSync('sysList', result.result)
  159. }).catch(error=>{
  160. })
  161. },
  162. getLocation(){
  163. const that = this;
  164. console.log('当前位置的经度:');
  165. wx.getLocation({
  166. type: 'wgs84',
  167. success: function (res) {
  168. console.log('位置',res);
  169. console.log('当前位置的经度:' + res.longitude);
  170. console.log('当前位置的纬度:' + res.latitude);
  171. uni.setStorageSync("longitude",res.longitude)
  172. uni.setStorageSync("latitude",res.latitude)
  173. const qqmapsdk = new QQMapWX({
  174. key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  175. });
  176. qqmapsdk.reverseGeocoder({
  177. location: {
  178. latitude: res.latitude,
  179. longitude: res.longitude
  180. },
  181. success: function(response) {
  182. // that.city = response.result.ad_info.city
  183. console.log('逆地理编码结果:', response);
  184. },
  185. fail: function(error) {
  186. console.error('逆地理编码失败:', error);
  187. }
  188. });
  189. }
  190. })
  191. },
  192. onIndustryList(){
  193. industryList({}).then(response=>{
  194. console.info("industryList",response);
  195. this.tabList = response.result
  196. }).catch(error=>{
  197. })
  198. },
  199. onBannerList(){
  200. bannerList({type:0}).then(response=>{
  201. this.swiperList = response.result.records
  202. }).catch(error=>{
  203. })
  204. },
  205. onTaskList(){
  206. taskList({
  207. latitude:this.latitude,
  208. longitude:this.longitude,
  209. pageNo:this.tpageNo,
  210. pageSize:this.tpageSize
  211. }).then(response=>{
  212. if(this.tpageNo==1){
  213. this.tList = response.result.records
  214. }else{
  215. this.tList = this.tList.concat(response.result.records)
  216. }
  217. console.info("taskList",response)
  218. }).catch(error=>{
  219. })
  220. },
  221. onRolelist(){
  222. rolelist({
  223. pageNo:this.rpageNo,
  224. pageSize:this.rpageSize
  225. }).then(response=>{
  226. console.info("response",response)
  227. if(this.rpageNo==1){
  228. this.rlist = response.result.records
  229. }else{
  230. this.rlist = this.rlist.concat(response.result.records)
  231. }
  232. }).catch(error=>{
  233. })
  234. },
  235. navClick(event){
  236. this.current=event.index
  237. },
  238. change(event){
  239. console.info(event)
  240. },
  241. click(event){
  242. console.info(event)
  243. },
  244. toNavigator(event){
  245. uni.navigateTo({
  246. url:"/pages_subpack/release/index?status="+event
  247. })
  248. },
  249. onCategory(){
  250. uni.navigateTo({
  251. url:"/pages_subpack/category/index"
  252. })
  253. }
  254. }
  255. }
  256. </script>
  257. <style>
  258. page{
  259. background-color: #f5f5f5;
  260. }
  261. .enterprise{
  262. background: #ff7a31;
  263. border: 4rpx solid rgba(255,255,255,0.50);
  264. border-radius: 14rpx;
  265. }
  266. .master{
  267. background: #f0b744;
  268. border: 4rpx solid rgba(255,255,255,0.50);
  269. border-radius: 14rpx;
  270. }
  271. </style>