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

236 lines
6.2 KiB

10 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
9 months ago
7 months ago
9 months ago
7 months ago
10 months ago
7 months ago
10 months ago
7 months ago
9 months ago
10 months ago
9 months ago
10 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" 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. </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. </view>
  39. </view>
  40. <u-tabs
  41. :current="current"
  42. lineWidth="30"
  43. lineColor="#FF7A31"
  44. :activeStyle="{
  45. color: '#303133',
  46. fontWeight: 'bold',
  47. transform: 'scale(1.05)'
  48. }"
  49. :inactiveStyle="{
  50. color: '#606266',
  51. transform: 'scale(1)'
  52. }"
  53. itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
  54. :list="navList"
  55. @click="navClick($event)">
  56. </u-tabs>
  57. <!-- 企业端 求职大厅 -->
  58. <enterpriseBox :rolelist="rlist" v-if="current==0" />
  59. <!-- 师傅端 招聘大厅 -->
  60. <masterBox :taskList="tList" v-if="current==1" />
  61. <view class="se-h-80"></view>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. bannerList,
  67. taskList,
  68. rolelist,
  69. industryList
  70. } from "@/common/api.js"
  71. import enterpriseBox from "./component/enterprise.vue"
  72. import masterBox from "./component/master.vue"
  73. import QQMapWX from "@/util/qqmap-wx-jssdk.min.js"
  74. export default{
  75. components:{
  76. enterpriseBox,
  77. masterBox
  78. },
  79. data(){
  80. return {
  81. status:1,
  82. list: [
  83. "https://cdn.uviewui.com/uview/swiper/swiper1.png"
  84. ],
  85. tabList:[],//导航栏
  86. swiperList:[],//轮播
  87. current:0,
  88. navList:[
  89. {
  90. name: '求职大厅',
  91. },
  92. {
  93. name: '招聘大厅',
  94. }
  95. ],
  96. rpageNo:1,
  97. rpageSize:20,
  98. rlist:[],
  99. latitude:'34.00',
  100. longitude:'134.65',
  101. tpageNo:1,
  102. tpageSize:20,
  103. tList:[]
  104. }
  105. },
  106. mounted() {
  107. this.onBannerList()
  108. this.onTaskList()
  109. this.onRolelist()
  110. this.onIndustryList()
  111. this.getLocation()
  112. },
  113. onPullDownRefresh() {
  114. let that = this
  115. that.rpageNo = 1
  116. that.rlist = []
  117. that.onRolelist()
  118. },
  119. onReachBottom() {
  120. let that = this
  121. that.rpageNo = that.rpageNo + 1
  122. that.onRolelist()
  123. },
  124. methods:{
  125. getLocation(){
  126. const that = this;
  127. console.log('当前位置的经度:');
  128. wx.getLocation({
  129. type: 'wgs84',
  130. success: function (res) {
  131. console.log('位置',res);
  132. console.log('当前位置的经度:' + res.longitude);
  133. console.log('当前位置的纬度:' + res.latitude);
  134. const qqmapsdk = new QQMapWX({
  135. key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填
  136. });
  137. qqmapsdk.reverseGeocoder({
  138. location: {
  139. latitude: res.latitude,
  140. longitude: res.longitude
  141. },
  142. success: function(response) {
  143. // that.city = response.result.ad_info.city
  144. console.log('逆地理编码结果:', response);
  145. },
  146. fail: function(error) {
  147. console.error('逆地理编码失败:', error);
  148. }
  149. });
  150. }
  151. })
  152. },
  153. onIndustryList(){
  154. industryList({}).then(response=>{
  155. console.info("industryList",response);
  156. this.tabList = response.result
  157. }).catch(error=>{
  158. })
  159. },
  160. onBannerList(){
  161. bannerList({}).then(response=>{
  162. console.info("banner",response)
  163. this.swiperList = response.result[0]
  164. }).catch(error=>{
  165. })
  166. },
  167. onTaskList(){
  168. taskList({
  169. latitude:this.latitude,
  170. longitude:this.longitude,
  171. pageNo:this.tpageNo,
  172. pageSize:this.tpageSize
  173. }).then(response=>{
  174. if(this.tpageNo==1){
  175. this.tList = response.result.records
  176. }else{
  177. this.tList = this.tList.concat(response.result.records)
  178. }
  179. console.info("taskList",response)
  180. }).catch(error=>{
  181. })
  182. },
  183. onRolelist(){
  184. rolelist({
  185. pageNo:this.rpageNo,
  186. pageSize:this.rpageSize
  187. }).then(response=>{
  188. console.info("response",response)
  189. if(this.rpageNo==1){
  190. this.rlist = response.result.records
  191. }else{
  192. this.rlist = this.rlist.concat(response.result.records)
  193. }
  194. }).catch(error=>{
  195. })
  196. },
  197. navClick(event){
  198. this.current=event.index
  199. },
  200. change(event){
  201. console.info(event)
  202. },
  203. click(event){
  204. console.info(event)
  205. },
  206. toNavigator(event){
  207. uni.navigateTo({
  208. url:"/pages_subpack/release/index?status="+event
  209. })
  210. },
  211. }
  212. }
  213. </script>
  214. <style>
  215. page{
  216. background-color: #f5f5f5;
  217. }
  218. .enterprise{
  219. background: #ff7a31;
  220. border: 4rpx solid rgba(255,255,255,0.50);
  221. border-radius: 14rpx;
  222. }
  223. .master{
  224. background: #f0b744;
  225. border: 4rpx solid rgba(255,255,255,0.50);
  226. border-radius: 14rpx;
  227. }
  228. </style>