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

267 lines
6.9 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
4 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
4 months ago
6 months ago
4 months ago
6 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
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-bgc-white se-px-0 se-py-10 se-ta-l se-c-orange se-flex se-flex-ai-c se-fs-26">
  22. <image class="se-a-80" src="@/static/image/aed60x.png" mode=""></image>
  23. <text class="se-ml-10">今日有6个工作息新发布....</text>
  24. </view>
  25. </view>
  26. <view class="se-my-20 se-bgc-white se-grid">
  27. <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">
  28. <image class="se-a-100 se-br-20 se-bgc-f5" :src="item.icon" mode=""></image>
  29. <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>
  30. </navigator>
  31. </view>
  32. <view class="se-my-20 se-bgc-white se-p-20 se-flex">
  33. <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">
  34. <!-- 找工作 -->
  35. 招聘
  36. </view>
  37. <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">
  38. <!-- 找师傅 -->
  39. 求职
  40. </view>
  41. </view>
  42. <u-tabs
  43. :current="current"
  44. lineWidth="30"
  45. lineColor="#FF7A31"
  46. :activeStyle="{
  47. color: '#303133',
  48. fontWeight: 'bold',
  49. transform: 'scale(1.05)'
  50. }"
  51. :inactiveStyle="{
  52. color: '#606266',
  53. transform: 'scale(1)'
  54. }"
  55. itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
  56. :list="navList"
  57. @click="navClick($event)">
  58. </u-tabs>
  59. <!-- 企业端 求职大厅 -->
  60. <enterpriseBox :rolelist="rlist" v-if="current==0" />
  61. <!-- 师傅端 招聘大厅 -->
  62. <masterBox :taskList="tList" v-if="current==1" />
  63. <view class="se-h-80"></view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. bannerList,
  69. taskList,
  70. rolelist,
  71. industryList,
  72. getSysText,
  73. getNotice
  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. status:1,
  86. list: [
  87. "https://cdn.uviewui.com/uview/swiper/swiper1.png"
  88. ],
  89. tabList:[],//导航栏
  90. swiperList:[],//轮播
  91. current:0,
  92. navList:[
  93. {
  94. name: '求职大厅',
  95. },
  96. {
  97. name: '招聘大厅',
  98. }
  99. ],
  100. rpageNo:1,
  101. rpageSize:20,
  102. rlist:[],
  103. latitude:'34.00',
  104. longitude:'134.65',
  105. tpageNo:1,
  106. tpageSize:20,
  107. tList:[]
  108. }
  109. },
  110. mounted() {
  111. this.onBannerList()
  112. this.onTaskList()
  113. this.onRolelist()
  114. this.onIndustryList()
  115. this.getLocation()
  116. this.onSysText()
  117. this.onNotice()
  118. },
  119. onPullDownRefresh() {
  120. let that = this
  121. that.rpageNo = 1
  122. that.rlist = []
  123. that.onRolelist()
  124. },
  125. onReachBottom() {
  126. let that = this
  127. that.rpageNo = that.rpageNo + 1
  128. that.onRolelist()
  129. },
  130. methods:{
  131. onNotice(){
  132. // let that = this
  133. // let params={}
  134. // getNotice(params).then(response=>{
  135. // console.info(response)
  136. // }).catch(error=>{
  137. // })
  138. },
  139. onSysText(){
  140. let that = this
  141. let params={}
  142. getSysText(params).then(response=>{
  143. localStorage.setItem("sysList",response.result)
  144. }).catch(error=>{
  145. })
  146. },
  147. getLocation(){
  148. const that = this;
  149. console.log('当前位置的经度:');
  150. wx.getLocation({
  151. type: 'wgs84',
  152. success: function (res) {
  153. console.log('位置',res);
  154. console.log('当前位置的经度:' + res.longitude);
  155. console.log('当前位置的纬度:' + res.latitude);
  156. uni.setStorageSync("longitude",res.longitude)
  157. uni.setStorageSync("latitude",res.latitude)
  158. const qqmapsdk = new QQMapWX({
  159. key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  160. });
  161. qqmapsdk.reverseGeocoder({
  162. location: {
  163. latitude: res.latitude,
  164. longitude: res.longitude
  165. },
  166. success: function(response) {
  167. // that.city = response.result.ad_info.city
  168. console.log('逆地理编码结果:', response);
  169. },
  170. fail: function(error) {
  171. console.error('逆地理编码失败:', error);
  172. }
  173. });
  174. }
  175. })
  176. },
  177. onIndustryList(){
  178. industryList({}).then(response=>{
  179. console.info("industryList",response);
  180. this.tabList = response.result
  181. }).catch(error=>{
  182. })
  183. },
  184. onBannerList(){
  185. bannerList({}).then(response=>{
  186. console.info("banner",response)
  187. this.swiperList = response.result[0]
  188. }).catch(error=>{
  189. })
  190. },
  191. onTaskList(){
  192. taskList({
  193. latitude:this.latitude,
  194. longitude:this.longitude,
  195. pageNo:this.tpageNo,
  196. pageSize:this.tpageSize
  197. }).then(response=>{
  198. if(this.tpageNo==1){
  199. this.tList = response.result.records
  200. }else{
  201. this.tList = this.tList.concat(response.result.records)
  202. }
  203. console.info("taskList",response)
  204. }).catch(error=>{
  205. })
  206. },
  207. onRolelist(){
  208. rolelist({
  209. pageNo:this.rpageNo,
  210. pageSize:this.rpageSize
  211. }).then(response=>{
  212. console.info("response",response)
  213. if(this.rpageNo==1){
  214. this.rlist = response.result.records
  215. }else{
  216. this.rlist = this.rlist.concat(response.result.records)
  217. }
  218. }).catch(error=>{
  219. })
  220. },
  221. navClick(event){
  222. this.current=event.index
  223. },
  224. change(event){
  225. console.info(event)
  226. },
  227. click(event){
  228. console.info(event)
  229. },
  230. toNavigator(event){
  231. uni.navigateTo({
  232. url:"/pages_subpack/release/index?status="+event
  233. })
  234. },
  235. onCategory(){
  236. uni.navigateTo({
  237. url:"/pages_subpack/category/index"
  238. })
  239. }
  240. }
  241. }
  242. </script>
  243. <style>
  244. page{
  245. background-color: #f5f5f5;
  246. }
  247. .enterprise{
  248. background: #ff7a31;
  249. border: 4rpx solid rgba(255,255,255,0.50);
  250. border-radius: 14rpx;
  251. }
  252. .master{
  253. background: #f0b744;
  254. border: 4rpx solid rgba(255,255,255,0.50);
  255. border-radius: 14rpx;
  256. }
  257. </style>