y595705120 il y a 4 ans
Parent
commit
a0ca77ac11
71 fichiers modifiés avec 2546 ajouts et 351 suppressions
  1. 20 30
      app.js
  2. 15 7
      app.json
  3. 3 1
      app.wxss
  4. BIN
      img/card.png
  5. BIN
      img/cardback.png
  6. BIN
      img/sign/color_black.png
  7. BIN
      img/sign/color_black_selected.png
  8. BIN
      img/sign/color_red.png
  9. BIN
      img/sign/color_red_selected.png
  10. BIN
      img/sign/handwriting.gif
  11. 2 55
      pages/index/index.js
  12. 40 31
      pages/index/index.wxml
  13. 1 1
      pages/log/log.js
  14. 4 4
      pages/log/log.wxml
  15. 6 0
      pages/log/log.wxss
  16. 37 30
      pages/me/index.js
  17. 9 5
      pages/me/index.wxml
  18. 4 1
      pages/me/index.wxss
  19. 62 0
      pages/task/confirm/index.js
  20. 0 0
      pages/task/confirm/index.json
  21. 50 0
      pages/task/confirm/index.wxml
  22. 5 0
      pages/task/confirm/index.wxss
  23. 51 0
      pages/task/demand/index.js
  24. 3 0
      pages/task/demand/index.json
  25. 48 0
      pages/task/demand/index.wxml
  26. 10 0
      pages/task/demand/index.wxss
  27. 31 0
      pages/task/finish/index.js
  28. 3 0
      pages/task/finish/index.json
  29. 49 0
      pages/task/finish/index.wxml
  30. 10 0
      pages/task/finish/index.wxss
  31. 5 2
      pages/task/index.js
  32. 117 0
      pages/task/lyg/index.js
  33. 3 0
      pages/task/lyg/index.json
  34. 81 0
      pages/task/lyg/index.wxml
  35. 16 0
      pages/task/lyg/index.wxss
  36. 117 0
      pages/task/rob/index.js
  37. 3 0
      pages/task/rob/index.json
  38. 81 0
      pages/task/rob/index.wxml
  39. 16 0
      pages/task/rob/index.wxss
  40. 62 0
      pages/task/supply/index.js
  41. 3 0
      pages/task/supply/index.json
  42. 49 0
      pages/task/supply/index.wxml
  43. 10 0
      pages/task/supply/index.wxss
  44. 52 0
      pages/task/trade/index.js
  45. 3 0
      pages/task/trade/index.json
  46. 58 0
      pages/task/trade/index.wxml
  47. 10 0
      pages/task/trade/index.wxss
  48. 85 0
      pages/tool/band/band.js
  49. 3 0
      pages/tool/band/band.json
  50. 65 0
      pages/tool/band/band.wxml
  51. 57 0
      pages/tool/band/band.wxss
  52. 67 0
      pages/tool/empty/index.js
  53. 3 0
      pages/tool/empty/index.json
  54. 8 0
      pages/tool/empty/index.wxml
  55. 1 0
      pages/tool/empty/index.wxss
  56. 112 0
      pages/tool/identify/index.js
  57. 3 0
      pages/tool/identify/index.json
  58. 77 0
      pages/tool/identify/index.wxml
  59. 57 0
      pages/tool/identify/index.wxss
  60. 544 0
      pages/tool/sign/signature.js
  61. 3 0
      pages/tool/sign/signature.json
  62. 23 0
      pages/tool/sign/signature.wxml
  63. 143 0
      pages/tool/sign/signature.wxss
  64. 0 21
      pages/user/home/myInfo.js
  65. 0 66
      pages/user/home/myInfo.wxml
  66. 0 43
      pages/user/home/myInfo.wxss
  67. 27 0
      pages/user/info/index.js
  68. 3 0
      pages/user/info/index.json
  69. 61 0
      pages/user/info/index.wxml
  70. 21 0
      pages/user/info/index.wxss
  71. 34 54
      util/util.js

+ 20 - 30
app.js

