Explorar o código

福利岗位页面开发

ZhangWenQiang %!s(int64=6) %!d(string=hai) anos
pai
achega
5f30998e14
Modificáronse 6 ficheiros con 695 adicións e 10 borrados
  1. 4 2
      app.json
  2. 191 0
      pages/fuli/index.js
  3. 10 0
      pages/fuli/index.json
  4. 82 0
      pages/fuli/index.wxml
  5. 406 0
      pages/fuli/index.wxss
  6. 2 8
      pages/index/index.js

+ 4 - 2
app.json

@@ -42,7 +42,9 @@
     "pages/store/storeList",
     "pages/store-detail/store-detail",
     "pages/store-form/store-form",
-    "pages/gdmap/index"
+    "pages/gdmap/index",
+    "pages/agent/index",
+    "pages/fuli/index"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -62,7 +64,7 @@
       },
       {
         "pagePath": "pages/pt/index",
-        "text": "拼团上班",
+        "text": "拼",
         "iconPath": "/images/tabs/pintuan.png",
         "selectedIconPath": "/images/tabs/pintuan1.png"
       },

+ 191 - 0
pages/fuli/index.js

@@ -0,0 +1,191 @@
+// pages/fuli/index.js
+import {
+  getWelfareList
+} from '../../services/index.js'
+import {
+  imgServerUrl,
+  imgServerUrl_new
+} from '../../config/config.js'
+var app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list: [],
+    pageNo: 1, //当前分页
+    isScroll: true, //是否可以滚动
+    showNoMore: "没有更多信息...", //显示已无更多
+    cityName: '无锡',
+    cityCode: '320200',
+    selectId: -1, //选中筛选的条件
+    settlementMethod: [{
+        index: -1,
+        name: '不限'
+      },
+      {
+        index: 2,
+        name: '日结'
+      },
+      {
+        index: 1,
+        name: '周结'
+      },
+      {
+        index: 0,
+        name: '月结'
+      },
+      {
+        index: 3,
+        name: '完工结'
+      },
+      {
+        index: 4,
+        name: '其他'
+      },
+    ], //结算方式(1:正序;2:倒序)
+    settleme: 0, //结算方式索引
+    settle: '', //结算方式
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+    if (app.globalData.userInfo) {
+      console.log('有info===', app.globalData)
+      this.start();
+    } else if (this.data.canIUse) {
+      // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+      // 所以此处加入 callback 以防止这种情况
+      app.userInfoReadyCallback = res => {
+        console.log('userInfoReadyCallback===', res.userInfo)
+        app.globalData.userInfo = res.userInfo;
+        this.start();
+      }
+    } else {
+      // 在没有 open-type=getUserInfo 版本的兼容处理
+      wx.getUserInfo({
+        success: res => {
+          app.globalData.userInfo = res.userInfo
+          console.log('兼容处理===', app.globalData)
+          this.start();
+        }
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+  start() {
+    this.welfareList();
+  },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {
+    let cityName = wx.getStorageSync('city') || app.globalData.userInfo.city || '无锡'
+    console.log(cityName)
+    this.setData({
+      cityName: cityName
+    })
+  },
+
+  //获取福利岗位列表数据
+  welfareList(params) {
+    if (!this.data.isScroll) {
+      return false
+    }
+    let paramsObj = {
+      settlementMethod: this.data.settle,
+      cityCode: this.data.cityCode,
+      pageNo: this.data.pageNo,
+      user_id: app.globalData.userId,
+      user_token: app.globalData.userToken
+    }
+    Object.assign(paramsObj);
+
+    getWelfareList(paramsObj).then(data => {
+      var pageNo = data.data.pageNo;
+      let setData = {}
+      // 是否可以滚动加载数据
+      if (data.data.isLast) {
+        setData.isScroll = false
+      }
+      if (data.data.welfarePosition.length != 0) {
+        setData.list = this.data.list.concat(data.data.welfarePosition)
+        setData.pageNo = pageNo;
+      } else {
+        setData.list = this.data.list;
+      }
+      this.setData({
+        ...setData
+      })
+
+    })
+  },
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+    this.setData({
+      pageNo: 1, //当前分页
+      isScroll: true, //是否可以滚动
+      list: [],
+    })
+    this.start();
+    wx.stopPullDownRefresh();
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+    var pageNo = this.data.pageNo + 1;
+    this.setData({
+      pageNo
+    })
+    this.welfareList();
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  },
+  doSalay: function(e) {
+    var selectId;
+    if (this.data.selectId == 0) {
+      selectId = -1;
+    } else {
+      selectId = 0;
+    }
+    this.setData({
+      selectId: selectId,
+    })
+  },
+  // 结算方式
+  settlemethod: function(e) {
+    var index = e.currentTarget.dataset.tt;
+    var settle = e.currentTarget.dataset.settle;
+    console.log("index", index)
+    console.log("settle", settle)
+    this.setData({
+      settleme: index,
+      settle: settle,
+      pageNo: 1, //当前分页
+      isScroll: true, //是否可以滚动
+      list: [],
+    })
+    this.start();
+    this.setData({
+      selectId: -1,
+    })
+  }
+})

