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

285 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
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
3 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
3 months ago
4 months ago
3 months ago
4 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.image" 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. },
  115. onShow() {
  116. this.onBannerList()
  117. this.onTaskList()
  118. this.onRolelist()
  119. this.onIndustryList()
  120. this.getLocation()
  121. this.onSysText()
  122. this.onNotice()
  123. },
  124. onPullDownRefresh() {
  125. let that = this
  126. that.rpageNo = 1
  127. that.rlist = []
  128. that.onRolelist()
  129. },
  130. onReachBottom() {
  131. let that = this
  132. that.rpageNo = that.rpageNo + 1
  133. that.onRolelist()
  134. },
  135. methods:{
  136. onNoticeDetail(index){
  137. uni.navigateTo({
  138. url:"/pages_subpack/notice/index?id="+this.notice[index].id
  139. })
  140. },
  141. onNotice(){
  142. let that = this
  143. let params={}
  144. let arr=[]
  145. noticeList(params).then(response=>{
  146. console.info(response)
  147. response.result.records.forEach(items=>{
  148. arr.push(items.title)
  149. })
  150. that.noticeList = arr
  151. that.notice = response.result
  152. }).catch(error=>{
  153. })
  154. },
  155. onSysText(){
  156. let that = this
  157. let params={}
  158. getSysText(params).then(response=>{
  159. console.info("onSysText",response.result)
  160. uni.setStorageSync('sysList', result.result)
  161. }).catch(error=>{
  162. })
  163. },
  164. getLocation(){
  165. const that = this;
  166. console.log('当前位置的经度:');
  167. wx.getLocation({
  168. type: 'wgs84',
  169. success: function (res) {
  170. console.log('位置',res);
  171. console.log('当前位置的经度:' + res.longitude);
  172. console.log('当前位置的纬度:' + res.latitude);
  173. uni.setStorageSync("longitude",res.longitude)
  174. uni.setStorageSync("latitude",res.latitude)
  175. const qqmapsdk = new QQMapWX({
  176. key: 'BJKBZ-W46K3-6S43C-OFLJB-FW6FQ-RMBYP' // 必填
  177. });
  178. qqmapsdk.reverseGeocoder({
  179. location: {
  180. latitude: res.latitude,
  181. longitude: res.longitude
  182. },
  183. success: function(response) {
  184. // that.city = response.result.ad_info.city
  185. console.log('逆地理编码结果:', response);
  186. },
  187. fail: function(error) {
  188. console.error('逆地理编码失败:', error);
  189. }
  190. });
  191. }
  192. })
  193. },
  194. onIndustryList(){
  195. industryList({}).then(response=>{
  196. console.info("industryList",response);
  197. this.tabList = response.result
  198. }).catch(error=>{
  199. })
  200. },
  201. onBannerList(){
  202. bannerList({type:0}).then(response=>{
  203. this.swiperList = response.result.records
  204. }).catch(error=>{
  205. })
  206. },
  207. onTaskList(){
  208. taskList({
  209. latitude:this.latitude,
  210. longitude:this.longitude,
  211. pageNo:this.tpageNo,
  212. pageSize:this.tpageSize
  213. }).then(response=>{
  214. console.info("response",response.result.records)
  215. if(this.tpageNo==1){
  216. this.tList = response.result.records
  217. }else{
  218. this.tList = this.tList.concat(response.result.records)
  219. }
  220. console.info("taskList",response)
  221. }).catch(error=>{
  222. })
  223. },
  224. onRolelist(){
  225. rolelist({
  226. pageNo:this.rpageNo,
  227. pageSize:this.rpageSize
  228. }).then(response=>{
  229. console.info("response",response)
  230. if(this.rpageNo==1){
  231. this.rlist = response.result.records
  232. }else{
  233. this.rlist = this.rlist.concat(response.result.records)
  234. }
  235. }).catch(error=>{
  236. })
  237. },
  238. navClick(event){
  239. this.current=event.index
  240. },
  241. change(event){
  242. console.info(event)
  243. },
  244. click(event){
  245. console.info(event)
  246. },
  247. toNavigator(event){
  248. uni.navigateTo({
  249. url:"/pages_subpack/release/index?status="+event
  250. })
  251. },
  252. onCategory(){
  253. uni.navigateTo({
  254. url:"/pages_subpack/category/index"
  255. })
  256. }
  257. }
  258. }
  259. </script>
  260. <style>
  261. page{
  262. background-color: #f5f5f5;
  263. }
  264. .enterprise{
  265. background: #ff7a31;
  266. border: 4rpx solid rgba(255,255,255,0.50);
  267. border-radius: 14rpx;
  268. }
  269. .master{
  270. background: #f0b744;
  271. border: 4rpx solid rgba(255,255,255,0.50);
  272. border-radius: 14rpx;
  273. }
  274. </style>