@@ -56,7 +56,7 @@ App({
         if (res.code) {
           let param = { code: res.code };
           //发起网络请求
-          util.http("base/wxLogin", param, (errCode, data) => {
+          util.http("/base/wxLogin", param, (errCode, data) => {
             if( errCode == 0){
               let {user, token} = data
               user.token = token;
@@ -90,15 +90,6 @@ App({
       }
     })
   },
-  addForm( e ){
-    let { formId } = e.detail;
-    if (!formId || formId == "the formId is a mock one" ){
-      return;
-    }
-    util.http("Form/addForm", {formId}, (err, res) => {
-      console.log( "addForm", err, res);
-    });
-  },
   goHome() {
     wx.navigateTo({
       url: '/pages/index/index',
@@ -138,23 +129,6 @@ App({
       }
     })
   },
-  setGbInfo:function( info ){
-    this.globalData.info = info;
-  },
-  getGbInfo: function(){
-    if( !this.globalData.info ){
-      let data = wx.getStorageSync( "@data")||{};
-      let {thumb, image, wiki} = data;
-      this.globalData.info = {thumb,image, wiki};
-    }
-    return this.globalData.info;
-  },
-  getGbVote(){
-    return this.globalData.voteInfo;
-  },
-  setGbVote( voteInfo ){
-    this.globalData.voteInfo = voteInfo;
-  },
   getLocation(){
     return this.globalData.location;
   },
@@ -169,12 +143,28 @@ App({
     wx.setStorageSync('@flogin', userInfo);
     this.globalData.userInfo = userInfo;
   },
+  setMakerInfo( maker ){
+    maker = Object.assign(this.globalData.maker, maker )
+    this.globalData.maker = maker;
+  },
+  getMakerInfo( cb ){
+    if( this.globalData.maker.id ){
+      cb&&cb( this.globalData.maker);
+    }else{
+      util.http( '/wx/getMakerInfo', {}, (err,res)=>{
+        if( err == 0 ) {
+          this.globalData.maker = res.info
+          cb&&cb( res.info );
+         }else{
+          cb&&cb( {} );
+         }
+      })
+    }
+  },
   globalData: {
     userInfo: {},
     location: {},
-    info: null,
-    voteInfo: null,
-    wiki:[],
+    maker: {},
     Custom:0,
     CustomBar:0,
     CustomRate:0,

+ 15 - 7
app.json

@@ -1,14 +1,22 @@
 {
   "pages": [
     "pages/me/index",
+    "pages/user/info/index",
+    "pages/tool/sign/signature",
+    "pages/index/index",
+    "pages/tool/identify/index",
+    "pages/task/rob/index",
+    "pages/task/lyg/index",
+    "pages/task/trade/index",
+    "pages/task/demand/index",
+    "pages/task/supply/index",
+    "pages/task/confirm/index",
+    "pages/task/finish/index",
+    "pages/tool/band/band",
     "pages/account/index",
-    "pages/task/index",
-  
     "pages/log/log",
+    "pages/tool/empty/index"
     
-    "pages/index/index",
-    "pages/user/sugguest/index",
-    "pages/user/home/myInfo"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -31,10 +39,10 @@
         "text": "首页"
       },
       {
-        "pagePath": "pages/task/index",
+        "pagePath": "pages/task/lyg/index",
         "iconPath": "img/icons/tasks.png",
         "selectedIconPath": "img/icons/tasksopen.png",
-        "text": "任务中心"
+        "text": "任务大厅"
       },
       {
         "pagePath": "pages/account/index",

+ 3 - 1
app.wxss

@@ -15,4 +15,6 @@
 .tc{text-align: center;}
 .tl{text-align: left;}
 
-.fl{float: left;}
+.fl{float: left;}
+.pt20{ padding-top: 20rpx;}
+.pt30{ padding-top: 30rpx;}

BIN
img/card.png


BIN
img/cardback.png


BIN
img/sign/color_black.png


BIN
img/sign/color_black_selected.png


BIN
img/sign/color_red.png


BIN
img/sign/color_red_selected.png


BIN
img/sign/handwriting.gif


+ 2 - 55
pages/index/index.js

@@ -24,68 +24,15 @@ Page({
   },
   loadData :function( cb ){
     let that = this
-    util.http("base/getActiveAd", {}, function (err, res) {
+    util.http("/base/getActiveAd", {}, function (err, res) {
       if( err == 0){
         that.setData({ swiperList:res})
       }
       cb && cb()
     });
   },
-
   onShow: function(){
     this.data.info.id || this.loadData( );
-  },
-  gotoUserInfo: function (e) {
-    wx.navigateTo({
-      url: `/pages/user/home/myInfo`,
-    })
-  },
-  gotoHistory: function (e) {
-    wx.navigateTo({
-      url: `/pages/garden/history/index`,
-    })
-  },
-  gotoNearBy: function(e){
-    wx.navigateTo({
-      url: `/pages/user/map/map`,
-    })
-  },
-  getDetail(e){
-    let index = e.currentTarget.dataset.index;
-    let id = this.data.hot_list[index].id
-    wx.navigateTo({
-      url: `/pages/garden/info/info?id=${id}`,
-    })
-  },
-  linkWiki: function (e) {
-    let name = e.currentTarget.dataset.name;
-    if( !name ) return;
-    wx.navigateTo({
-      url: `/pages/wiki/info/wikiInfo?name=${name}`,
-    })
-  },
-  gotoWikiList: function(e){
-    wx.navigateTo({
-      url: `/pages/wiki/index/index`
-    })
-  },
-  gotoVoteList: function(e){
-    wx.navigateTo({
-      url: `/pages/vote/list/index`,
-    })
-  },
-  onShareAppMessage: function () {
-    return {
-      title: "识花小助手",
-      desc: "",
-      imageUrl: "",
-      path: '/pages/index/index',
-      success: (res) => {
-        util.showSuccess("邀请成功");
-      },
-      fail: (res) => {
-        util.showMsg("转发失败");
-      }
-    }
   }
+  
 })

+ 40 - 31
pages/index/index.wxml

@@ -5,32 +5,41 @@
   </view>
 </view>
 
-<swiper class="screen-swiper round-dot" 
-  indicator-dots="true" circular="true" autoplay="true" interval="10000" duration="500">
-  <swiper-item wx:for="{{swiperList}}" wx:key="index" data-name="{{item.link}}" bindtap="linkWiki"  >
-    <image src="{{item.image_url}}" mode="aspectFill"  ></image>
-  </swiper-item> 
+<swiper class="screen-swiper round-dot" indicator-dots="true" circular="true" autoplay="true" interval="10000"
+  duration="500">
+  <swiper-item wx:for="{{swiperList}}" wx:key="index" data-name="{{item.link}}" bindtap="linkWiki">
+    <image src="{{item.image_url}}" mode="aspectFill"></image>
+  </swiper-item>
 </swiper>
 
 <view class="cate-section">
-  <view class="cate-item" bindtap="gotoVoteList">
-    <image src="/img/1.png"></image>
-    <text>供应大厅</text>
-  </view>
-  <view class="cate-item" bindtap="gotoWikiList">
-    <image src="/img/2.png"></image>
-    <text>需求大厅</text>
-  </view>
-  <view class="cate-item" bindtap="gotoNearBy">
-    <image src="/img/3.png"></image>
-    <text>交易大厅</text>
-  </view>
-  <view class="cate-item" bindtap="gotoUserInfo">
-    <image src="/img/4.png"></image>
-    <text>任务大厅</text>
-  </view>
-</view>
+  <navigator url="/pages/task/supply/index" hover-class="none" open-type="navigate">
+    <view class="cate-item" bindtap="gotoVoteList">
+      <image src="/img/1.png"></image>
+      <text>供应大厅</text>
+    </view>
+  </navigator>
+  <navigator url="/pages/task/demand/index" hover-class="none" open-type="navigate">
+    <view class="cate-item">
+      <image src="/img/2.png"></image>
+      <text>需求大厅</text>
+    </view>
+  </navigator>
 
+  <navigator url="/pages/task/trade/index" hover-class="none" open-type="navigate">
+    <view class="cate-item">
+      <image src="/img/3.png"></image>
+      <text>交易大厅</text>
+    </view>
+  </navigator>
+
+  <navigator url="/pages/task/rob/index" hover-class="none" open-type="navigate">
+    <view class="cate-item">
+      <image src="/img/4.png"></image>
+      <text>任务大厅</text>
+    </view>
+  </navigator>
+</view>
 
 <view class="f-header">
   <image src="/img/h1.png"></image>
@@ -43,15 +52,15 @@
 
 
 <view class="ml50">
-    <view class="cu-card"  data-id="1" bindtap="getDetail">
-      <view class="p20 tl">1、如何注册以及实名认证</view>
-    </view>
-    <view class="cu-card" data-id="1"  bindtap="getDetail">
-      <view class="p20 tl">2、接单的完整流程</view>
-    </view>
-    <view class="cu-card" data-id="1" bindtap="getDetail">
-      <view class="p20 tl">3、名词解释</view>
-    </view>
+  <view class="cu-card" data-id="1" bindtap="getDetail">
+    <view class="p20 tl">1、如何注册以及实名认证</view>
+  </view>
+  <view class="cu-card" data-id="1" bindtap="getDetail">
+    <view class="p20 tl">2、接单的完整流程</view>
+  </view>
+  <view class="cu-card" data-id="1" bindtap="getDetail">
+    <view class="p20 tl">3、名词解释</view>
+  </view>
 </view>
 
 <view class="cu-tabbar-height"> </view>

+ 1 - 1
pages/log/log.js

@@ -13,7 +13,7 @@ Page({
     this.loadData( month )
   },
   loadData( month ){
-    util.http("wx/incomeList", {month},  (err, res)=> {
+    util.http("/wx/incomeList", {month},  (err, res)=> {
       console.log("res", err, res)
       if( err != 0 ) return;
       let list = res.map(item=>{

+ 4 - 4
pages/log/log.wxml

@@ -10,10 +10,10 @@
         <view class="cu-tag line-white">税费:{{(item.maker_service_fee+item.maker_tax_fee)/100}}元</view>
       </view>
       <view class="margin-top-sm">
-        <view class="log-item">任务:{{item.title}}</view>
-        <view class="log-item">分类:{{item.category}}</view>
-        <view class="log-item">企业:{{item.company}}</view>
-        <view class="log-item">时间:{{item.finish_at}}</view>
+        <view class="log-item">任务标题: <text class="task-info-txt">{{item.title}}</text> </view>
+        <view class="log-item">任务分类: <text class="task-info-txt">{{item.category}}</text></view>
+        <view class="log-item">发布企业: <text class="task-info-txt">{{item.company}}</text></view>
+        <view class="log-item">完成时间: <text class="task-info-txt">{{item.finish_at}}</text></view>
       </view>
     </view>   
   </view>

+ 6 - 0
pages/log/log.wxss

@@ -7,4 +7,10 @@ page {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
+}
+
+.task-info-txt{
+  overflow: hidden;
+  text-overflow: ellipsis;
+  color: orange;
 }

+ 37 - 30
pages/me/index.js

@@ -6,68 +6,75 @@ Page({
     CustomBar: app.globalData.CustomBar,
     mytask:[{
       img: "../../img/server/order.png",
-      openpath: "/pages/IDCard/IDCard",
-      text: "全部订单"
+      openpath: "/pages/task/rob/index?tab=0",
+      text: "任务中心"
     },
     {
       img: "../../img/server/doing.png",
-      openpath: "../../pages/bankQuery/bankQuery",
-      text: "进行中"
+      openpath: "/pages/task/rob/index?tab=1",
+      text: "待交付"
     },
     {
       img: "../../img/server/account.png",
-      openpath: "../../pages/bankQuery/bankQuery",
-      text: "我的账单"
+      openpath: "/pages/task/rob/index?tab=2",
+      text: "已交付"
     },
     {
       img: "../../img/server/history.png",
-      openpath: "../../pages/bankQuery/bankQuery",
-      text: "我的足迹"
+      openpath: "/pages/task/rob/index?tab=3",
+      text: "已完成"
     }
     ],
-    server:[{
+    server:[
+      {
+        img: "../../img/server/identify.png",
+        openpath: "/pages/tool/identify/index",
+        text: "实名认证"
+      },
+      {
+        img: "../../img/server/band.png",
+        openpath: "/pages/tool/band/band",
+        text: "绑定银行"
+      },
+      {
       img: "../../img/server/credit.png",
-      openpath: "/pages/IDCard/IDCard",
+      openpath: "/pages/tool/empty/index",
       text: "营业执照"
     },
     {
       img: "../../img/server/info.png",
-      openpath: "../../pages/bankQuery/bankQuery",
-      text: "完善信息"
-    },
-    {
-      img: "../../img/server/identify.png",
-      openpath: "../../pages/MobileHome/MobileHome",
-      text: "实名认证"
-    },
-    {
-      img: "../../img/server/band.png",
-      openpath: "../../pages/IP/IP",
-      text: "绑定银行"
-    }],
+      openpath: "/pages/tool/sign/signature",
+      text: "电子合同"
+    }
+    
+  ],
     other:[
       {
-        img: "../../img/server/like.png",
-        openpath: "../../pages/bankQuery/bankQuery",
-        text: "点赞助手"
+        img: "../../img/icons/mesopen.png",
+        openpath: "/pages/user/info/index",
+        text: "我的信息"
       },
       {
         img: "../../img/server/help.png",
-        openpath: "../../pages/bankQuery/bankQuery",
+        openpath: "/pages/tool/empty/index",
         text: "联系客服"
       },
       {
         img: "../../img/server/more.png",
-        openpath: "../../pages/MobileHome/MobileHome",
+        openpath: "/pages/tool/empty/index",
         text: "其他更多"
       }
     ]
   },
 
   onLoad: function (options) {
-
+    app.getMakerInfo()
+  },
+  gotoInfo( ){
+    wx.navigateTo({
+      url: '/pages/user/info/index',
+    })
   },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 9 - 5
pages/me/index.wxml

@@ -8,7 +8,7 @@
 <view class='container' style="top: {{StatusBar}}px;">
 
   <view class='userinfo'>
-    <view class='userinfo-avatar'>
+    <view class='userinfo-avatar' bindtap="gotoInfo">
       <open-data type="userAvatarUrl"></open-data>
     </view>
     <view class='userinfo-name'>
@@ -16,7 +16,7 @@
     </view>
   </view>
 </view>
-
+<!-- 我的任务 -->
 <view class="server-box ">
   <view class="">
     <view class="server-text fs26 ml20">我的任务</view>
@@ -35,7 +35,7 @@
   </view>
   <view class="clear"></view>
 </view>
-
+<!-- 我的资料 -->
 <view class="server-box inm">
   <view class="">
     <view class="server-text fs26 ml20">我的资料</view>
@@ -43,8 +43,11 @@
   <view class="list-server">
     <view class="listbox" wx:for="{{server}}" wx:key="img">
       <navigator url="{{item.openpath}}" hover-class="none" open-type="navigate">
-        <view>
-          <image src="{{item.img}}" class="listimg" />
+        <view class="bg-img">
+          <image src="{{item.img}}" class="listimg"  mode='aspectFill'></image>
+          <view class="cu-tag bg-red" class="small" wx:if="{{item.finish}}">
+            <text class="cuIcon-check"></text>
+          </view>
         </view>
         <view class="fs28">
           {{item.text}}
@@ -55,6 +58,7 @@
   <view class="clear"></view>
 </view>
 
+<!-- 更多 -->
 <view class="server-box inm">
   <view class="">
     <view class="server-text fs26 ml20">更多</view>

+ 4 - 1
pages/me/index.wxss

@@ -41,7 +41,10 @@ page {
   width:60rpx;
   height:60rpx;
 }
-
+.small{
+  width: 10rpx;
+  position: relative;
+}
 
 .inm{
   margin-top:200rpx;

+ 62 - 0
pages/task/confirm/index.js

@@ -0,0 +1,62 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    index:0,
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getData()
+  },
+  getData: function(){
+    let param = {  }
+    util.http("/wx/getConfirmTask", param,  (err, list) =>{
+      if( err != 0) return;
+      this.setData({ list })
+    });
+  },
+  doUpload( err, {url} ){
+    if( err !=0 || !url ) {
+      util.showMsg("图片上传失败")
+      return
+    }
+    let {index,list} = this.data
+    let id = list[index].id
+    util.http( '/maker/addDeliverImg', {id, url}, (err,res)=>{
+      if( err!= 0 ) return;
+      list[index].deliver_img = url;
+      this.setData({list});
+    })
+  },
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, 
+      urls: [current]
+    })
+  } ,
+  uplodImg: function(e ){
+    let index = e.currentTarget.dataset.index;
+    console.log("uplodImg", e.currentTarget.dataset)
+    this.setData({index});
+    wx.chooseImage({  
+      count: 1,  
+      sizeType: ['compressed'], 
+      sourceType: ['album', 'camera'],
+      success:  (res) =>{
+        var tempImagePath = res.tempFilePaths[0];
+        util.uploadFile( tempImagePath, this.doUpload )
+      },
+      fail:()=>{
+        app.showMsg('选择失败')
+      }
+    })
+  }
+})

+ 0 - 0
pages/user/home/myInfo.json → pages/task/confirm/index.json


+ 50 - 0
pages/task/confirm/index.wxml

@@ -0,0 +1,50 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">进行中的任务</view>
+</cu-custom>
+
+<scroll-view scroll-y class="scrollPage">
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar p20">
+      <view class="cu-item">
+        <view class="cu-avatar round lg" style="background-image:url(/img/.png);"></view>
+        <view class="content flex-sub">
+          <view>{{item.title}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            {{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="padding text-grey bg-white h400">
+        <view class="text-cut">
+          <view class="fl w100">任务编号 : </view>
+          <text class="text-blue">{{item.id}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">联系人 : </view>
+          <text class="text-blue">{{item.contact}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">预算金额 : </view>
+          <text class="text-blue">¥{{item.budget_fee/100}}元</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">是否交付 : </view>
+          <text class="text-blue">{{item.deliver_img?'是':'否'}}
+          </text>  
+        </view>
+        <view class="margin-top-sm tc" >
+          <button class="cu-btn bg-blue " style="margin-right:30rpx;" wx:if="{{item.deliver_img}}" 
+              data-src="{{item.deliver_img}}" bindtap="previewImage">凭据预览</button>
+          <button class="cu-btn bg-blue" data-index="{{index}}" bindtap="uplodImg">上传凭据</button>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 5 - 0
pages/task/confirm/index.wxss

@@ -0,0 +1,5 @@
+.btn-sm{
+  width: 50%;
+  padding: 5rpx;
+  font-size: 32rpx;
+}

+ 51 - 0
pages/task/demand/index.js

@@ -0,0 +1,51 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    from:0,
+    size:6,
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function ( ) {
+    app.checkLogin( ()=>{
+      this.loadData()
+    } )
+  },
+  onReachBottom: function () {
+    var that = this
+    let newFrom = that.data.from
+    if (newFrom == -1) {
+      wx.stopPullDownRefresh();
+      return;
+    }
+    this.getTaskList(newFrom, wx.stopPullDownRefresh);
+  },
+  getTaskList: function( newFrom, cb){
+    let param = { from: newFrom, size:this.data.size }
+    let list = this.data.list
+    let that = this
+    util.http("/wx/getDemandCenter", param, function (err, res) {
+      if( err != 0) return;
+      if (newFrom == 0) list = [];
+      let newlist = res.list.map( item =>{
+        item.bid_end_at = item.bid_end_at.substr(0,10);
+        return item
+      });
+      that.setData({
+        from: res.from || -1,
+        list: list.concat(newlist)
+      })
+      cb && cb()
+    });
+  },
+  loadData :function( ){
+    this.getTaskList(0)
+  },
+})

+ 3 - 0
pages/task/demand/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 48 - 0
pages/task/demand/index.wxml

@@ -0,0 +1,48 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">需求大厅</view>
+</cu-custom>
+
+<scroll-view scroll-y class="scrollPage">
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar">
+      <view class="cu-item">
+        <image src="/img/1.png" class="cu-avatar round lg"></image>
+        <view class="content flex-sub">
+          <view>{{item.product}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            {{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="padding text-grey bg-white">
+        <view class="text-cut">
+          <view class="fl w100">任务编号 : </view>
+          <text class="text-blue">{{item.id}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">交易金额 : </view>
+          <text class="text-blue">¥{{item.fee/100}}元</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">任务类型 : </view>
+          <text class="text-blue">{{item.type}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">关联公司 : </view>
+          <text class="text-blue">{{item.target||'---'}}</text>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view wx:if="{{from==-1}}"  class="flex-sub text-center">
+    <view class="padding">没有更多了</view>
+    <view class='cu-tabbar-height'></view>
+  </view>
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 10 - 0
pages/task/demand/index.wxss

@@ -0,0 +1,10 @@
+
+
+.w100{ width: 180rpx;}
+
+.tark-list{
+  border-radius: 20rpx;
+  margin-top:16rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}

+ 31 - 0
pages/task/finish/index.js

@@ -0,0 +1,31 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    filterTime:util.filterTime,
+    from:0,
+    size:6,
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getData()
+  },
+  getData: function(){
+    let param = {  }
+    util.http("/wx/getFinishTask", param,  (err, list) =>{
+      if( err != 0) return;
+      list = list.map( (item)=>{
+        item.finish_at = util.filterTime( item.finish_at);
+        return item
+      })
+      this.setData({ list })
+    });
+  }
+})

+ 3 - 0
pages/task/finish/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 49 - 0
pages/task/finish/index.wxml

@@ -0,0 +1,49 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">已完成的任务</view>
+</cu-custom>
+
+<scroll-view scroll-y class="scrollPage">
+  
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar p20">
+      <view class="cu-item">
+        <view class="cu-avatar round lg" style="background-image:url(/img/1.png);"></view>
+        <view class="content flex-sub">
+          <view>{{item.title}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            {{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="padding text-grey bg-white h400">
+        <view class="text-cut">
+          <view class="fl w100">任务编号 : </view>
+          <text class="text-blue">{{item.id}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">联系人 : </view>
+          <text class="text-blue">{{item.contact}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">预算金额 : </view>
+          <text class="text-blue">¥{{item.budget_fee/100}}元</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">实际金额 : </view>
+          <text class="text-blue">¥{{item.fee/100}}元</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">完成时间 : </view>
+          <text class="text-blue">{{item.finish_at}}</text>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 10 - 0
pages/task/finish/index.wxss

@@ -0,0 +1,10 @@
+.w100{ width: 180rpx;}
+.tark-list{
+  border-radius: 20rpx;
+  margin-top:16rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}
+.h500{
+  height: 500rpx;
+}

+ 5 - 2
pages/task/index.js

@@ -21,13 +21,16 @@ Page({
   bidTask: function( e ){
     let index = e.currentTarget.dataset.index;
     let item = this.data.list[index]
-    util.http("wx/applyWxTask", {id:item.id}, (err, res) =>{
+    util.http("/wx/applyWxTask", {id:item.id}, (err, res) =>{
       if( err != 0) return;
       item.is_bid = 1
       this.setData({ list: this.data.list})
       util.showMsg("抢单子成功");
     })
   },
+  onShow: function(e){
+    this.getTaskList(0)
+  },
   onReachBottom: function () {
     var that = this
     let newFrom = that.data.from
@@ -41,7 +44,7 @@ Page({
     let param = { from: newFrom, size:this.data.size }
     let list = this.data.list
     let that = this
-    util.http("wx/getWxTaskList", param, function (err, res) {
+    util.http("/wx/getWxTaskList", param, function (err, res) {
       if( err != 0) return;
       if (newFrom == 0) list = [];
       let newlist = res.list.map( item =>{

+ 117 - 0
pages/task/lyg/index.js

@@ -0,0 +1,117 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    from:0,
+    size:6,
+    TabCur:0,
+    scrollLeft:0,
+    tabList:["待接任务","已确认","已交付","已完成"],
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function ( opt) {
+    let TabCur = +opt.tab||0
+    this.setData( {TabCur} )
+    app.checkLogin( ()=>{
+      this.loadData()
+    } )
+  },
+  tabSelect(e){
+    this.setData({
+      TabCur: e.currentTarget.dataset.id,
+      list:[],
+      scrollLeft: (e.currentTarget.dataset.id - 1) * 80
+    })
+    this.getTaskList(0)
+  },
+  bidTask: function( e ){
+    let index = e.currentTarget.dataset.index;
+    let item = this.data.list[index]
+    util.http("/wx/applyWxTask", {id:item.id}, (err, res) =>{
+      if( err != 0) return;
+      item.is_bid = 1
+      this.setData({ list: this.data.list})
+      util.showMsg("抢单子成功");
+    })
+  },
+
+  onPullDownRefresh: function () {
+    this.getTaskList( 0, ()=>{
+      wx.stopPullDownRefresh();
+    })
+  },
+  onReachBottom: function () {
+    var that = this
+    let newFrom = that.data.from
+    if (newFrom == -1) {
+      wx.stopPullDownRefresh();
+      return;
+    }
+    this.getTaskList(newFrom, wx.stopPullDownRefresh);
+  },
+  doUpload( err, {url} ){
+    if( err !=0 || !url ) {
+      util.showMsg("图片上传失败")
+      return
+    }
+    let {index,list} = this.data
+    let id = list[index].id
+    util.http( '/maker/addDeliverImg', {id, url}, (err,res)=>{
+      if( err!= 0 ) return;
+      list[index].deliver_img = url;
+      this.setData({list});
+    })
+  },
+  getTaskList: function( newFrom, cb){
+    let type = this.data.TabCur +1;
+    let param = { from: newFrom, size:this.data.size, type }
+    let list = this.data.list
+    let that = this
+    util.http("/wx/getWxTaskList", param, function (err, res) {
+      if( err != 0) return;
+      if (newFrom == 0) list = [];
+      let newlist = res.list.map( item =>{
+        return item
+      });
+      that.setData({
+        from: res.from || -1,
+        list: list.concat(newlist)
+      })
+      cb && cb()
+    });
+  },
+  loadData :function( ){
+    this.getTaskList(0)
+  },
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, 
+      urls: [current]
+    })
+  } ,
+  uplodImg: function(e ){
+    let index = e.currentTarget.dataset.index;
+    console.log("uplodImg", e.currentTarget.dataset)
+    this.setData({index});
+    wx.chooseImage({  
+      count: 1,  
+      sizeType: ['compressed'], 
+      sourceType: ['album', 'camera'],
+      success:  (res) =>{
+        var tempImagePath = res.tempFilePaths[0];
+        util.uploadFile( tempImagePath, this.doUpload )
+      },
+      fail:()=>{
+        app.showMsg('选择失败')
+      }
+    })
+  }
+})

+ 3 - 0
pages/task/lyg/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 81 - 0
pages/task/lyg/index.wxml

@@ -0,0 +1,81 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">任务大厅</view>
+</cu-custom>
+
+<scroll-view scroll-x class="text-center" scroll-with-animation scroll-left="{{scrollLeft}}" >
+  <view class="nav bg-white nav-list">
+    <view class="cu-item {{index==TabCur?'text-green cur':''}}" wx:for="{{tabList}}" bindtap="tabSelect" wx:key="index" data-id="{{index}}">
+      {{tabList[index]}}
+    </view>
+  </view>
+
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar">
+      <view class="cu-item">
+        <image src="/img/1.png" class="cu-avatar round lg"></image>
+        <view class="content flex-sub">
+          <view>{{item.title}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            {{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="text-grey bg-white">
+        <view class="padding bg-white ">
+          <view class="text-left">任务编号 : 
+            <text class="text-blue">{{item.id}}</text>
+          </view>
+          <view class="text-left margin-top-sm">预算金额 : 
+            <text class="text-blue">¥{{item.budget_fee/100}}元</text>
+          </view>
+          <view class="text-left margin-top-sm" wx:if="{{item.fee}}">实际金额 : 
+            <text class="text-blue">¥{{item.fee/100}}元</text>
+          </view>
+
+          <view class="text-left margin-top-sm">任务分类 : 
+            <text class="text-blue">{{item.category}}</text>
+          </view>
+          
+          <view class="text-left margin-top-sm" wx:if="{{item.finish}}">完成时间 : 
+            <text class="text-blue ">{{item.finish_at}}</text>
+          </view>
+
+           <!-- 已经交付 -->
+          <view class="text-left margin-top-sm" wx:if="{{TabCur==2}}"> 企业付款 : 
+            <text class="text-blue ">{{item.pay_time?'已经付款':'未付款'}}</text>
+          </view>
+
+          <!-- 待交付 -->
+          <view data-index="{{index}}" wx:if="{{TabCur==1}}" class="margin-top-sm">
+            <button class="cu-btn bg-blue " style="margin-right:30rpx;" wx:if="{{item.deliver_img}}" 
+                data-src="{{item.deliver_img}}" bindtap="previewImage">查看交付</button>
+            <button class="cu-btn bg-blue" data-index="{{index}}" bindtap="uplodImg">任务交付</button>
+          </view>
+ 
+          <!-- 未接任务 -->
+          <view wx:if="{{TabCur==0}}" class="margin-top-sm">
+            <button type="text" class="text-blue bg-white" wx:if="{{item.is_bid==0}}" bindtap="bidTask" data-index="{{index}}" >
+              抢单
+            </button>
+            <button type="text" class="text-gray bg-white" wx:else >
+              已经抢过
+            </button>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view wx:if="{{from==-1}}"  class="flex-sub text-center">
+    <view class="padding">没有更多了</view>
+    <view class='cu-tabbar-height'></view>
+  </view>
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+
+
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 16 - 0
pages/task/lyg/index.wxss

@@ -0,0 +1,16 @@
+
+.tark-list{
+  border-radius: 20rpx;
+  margin-top:16rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}
+.w100{
+  width: 100rpx;
+}
+.ml100{
+  margin-left: 100rp;
+}
+.nav-list{
+  position: static;
+}

+ 117 - 0
pages/task/rob/index.js

@@ -0,0 +1,117 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    from:0,
+    size:6,
+    TabCur:0,
+    scrollLeft:0,
+    tabList:["待接任务","已确认","已交付","已完成"],
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function ( opt) {
+    let TabCur = +opt.tab||0
+    this.setData( {TabCur} )
+    app.checkLogin( ()=>{
+      this.loadData()
+    } )
+  },
+  tabSelect(e){
+    this.setData({
+      TabCur: e.currentTarget.dataset.id,
+      list:[],
+      scrollLeft: (e.currentTarget.dataset.id - 1) * 80
+    })
+    this.getTaskList(0)
+  },
+  bidTask: function( e ){
+    let index = e.currentTarget.dataset.index;
+    let item = this.data.list[index]
+    util.http("/wx/applyWxTask", {id:item.id}, (err, res) =>{
+      if( err != 0) return;
+      item.is_bid = 1
+      this.setData({ list: this.data.list})
+      util.showMsg("抢单子成功");
+    })
+  },
+
+  onPullDownRefresh: function () {
+    this.getTaskList( 0, ()=>{
+      wx.stopPullDownRefresh();
+    })
+  },
+  onReachBottom: function () {
+    var that = this
+    let newFrom = that.data.from
+    if (newFrom == -1) {
+      wx.stopPullDownRefresh();
+      return;
+    }
+    this.getTaskList(newFrom, wx.stopPullDownRefresh);
+  },
+  doUpload( err, {url} ){
+    if( err !=0 || !url ) {
+      util.showMsg("图片上传失败")
+      return
+    }
+    let {index,list} = this.data
+    let id = list[index].id
+    util.http( '/maker/addDeliverImg', {id, url}, (err,res)=>{
+      if( err!= 0 ) return;
+      list[index].deliver_img = url;
+      this.setData({list});
+    })
+  },
+  getTaskList: function( newFrom, cb){
+    let type = this.data.TabCur +1;
+    let param = { from: newFrom, size:this.data.size, type }
+    let list = this.data.list
+    let that = this
+    util.http("/wx/getWxTaskList", param, function (err, res) {
+      if( err != 0) return;
+      if (newFrom == 0) list = [];
+      let newlist = res.list.map( item =>{
+        return item
+      });
+      that.setData({
+        from: res.from || -1,
+        list: list.concat(newlist)
+      })
+      cb && cb()
+    });
+  },
+  loadData :function( ){
+    this.getTaskList(0)
+  },
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, 
+      urls: [current]
+    })
+  } ,
+  uplodImg: function(e ){
+    let index = e.currentTarget.dataset.index;
+    console.log("uplodImg", e.currentTarget.dataset)
+    this.setData({index});
+    wx.chooseImage({  
+      count: 1,  
+      sizeType: ['compressed'], 
+      sourceType: ['album', 'camera'],
+      success:  (res) =>{
+        var tempImagePath = res.tempFilePaths[0];
+        util.uploadFile( tempImagePath, this.doUpload )
+      },
+      fail:()=>{
+        app.showMsg('选择失败')
+      }
+    })
+  }
+})

+ 3 - 0
pages/task/rob/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 81 - 0
pages/task/rob/index.wxml

@@ -0,0 +1,81 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">任务大厅</view>
+</cu-custom>
+
+<scroll-view scroll-x class="text-center" scroll-with-animation scroll-left="{{scrollLeft}}" >
+  <view class="nav bg-white nav-list">
+    <view class="cu-item {{index==TabCur?'text-green cur':''}}" wx:for="{{tabList}}" bindtap="tabSelect" wx:key="index" data-id="{{index}}">
+      {{tabList[index]}}
+    </view>
+  </view>
+
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar">
+      <view class="cu-item">
+        <image src="/img/1.png" class="cu-avatar round lg"></image>
+        <view class="content flex-sub">
+          <view>{{item.title}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            {{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="text-grey bg-white">
+        <view class="padding bg-white ">
+          <view class="text-left">任务编号 : 
+            <text class="text-blue">{{item.id}}</text>
+          </view>
+          <view class="text-left margin-top-sm">预算金额 : 
+            <text class="text-blue">¥{{item.budget_fee/100}}元</text>
+          </view>
+          <view class="text-left margin-top-sm" wx:if="{{item.fee}}">实际金额 : 
+            <text class="text-blue">¥{{item.fee/100}}元</text>
+          </view>
+
+          <view class="text-left margin-top-sm">任务分类 : 
+            <text class="text-blue">{{item.category}}</text>
+          </view>
+          
+          <view class="text-left margin-top-sm" wx:if="{{item.finish}}">完成时间 : 
+            <text class="text-blue ">{{item.finish_at}}</text>
+          </view>
+
+           <!-- 已经交付 -->
+          <view class="text-left margin-top-sm" wx:if="{{TabCur==2}}"> 企业付款 : 
+            <text class="text-blue ">{{item.pay_time?'已经付款':'未付款'}}</text>
+          </view>
+
+          <!-- 待交付 -->
+          <view data-index="{{index}}" wx:if="{{TabCur==1}}" class="margin-top-sm">
+            <button class="cu-btn bg-blue " style="margin-right:30rpx;" wx:if="{{item.deliver_img}}" 
+                data-src="{{item.deliver_img}}" bindtap="previewImage">查看交付</button>
+            <button class="cu-btn bg-blue" data-index="{{index}}" bindtap="uplodImg">任务交付</button>
+          </view>
+ 
+          <!-- 未接任务 -->
+          <view wx:if="{{TabCur==0}}" class="margin-top-sm">
+            <button type="text" class="text-blue bg-white" wx:if="{{item.is_bid==0}}" bindtap="bidTask" data-index="{{index}}" >
+              抢单
+            </button>
+            <button type="text" class="text-gray bg-white" wx:else >
+              已经抢过
+            </button>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view wx:if="{{from==-1}}"  class="flex-sub text-center">
+    <view class="padding">没有更多了</view>
+    <view class='cu-tabbar-height'></view>
+  </view>
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+
+
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 16 - 0
pages/task/rob/index.wxss

@@ -0,0 +1,16 @@
+
+.tark-list{
+  border-radius: 20rpx;
+  margin-top:16rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}
+.w100{
+  width: 100rpx;
+}
+.ml100{
+  margin-left: 100rp;
+}
+.nav-list{
+  position: static;
+}

+ 62 - 0
pages/task/supply/index.js

@@ -0,0 +1,62 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    from:0,
+    size:6,
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function ( ) {
+    app.checkLogin( ()=>{
+      this.loadData()
+    } )
+  },
+  bidTask: function( e ){
+    let index = e.currentTarget.dataset.index;
+    let item = this.data.list[index]
+    util.http("/wx/applyWxTask", {id:item.id}, (err, res) =>{
+      if( err != 0) return;
+      item.is_bid = 1
+      this.setData({ list: this.data.list})
+      util.showMsg("抢单子成功");
+    })
+  },
+  onReachBottom: function () {
+    var that = this
+    let newFrom = that.data.from
+    if (newFrom == -1) {
+      wx.stopPullDownRefresh();
+      return;
+    }
+    this.getTaskList(newFrom, wx.stopPullDownRefresh);
+  },
+  getTaskList: function( newFrom, cb){
+    let param = { from: newFrom, size:this.data.size }
+    let list = this.data.list
+    let that = this
+    
+    util.http("/wx/getSupplyCenter", param, function (err, res) {
+      if( err != 0) return;
+      if (newFrom == 0) list = [];
+      let newlist = res.list.map( item =>{
+        item.bid_end_at = item.bid_end_at.substr(0,10);
+        return item
+      });
+      that.setData({
+        from: res.from || -1,
+        list: list.concat(newlist)
+      })
+      cb && cb()
+    });
+  },
+  loadData :function( ){
+    this.getTaskList(0)
+  },
+})

+ 3 - 0
pages/task/supply/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 49 - 0
pages/task/supply/index.wxml

@@ -0,0 +1,49 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">供应大厅</view>
+</cu-custom>
+
+<scroll-view scroll-y class="scrollPage">
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar">
+      <view class="cu-item">
+        <image src="/img/1.png" class="cu-avatar round lg"></image>
+        <view class="content flex-sub">
+          <view>{{item.product}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            企业:{{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="padding text-grey bg-white">
+        <view class="text-cut">
+          <view class="fl w100">任务编号 : </view>
+          <text class="text-blue">{{item.id}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">交易费用 : </view>
+          <text class="text-blue">{{item.fee/100}}元</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">任务类型 : </view>
+          <text class="text-blue">{{item.type}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">关联公司 : </view>
+          <text class="text-blue">{{item.target||'---'}}</text>
+        </view>
+      </view>
+    </view>
+  </view>
+  <view wx:if="{{from==-1}}"  class="flex-sub text-center">
+    <view class="padding">没有更多了</view>
+    <view class='cu-tabbar-height'></view>
+  </view>
+  
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 10 - 0
pages/task/supply/index.wxss

@@ -0,0 +1,10 @@
+
+
+.w100{ width: 180rpx;}
+
+.tark-list{
+  border-radius: 20rpx;
+  margin-top:16rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}

+ 52 - 0
pages/task/trade/index.js

@@ -0,0 +1,52 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    loadModal:false,
+    from:0,
+    size:6,
+    list:[
+    ]
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function ( ) {
+    app.checkLogin( ()=>{
+      this.loadData()
+    } )
+  },
+  onReachBottom: function () {
+    var that = this
+    let newFrom = that.data.from
+    if (newFrom == -1) {
+      wx.stopPullDownRefresh();
+      return;
+    }
+    this.getTaskList(newFrom, wx.stopPullDownRefresh);
+  },
+  getTaskList: function( newFrom, cb){
+    let param = { from: newFrom, size:this.data.size }
+    let list = this.data.list
+    let that = this
+    
+    util.http("/wx/getTradeCenter", param, function (err, res) {
+      if( err != 0) return;
+      if (newFrom == 0) list = [];
+      let newlist = res.list.map( item =>{
+        item.finish_at = item.finish_at.substr(0,19).replace("T", " ");
+        return item
+      });
+      that.setData({
+        from: res.from || -1,
+        list: list.concat(newlist)
+      })
+      cb && cb()
+    });
+  },
+  loadData :function( ){
+    this.getTaskList(0)
+  },
+})

+ 3 - 0
pages/task/trade/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 58 - 0
pages/task/trade/index.wxml

@@ -0,0 +1,58 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">交易大厅</view>
+</cu-custom>
+
+<scroll-view scroll-y class="scrollPage">
+  <view class="tark-list" wx:for="{{list}}" wx:key="id" wx:for-index="index">
+    <view class="cu-list menu-avatar">
+      <view class="cu-item">
+        <image src="/img/1.png" class="cu-avatar round lg"></image>
+        <view class="content flex-sub">
+          <view>{{item.product}}</view>
+          <view class="text-gray text-sm flex justify-between">
+            企业:{{item.company}}
+          </view>
+        </view>
+      </view>
+      <!-- 任务详情 -->
+      <view class="padding text-grey bg-white">
+        <view class="text-cut">
+          <view class="fl w100">任务编号 : </view>
+          <text class="text-blue">{{item.id}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">交易费用 : </view>
+          <text class="text-blue">{{item.fee/100}}元</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">交易类型 : </view>
+          <text class="text-blue">{{item.type}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">关联公司 : </view>
+          <text class="text-blue">{{item.target||'---'}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">业务员 : </view>
+          <text class="text-blue">{{item.saleman||'---'}}</text>
+        </view>
+        <view class="margin-top-sm">
+          <view class="fl w100">完成时间 : </view>
+          <text class="text-blue">{{item.finish_at||'---'}}</text>
+        </view>
+
+      </view>
+    </view>
+  </view>
+  <view wx:if="{{from==-1}}"  class="flex-sub text-center">
+    <view class="padding">没有更多了</view>
+    <view class='cu-tabbar-height'></view>
+  </view>
+  
+  <view class='cu-tabbar-height'></view>
+</scroll-view>
+<view class='cu-load load-modal' wx:if="{{loadModal}}">
+  <view class='cuIcon-emojifill text-orange'></view>
+  <view class='gray-text'>加载中...</view>
+</view>

+ 10 - 0
pages/task/trade/index.wxss

@@ -0,0 +1,10 @@
+
+
+.w100{ width: 180rpx;}
+
+.tark-list{
+  border-radius: 20rpx;
+  margin-top:16rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+}

+ 85 - 0
pages/tool/band/band.js

@@ -0,0 +1,85 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    ctx: false,
+    hidden: true,
+    showcamara: false,
+    type:'card',
+    info:{
+      card_code:"",
+      name:""
+    }
+  },
+  onLoad: function (options) {
+    let info = this.data.info;
+    app.getMakerInfo(  res =>{
+      Object.assign( info, res )
+      this.setData( {info })
+    })
+  },
+  onReady: function (res) {
+    var ctx = wx.createCameraContext('myCamera')
+    this.setData({ ctx: ctx })
+  },
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, 
+      urls: [current]
+    })
+  } ,
+  takeBand(){
+    this.setData( {showcamara:true, type:'band'})
+  },
+  identify( err, {url} ){
+    if( err !=0 || !url ) {
+      util.showMsg("图片上传失败")
+      return
+    }
+    let info = this.data.info
+    let method='/maker/addMakerBand';
+    let showcamara= false
+    util.http( method, {url}, (err,res)=>{
+      if( err!= 0 ) return;
+      console.log("http",err, res)
+      Object.assign( info, res)
+      this.setData({info,showcamara})
+    })
+  },
+  chooseImg: function () {
+    var that = this
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album'], 
+      success: function (res) {
+        util.uploadFile( res.tempFilePaths[0], that.identify )
+      }
+    })
+  },
+  takePhoto() {
+    var that = this
+    var ctx = this.data.ctx
+    that.setData({ hidden: false })
+    ctx.takePhoto({
+      quality: 'low',
+      success: (res) => {
+        var tempImagePath = res.tempImagePath
+        util.uploadFile( tempImagePath, that.identify )
+      },
+      fail: function (res) {
+        cosole.log('take error', res)
+        that.setData({ hidden: true })
+        app.showMsg('拍照失败')
+      }
+    })
+  },
+  goBack() {
+    wx.navigateBack({
+      delta: 1
+    })
+  }
+})

+ 3 - 0
pages/tool/band/band.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 65 - 0
pages/tool/band/band.wxml

@@ -0,0 +1,65 @@
+<camera device-position="back" flash="auto" binderror="errorCamara" id="myCamera" wx:if="{{showcamara}}"
+  style="width: 100%; height:100vh;">
+  <cover-view class="mcover-view" style='width: 100%; height:100%; top:45%' wx:if="{{!hidden}}">
+    <cover-image class="dialog-body wh70" style='right:45%' src="/img/loading.gif" />
+  </cover-view>
+  <cover-view class="mcover-bar" wx:if="{{hidden}}">
+    <cover-view class="mcover-view">
+      <cover-view>
+        <cover-image class="dialog-body circle wh60" src="/img/img_gallery.png" bindtap="chooseImg" />
+      </cover-view>
+      <cover-view class="dialog-body camara" bindtap="takePhoto">
+        <cover-view class="camara-1"></cover-view>
+      </cover-view>
+
+      <cover-view>
+        <cover-image class="dialog-body circle wh60" src="/img/img_close.png" bindtap="goBack" />
+      </cover-view>
+    </cover-view>
+  </cover-view>
+</camera>
+
+<scroll-view scroll-y="true" wx:else class="scroll-view">
+
+  <cu-custom isBack="{{true}}">
+    <view slot="backText">返回</view>
+    <view slot="content">实名认证</view>
+  </cu-custom>
+
+  <view class='container' style="top: {{StatusBar}}px;">
+    <view class="pt30">
+      <view class="fs36 ml20 tc">请上传银行卡号</view>
+    </view>
+
+    <view class="identify-box" style="heigth:300rpx;">
+      <view class="identify-list-1" >
+        <image wx:if="{{info.band_img}}" src="{{info.band_img+'?x-oss-process=image/resize,w_300'}}"  mode="aspectFit"
+          data-src="{{info.band_img}}" class="identify-img-1" bindtap="previewImage"/>
+        <image  wx:else src="/img/card.png"  class="identify-img-1" bindtap="takeBand" />
+      </view>
+    </view>
+
+    <view class="cu-list menu" style="margin-top:40rpx;">
+      <view class="cu-item">
+        <view class="content">
+          <text class="cuIcon-card text-grey"></text>
+          <text class="text-grey">银行卡号:{{info.band_code}}</text>
+        </view>
+      </view>
+      <view class="cu-item">
+        <view class="content">
+          <text class="cuIcon-info text-grey"></text>
+          <text class="text-grey">银行名字: {{info.band_name}} </text>
+        </view>
+      </view>
+    </view>  
+  </view>
+
+  <view class="padding flex flex-direction" wx:if="info.band_img" >
+    <button class="cu-btn bg-green margin-tb-sm lg">已经认证</button>
+  </view>
+  <view class="padding flex flex-direction" wx:else>
+    <button class="cu-btn bg-green margin-tb-sm lg">确认</button>
+  </view>
+
+</scroll-view>

+ 57 - 0
pages/tool/band/band.wxss

@@ -0,0 +1,57 @@
+.identify-box{
+  width:100%;
+  padding:0rpx 20rpx 20rpx 20rpx;
+  box-sizing: border-box;
+  border-top:20rpx solid #f2f2f2;
+ }
+
+.identify-list-1{
+  width: 100%;
+  margin-top:30rpx auto;
+}
+.identify-img-1{
+  padding:50rpx;
+  width: 100%;
+  float: center;
+  text-align: center;
+  margin: 0 auto;
+}
+.fs36{ font-size: 36rpx;}
+
+.dialog-body{
+  text-align:center; 
+}
+.mcover-home{
+  position: relative;
+  flex-direction: row; 
+  height: 100%;
+  top: 0;
+  z-index: 1000;
+  display: flex;
+}
+
+.camara-1{
+  width: 50px; 
+  height: 50px; 
+  margin: 5px;
+  background-color: #f70264; 
+  -webkit-border-radius: 50px; 
+  -moz-border-radius:50px;
+  border-radius:50px;
+}
+
+.mcover-bar{
+  position: absolute;
+  bottom: 10px;
+  height: 70px;
+  margin: 0;
+  padding: 0;
+  width: 100%;
+}
+.mcover-view{
+  position: relative;
+  justify-content: space-around;
+  background-color: none;
+  display: flex;
+  z-index: 1001;
+}

+ 67 - 0
pages/tool/empty/index.js

@@ -0,0 +1,67 @@
+const app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/tool/empty/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 8 - 0
pages/tool/empty/index.wxml

@@ -0,0 +1,8 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">功能还未实现</view>
+</cu-custom>
+
+<view class='container' style="top: {{StatusBar}}px;">
+  <view style="margin:250rpx auto;width:300rpx"> 功能开发中,请耐心等待 </view>
+</view>

+ 1 - 0
pages/tool/empty/index.wxss

@@ -0,0 +1 @@
+/* pages/tool/empty/index.wxss */

+ 112 - 0
pages/tool/identify/index.js

@@ -0,0 +1,112 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    StatusBar: app.globalData.StatusBar,
+    CustomBar: app.globalData.CustomBar,
+    ctx: false,
+    hidden: true,
+    showcamara: false,
+    type:'card',
+    phone:'',
+    info:{
+      card_code:"",
+      phone:"",
+      name:""
+    }
+  },
+  onLoad: function (options) {
+    let info = this.data.info;
+    app.getMakerInfo(  res =>{
+      Object.assign( info, res )
+      let phone = info.phone||''
+      this.setData( {info, phone })
+    })
+  },
+  onReady: function (res) {
+    var ctx = wx.createCameraContext('myCamera')
+    this.setData({ ctx: ctx })
+  },
+  getInfo( ){
+    util.http( '/wx/getMakerInfo', {}, (err,res)=>{
+      if( err!= 0 ) return;
+      console.log("http",err, res)
+      let phone= res.info.phone||''
+      this.setData({info: res.info,phone})
+    })
+  },
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, 
+      urls: [current]
+    })
+  } ,
+  takeCard(){
+    this.setData( {showcamara:true, type:'card'})
+  },
+  takeCardBack(){
+    this.setData( {showcamara:true, type:'cardBack'})
+  },
+  identify( err, {url} ){
+    if( err !=0 || !url ) {
+      util.showMsg("图片上传失败")
+      return
+    }
+    let info = this.data.info
+    let method=this.data.type=='card'?'/maker/addMakerCard':'/maker/addMakerBackCard';
+    let showcamara= false
+    util.http( method, {url}, (err,res)=>{
+      if( err!= 0 ) return;
+      console.log("http",err, res)
+      Object.assign( info, res)
+      this.setData({info,showcamara})
+    })
+  },
+  chooseImg: function () {
+    var that = this
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['album'], 
+      success: function (res) {
+        util.uploadFile( res.tempFilePaths[0], that.identify )
+      }
+    })
+  },
+  takePhoto() {
+    var that = this
+    var ctx = this.data.ctx
+    that.setData({ hidden: false })
+    ctx.takePhoto({
+      quality: 'low',
+      success: (res) => {
+        var tempImagePath = res.tempImagePath
+        util.uploadFile( tempImagePath, that.identify )
+      },
+      fail: function (res) {
+        cosole.log('take error', res)
+        that.setData({ hidden: true })
+        app.showMsg('拍照失败')
+      }
+    })
+  },
+  onConfirm( e ){
+    let {phone} = e.detail.value
+    let info = this.data.info
+    let {card_img, card_back_img} = this.data.info
+    if( !card_img ) return util.showMsg( "身份证正面有误");
+    if( !card_back_img ) return util.showMsg( "身份证背面有误");
+    if( !phone || phone.length != 11 ) return util.showMsg( "手机号码有误");
+    util.http( '/maker/identifyMaker', {phone}, (err,res)=>{
+      if( err!= 0 ) return;
+      this.setData({info})
+    })
+
+  },
+  goBack() {
+    wx.navigateBack({
+      delta: 1
+    })
+  }
+})

+ 3 - 0
pages/tool/identify/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 77 - 0
pages/tool/identify/index.wxml

@@ -0,0 +1,77 @@
+<camera device-position="back" flash="auto" binderror="errorCamara" id="myCamera" wx:if="{{showcamara}}"
+  style="width: 100%; height:100vh;">
+  <cover-view class="mcover-view" style='width: 100%; height:100%; top:45%' wx:if="{{!hidden}}">
+    <cover-image class="dialog-body wh70" style='right:45%' src="/img/loading.gif" />
+  </cover-view>
+  <cover-view class="mcover-bar" wx:if="{{hidden}}">
+    <cover-view class="mcover-view">
+      <cover-view>
+        <cover-image class="dialog-body circle wh60" src="/img/img_gallery.png" bindtap="chooseImg" />
+      </cover-view>
+      <cover-view class="dialog-body camara" bindtap="takePhoto">
+        <cover-view class="camara-1"></cover-view>
+      </cover-view>
+
+      <cover-view>
+        <cover-image class="dialog-body circle wh60" src="/img/img_close.png" bindtap="goBack" />
+      </cover-view>
+    </cover-view>
+  </cover-view>
+</camera>
+
+<scroll-view scroll-y="true" wx:else class="scroll-view">
+
+  <cu-custom isBack="{{true}}">
+    <view slot="backText">返回</view>
+    <view slot="content">实名认证</view>
+  </cu-custom>
+
+  <view class='container' style="top: {{StatusBar}}px;">
+
+    <view class="pt20">
+      <view class="fs36 ml20">请上传身份证照片</view>
+    </view>
+
+    <view class="identify-box" style="heigth:300rpx;">
+      <view class="identify-list" >
+        <image wx:if="{{info.card_img}}" src="{{info.card_img+'?x-oss-process=image/resize,w_200'}}" data-src="{{info.card_img}}" class="identify-img" bindtap="previewImage"/>
+        <image wx:else src="/img/card.png" class="identify-img" bindtap="takeCard"/>
+      </view>
+      <view class="identify-list" >
+        <image wx:if="{{info.card_back_img}}" src="{{info.card_back_img+'?x-oss-process=image/resize,w_200'}}" data-src="{{info.card_back_img}}" class="identify-img" bindtap="previewImage"/>
+        <image  wx:else src="/img/cardback.png" class="identify-img" bindtap="takeCardBack" />
+      </view>
+    </view>
+
+    <view class="cu-list menu" style="margin-top:400rpx;">
+      <view class="cu-form-group">
+          <text class="cuIcon-info text-grey"></text>
+          <view class="title solids-right">身份证号</view>
+          <input bindinput="titleInput" class ="ml20" value="{{info.card_code}}" name="card_code" disabled></input>
+      </view>
+
+      <view class="cu-form-group">
+          <text class="cuIcon-info text-grey"></text>
+          <view class="title solids-right">用户姓名</view>
+          <input bindinput="titleInput" class ="ml20" value="{{info.name}}" name="name" disabled></input>
+      </view>
+      <form bindsubmit="onConfirm">
+        <view class="cu-form-group">
+          <text class="cuIcon-phone text-grey"></text>
+          <view class="title solids-right">手机号码</view>
+          <input class ="ml20" value="{{phone}}" name="phone"></input>
+        </view>
+
+        <view class="padding flex flex-direction" wx:if="{{info.identify}}" >
+          <button class="cu-btn bg-green margin-tb-sm lg">已经认证</button>
+        </view>
+
+        <view class="padding flex flex-direction" wx:else >
+          <button class="cu-btn bg-blue margin-tb-sm lg" form-type="submit"> 实名认证</button>
+        </view>
+      </form>
+    </view>
+
+    
+  </view>
+</scroll-view>

+ 57 - 0
pages/tool/identify/index.wxss

@@ -0,0 +1,57 @@
+.identify-box{
+  width:100%;
+  padding:0rpx 20rpx 20rpx 20rpx;
+  box-sizing: border-box;
+  border-top:20rpx solid #f2f2f2;
+ }
+
+ .identify-list{
+  float: left;
+  width: 50%;
+  margin-top:30rpx;
+}
+.identify-img{
+  width:350rpx;
+  height:350rpx;
+  padding: 2rpx;
+}
+
+.fs36{ font-size: 36rpx;}
+
+.dialog-body{
+  text-align:center; 
+}
+.mcover-home{
+position: relative;
+flex-direction: row; 
+height: 100%;
+top: 0;
+z-index: 1000;
+display: flex;
+}
+
+.camara-1{
+  width: 50px; 
+  height: 50px; 
+  margin: 5px;
+  background-color: #f70264; 
+  -webkit-border-radius: 50px; 
+  -moz-border-radius:50px;
+  border-radius:50px;
+}
+
+.mcover-bar{
+  position: absolute;
+  bottom: 10px;
+  height: 70px;
+  margin: 0;
+  padding: 0;
+  width: 100%;
+}
+.mcover-view{
+  position: relative;
+  justify-content: space-around;
+  background-color: none;
+  display: flex;
+  z-index: 1001;
+}

+ 544 - 0
pages/tool/sign/signature.js

@@ -0,0 +1,544 @@
+const app = getApp();
+const util = require("../../../util/util.js")
+
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    canvasName: 'handWriting',
+    ctx: '',
+    canvasWidth: 0,
+    canvasHeight: 0,
+    transparent: 1, // 透明度
+    selectColor: 'black',
+    lineColor: '#1A1A1A', // 颜色
+    lineSize: 1.5, // 笔记倍数
+    lineMin: 0.5, // 最小笔画半径
+    lineMax: 4, // 最大笔画半径
+    pressure: 1, // 默认压力
+    smoothness: 60, //顺滑度,用60的距离来计算速度
+    currentPoint: {},
+    currentLine: [], // 当前线条
+    firstTouch: true, // 第一次触发
+    radius: 1, //画圆的半径
+    cutArea: {
+      top: 0,
+      right: 0,
+      bottom: 0,
+      left: 0
+    }, //裁剪区域
+    bethelPoint: [], //保存所有线条 生成的贝塞尔点;
+    lastPoint: 0,
+    chirography: [], //笔迹
+    currentChirography: {}, //当前笔迹
+    linePrack: [] //划线轨迹 , 生成线条的实际点
+  },
+
+  /*======所有自定义函数======*/
+
+  // 笔迹开始
+  uploadScaleStart(e) {
+    if (e.type != 'touchstart') return false;
+    let ctx = this.data.ctx;
+    ctx.setFillStyle(this.data.lineColor); // 初始线条设置颜色
+    ctx.setGlobalAlpha(this.data.transparent); // 设置半透明
+    let currentPoint = {
+      x: e.touches[0].x,
+      y: e.touches[0].y
+    }
+    let currentLine = this.data.currentLine;
+    currentLine.unshift({
+      time: new Date().getTime(),
+      dis: 0,
+      x: currentPoint.x,
+      y: currentPoint.y
+    })
+    this.setData({
+      currentPoint,
+      // currentLine
+    })
+    if (this.data.firstTouch) {
+      this.setData({
+        cutArea: {
+          top: currentPoint.y,
+          right: currentPoint.x,
+          bottom: currentPoint.y,
+          left: currentPoint.x
+        },
+        firstTouch: false
+      })
+    }
+    this.pointToLine(currentLine);
+  },
+  // 笔迹移动
+  uploadScaleMove(e) {
+    if (e.type != 'touchmove') return false;
+    if (e.cancelable) {
+      // 判断默认行为是否已经被禁用
+      if (!e.defaultPrevented) {
+        e.preventDefault();
+      }
+    }
+    let point = {
+      x: e.touches[0].x,
+      y: e.touches[0].y
+    }
+
+    //测试裁剪
+    if (point.y < this.data.cutArea.top) {
+      this.data.cutArea.top = point.y;
+    }
+    if (point.y < 0) this.data.cutArea.top = 0;
+
+    if (point.x > this.data.cutArea.right) {
+      this.data.cutArea.right = point.x;
+    }
+    if (this.data.canvasWidth - point.x <= 0) {
+      this.data.cutArea.right = this.data.canvasWidth;
+    }
+    if (point.y > this.data.cutArea.bottom) {
+      this.data.cutArea.bottom = point.y;
+    }
+    if (this.data.canvasHeight - point.y <= 0) {
+      this.data.cutArea.bottom = this.data.canvasHeight;
+    }
+    if (point.x < this.data.cutArea.left) {
+      this.data.cutArea.left = point.x;
+    }
+    if (point.x < 0) this.data.cutArea.left = 0;
+
+    this.setData({
+      lastPoint: this.data.currentPoint,
+      currentPoint: point
+    })
+    let currentLine = this.data.currentLine
+    currentLine.unshift({
+      time: new Date().getTime(),
+      dis: this.distance(this.data.currentPoint, this.data.lastPoint),
+      x: point.x,
+      y: point.y
+    })
+    // this.setData({
+    //   currentLine
+    // })
+    this.pointToLine(currentLine);
+  },
+  // 笔迹结束
+  uploadScaleEnd(e) {
+    if (e.type != 'touchend') return 0;
+    let point = {
+      x: e.changedTouches[0].x,
+      y: e.changedTouches[0].y
+    }
+    this.setData({
+      lastPoint: this.data.currentPoint,
+      currentPoint: point
+    })
+    let currentLine = this.data.currentLine
+    currentLine.unshift({
+      time: new Date().getTime(),
+      dis: this.distance(this.data.currentPoint, this.data.lastPoint),
+      x: point.x,
+      y: point.y
+    })
+    if (currentLine.length > 2) {
+      var info = (currentLine[0].time - currentLine[currentLine.length - 1].time) / currentLine.length;
+      //$("#info").text(info.toFixed(2));
+    }
+    //一笔结束,保存笔迹的坐标点,清空,当前笔迹
+    //增加判断是否在手写区域;
+    this.pointToLine(currentLine);
+    var currentChirography = {
+      lineSize: this.data.lineSize,
+      lineColor: this.data.lineColor
+    };
+    var chirography = this.data.chirography
+    chirography.unshift(currentChirography);
+    this.setData({
+      chirography
+    })
+    var linePrack = this.data.linePrack
+    linePrack.unshift(this.data.currentLine);
+    this.setData({
+      linePrack,
+      currentLine: []
+    })
+  },
+
+  retDraw() {
+    this.data.ctx.clearRect(0, 0, 700, 730)
+    this.data.ctx.draw();
+
+    //设置canvas背景
+    this.setCanvasBg("#fff");
+  },
+
+  //画两点之间的线条;参数为:line,会绘制最近的开始的两个点;
+  pointToLine(line) {
+    this.calcBethelLine(line);
+    return;
+  },
+  //计算插值的方式;
+  calcBethelLine(line) {
+    if (line.length <= 1) {
+      line[0].r = this.data.radius;
+      return;
+    }
+    let x0, x1, x2, y0, y1, y2, r0, r1, r2, len, lastRadius, dis = 0,
+      time = 0,
+      curveValue = 0.5;
+    if (line.length <= 2) {
+      x0 = line[1].x
+      y0 = line[1].y
+      x2 = line[1].x + (line[0].x - line[1].x) * curveValue;
+      y2 = line[1].y + (line[0].y - line[1].y) * curveValue;
+      //x2 = line[1].x;
+      //y2 = line[1].y;
+      x1 = x0 + (x2 - x0) * curveValue;
+      y1 = y0 + (y2 - y0) * curveValue;;
+
+    } else {
+      x0 = line[2].x + (line[1].x - line[2].x) * curveValue;
+      y0 = line[2].y + (line[1].y - line[2].y) * curveValue;
+      x1 = line[1].x;
+      y1 = line[1].y;
+      x2 = x1 + (line[0].x - x1) * curveValue;
+      y2 = y1 + (line[0].y - y1) * curveValue;
+    }
+    //从计算公式看,三个点分别是(x0,y0),(x1,y1),(x2,y2) ;(x1,y1)这个是控制点,控制点不会落在曲线上;实际上,这个点还会手写获取的实际点,却落在曲线上
+    len = this.distance({
+      x: x2,
+      y: y2
+    }, {
+      x: x0,
+      y: y0
+    });
+    lastRadius = this.data.radius;
+    for (let n = 0; n < line.length - 1; n++) {
+      dis += line[n].dis;
+      time += line[n].time - line[n + 1].time;
+      if (dis > this.data.smoothness) break;
+    }
+    this.setData({
+      radius: Math.min(time / len * this.data.pressure + this.data.lineMin, this.data.lineMax) * this.data.lineSize
+    });
+    line[0].r = this.data.radius;
+    //计算笔迹半径;
+    if (line.length <= 2) {
+      r0 = (lastRadius + this.data.radius) / 2;
+      r1 = r0;
+      r2 = r1;
+      //return;
+    } else {
+      r0 = (line[2].r + line[1].r) / 2;
+      r1 = line[1].r;
+      r2 = (line[1].r + line[0].r) / 2;
+    }
+    let n = 5;
+    let point = [];
+    for (let i = 0; i < n; i++) {
+      let t = i / (n - 1);
+      let x = (1 - t) * (1 - t) * x0 + 2 * t * (1 - t) * x1 + t * t * x2;
+      let y = (1 - t) * (1 - t) * y0 + 2 * t * (1 - t) * y1 + t * t * y2;
+      let r = lastRadius + (this.data.radius - lastRadius) / n * i;
+      point.push({
+        x: x,
+        y: y,
+        r: r
+      });
+      if (point.length == 3) {
+        let a = this.ctaCalc(point[0].x, point[0].y, point[0].r, point[1].x, point[1].y, point[1].r, point[2].x, point[2].y, point[2].r);
+        a[0].color = this.data.lineColor;
+        // let bethelPoint = this.data.bethelPoint;
+        // console.log(a)
+        // console.log(this.data.bethelPoint)
+        // bethelPoint = bethelPoint.push(a);
+        this.bethelDraw(a, 1);
+        point = [{
+          x: x,
+          y: y,
+          r: r
+        }];
+      }
+    }
+    this.setData({
+      currentLine: line
+    })
+  },
+  //求两点之间距离
+  distance(a, b) {
+    let x = b.x - a.x;
+    let y = b.y - a.y;
+    return Math.sqrt(x * x + y * y);
+  },
+  ctaCalc(x0, y0, r0, x1, y1, r1, x2, y2, r2) {
+    let a = [],
+      vx01, vy01, norm, n_x0, n_y0, vx21, vy21, n_x2, n_y2;
+    vx01 = x1 - x0;
+    vy01 = y1 - y0;
+    norm = Math.sqrt(vx01 * vx01 + vy01 * vy01 + 0.0001) * 2;
+    vx01 = vx01 / norm * r0;
+    vy01 = vy01 / norm * r0;
+    n_x0 = vy01;
+    n_y0 = -vx01;
+    vx21 = x1 - x2;
+    vy21 = y1 - y2;
+    norm = Math.sqrt(vx21 * vx21 + vy21 * vy21 + 0.0001) * 2;
+    vx21 = vx21 / norm * r2;
+    vy21 = vy21 / norm * r2;
+    n_x2 = -vy21;
+    n_y2 = vx21;
+    a.push({
+      mx: x0 + n_x0,
+      my: y0 + n_y0,
+      color: "#1A1A1A"
+    });
+    a.push({
+      c1x: x1 + n_x0,
+      c1y: y1 + n_y0,
+      c2x: x1 + n_x2,
+      c2y: y1 + n_y2,
+      ex: x2 + n_x2,
+      ey: y2 + n_y2
+    });
+    a.push({
+      c1x: x2 + n_x2 - vx21,
+      c1y: y2 + n_y2 - vy21,
+      c2x: x2 - n_x2 - vx21,
+      c2y: y2 - n_y2 - vy21,
+      ex: x2 - n_x2,
+      ey: y2 - n_y2
+    });
+    a.push({
+      c1x: x1 - n_x2,
+      c1y: y1 - n_y2,
+      c2x: x1 - n_x0,
+      c2y: y1 - n_y0,
+      ex: x0 - n_x0,
+      ey: y0 - n_y0
+    });
+    a.push({
+      c1x: x0 - n_x0 - vx01,
+      c1y: y0 - n_y0 - vy01,
+      c2x: x0 + n_x0 - vx01,
+      c2y: y0 + n_y0 - vy01,
+      ex: x0 + n_x0,
+      ey: y0 + n_y0
+    });
+    a[0].mx = a[0].mx.toFixed(1);
+    a[0].mx = parseFloat(a[0].mx);
+    a[0].my = a[0].my.toFixed(1);
+    a[0].my = parseFloat(a[0].my);
+    for (let i = 1; i < a.length; i++) {
+      a[i].c1x = a[i].c1x.toFixed(1);
+      a[i].c1x = parseFloat(a[i].c1x);
+      a[i].c1y = a[i].c1y.toFixed(1);
+      a[i].c1y = parseFloat(a[i].c1y);
+      a[i].c2x = a[i].c2x.toFixed(1);
+      a[i].c2x = parseFloat(a[i].c2x);
+      a[i].c2y = a[i].c2y.toFixed(1);
+      a[i].c2y = parseFloat(a[i].c2y);
+      a[i].ex = a[i].ex.toFixed(1);
+      a[i].ex = parseFloat(a[i].ex);
+      a[i].ey = a[i].ey.toFixed(1);
+      a[i].ey = parseFloat(a[i].ey);
+    }
+    return a;
+  },
+  bethelDraw(point, is_fill, color) {
+    let ctx = this.data.ctx;
+    ctx.beginPath();
+    ctx.moveTo(point[0].mx, point[0].my);
+    if (undefined != color) {
+      ctx.setFillStyle(color);
+      ctx.setStrokeStyle(color);
+    } else {
+      ctx.setFillStyle(point[0].color);
+      ctx.setStrokeStyle(point[0].color);
+    }
+    for (let i = 1; i < point.length; i++) {
+      ctx.bezierCurveTo(point[i].c1x, point[i].c1y, point[i].c2x, point[i].c2y, point[i].ex, point[i].ey);
+    }
+    ctx.stroke();
+    if (undefined != is_fill) {
+      ctx.fill(); //填充图形 ( 后绘制的图形会覆盖前面的图形, 绘制时注意先后顺序 )
+    }
+    ctx.draw(true)
+  },
+  selectColorEvent(event) {
+    console.log(event)
+    var color = event.currentTarget.dataset.colorValue;
+    var colorSelected = event.currentTarget.dataset.color;
+    this.setData({
+      selectColor: colorSelected,
+      lineColor: color
+    })
+  },
+
+  //将Canvas内容转成 临时图片 --> cb 为回调函数 形参 tempImgPath 为 生成的图片临时路径
+  canvasToImg(cb) { //这种写法移动端 出不来
+
+    this.data.ctx.draw(true, () => {
+      wx.canvasToTempFilePath({
+        canvasId: 'handWriting',
+        fileType: 'png',
+        quality: 1, //图片质量
+        success(res) {
+          // console.log(res.tempFilePath, 'canvas生成图片地址');
+
+          wx.showToast({
+            title: '执行了吗?',
+          })
+
+          cb(res.tempFilePath);
+        }
+
+      })
+    });
+
+
+  },
+  doSaveServer( err, {url} ){
+    let method='/maker/addContractImg';
+    util.http( method, {url}, (err,res)=>{
+      if( err!= 0 ) return;
+      util.showSuccess("合同签约成功")
+    })
+  },
+  //完成
+  subCanvas() {	
+    wx.canvasToTempFilePath({
+      canvasId: 'handWriting',
+      fileType: 'jpg',
+      quality: 1, //图片质量
+      success: (res)=> {
+        util.uploadFile(res.tempFilePath, this.doSaveServer)
+      }
+    })
+  },
+  //保存到相册
+  saveCanvasAsImg() {
+    wx.canvasToTempFilePath({
+      canvasId: 'handWriting',
+      fileType: 'png',
+      quality: 1, //图片质量
+      success(res) {
+        wx.saveImageToPhotosAlbum({
+          filePath: res.tempFilePath,
+          success(res) {
+            wx.showToast({
+              title: '已保存到相册',
+              duration: 2000
+            });
+          }
+        })
+      }
+    })
+  },
+  //预览
+  previewCanvasImg() {
+    wx.canvasToTempFilePath({
+      canvasId: 'handWriting',
+      fileType: 'jpg',
+      quality: 1, //图片质量
+      success(res) {
+        wx.previewImage({
+          urls: [res.tempFilePath], //预览图片 数组
+        })
+      }
+    })
+  },
+  
+  //设置canvas背景色  不设置  导出的canvas的背景为透明 
+  //@params:字符串  color
+  setCanvasBg(color) {
+    /* 将canvas背景设置为 白底,不设置  导出的canvas的背景为透明 */
+    //rect() 参数说明  矩形路径左上角的横坐标,左上角的纵坐标, 矩形路径的宽度, 矩形路径的高度
+    //这里是 canvasHeight - 4 是因为下边盖住边框了,所以手动减了写
+    this.data.ctx.rect(0, 0, this.data.canvasWidth, this.data.canvasHeight - 4);
+    // ctx.setFillStyle('red')
+    this.data.ctx.setFillStyle(color)
+    this.data.ctx.fill() //设置填充
+    this.data.ctx.draw() //开画
+  },
+  /*======所有自定义函数=END=====*/
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let canvasName = this.data.canvasName
+    let ctx = wx.createCanvasContext(canvasName)
+    this.setData({
+      ctx: ctx
+    })
+    var query = wx.createSelectorQuery();
+    query.select('.handCenter').boundingClientRect(rect => {
+      this.setData({
+        canvasWidth: rect.width,
+        canvasHeight: rect.height
+      })
+      /* 将canvas背景设置为 白底,不设置  导出的canvas的背景为透明 */
+      this.setCanvasBg('#fff');
+    }).exec();
+  },
+  goBack(){
+    wx.navigateBack({
+      delta: 1,
+    })
+  },
+
+
+
+
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/tool/sign/signature.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 23 - 0
pages/tool/sign/signature.wxml

@@ -0,0 +1,23 @@
+
+<view class="wrapper">
+  <view class="handBtn">
+    <image catchtap="selectColorEvent" src="{{ selectColor === 'black' ? '/img/sign/color_black_selected.png' : '/img/sign/color_black.png' }}" class="{{ selectColor === 'black' ? 'color_select' : '' }} black-select" data-color="black"
+      data-color-value="#1A1A1A"></image>
+    <image catchtap="selectColorEvent" src="{{ selectColor === 'red' ? '/img/sign/color_red_selected.png' : '/img/sign/color_red.png' }}" class="{{ selectColor === 'red' ? 'color_select' : '' }} red-select" data-color="red"
+      data-color-value="#ca262a"></image>
+    <button catchtap="retDraw" class="delBtn">重写</button>
+    <!-- <button catchtap="subCanvas" class="subBtn">完成</button> -->
+		<button catchtap="saveCanvasAsImg" class="saveBtn">保存</button>
+    <button catchtap="previewCanvasImg" class="previewBtn">预览</button>
+    <button catchtap="goBack" class="previewBtn">返回</button>
+    <button catchtap="subCanvas" class="subBtn">完成</button>
+  </view>
+  <view class="handCenter">
+    <canvas class="handWriting" disable-scroll="true" bindtouchstart="uploadScaleStart" bindtouchmove="uploadScaleMove"
+      bindtouchend="uploadScaleEnd" bindtap="mouseDown" canvas-id="handWriting">
+    </canvas>
+  </view>
+  <view class="handRight">
+    <view class="handTitle">电子合同</view>
+  </view>
+</view>

+ 143 - 0
pages/tool/sign/signature.wxss

@@ -0,0 +1,143 @@
+/* pages/signature/signature.wxss */
+page {
+  background: #fbfbfb;
+  height: auto;
+  overflow: hidden;
+}
+
+.wrapper {
+  width: 100%;
+  height: 95vh;
+  margin: 30rpx 0;
+  overflow: hidden;
+  display: flex;
+  align-content: center;
+  flex-direction: row;
+  justify-content: center;
+  font-size: 28rpx;
+}
+
+.handWriting {
+  background: #fff;
+  width: 100%;
+  height: 95vh;
+}
+
+.handRight {
+  display: inline-flex;
+  align-items: center;
+}
+
+.handCenter {
+  border: 4rpx dashed #e9e9e9;
+  flex: 5;
+  overflow: hidden;
+  box-sizing: border-box;
+}
+
+.handTitle {
+  transform: rotate(90deg);
+  flex: 1;
+  color: #666;
+}
+
+.handBtn button {
+  font-size: 28rpx;
+}
+
+.handBtn {
+  height: 95vh;
+  display: inline-flex;
+  flex-direction: column;
+  justify-content: space-between;
+  align-content: space-between;
+  flex: 1;
+}
+
+.delBtn {
+  position: absolute;
+  top: 250rpx;
+  left: 0rpx;
+  transform: rotate(90deg);
+  color: #666;
+}
+
+.delBtn image {
+  position: absolute;
+  top: 13rpx;
+  left: 25rpx;
+}
+
+.subBtn {
+  position: absolute;
+  bottom: 52rpx;
+  left: -3rpx;
+  display: inline-flex;
+  transform: rotate(90deg);
+  background: #008ef6;
+  color: #fff;
+  margin-bottom: 30rpx;
+  text-align: center;
+  justify-content: center;
+}
+
+/*Peach - 新增 - 保存*/
+
+.saveBtn {
+  position: absolute;
+  top: 375rpx;
+  left: 0rpx;
+  transform: rotate(90deg);
+  color: #666;
+}
+
+
+.previewBtn {
+  position: absolute;
+  top: 500rpx;
+  left: 0rpx;
+  transform: rotate(90deg);
+  color: #666;
+}
+
+.uploadBtn {
+	position: absolute;
+  top: 625rpx;
+  left: 0rpx;
+  transform: rotate(90deg);
+  color: #666;
+}
+
+
+/*Peach - 新增 - 保存*/
+
+
+
+
+
+.black-select {
+  width: 60rpx;
+  height: 60rpx;
+  position: absolute;
+  top: 30rpx;
+  left: 25rpx;
+}
+.black-select.color_select {
+  width: 90rpx;
+  height: 90rpx;
+  top: 30rpx;
+  left: 10rpx;
+}
+.red-select {
+  width: 60rpx;
+  height: 60rpx;
+  position: absolute;
+  top:140rpx;
+  left:25rpx;
+}
+.red-select.color_select {
+  width: 90rpx;
+  height: 90rpx;
+  top: 120rpx;
+  left: 10rpx;
+}

+ 0 - 21
pages/user/home/myInfo.js

@@ -1,21 +0,0 @@
-const app = getApp()
-Page({
-  data: {
-    StatusBar: app.globalData.StatusBar,
-    CustomBar: app.globalData.CustomBar,
-    userInfo:{}
-  },
-  onLoad: function (opt) {
-    app.checkLogin(  this.loadData )
-  },
-  loadData: function ( ) {
-    let userInfo = app.getUserInfo()||{};
-    this.setData( {userInfo} )
-  },
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
-})

+ 0 - 66
pages/user/home/myInfo.wxml

@@ -1,66 +0,0 @@
-<cu-custom isBack="{{true}}">
-  <view slot="backText">返回</view>
-  <view slot="content">个人中心</view>
-</cu-custom>
-
-<scroll-view scroll-y class="scrollPage" style="top: {{StatusBar+5}}px;">
-  <view class="UCenter-bg">
-    <ad unit-id="adunit-9afeecd7cbeae1de" ad-type="video" ad-theme="white"></ad>
-  </view>
-
-  <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
-    <navigator class="cu-item arrow"  url="/pages/garden/history/index" hover-class="none">
-      <view class="content">
-        <text class="cuIcon-camera text-blue"></text>
-        <text class="text-grey">我的足迹</text>
-      </view>
-    </navigator>
-
-    <!-- <navigator class="cu-item arrow" url="/pages/user/update/index" hover-class="none">
-      <view class="content" >
-        <text class="cuIcon-info text-orange"></text>
-        <text class="text-grey">完善信息</text>
-      </view>
-    </navigator> -->
-
-    <navigator class="cu-item arrow" url="/pages/user/sugguest/index" hover-class="none">
-      <view class="content">
-        <text class="cuIcon-writefill text-cyan"></text>
-        <text class="text-grey">意见反馈</text>
-      </view>
-    </navigator>
-
-
-    <navigator class="cu-item arrow" url="/pages/user/image/index">
-      <view class="content"  hover-class="none">
-        <text class="cuIcon-delete text-green"></text>
-        <text class="text-grey">管理图片</text>
-      </view>
-    </navigator>
-
-    <navigator class="cu-item arrow" url="/pages/user/near/index">
-      <view class="content"  hover-class="none">
-        <text class="cuIcon-location text-red"></text>
-        <text class="text-grey">附近图片</text>
-      </view>
-    </navigator>
-
-    
-    <navigator class="cu-item arrow" url="/pages/share/list/index" hover-class="none" wx:if="{{userInfo.role>0}}">
-      <view class="content">
-        <text class="cuIcon-share text-green"></text>
-        <text class="text-grey">分享图片</text>
-      </view>
-    </navigator>
-
-    <navigator class="cu-item arrow" url="/pages/user/history/index" hover-class="none" >
-      <view class="content" >
-        <text class="cuIcon-favor text-orange"></text>
-        <text class="text-grey">最近浏览</text>
-      </view>
-    </navigator>
-  </view>
-
-  <button open-type='contact' session-from=''>联系我们</button>
-  <view class="cu-tabbar-height"></view>
-</scroll-view>

+ 0 - 43
pages/user/home/myInfo.wxss

@@ -1,43 +0,0 @@
-.UCenter-bg {
-  background-size: cover;
-  display: flex;
-  justify-content: center;
-  overflow: hidden;
-  position: relative;
-  flex-direction: column;
-  align-items: center;
-  color: #fff;
-  font-weight: 300;
-  text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
-}
-
-.UCenter-bg text {
-  opacity: 0.8;
-}
-
-.UCenter-bg image {
-  width: 200rpx;
-  height: 200rpx;
-}
-
-.UCenter-bg .gif-wave{
-  position: absolute;
-  width: 100%;
-  bottom: 0;
-  left: 0;
-  z-index: 99;
-  mix-blend-mode: screen;  
-  height: 100rpx;   
-}
-
-map,.mapBox{
-  left: 0;
-  z-index: 99;
-  mix-blend-mode: screen;  
-  height: 100rpx;   
-}
-
-map,.mapBox{
-  width: 750rpx;
-  height: 300rpx;
-}

+ 27 - 0
pages/user/info/index.js

@@ -0,0 +1,27 @@
+// pages/user/info/index.js
+const app = getApp();
+const util = require("../../../util/util.js")
+Page({
+  data: {
+    info:{}
+  },
+  onLoad: function (options) {
+    let info = this.data.info;
+    app.getMakerInfo(  res =>{
+      Object.assign( info, res )
+      this.setData( {info })
+    })
+  },
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, 
+      urls: [current]
+    })
+  },
+  gotoSign(){
+    wx.navigateTo({
+      url: '/pages/tool/sign/signature',
+    })
+  }
+})

+ 3 - 0
pages/user/info/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 61 - 0
pages/user/info/index.wxml

@@ -0,0 +1,61 @@
+<cu-custom isBack="{{true}}">
+  <view slot="backText">返回</view>
+  <view slot="content">我的信息</view>
+</cu-custom>
+
+<view class='container' style="top: {{StatusBar}}px;">
+  <view class='userinfo'>
+    <view class='userinfo-avatar' bindtap="gotoInfo">
+      <open-data type="userAvatarUrl"></open-data>
+    </view>
+    <view class='userinfo-name'>
+      <open-data type="userNickName"></open-data>
+    </view>
+  </view>
+</view>
+
+<view class="cu-list menu">
+  <view class="cu-form-group">
+    <text class="cuIcon-info text-grey"></text>
+    <view class="title solids-right">身份证号</view>
+    <input  class="ml20" value="{{info.card_code}}" name="card_code" disabled></input>
+  </view>
+  <view class="cu-form-group">
+    <text class="cuIcon-people text-grey"></text>
+    <view class="title solids-right">用户姓名</view>
+    <input  class="ml20" value="{{info.name}}" name="name" disabled></input>
+  </view>
+
+  <view class="cu-form-group">
+    <text class="cuIcon-phone text-grey"></text>
+    <view class="title solids-right">手机号码</view>
+    <input  class="ml20" value="{{info.phone}}" name="name" disabled></input>
+  </view>
+
+  <view class="cu-form-group">
+    <text class="cuIcon-pay text-grey"></text>
+    <view class="title solids-right">银行卡号</view>
+    <input  class="ml20" value="{{info.band_code}}" name="name" disabled></input>
+  </view>
+  
+  <view class="cu-form-group">
+    <text class="cuIcon-phone text-grey"></text>
+    <view class="title solids-right">实名认证</view>
+    <input  class="ml20" value="{{info.identify?'已实名认证':'未实名认证'}}" name="name" disabled></input>
+  </view>
+
+  <view class="cu-form-group">
+    <text class="cuIcon-check text-grey"></text>
+    <view class="title solids-right">平台审核</view>
+    <input  class="ml20" value="{{info.confirm?'审核通过':'等待审核'}}" name="name" disabled></input>
+  </view>
+
+  <view class="cu-form-group">
+    <text class="cuIcon-copy text-grey"></text>
+    <view class="title solids-right">电子合同</view>
+    <button type="primary" class="text-left ml20" bindtap="" wx:if="{{info.contract_img}}" 
+        data-src="{{info.contract_img}}"  bindtap="previewImage"> 查看合约 </button>
+    <button type="primary" class="text-left ml20" bindtap="gotoSign"> 电子签约 </button>
+  </view>
+
+</view>

+ 21 - 0
pages/user/info/index.wxss

@@ -0,0 +1,21 @@
+.userinfo {
+  position: relative;
+  width: 100%;
+  background: #fff;
+  text-align: center;
+  padding: 30rpx 0;
+}
+.userinfo .userinfo-avatar {
+  overflow: hidden;
+  display: block;
+  width: 160rpx;
+  height: 160rpx;
+  border-radius: 50%;
+  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
+  margin: auto;
+}
+.userinfo .userinfo-name {
+  font-size: 30rpx;
+  font-weight: bold;
+  margin-top: 20rpx;
+}

+ 34 - 54
util/util.js

@@ -1,9 +1,9 @@
 var env = 'development';
 const md5 = require('./md5.js');
-var createParam = require('./createParam.js');
 var wiki = require('./wiki.js');
 var location = require('./location.js');
-const baseUrl = "http://localhost:8888"
+const baseUrl = "https://edu.ndjsxh.cn:8443/api"
+// const baseUrl = "http://localhost:8888"
 
 const formatTime = date => {
   const year = date.getFullYear()
@@ -16,6 +16,11 @@ const formatTime = date => {
   return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
 }
 
+const filterTime = ( str) => {
+  if(!str) return "---";
+  return str.substr(0,19).replace("T", " ");
+}
+
 const curDate = () =>{
   var nowDate = new Date();
   var year = nowDate.getFullYear();
@@ -44,7 +49,7 @@ var showSuccess = text => wx.showToast({
 
 var showMsg = text => wx.showToast({
   title: text,
-  icon: 'success',
+  image: '/img/img_close.png',
   duration: 1000,
   mask: true
 })
@@ -82,7 +87,7 @@ var http = (method, data, fun) => {
     let body = JSON.stringify(data);
     wx.request({
     method: "POST",
-    url: `${baseUrl}/${method}`,
+    url: `${baseUrl}${method}`,
     data: body,
     header:header,
     success: function(res) {
@@ -91,6 +96,7 @@ var http = (method, data, fun) => {
         if( code == 0 ){
           fun&&fun(code, data)
         }else{
+          showModel("请求异常", msg)
           fun&&fun(code, msg)
         }  
       }else{
@@ -103,64 +109,39 @@ var http = (method, data, fun) => {
     }
   })
 }
-// 缩略图
-var ossList = [
-  {
-    "url": "https://rbbaby.oss-cn-beijing.aliyuncs.com",
-    "accessid": "13pLPAeBfleg6cQs",
-    "accesskey":"CIX2vxlFQlro3GgMW07UNuUpaIYcnM"
-  },
-  {
-    "url": "https://ddg-applets.oss-cn-hangzhou.aliyuncs.com",
-    "accessid": "LTAIofD6SB93kjd1",
-    "accesskey": "4suXiLQ8rTxbAZ3YGlbC6cCaDhOuzI"
-  }
-];
-
-var uploadFile = (index, tempFilePaths, callback) =>{
-    wx.showLoading({
-      title: "正在上传图片",
-      mask: true
-    });
-    let ossObj = ossList[index];
-    var uploadOs = ossObj.url;
-    var that = this;
-    var param = createParam.getUploadParam(tempFilePaths, ossObj.accessid, ossObj.accesskey);
-    param.name = tempFilePaths;
+var uploadFile = (tempFilePaths, fun) =>{
+    let authDB = wx.getStorageSync("@yunyuanqu");
+    let user_id = authDB&&authDB.ID||0;
+    let token=authDB&&authDB.token||''
+    let header={}
+    if( user_id && token ){
+      header['x-token'] = token
+      header['x-user-id']= user_id
+    }
     wx.uploadFile({
-      url: uploadOs,
+      url: `${baseUrl}/wx/upload`,
       filePath: tempFilePaths,
       name: "file",
-      /**上传的参数**/
-      formData: param,
+      header:header,
       success: function (res) {
-        wx.hideLoading();
-        if (callback){
-          callback(uploadOs + "/" + param.key);
+        if( res.statusCode === 200){
+          let { code, data, msg} = JSON.parse(res.data)
+          console.log( code, data, msg )
+          if( code == 0 ){
+            fun&&fun(code, data)
+          }else{
+            fun&&fun(code, msg)
+          }  
+        }else{
+          fun&&fun(404, "请求异常")
         }
-       
       },
       fail: function (res) {
-        wx.hideLoading();
-        console.log(res)
+        fun&&fun(404, "" );
       }
     })
 }
 
-var randFlower = function(){
-  let catList = [];
-  for( let i in wiki){
-    catList.push( i );
-  }
-  let name = randOne( catList );
-  return randOne( wiki[name]);
-};
-
-var randOne = function( list ){
-  let index = parseInt(Math.random() * list.length);
-  return list[index];
-}
-
 module.exports = { 
   formatTime, 
   curDate,
@@ -168,12 +149,11 @@ module.exports = {
   showSuccess, 
   showMsg, 
   showModel, 
+  filterTime,
   http, 
   uploadFile, 
   showToast, 
   wiki,
-  randFlower,
   baseUrl,
-  location,
-  randOne
+  location
 }