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

249 lines
6.5 KiB

7 months ago
6 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
3 months ago
6 months ago
3 months ago
6 months ago
4 months ago
7 months ago
4 months ago
3 months ago
4 months ago
7 months ago
4 months ago
7 months ago
6 months ago
4 months ago
6 months ago
4 months ago
7 months ago
4 months ago
3 months ago
4 months ago
7 months ago
3 months ago
4 months ago
6 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">
  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`+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. } from "@/common/api.js"
  74. import enterpriseBox from "./component/enterprise.vue"
  75. import masterBox from "./component/master.vue"
  76. import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
  77. export default{
  78. components:{
  79. enterpriseBox,
  80. masterBox
  81. },
  82. data(){
  83. return {
  84. status:1,
  85. list: [
  86. "https://cdn.uviewui.com/uview/swiper/swiper1.png"
  87. ],
  88. tabList:[],//导航栏
  89. swiperList:[],//轮播
  90. current:0,
  91. navList:[
  92. {
  93. name: '求职大厅',
  94. },
  95. {
  96. name: '招聘大厅',
  97. }
  98. ],
  99. rpageNo:1,
  100. rpageSize:20,
  101. rlist:[],
  102. latitude:'34.00',
  103. longitude:'134.65',
  104. tpageNo:1,
  105. tpageSize:20,
  106. tList:[]
  107. }
  108. },
  109. mounted() {
  110. this.onBannerList()
  111. this.onTaskList()
  112. this.onRolelist()
  113. this.onIndustryList()
  114. this.getLocation()
  115. this.onSysText()
  116. },
  117. onPullDownRefresh() {
  118. let that = this
  119. that.rpageNo = 1
  120. that.rlist = []
  121. that.onRolelist()
  122. },
  123. onReachBottom() {
  124. let that = this
  125. that.rpageNo = that.rpageNo + 1
  126. that.onRolelist()
  127. },
  128. methods:{
  129. onSysText(){
  130. let that = this
  131. let params={}
  132. getSysText(params).then(response=>{
  133. localStorage.setItem("sysList",response.result)
  134. }).catch(error=>{
  135. })
  136. },
  137. getLocation(){
  138. const that = this;
  139. console.log('当前位置的经度:');
  140. wx.getLocation({
  141. type: 'wgs84',
  142. success: function (res) {
  143. console.log('位置',res);
  144. console.log('当前位置的经度:' + res.longitude);
  145. console.log('当前位置的纬度:' + res.latitude);
  146. const qqmapsdk = new QQMapWX({
  147. key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  148. });
  149. qqmapsdk.reverseGeocoder({
  150. location: {
  151. latitude: res.latitude,
  152. longitude: res.longitude
  153. },
  154. success: function(response) {
  155. // that.city = response.result.ad_info.city
  156. console.log('逆地理编码结果:', response);
  157. },
  158. fail: function(error) {
  159. console.error('逆地理编码失败:', error);
  160. }
  161. });
  162. }
  163. })
  164. },
  165. onIndustryList(){
  166. industryList({}).then(response=>{
  167. console.info("industryList",response);
  168. this.tabList = response.result
  169. }).catch(error=>{
  170. })
  171. },
  172. onBannerList(){
  173. bannerList({}).then(response=>{
  174. console.info("banner",response)
  175. this.swiperList = response.result[0]
  176. }).catch(error=>{
  177. })
  178. },
  179. onTaskList(){
  180. taskList({
  181. latitude:this.latitude,
  182. longitude:this.longitude,
  183. pageNo:this.tpageNo,
  184. pageSize:this.tpageSize
  185. }).then(response=>{
  186. if(this.tpageNo==1){
  187. this.tList = response.result.records
  188. }else{
  189. this.tList = this.tList.concat(response.result.records)
  190. }
  191. console.info("taskList",response)
  192. }).catch(error=>{
  193. })
  194. },
  195. onRolelist(){
  196. rolelist({
  197. pageNo:this.rpageNo,
  198. pageSize:this.rpageSize
  199. }).then(response=>{
  200. console.info("response",response)
  201. if(this.rpageNo==1){
  202. this.rlist = response.result.records
  203. }else{
  204. this.rlist = this.rlist.concat(response.result.records)
  205. }
  206. }).catch(error=>{
  207. })
  208. },
  209. navClick(event){
  210. this.current=event.index
  211. },
  212. change(event){
  213. console.info(event)
  214. },
  215. click(event){
  216. console.info(event)
  217. },
  218. toNavigator(event){
  219. uni.navigateTo({
  220. url:"/pages_subpack/release/index?status="+event
  221. })
  222. },
  223. }
  224. }
  225. </script>
  226. <style>
  227. page{
  228. background-color: #f5f5f5;
  229. }
  230. .enterprise{
  231. background: #ff7a31;
  232. border: 4rpx solid rgba(255,255,255,0.50);
  233. border-radius: 14rpx;
  234. }
  235. .master{
  236. background: #f0b744;
  237. border: 4rpx solid rgba(255,255,255,0.50);
  238. border-radius: 14rpx;
  239. }
  240. </style>