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

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