+ 10 - 0
pages/fuli/index.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {
+    "i-icon": "../../ui/icon/index",
+    "i-notice-bar": "../../ui/notice-bar/index",
+    "i-tag": "../../ui/tag/index",
+    "marquee": "../../ui/marquee/index"
+  },
+  "enablePullDownRefresh": true,
+  "navigationBarTitleText": "福利岗位"
+}

+ 82 - 0
pages/fuli/index.wxml

@@ -0,0 +1,82 @@
+<!--pages/fuli/index.wxml-->
+<wxs src="../tools.wxs" module="globalTools" />
+<!-- 顶部筛选 -->
+<view class='head'>
+  <view class='map'>
+    <view class='location'>
+      <image src='../../images/happyjob/location.png'></image>
+    </view>
+    <text class='cityname'>{{cityName}}</text>
+  </view>
+  <view class='salay' bindtap='doSalay'>
+    <text class="salayname">结算方式</text>
+    <view class='arrow1'>
+      <block wx:if="{{selectId == 0}}">
+        <image src='../../images/happyjob/arrow1.png'></image>
+      </block>
+      <block wx:else>
+        <image src='../../images/happyjob/arrow.png'></image>
+      </block>
+    </view>
+  </view>
+</view>
+
+<!-- 结算方式弹出框 -->
+<block wx:if="{{selectId == 0}}">
+  <view class='settlementMethod scrolled'>
+    <block wx:for="{{settlementMethod}}" wx:key="index" wx:for-item="settle">
+      <view class="settleme {{settleme==index?'active':''}}" bindtap='settlemethod' data-settle='{{settle.index}}' data-tt='{{index}}'>
+        <text>{{settle.name}}</text>
+      </view>
+    </block>
+  </view>
+</block>
+
+<!-- 列表 -->
+<block wx:if="{{list.length !=0 }}">
+  <view class='box-body'>
+    <view class='box-item' wx:for="{{list}}" wx:key="hpPositionId" bindtap='toDetail' data-id="{{item.id}}" data-cate="{{item.positionCategory}}" hover-class="item-hover">
+      <view class='box-item-info'>
+        <view class='one'>
+          <view class='left'>
+            {{item.positionName}}
+          </view>
+          <view class='salary'>
+            <image src='../../images/happyjob/dollor.png'></image>
+            {{item.salary}}
+          </view>
+        </view>
+        <view class='two'>
+          <view class='limit'>
+            <view>
+              <image src='../../images/happyjob/limit.png'></image>
+            </view>
+            <text> {{globalTools.subStr(item.publishTime)}}-{{globalTools.subStr(item.endTime)}}</text>
+          </view>
+          <view class='time'>{{item.settlementMethod}}</view>
+        </view>
+        <view class='three'>
+          <view class='area'>
+            <image src='../../images/happyjob/address.png'></image>
+            <block wx:if="{{item.activityWide}}">
+              <i-tag wx:for="{{globalTools.splitStr1(item.activityWide,',')}}" wx:key="*this" wx:for-item="tag" i-class="tag-class" style="margin-left:10rpx;">
+                {{tag}}
+              </i-tag>
+            </block>
+          </view>
+          <view class='time'>
+            <image src='../../images/happyjob/time.png'></image>
+            <text>{{globalTools.subStr(item.updateDate)}}</text>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view class="loading_no" hidden='{{isScroll}}'>{{showNoMore}}</view>
+</block>
+<block wx:else>
+  <view class='no_data'>
+    <image src="../../images/happyjob/no_data.png" class="white" />
+    <view class='no_text'>暂时还没有福利工作 看看其他的吧</view>
+  </view>
+</block>

+ 406 - 0
pages/fuli/index.wxss

