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

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