Explorar el Código

添加水印 设置分享

wangxin hace 6 años
padre
commit
d3447946a4
Se han modificado 49 ficheros con 565 adiciones y 321 borrados
  1. 48 0
      app.js
  2. 16 0
      app.wxss
  3. BIN
      images/happyjob/watermark.png
  4. 0 3
      pages/about/index.js
  5. 0 7
      pages/agent/index.js
  6. 0 4
      pages/apply-list/index.js
  7. 4 3
      pages/apply-list/index.wxml
  8. 0 7
      pages/bus-detail/bus-detail.js
  9. 0 3
      pages/collection-list/index.js
  10. 4 3
      pages/collection-list/index.wxml
  11. 0 7
      pages/company-desc/company-desc.js
  12. 1 0
      pages/detail/index.js
  13. 3 3
      pages/detail/index.wxml
  14. 0 7
      pages/expense/pages/return-fee/detail.js
  15. 0 7
      pages/expense/pages/return-fee/index.js
  16. 0 7
      pages/expense/pages/wages/detail.js
  17. 1 1
      pages/index/index.js
  18. 3 3
      pages/index/index.wxml
  19. 1 12
      pages/index/index.wxs
  20. 1 8
      pages/integral/pages/exchange-detail/exchange-detail.js
  21. 0 7
      pages/integral/pages/exchange-record/exchange-record.js
  22. 27 4
      pages/integral/pages/gift-detail/gift-detail.js
  23. 0 7
      pages/integral/pages/integral-pay/integral-pay.js
  24. 0 7
      pages/integral/pages/integral-rule/integral-rule.js
  25. 0 7
      pages/integral/pages/task/task.js
  26. 0 3
      pages/interview/index.js
  27. 16 2
      pages/jianli/index.js
  28. 84 76
      pages/jianli/index.wxml
  29. 14 0
      pages/jinali-info/index.js
  30. 71 63
      pages/jinali-info/index.wxml
  31. 6 0
      pages/mine/index.js
  32. 0 7
      pages/payment-details/payment-details.js
  33. 1 0
      pages/pt-detail/index.js
  34. 1 0
      pages/pt-share/pt-share.js
  35. 1 0
      pages/pt/index.js
  36. 1 0
      pages/recommend/index.js
  37. 0 3
      pages/search-result/search-result.js
  38. 4 3
      pages/search-result/search-result.wxml
  39. 0 7
      pages/share/index.js
  40. 13 1
      pages/tools.wxs
  41. 122 6
      pages/user-works/index.js
  42. 20 6
      pages/user-works/index.wxml
  43. 48 0
      pages/user-works/index.wxss
  44. 0 7
      pages/wallet/index.js
  45. 0 7
      pages/withdrawal-result/withdrawal-result.js
  46. 0 7
      pages/withdrawal/withdrawal.js
  47. 7 0
      project.config.json
  48. 12 0
      utils/http.js
  49. 35 6
      utils/util.js

+ 48 - 0
app.js

@@ -54,8 +54,30 @@ App({
     if (options.shareTicket) {
       this.getShareInfo(options.shareTicket)
     }
+    wx.onAppRoute((data) => {
+      const route = getCurrentPages();
+      const page = route[route.length - 1];
+      console.log(data)
+      console.log(page)
+      if (!page.data.hasShare) {
+        let _str = '';
+        for (let key in data.query) {
+          _str += `${key}=${data.query[key]}&&`
+        }
+        const shareTitle = this.shareTitle[page.route]
+        page.onShareAppMessage = function(e) {
+          return {
+            path: `/${page.route}?${_str}`,
+            // imageUrl: page.data.shareImageUrl || '/images/happyjob/detail_share.jpg',
+            title: shareTitle || '开心工作'
+          }
+        }.bind(page)
+      }
+    })
   },
+  shareTitle: {
 
+  },
   globalData: {
     openId: '',
     userInfo: null,
@@ -97,4 +119,30 @@ App({
       url: '/pages/login/login',
     })
   },
+  watermark(height) {
+    const system = wx.getSystemInfoSync();
+    const _height = system.windowHeight > height ? system.windowHeight : height;
+    const row = Math.floor(_height * (750 / system.windowWidth) / 200);
+    const json = [];
+    for (let i = 0; i < row; i++) {
+      json.push([])
+      let _tmp = i % 2;
+      if (_tmp) {
+        for (let j = 0; j < 2; j++) {
+          json[i].push({
+            top: 30 + 200 * i,
+            left: 160 + 235 * j
+          })
+        }
+      } else {
+        for (let j = 0; j < 3; j++) {
+          json[i].push({
+            top: 30 + 200 * i,
+            left: 30 + 250 * j
+          })
+        }
+      }
+    }
+    return json;
+  }
 })

+ 16 - 0
app.wxss

@@ -24,3 +24,19 @@ i-count-down {
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+
+.watermark {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: -1;
+}
+
+.watermark-img {
+  height: 134rpx;
+  width: 190rpx;
+  position: absolute;
+  z-index: -1;
+}

BIN
images/happyjob/watermark.png


+ 0 - 3
pages/about/index.js

@@ -3,7 +3,4 @@ Page({
   data: {
     imgServerUrl: imgServerUrl
   },
-  onShareAppMessage: function () {
-
-  }
 })

+ 0 - 7
pages/agent/index.js

@@ -59,13 +59,6 @@ Page({
       isLogin: isLogin
     })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  },
   imageLoad() {
     var that = this
     var query = wx.createSelectorQuery()

+ 0 - 4
pages/apply-list/index.js

@@ -47,10 +47,6 @@ Page({
     })
     this.fetchData()
   },