@@ -0,0 +1,406 @@
+/* pages/fuli/index.wxss */
+
+page {
+  background-color: #f5f5f5;
+}
+
+/* 顶部筛选 */
+
+.head {
+  display: flex;
+  height: 100rpx;
+  width: 100%;
+  flex: 1 0 auto;
+  align-items: center;
+  background-color: #fff;
+  border-bottom: 2rpx solid #ddd;
+}
+
+.head .map {
+  display: flex;
+  white-space: nowrap;
+  flex-grow: 1;
+  font-size: 30rpx;
+  justify-content: center;
+  height: 40rpx;
+  align-items: center;
+  color: #525255;
+}
+
+.head .map .location {
+  display: flex;
+  align-items: center;
+  width: 20rpx;
+  height: 24rpx;
+  padding-right: 10rpx;
+}
+
+.map .location image {
+  width: 100%;
+  height: 100%;
+}
+
+.head .salay {
+  display: flex;
+  flex-grow: 1;
+  white-space: nowrap;
+  font-size: 26rpx;
+  height: 40rpx;
+  color: #868b92;
+  justify-content: center;
+  align-items: center;
+}
+
+.salay .salayname {
+  padding-right: 10rpx;
+}
+
+.salay .arrow {
+  display: flex;
+  width: 14rpx;
+  height: 8rpx;
+  align-items: center;
+}
+
+.salay .arrow image {
+  width: 100%;
+  height: 100%;
+}
+
+.salay .arrow1 {
+  display: flex;
+  width: 18rpx;
+  height: 10rpx;
+  align-items: center;
+}
+
+.salay .arrow1 image {
+  width: 100%;
+  height: 100%;
+}
+
+.salay .active {
+  color: #1e62a7;
+}
+
+/* 结算方式 */
+
+.scrolled {
+  position: fixed;
+  top: 100rpx;
+  left: 0;
+}
+
+.settlementMethod {
+  display: flex;
+  display: -webkit-flex;
+  width: 100%;
+  padding: 14rpx 30rpx;
+  box-sizing: border-box;
+  z-index: 999;
+  -webkit-transition: background 0.5s ease-in-out;
+  align-items: center;
+  height: 163rpx;
+  flex-wrap: wrap;
+  background-color: #fff;
+  box-shadow: 0px 6px 10px 0px rgba(0, 0, 0, 0.06);
+  border-top: 2rpx solid #ddd;
+}
+
+.settlementMethod .settleme {
+  display: flex;
+  height: 48rpx;
+  align-items: center;
+  background: rgba(245, 245, 245, 1);
+  border-radius: 24rpx;
+  margin-right: 16rpx;
+  color: #706f6f;
+}
+
+.settlementMethod .settleme text {
+  padding: 0 30rpx;
+  font-size: 24rpx;
+}
+
+.settlementMethod .active {
+  background-color: #5191d3;
+  color: #fff;
+}
+
+/* 列表 */
+
+.box-body {
+  width: 100%;
+  overflow: hidden;
+}
+
+.box_title {
+  padding: 17rpx 0 17rpx 40rpx;
+  font-size: 28rpx;
+  color: #666;
+  border-bottom: 2rpx solid #ddd;
+}
+
+.box-item {
+  display: flex;
+  padding: 35rpx 40rpx 30rpx 40rpx;
+  font-size: 32rpx;
+  color: #232327;
+  box-sizing: border-box;
+  background-color: #fff;
+  border-bottom: 16rpx solid #f5f5f5;
+}
+
+.item-hover {
+  background: #f5f5f5;
+}
+
+.box-item .box-item-img {
+  display: flex;
+  flex: 0 0 auto;
+  width: 150rpx;
+  height: 150rpx;
+  border-radius: 6rpx;
+  background: #fff;
+}
+
+.box-item .box-item-info {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  flex-grow: 1;
+  box-sizing: border-box;
+  overflow: hidden;
+}
+
+.box-item .one {
+  display: flex;
+  justify-content: space-between;
+  color: #232327;
+  flex-direction: row;
+}
+
+.box-item .one .left {
+  display: flex;
+  flex-grow: 1;
+  align-items: center;
+  font-size: 32rpx;
+  font-family: SourceHanSansCN-Regular;
+  font-weight: 400;
+  color: rgba(35, 35, 39, 1);
+  width: 60%;
+}
+
+.box-item .one .salary {
+  font-size: 32rpx;
+  font-family: Arial-BoldMT;
+  font-weight: bold;
+  color: rgba(30, 98, 167, 1);
+}
+
+.box-item .one .salary image {
+  width: 18rpx;
+  height: 24rpx;
+}
+
+.box-item .two {
+  display: flex;
+  justify-content: space-between;
+  color: #909090;
+  font-size: 24rpx;
+  margin-top: 30rpx;
+  align-items: center;
+}
+
+.box-item .two .limit {
+  display: flex;
+  flex-direction: row;
+  flex-grow: 1;
+  overflow: hidden;
+  margin-right: 30rpx;
+  width: 80%;
+  color: #868b92;
+}
+
+.box-item .two .limit image {
+  width: 18rpx;
+  height: 18rpx;
+  margin-right: 10rpx;
+}
+
+.box-item .two .limit i-tag {
+  /* margin-left: 10rpx; */
+}
+
+.box-item .two .limit text {
+  margin-left: 10rpx;
+}
+
+.box-item .two .time {
+  color: #706f6f;
+  font-size: 20rpx;
+}
+
+.tag-class {
+  background: #e2f4fe !important;
+  margin-right: 6rpx;
+  white-space: nowrap;
+  border: none !important;
+  background: rgba(245, 245, 245, 1) !important;
+  border-radius: 14px !important;
+}
+
+.box-item .three {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  font-size: 20rpx;
+  margin-top: 20rpx;
+}
+
+.box-item .three image {
+  width: 16rpx;
+  height: 19rpx;
+}
+
+.box-item .three .area {
+  color: #868b92;
+  font-size: 24rpx;
+}
+
+.box-item .three .area .area-name {
+  margin-left: 10rpx;
+  color: #868b92;
+  font-size: 24rpx;
+}
+
+.box-item .three .limit {
+  display: flex;
+  flex-grow: 1;
+  overflow: hidden;
+  margin-right: 10rpx;
+  width: 80%;
+  flex-direction: row;
+}
+
+.box-item .three .limit i-tag {
+  margin-left: 10rpx;
+}
+
+.box-item .three .time {
+  flex: 0 0 auto;
+  color: #868b92;
+}
+
+.box-item .three .time image {
+  width: 18rpx;
+  height: 18rpx;
+}
+
+.box-item .three .time text {
+  margin-left: 6rpx;
+  font-size: 20rpx;
+}
+
+.box-item .three .fan {
+  display: flex;
+  flex-direction: row;
+  color: #ff400e;
+  font-size: 20rpx;
+  align-items: center;
+}
+
+.box-item .three .fan image {
+  width: 24rpx;
+  height: 24rpx;
+  margin-right: 10rpx;
+}
+
+.box-item .four {
+  display: flex;
+  justify-content: space-between;
+  color: #909090;
+  font-size: 22rpx;
+  margin-top: 18rpx;
+  align-items: center;
+}
+
+.box-item .four .limit {
+  display: flex;
+  flex-direction: row;
+  flex-grow: 1;
+  overflow: hidden;
+  margin-right: 30rpx;
+  width: 80%;
+  color: #868b92;
+}
+
+.box-item .four .limit image {
+  width: 18rpx;
+  height: 18rpx;
+}
+
+.box-item .four .limit i-tag {
+  margin-left: 10rpx;
+}
+
+.box-item .four .limit text {
+  margin-left: 10rpx;
+}
+
+.box-item .four .time {
+  color: #706f6f;
+  font-size: 20rpx;
+}
+
+.box-item .four .commpany {
+  font-size: 22rpx;
+  color: #a0a4a9;
+}
+
+.box-item .four .area {
+  color: #868b92;
+  font-size: 24rpx;
+}
+
+.box-item .four .area image {
+  width: 16rpx;
+  height: 19rpx;
+}
+
+.box-item .four .area .area-name {
+  margin-left: 10rpx;
+  color: #868b92;
+  font-size: 22rpx;
+}
+
+.loading_no {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 60rpx;
+  font-size: 22rpx;
+  color: #696969;
+}
+
+/* 空白页 */
+
+.no_data {
+  width: 100%;
+  margin-top: 20%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+}
+
+.white {
+  width: 125px;
+  height: 125px;
+}
+
+.no_text {
+  color: #ccc;
+  font-size: 32rpx;
+  margin-top: 48rpx;
+}

+ 2 - 8
pages/index/index.js

@@ -92,7 +92,7 @@ Page({
   },
   start() {
     this.fetchBanner();
-    this.workType(this.data.filter);
+    this.fetchList();
   },
   onShow: function() {
     let cityName = wx.getStorageSync('city') || app.globalData.userInfo.city || '无锡'
@@ -118,7 +118,7 @@ Page({
     this.setData({
       pageNo
     })
-    this.workType(this.data.filter)
+    this.fetchList();
   },
 
   onShareAppMessage: function(e) {
@@ -340,12 +340,6 @@ Page({
     const {
       index
     } = e.currentTarget.dataset
-    // this.setData({
-    //   pageNo: 1,
-    //   filter: index,
-    //   list: [],
-    //   isScroll: true
-    // })
     this.workType(index)
   },