-
-  onShareAppMessage: function() {
-
-  },
   doArrow(e) {
     const index = e.currentTarget.dataset.index;
     const list = this.data.list;

+ 4 - 3
pages/apply-list/index.wxml

@@ -1,5 +1,6 @@
 <!--pages/search-result/search-result.wxml-->
 <wxs src="../tools.wxs" module="globalTools" />
+<wxs src="../index/index.wxs" module="Tools" />
 <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="none">
@@ -23,10 +24,10 @@
                 <block wx:if="{{item.workDay}}">
                   <block wx:for="{{globalTools.splitStr1(item.workDay,',')}}" wx:key="*this" wx:for-item="tag">
                     <block wx:if="{{index == 0}}">
-                      {{Tools.formatDate(tag)}} 至
+                      {{globalTools.formatDate(tag)}} 至
                     </block>
                     <block wx:if="{{index == (globalTools.splitStr1(item.workDay,',').length-1)}}">
-                      {{Tools.formatDate(tag)}}
+                      {{globalTools.formatDate(tag)}}
                     </block>
                   </block>
                   <text> (共计{{globalTools.splitStr1(item.workDay,',').length}}天)</text>
@@ -181,7 +182,7 @@
               <!-- <view>
               <image src='{{imgServerUrl}}/images/happyjob/time.png'></image>
             </view> -->
-              <text> {{Tools.formatDate(item.publishTime)}} 至 {{Tools.formatDate(item.endTime)}}</text>
+              <text> {{globalTools.formatDate(item.publishTime)}} 至 {{globalTools.formatDate(item.endTime)}}</text>
             </view>
             <view class='time'>{{Tools.formatTime(item.updateDate)}}</view>
           </view>

+ 0 - 7
pages/bus-detail/bus-detail.js

@@ -66,11 +66,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 3
pages/collection-list/index.js

@@ -48,9 +48,6 @@ Page({
     this.fetchData()
   },
 
-  onShareAppMessage: function() {
-
-  },
   doArrow(e) {
     const index = e.currentTarget.dataset.index;
     const list = this.data.list;

+ 4 - 3
pages/collection-list/index.wxml

@@ -1,5 +1,6 @@
 <!--pages/search-result/search-result.wxml-->
 <wxs src="../tools.wxs" module="globalTools" />
+<wxs src="../index/index.wxs" module="Tools" />
 <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="none">
@@ -23,10 +24,10 @@
                 <block wx:if="{{item.workDay}}">
                   <block wx:for="{{globalTools.splitStr1(item.workDay,',')}}" wx:key="*this" wx:for-item="tag">
                     <block wx:if="{{index == 0}}">
-                      {{Tools.formatDate(tag)}} 至
+                      {{globalTools.formatDate(tag)}} 至
                     </block>
                     <block wx:if="{{index == (globalTools.splitStr1(item.workDay,',').length-1)}}">
-                      {{Tools.formatDate(tag)}}
+                      {{globalTools.formatDate(tag)}}
                     </block>
                   </block>
                   <text> (共计{{globalTools.splitStr1(item.workDay,',').length}}天)</text>
@@ -180,7 +181,7 @@
               <!-- <view>
               <image src='{{imgServerUrl}}/images/happyjob/time.png'></image>
             </view> -->
-              <text> {{Tools.formatDate(item.publishTime)}} 至 {{Tools.formatDate(item.endTime)}}</text>
+              <text> {{globalTools.formatDate(item.publishTime)}} 至 {{globalTools.formatDate(item.endTime)}}</text>
             </view>
             <view class='time'>{{Tools.formatTime(item.updateDate)}}</view>
           </view>

+ 0 - 7
pages/company-desc/company-desc.js

@@ -66,11 +66,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 1 - 0
pages/detail/index.js

@@ -21,6 +21,7 @@ const app = getApp();
 
 Page({
   data: {
+    hasShare: true,
     imgServerUrl: imgServerUrl,
     imgServerUrl_new: imgServerUrl_new,
     hpPositionId: 0,

+ 3 - 3
pages/detail/index.wxml

@@ -274,7 +274,7 @@
       <view class="right">
         <view class='favour' bindtap='favourate'>
           <block wx:if="{{isFarovite}}">
-            <image src='/images/happyjob/share.png'></image>
+            <image src='/images/happyjob/collected.png'></image>
           </block>
           <block wx:else>
             <image src='/images/happyjob/collect.png'></image>
@@ -522,7 +522,7 @@
     </view>
     <view class="two1">
       <view class='left'>
-        <view class='reward'>
+        <view class='reward'  wx:if="{{postitionDetail.reward}}">
           <text class="reward1">入职奖励 </text>
           <text class="reward2"><text wx:if='{{postitionDetail.maleReward}}'>男{{postitionDetail.maleReward}} </text><text wx:if='{{postitionDetail.femaleReward}}'>女{{postitionDetail.femaleReward}}</text><text wx:if='{{postitionDetail.platformAllowance}}'>,额外奖励{{postitionDetail.platformAllowance}}</text></text>
           <text class="reward3">拼团成功最高可得{{maxReward}}元</text>
@@ -769,7 +769,7 @@
       <view class="right">
         <view class='favour' bindtap='favourate'>
           <block wx:if="{{isFarovite}}">
-            <image src='/images/happyjob/share.png'></image>
+            <image src='/images/happyjob/collected.png'></image>
           </block>
           <block wx:else>
             <image src='/images/happyjob/collect.png'></image>

+ 0 - 7
pages/expense/pages/return-fee/detail.js

@@ -137,11 +137,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/expense/pages/return-fee/index.js

@@ -108,11 +108,4 @@ Page({
       this.getList()
     }
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/expense/pages/wages/detail.js

@@ -87,11 +87,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 1 - 1
pages/index/index.js

@@ -149,7 +149,7 @@ Page({
   },
 
   onShareAppMessage: function(e) {
-    console.log(e)
+
   },
   // 获取banner图
   fetchBanner() {

+ 3 - 3
pages/index/index.wxml

@@ -94,10 +94,10 @@
               <block wx:if="{{item.workDay}}">
                 <block wx:for="{{globalTools.splitStr1(item.workDay,',')}}" wx:key="*this" wx:for-item="tag">
                   <block wx:if="{{index == 0}}">
-                    {{Tools.formatDate(tag)}} 至
+                    {{globalTools.formatDate(tag)}} 至
                   </block>
                   <block wx:if="{{index == (globalTools.splitStr1(item.workDay,',').length-1)}}">
-                    {{Tools.formatDate(tag)}}
+                    {{globalTools.formatDate(tag)}}
                   </block>
                 </block>
                 <text> (共计{{globalTools.splitStr1(item.workDay,',').length}}天)</text>
@@ -179,7 +179,7 @@
             <!-- <view>
               <image src='{{imgServerUrl}}/images/happyjob/time.png'></image>
             </view> -->
-            <text> {{Tools.formatDate(item.publishTime)}} 至 {{Tools.formatDate(item.endTime)}}</text>
+            <text> {{globalTools.formatDate(item.publishTime)}} 至 {{globalTools.formatDate(item.endTime)}}</text>
           </view>
           <view class='time'>{{Tools.formatTime(item.updateDate)}}</view>
         </view>

+ 1 - 12
pages/index/index.wxs

@@ -1,14 +1,4 @@
-function formatDate(date, month_str, minute_str) {
-  if (!date) {
-    return 0
-  }
-  date = date.replace(getRegExp('-', 'g'), '/');
-  var _date = null;
-  _date = getDate(date);
-  var month = _date.getMonth() + 1;
-  var day = _date.getDate();
-  return month + '月' + day + '日';
-}
+
 
 function formatTime(date) {
   if (!date) {
@@ -27,6 +17,5 @@ function formatNumber(n) {
   return n[1] ? n : '0' + n
 }
 module.exports = {
-  formatDate: formatDate,
   formatTime: formatTime
 };

+ 1 - 8
pages/integral/pages/exchange-detail/exchange-detail.js

@@ -8,7 +8,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    hasShare:true
   },
 
   /**
@@ -76,11 +76,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/integral/pages/exchange-record/exchange-record.js

@@ -151,11 +151,4 @@ Page({
       this[this.data.type]();
     }
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 27 - 4
pages/integral/pages/gift-detail/gift-detail.js

@@ -16,6 +16,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    hasShare: true,
     title_arr: {
       gift: '好礼详情',
       activity: '活动详情'
@@ -25,6 +26,7 @@ Page({
     cover: true,
     input: false,
     title: true,
+    hasloading: false
   },
   gift(id) {
     getMpCompaignsRewardDetail({
@@ -34,7 +36,14 @@ Page({
       mpCompaignsRewardSettingId: id,
     }).then(res => {
       if (res.errcode === 0) {
-        this.setData(res.data.mpCompaignsRewardSettingAPI)
+        this.setData(res.data.mpCompaignsRewardSettingAPI);
+        this.setData({
+          hasloading: true
+        })
+      } else {
+        this.setData({
+          hasloading: false
+        })
       }
     })
   },
@@ -48,6 +57,13 @@ Page({
     }).then(res => {
       if (res.errcode === 0) {
         this.setData(res.data.mpCompaignsActivitySettingAPI)
+        this.setData({
+          hasloading: true
+        })
+      } else {
+        this.setData({
+          hasloading: false
+        })
       }
     })
   },
@@ -210,8 +226,9 @@ Page({
         // button: this.data.button_message[options.type],
         type: options.type,
         page_title: this.data.title_arr[options.type],
+        id: options.id
       })
-      this[options.type](options.id);
+      // this[options.type](options.id);
     }
   },
 
@@ -226,7 +243,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-
+    if (!this.data.hasloading) {
+      this[this.data.type](this.data.id)
+    }
   },
 
   /**
@@ -261,7 +280,11 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function() {
-
+    return {
+      path: `${this.route}?type=${this.data.type}&&id=${this.data.id}`,
+      imageUrl: this.data.rewardPic || this.data.activityPic,
+      title: this.data.rewardName || this.data.activityName
+    }
   },
   returnCover() {
 

+ 0 - 7
pages/integral/pages/integral-pay/integral-pay.js

@@ -285,11 +285,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/integral/pages/integral-rule/integral-rule.js

@@ -70,11 +70,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/integral/pages/task/task.js

@@ -166,11 +166,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 3
pages/interview/index.js

@@ -48,9 +48,6 @@ Page({
     this.fetchData()
   },
 
-  onShareAppMessage: function() {
-
-  },
   //获取我的申请岗位
   fetchData() {
     if (!this.data.isScroll) {

+ 16 - 2
pages/jianli/index.js

@@ -14,6 +14,7 @@ const app = getApp();
 
 Page({
   data: {
+    watermark: [],
     imgServerUrl: imgServerUrl,
     hpUserResumeId: '', //是否有简历
     eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
@@ -78,7 +79,7 @@ Page({
     }
   },
   onShow: function(options) {
-    this.fetchData()
+    this.fetchData();
   },
   //获取用户简历详情
   fetchData() {
@@ -89,7 +90,7 @@ Page({
     }
     Object.assign(paramsObj);
     getResume(paramsObj).then(data => {
-      console.log("ghj",data)
+      console.log("ghj", data)
       if (!data.data.userResume) {
         wx.navigateTo({
           url: '../user-info/index',
@@ -124,6 +125,19 @@ Page({
         eduName: eduName,
         expList: expList,
         year: year
+      },_=>{
+        wx.createSelectorQuery().select('.container').fields({
+          dataset: true,
+          size: true,
+          scrollOffset: true,
+          properties: ['scrollX', 'scrollY'],
+          computedStyle: ['margin', 'backgroundColor'],
+          context: true,
+        }, (res) => {
+          this.setData({
+            watermark: app.watermark(res.height)
+          })
+        }).exec()
       })
       wx.setStorageSync('userResume', userResume)
     })

+ 84 - 76
pages/jianli/index.wxml

@@ -1,96 +1,102 @@
 <wxs src="../tools.wxs" module="globalTools" />
-<view class='card'>
-  <image class="avatar" src="{{userResume.headImg}}" />
-  <view class="flex">
-    <text class="name">{{userResume.realName}}</text>
-    <text class="wz">简历写得好,工作更好找,脱贫没烦恼!</text>
-  </view>
+<view class="watermark">
+  <block wx:for='{{watermark}}' wx:for-item='watermark' wx:key='index'>
+    <image wx:for='{{watermark}}' wx:key='index' src="/images/happyjob/watermark.png" style="left:{{item.left}}rpx;top:{{item.top}}rpx" class="watermark-img"></image>
+  </block>
 </view>
+<view class="container">
+  <view class='card'>
+    <image class="avatar" src="{{userResume.headImg}}" />
+    <view class="flex">
+      <text class="name">{{userResume.realName}}</text>
+      <text class="wz">简历写得好,工作更好找,脱贫没烦恼!</text>
+    </view>
+  </view>
 
 
-<view class='basic'>
-  <text class="persondetail">个人资料</text>
-  <image class="edit" src="{{imgServerUrl}}/images/happyjob/edit1.png" bindtap='toUserInfo' />
-</view>
-
-<view class='basic-info'>
-  <view class='infoma'>
-    <text class="detailinfo">性别:</text>
-    <text class="detail" wx:if='{{userResume.gender==1}}'>男</text>
-    <text class="detail" wx:if='{{userResume.gender==2}}'>女</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">年龄:</text>
-    <text class="detail">{{year}}岁</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">最高学历:</text>
-    <text class="detail">{{eduName}}</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">联系方式:</text>
-    <text class="detail">{{userResume.phone}}</text>
+  <view class='basic'>
+    <text class="persondetail">个人资料</text>
+    <image class="edit" src="{{imgServerUrl}}/images/happyjob/edit1.png" bindtap='toUserInfo' />
   </view>
-</view>
-
-<view class='basic'>
-  <text class="persondetail">求职意向</text>
-  <image class="edit" src="{{imgServerUrl}}/images/happyjob/edit1.png" bindtap='toUserJob' />
-</view>
 
-<view class='basic-info1' wx:if="{{userResume.expectationPosition}}">
-  <view class='infoma'>
-    <text class="detailinfo">期望岗位:</text>
-    <view class="detail">
-      <block wx:for="{{globalTools.splitStr1(userResume.expectationPosition,',')}}" wx:for-item="item" wx:key="*this">
-        {{expectationPosition[item]}}
-      </block>
+  <view class='basic-info'>
+    <view class='infoma'>
+      <text class="detailinfo">性别:</text>
+      <text class="detail" wx:if='{{userResume.gender==1}}'>男</text>
+      <text class="detail" wx:if='{{userResume.gender==2}}'>女</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">年龄:</text>
+      <text class="detail">{{year}}岁</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">最高学历:</text>
+      <text class="detail">{{eduName}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">联系方式:</text>
+      <text class="detail">{{userResume.phone}}</text>
     </view>
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">期望地点:</text>
-    <text class="detail">{{userResume.expectationAddress}}</text>
+
+  <view class='basic'>
+    <text class="persondetail">求职意向</text>
+    <image class="edit" src="{{imgServerUrl}}/images/happyjob/edit1.png" bindtap='toUserJob' />
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">期望薪资:</text>
-    <text class="detail">{{userResume.expectationSalary}}</text>
+
+  <view class='basic-info1' wx:if="{{userResume.expectationPosition}}">
+    <view class='infoma'>
+      <text class="detailinfo">期望岗位:</text>
+      <view class="detail">
+        <block wx:for="{{globalTools.splitStr1(userResume.expectationPosition,',')}}" wx:for-item="item" wx:key="*this">
+          {{expectationPosition[item]}}
+        </block>
+      </view>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">期望地点:</text>
+      <text class="detail">{{userResume.expectationAddress}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">期望薪资:</text>
+      <text class="detail">{{userResume.expectationSalary}}</text>
+    </view>
   </view>
-</view>
 
-<view wx:if='{{!userResume.expectationPosition}}' class='add' bindtap='toUserJob'>
-  <image src="{{imgServerUrl}}/images/happyjob/addinfo.png" />
-  <text>添加求职意向,更易筛选岗位</text>
-</view>
+  <view wx:if='{{!userResume.expectationPosition}}' class='add' bindtap='toUserJob'>
+    <image src="{{imgServerUrl}}/images/happyjob/addinfo.png" />
+    <text>添加求职意向,更易筛选岗位</text>
+  </view>
 
-<view class='basic'>
-  <text class="persondetail">工作经验</text>
-</view>
+  <view class='basic'>
+    <text class="persondetail">工作经验</text>
+  </view>
 
-<view class='basic-info2' wx:if="{{expList.length}}" wx:for="{{expList}}" wx:key="hpUserResumeId" bindtap="toUserWorks" data-type="edit" data-index="{{index}}">
-  <view class='infoma'>
-    <text class="detailinfo">企业名称:</text>
-    <view class="dba">
-      <text class="detail">{{item.workCompany}}</text>
-      <image class="edit1" src="{{imgServerUrl}}/images/happyjob/edit1.png" />
+  <view class='basic-info2' wx:if="{{expList.length}}" wx:for="{{expList}}" wx:key="hpUserResumeId" bindtap="toUserWorks" data-type="edit" data-index="{{index}}">
+    <view class='infoma'>
+      <text class="detailinfo">企业名称:</text>
+      <view class="dba">
+        <text class="detail">{{item.workCompany}}</text>
+        <image class="edit1" src="{{imgServerUrl}}/images/happyjob/edit1.png" />
+      </view>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">工作岗位:</text>
+      <text class="detail">{{item.workPosition}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">工作时间:</text>
+      <text class="detail">{{item.workStartDate}}~{{item.workEndDate}}</text>
     </view>
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">工作岗位:</text>
-    <text class="detail">{{item.workPosition}}</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">工作时间:</text>
-    <text class="detail">{{item.workStartDate}}~{{item.workEndDate}}</text>
-  </view>
-</view>
 
-<view class='add' bindtap='toUserWorks' data-type="new">
-  <image src="{{imgServerUrl}}/images/happyjob/addinfo.png" />
-  <text>添加求职意向,更易筛选岗位</text>
-</view>
+  <view class='add' bindtap='toUserWorks' data-type="new">
+    <image src="{{imgServerUrl}}/images/happyjob/addinfo.png" />
+    <text>添加工作经验,更易筛选岗位</text>
+  </view>
 
 
-<!-- <view class='wx'>
+  <!-- <view class='wx'>
   <view class='infoma'>
     <text class="detailinfo">微信账号:</text>
     <view class="dba">
@@ -98,4 +104,6 @@
       <image class="edit1" src="{{imgServerUrl}}/images/happyjob/edit1.png" />
     </view>
   </view>
-</view> -->
+</view> -->
+
+</view>

+ 14 - 0
pages/jinali-info/index.js

@@ -14,6 +14,7 @@ const app = getApp();
 
 Page({
   data: {
+    watermark: [],
     imgServerUrl: imgServerUrl,
     hpUserResumeId: '', //是否有简历
     eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
@@ -78,6 +79,19 @@ Page({
     }
     this.setData({
       userResume: userResume
+    }, _ => {
+      wx.createSelectorQuery().select('.container').fields({
+        dataset: true,
+        size: true,
+        scrollOffset: true,
+        properties: ['scrollX', 'scrollY'],
+        computedStyle: ['margin', 'backgroundColor'],
+        context: true,
+      }, (res) => {
+        this.setData({
+          watermark: app.watermark(res.height)
+        })
+      }).exec()
     })
   },
   onShow: function(options) {

+ 71 - 63
pages/jinali-info/index.wxml

@@ -1,78 +1,86 @@
 <wxs src="../tools.wxs" module="globalTools" />
-<view class='card'>
-  <image class="avatar" src="{{userResume.headImg}}" />
-  <view class="flex">
-    <text class="name">{{userResume.realName}}</text>
-    <text class="wz">简历写得好,工作更好找,脱贫没烦恼!</text>
-  </view>
+<view class="watermark">
+  <block wx:for='{{watermark}}' wx:for-item='watermark' wx:key='index'>
+    <image wx:for='{{watermark}}' wx:key='index' src="/images/happyjob/watermark.png" style="left:{{item.left}}rpx;top:{{item.top}}rpx" class="watermark-img"></image>
+  </block>
 </view>
+<view class="container">
+  <view class='card'>
+    <image class="avatar" src="{{userResume.headImg}}" />
+    <view class="flex">
+      <text class="name">{{userResume.realName}}</text>
+      <text class="wz">简历写得好,工作更好找,脱贫没烦恼!</text>
+    </view>
+  </view>
 
 
-<view class='basic'>
-  <text class="persondetail">个人资料</text>
-</view>
-
-<view class='basic-info'>
-  <view class='infoma'>
-    <text class="detailinfo">性别:</text>
-    <text class="detail" wx:if='{{userResume.gender==1}}'>男</text>
-    <text class="detail" wx:if='{{userResume.gender==2}}'>女</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">年龄:</text>
-    <text class="detail">{{userResume.birthYear}}</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">最高学历:</text>
-    <text class="detail">{{eduList[userResume.highestQualification]}}</text>
+  <view class='basic'>
+    <text class="persondetail">个人资料</text>
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">联系方式:</text>
-    <text class="detail">{{userResume.phone}}</text>
-  </view>
-</view>
-
-<view class='basic'>
-  <text class="persondetail">求职意向</text>
-</view>
 
-<view class='basic-info1' wx:if="{{userResume.expectationPosition}}">
-  <view class='infoma'>
-    <text class="detailinfo">期望岗位:</text>
-    <view class="detail">
-      <block wx:for="{{globalTools.splitStr1(userResume.expectationPosition,',')}}" wx:for-item="item" wx:key="*this">
-        {{expectationPosition[item]}}
-      </block>
+  <view class='basic-info'>
+    <view class='infoma'>
+      <text class="detailinfo">性别:</text>
+      <text class="detail" wx:if='{{userResume.gender==1}}'>男</text>
+      <text class="detail" wx:if='{{userResume.gender==2}}'>女</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">年龄:</text>
+      <text class="detail">{{userResume.birthYear}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">最高学历:</text>
+      <text class="detail">{{eduList[userResume.highestQualification]}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">联系方式:</text>
+      <text class="detail">{{userResume.phone}}</text>
     </view>
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">期望地点:</text>
-    <text class="detail">{{userResume.expectationAddress}}</text>
-  </view>
-  <view class='infoma'>
-    <text class="detailinfo">期望薪资:</text>
-    <text class="detail">{{userResume.expectationSalary}}</text>
-  </view>
-</view>
 
-<view class='basic'>
-  <text class="persondetail">工作经验</text>
-</view>
+  <view class='basic'>
+    <text class="persondetail">求职意向</text>
+  </view>
 
-<view class='basic-info2' wx:if="{{expList.length}}" wx:for="{{expList}}" wx:key="hpUserResumeId" bindtap="toUserWorks" data-type="edit" data-index="{{index}}">
-  <view class='infoma'>
-    <text class="detailinfo">企业名称:</text>
-    <view class="dba">
-      <text class="detail">{{item.workCompany}}</text>
-      <image class="edit1" src="{{imgServerUrl}}/images/happyjob/edit1.png" />
+  <view class='basic-info1' wx:if="{{userResume.expectationPosition}}">
+    <view class='infoma'>
+      <text class="detailinfo">期望岗位:</text>
+      <view class="detail">
+        <block wx:for="{{globalTools.splitStr1(userResume.expectationPosition,',')}}" wx:for-item="item" wx:key="*this">
+          {{expectationPosition[item]}}
+        </block>
+      </view>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">期望地点:</text>
+      <text class="detail">{{userResume.expectationAddress}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">期望薪资:</text>
+      <text class="detail">{{userResume.expectationSalary}}</text>
     </view>
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">工作岗位:</text>
-    <text class="detail">{{item.workPosition}}</text>
+
+  <view class='basic'>
+    <text class="persondetail">工作经验</text>
   </view>
-  <view class='infoma'>
-    <text class="detailinfo">工作时间:</text>
-    <text class="detail">{{item.workStartDate}}~{{item.workEndDate}}</text>
+
+  <view class='basic-info2' wx:if="{{expList.length}}" wx:for="{{expList}}" wx:key="hpUserResumeId" bindtap="toUserWorks" data-type="edit" data-index="{{index}}">
+    <view class='infoma'>
+      <text class="detailinfo">企业名称:</text>
+      <view class="dba">
+        <text class="detail">{{item.workCompany}}</text>
+        <image class="edit1" src="{{imgServerUrl}}/images/happyjob/edit1.png" />
+      </view>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">工作岗位:</text>
+      <text class="detail">{{item.workPosition}}</text>
+    </view>
+    <view class='infoma'>
+      <text class="detailinfo">工作时间:</text>
+      <text class="detail">{{item.workStartDate}}~{{item.workEndDate}}</text>
+    </view>
   </view>
+
 </view>

+ 6 - 0
pages/mine/index.js

@@ -83,6 +83,12 @@ Page({
       phone: phone
     })
   },
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  },
   start() {
     this.fetchData();
     this.getUserResume();

+ 0 - 7
pages/payment-details/payment-details.js

@@ -130,11 +130,4 @@ Page({
       this[this.data.type]();
     }
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 1 - 0
pages/pt-detail/index.js

@@ -14,6 +14,7 @@ var app = getApp()
 
 Page({
   data: {
+    hasShare:true,
     positionId: 0,
     positionCategory: 0, //0:全职 1:兼职 2:入职奖励 3:高薪急聘 4:拼团岗位 5:福利岗位 8:自发布全职 9:自发布兼职
     imgServerUrl: imgServerUrl,

+ 1 - 0
pages/pt-share/pt-share.js

@@ -16,6 +16,7 @@ var app = getApp()
 
 Page({
   data: {
+    hasShare:true,
     imgServerUrl: imgServerUrl,
     qrCode: '',
     hasAuth: true,

+ 1 - 0
pages/pt/index.js

@@ -18,6 +18,7 @@ const app = getApp();
 
 Page({
   data: {
+    hasShare: true,
     imgServerUrl: imgServerUrl,
     cityCode: '',
     pageNo: 1, //当前分页

+ 1 - 0
pages/recommend/index.js

@@ -3,6 +3,7 @@ import { updataStorageData } from '../../utils/storage.js'
 var app = getApp()
 Page({
   data: {
+    hasShare:true,
     imgServerUrl: imgServerUrl,
   },
 

+ 0 - 3
pages/search-result/search-result.js

@@ -71,9 +71,6 @@ Page({
     })
     this.fetchList();
   },
-  onShareAppMessage: function(e) {
-    console.log(e)
-  },
   //去详情页
   toDetail(e) {
     const {

+ 4 - 3
pages/search-result/search-result.wxml

@@ -1,5 +1,6 @@
 <!--pages/search-result/search-result.wxml-->
 <wxs src="../tools.wxs" module="globalTools" />
+<wxs src="../index/index.wxs" module="Tools" />
 <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="none">
@@ -23,10 +24,10 @@
                 <block wx:if="{{item.workDay}}">
                   <block wx:for="{{globalTools.splitStr1(item.workDay,',')}}" wx:key="*this" wx:for-item="tag">
                     <block wx:if="{{index == 0}}">
-                      {{Tools.formatDate(tag)}} 至
+                      {{globalTools.formatDate(tag)}} 至
                     </block>
                     <block wx:if="{{index == (globalTools.splitStr1(item.workDay,',').length-1)}}">
-                      {{Tools.formatDate(tag)}}
+                      {{globalTools.formatDate(tag)}}
                     </block>
                   </block>
                   <text> (共计{{globalTools.splitStr1(item.workDay,',').length}}天)</text>
@@ -177,7 +178,7 @@
               <!-- <view>
               <image src='{{imgServerUrl}}/images/happyjob/time.png'></image>
             </view> -->
-              <text> {{Tools.formatDate(item.publishTime)}} 至 {{Tools.formatDate(item.endTime)}}</text>
+              <text> {{globalTools.formatDate(item.publishTime)}} 至 {{globalTools.formatDate(item.endTime)}}</text>
             </view>
             <view class='time'>{{Tools.formatTime(item.updateDate)}}</view>
           </view>

+ 0 - 7
pages/share/index.js

@@ -56,11 +56,4 @@ Page({
   onReachBottom: function () {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
 })

+ 13 - 1
pages/tools.wxs

@@ -107,6 +107,17 @@ function limitedSize(number, limit) {
   return _num > _limt ? _limt : _num;
 }
 
+function formatDate(date, month_str, minute_str) {
+  if (!date) {
+    return 0
+  }
+  date = date.replace(getRegExp('-', 'g'), '/');
+  var _date = null;
+  _date = getDate(date);
+  var month = _date.getMonth() + 1;
+  var day = _date.getDate();
+  return month + '月' + day + '日';
+}
 module.exports = {
   formatemd: formatemd,
   splitStr: splitStr,
@@ -116,5 +127,6 @@ module.exports = {
   formateDay: formateDay,
   formatUrl: formatUrl,
   formatTime: formatTime,
-  limitedSize: limitedSize
+  limitedSize: limitedSize,
+  formatDate: formatDate
 };

+ 122 - 6
pages/user-works/index.js

@@ -10,10 +10,12 @@ import {
 import {
   formatNumber,
   argusToTimestamp,
-  formateym
+  formateym,
+  formateYM,
+  formatetime,
 } from '../../utils/util.js'
 const app = getApp();
-
+let end_time = [];
 Page({
   data: {
     imgServerUrl: imgServerUrl,
@@ -22,10 +24,17 @@ Page({
     startDate: '请选择入职时间',
     endDate: '请选择离职时间',
     startDateEnd: '',
+    endTime: formatetime(new Date(), '-', false),
     hpUserExpId: '', //求职者工作经验表
     hpUserResumeId: '', //用户简历表id 
+    years: [],
+    months: [],
+    pick_view: true,
+    touch_end: true
   },
   onLoad: function(options) {
+    this.pushYear();
+    // this.pushMonths();
     let {
       hpUserResumeId,
       index
@@ -46,17 +55,124 @@ Page({
       })
     }
   },
+  pushYear() {
+    const year = new Date().getFullYear();
+    const mouth = new Date().getMonth();
+    const _len = year - 2015;
+    const years = this.data.years;
+    for (let i = 0; i <= _len; i++) {
+      years.push(2015 + i + '年')
+    }
+    years.push('至今');
+    end_time[0] = years.length - 2;
+    end_time[1] = mouth;
+    this.setData({
+      years,
+    }, _ => {
+      this.pushMonths(end_time);
+    })
+  },
+  pushMonths(end_time) {
+    // const end_time = this.data.end_time;
+    const mouth = new Date().getMonth() + 1;
+    const months = [];
+    const _len = this.data.years.length;
+    if (this.data.years[end_time[0]] === '至今') {
+      this.setData({
+        months: []
+      }, _ => {
+        this.setData({
+          end_time
+        })
+      })
+      return
+    }
+    if (end_time[0] === _len - 2) {
+      for (let i = 0; i < mouth; i++) {
+        months.push(i + 1)
+      }
+      this.setData({
+        months: months.map(formatNumber)
+      }, _ => {
+        this.setData({
+          end_time
+        })
+      })
+      return
+    }
+    this.setData({
+      months: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
+    }, _ => {
+      this.setData({
+        end_time
+      })
+    })
+  },
+  showEndDate() {
+    this.setData({
+      pick_view: false
+    })
+  },
+  endDateCancel() {
+    this.setData({
+      pick_view: true
+    })
+  },
+  endDateSure() {
+    if (this.data.touch_end) {
+      const years = this.data.years;
+      const months = this.data.months;
+      console.log(years)
+      console.log(end_time)
+      if (end_time[0] === years.length - 1) {
+        this.setData({
+          endDate: years[years.length - 1],
+          pick_view: true,
+        })
+      } else {
+        this.setData({
+          endDate: `${years[end_time[0]]}${Number(months[end_time[1]])}月`,
+          pick_view: true,
+        })
+      }
+    }
+  },
+  catchtap() {
+
+  },
+  touchEnd() {
+    this.setData({
+      touch_end: true
+    })
+  },
+  touchStart() {
+    this.setData({
+      touch_end: false
+    })
+  },
   //入职时间
   startDateChange(e) {
     this.setData({
-      startDate: e.detail.value
+      startDate: formateYM(e.detail.value)
     })
   },
   //离职时间
   endDateChange(e) {
-    this.setData({
-      endDate: e.detail.value
-    })
+    console.log(e);
+    end_time = e.detail.value;
+    if (end_time[1] > this.data.months.length - 1) {
+      end_time[1] = this.data.months.length - 1
+    }
+    if (end_time[1] < 0) {
+      end_time[1] = 0
+    }
+    // this.setData({
+    //   end_time: end_time,
+    // })
+    this.pushMonths(end_time);
+    // this.setData({
+    //   endDate: formateYM(e.detail.value)
+    // })
   },
   //公司名称
   changeComName(e) {

+ 20 - 6
pages/user-works/index.wxml

@@ -20,14 +20,28 @@
 </view>
 <view class='list'>
   <text>离职时间</text>
-  <view>
-    <picker bindchange="endDateChange" mode="date" value="{{endDate}}" fields="month" start="2015-09" end="{{startDateEnd}}">
-      {{endDate}}
-    </picker>
+  <view bindtap="showEndDate" class="endDate">
+  {{endDate}}
+    <!-- <picker bindchange="endDateChange" mode="date" value="{{endDate}}" fields="month" start="2015-09" end="{{endTime}}">
+    </picker> -->
   </view>
 </view>
 
 
-<form bindsubmit="submit" report-submit='true' class="btn-group fixed-footer" >
-    <button class="distance selfBtn" form-type="submit">保存</button>
+<form bindsubmit="submit" report-submit='true' class="btn-group fixed-footer">
+  <button class="distance selfBtn" form-type="submit">保存</button>
 </form>
+<view class="pick-view" bindtap="endDateCancel" hidden="{{pick_view}}">
+  <view class="pick-view-header">
+    <view style="color:#8e8e8e;" catchtap="endDateCancel">取消</view>
+    <view style="color:#47b841" catchtap="endDateSure">确定</view>
+  </view>
+  <picker-view class="show-pick" style="width: 750rpx; height: 300px;" value="{{end_time}}" indicator-style="height: 50px;" style="width: 100%; height: 300px;position:absolute;bottom: 0;left: 0;background: #fff;" indicator-class='indicator-class' catchchange="endDateChange" bindpickend='touchEnd' bindpickstart='touchStart' catchtap="endDateTap">
+    <picker-view-column style='background: #fff;'>
+      <view wx:for="{{years}}" wx:key='index' style="line-height: 50px;text-align: center;background: #fff;">{{item}}</view>
+    </picker-view-column>
+    <picker-view-column>
+      <view wx:for="{{months}}" wx:key='index' style="line-height: 50px;text-align: center;background: #fff;">{{item}}月</view>
+    </picker-view-column>
+  </picker-view>
+</view>

+ 48 - 0
pages/user-works/index.wxss

@@ -1,4 +1,9 @@
 /* 输入框部分 */
+
+page {
+  height: 100%;
+}
+
 .list {
   display: flex;
   flex-direction: row;
@@ -74,3 +79,46 @@
   font-weight: 400;
   color: rgba(255, 254, 254, 1);
 }
+
+.endDate {
+  line-height: 77rpx;
+  width: 100%;
+  height: 100%;
+  text-align: left;
+  text-indent: 23rpx;
+  font-size: 28rpx;
+  font-family: SourceHanSansCN-Regular;
+  font-weight: 400;
+  color: rgba(153, 153, 153, 1);
+}
+
+.pick-view {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.5);
+  width: 100%;
+  height: 100%;
+  z-index: 99999;
+}
+
+.indicator {
+  line-height: 50rpx;
+  color: #000;
+  background: #fff;
+}
+
+.pick-view-header {
+  height: 50px;
+  width: 100%;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+  border-bottom: 2rpx solid #ebebeb;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  background: #fff;
+  position: absolute;
+  left: 0;
+  bottom: 300px;
+}

+ 0 - 7
pages/wallet/index.js

@@ -138,11 +138,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/withdrawal-result/withdrawal-result.js

@@ -60,11 +60,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 0 - 7
pages/withdrawal/withdrawal.js

@@ -119,11 +119,4 @@ Page({
   onReachBottom: function() {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function() {
-
-  }
 })

+ 7 - 0
project.config.json

@@ -247,6 +247,13 @@
 					"pathName": "pages/expense/pages/wages/index",
 					"query": "hpPositionId=10&cate=3",
 					"scene": null
+				},
+				{
+					"id": 26,
+					"name": "pages/user-works/index",
+					"pathName": "pages/user-works/index",
+					"query": "scene=gd%3D21%26pc%3D4%26pd%3D47",
+					"scene": null
 				}
 			]
 		}

+ 12 - 0
utils/http.js

@@ -136,6 +136,18 @@ const http = (params) => {
             //账号类型不符
           } else if (errorCode == 2006) {
             //后台接口异常
+          } else if (errorCode == 2010) {
+            //用户未登录
+            wx.navigateTo({
+              url: '/pages/login/login',
+              success:data=>{
+                wx.showToast({
+                  icon:'none',
+                  title: '请先登录',
+                })
+              }
+            })
+            return
           }
           params.data.task_id !== 10 && showToast(res.data.errmsg);
           reject(res.data);

+ 35 - 6
utils/util.js

@@ -26,10 +26,10 @@ const formatNumber = n => {
 //将年月日数组转成时间戳
 const argusToTimestamp = arr => {
   var lenth = arr.length;
-  if (lenth< 3) {                
-      for (var i =0; i < 3-lenth; i++) {
-          arr.push("01")
-      }
+  if (lenth < 3) {
+    for (var i = 0; i < 3 - lenth; i++) {
+      arr.push("01")
+    }
   }
   return Date.parse(new Date(arr.join("/")))
 }
@@ -43,9 +43,38 @@ function formateym(dates, split = ".") {
   return date.getFullYear() + split + formatNumber(date.getMonth() + 1)
 }
 
+// 时间转成年月
+function formateYM(date, status = true) {
+  const _date = date.replace(/-/g, '/')
+  var time = new Date(_date)
+  var year = time.getFullYear()
+  var month = time.getMonth() + 1
+  var day = time.getDate()
+  if (status) {
+    return `${year}年${month}月`
+  } else {
+    return `${year}年${month}月${day}`
+  }
+}
+// 时间转成年月
+function formatetime(date, str, status = true) {
+  const _date = date.replace ? date.replace(/-/g, '/') : date;
+  var time = new Date(_date)
+  var year = time.getFullYear()
+  var month = time.getMonth() + 1
+  var day = time.getDate()
+  if (status) {
+    return `${year}${str}${month}`
+  } else {
+    return `${year}${str}${month}${str}${day}`
+  }
+}
+
 module.exports = {
   formatTime: formatTime,
   formatNumber,
   formateym,
-  argusToTimestamp
-}
+  argusToTimestamp,
+  formateYM,
+  formatetime
+}