| @@ -28,7 +28,6 @@ App({ | |||
| // iphoneX顶部适配 | |||
| wx.getSystemInfo({ | |||
| success: function (res) { | |||
| console.log(res); | |||
| if (res.statusBarHeight > 20) { | |||
| console.log("Device is iPhoneX!!!"); | |||
| that.globalData.isIPX = true; | |||
| @@ -10,10 +10,9 @@ | |||
| "pages/apply/index", | |||
| "pages/apply/paymentTemplate/paymentTemplate", | |||
| "pages/apply/approval/approval", | |||
| "pages/inCome/inCome", | |||
| "pages/apply/approval/approval", | |||
| "pages/inCome/inCome", | |||
| "pages/inCome/accounting/index", | |||
| "pages/apply/paymentTemplate/see/see", | |||
| "pages/apply/paymentTemplate/see/see", | |||
| "pages/apply/paymentTemplate/add/add" ], | |||
| "window": { | |||
| "backgroundTextStyle": "light", | |||
| @@ -1,11 +1,11 @@ | |||
| module.exports = { | |||
| DEV: { | |||
| URL_PREFIX: '192.168.31.228:8080/', | |||
| URL_PREFIX: 'http://192.168.31.228/api', | |||
| }, | |||
| PRE: { | |||
| URL_PREFIX: 'http://192.168.31.196:3318/rural_collective_assetes', | |||
| URL_PREFIX: 'http://192.168.31.228:8080/api', | |||
| }, | |||
| PROD: { | |||
| URL_PREFIX: 'http://192.168.31.196:3318/rural_collective_assetes', | |||
| URL_PREFIX: 'http://192.168.31.228:8080/api', | |||
| } | |||
| } | |||
| @@ -13,7 +13,6 @@ | |||
| <view class="main"> | |||
| <van-tabs sticky color="#000"> | |||
| <van-tab title="银行账户"> | |||
| <view class="bank_box"> | |||
| <text class="zt">一般户</text> | |||
| <image src="../../image/apply/jsyh_bg2.png" style="width: 100%;position: absolute;bottom:0;z-index: 9;" mode="widthFix"></image> | |||
| @@ -3,7 +3,7 @@ | |||
| <image src="../../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">记账申请</text> | |||
| </view> | |||
| <view class="work_plan"> | |||
| <view class="work_plan" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view> | |||
| <view class="menu_item {{inOrOut?'active':''}}" bindtap="switchTab" data-gid='{{1}}'>收入流水<text class="remind">0</text></view> | |||
| <view class="menu_item {{!inOrOut?'active':''}}" bindtap="switchTab" data-gid='{{2}}'>支出流水<text class="remind">0</text></view> | |||
| @@ -4,7 +4,7 @@ | |||
| <text style="top:{{isIPX?'54px':'30px'}};">收入登记</text> | |||
| </view> | |||
| <!-- 付款单位开始 --> | |||
| <view class="top"> | |||
| <view class="top" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <image src="../../image/apply/dress_icon.png" mode="widthFix"></image> | |||
| <view class="top-tit">收入单位</view> | |||
| <view class="top-title">龙水镇龙洞村股份经济联合社</view> | |||
| @@ -5,62 +5,222 @@ Page({ | |||
| //顶部胶囊按钮位置信息rect | |||
| CustomMenuButton: null, | |||
| wrokScrollHeight:0, | |||
| userInfoObj:{} //用户信息 | |||
| userInfoObj:{}, //用户信息, | |||
| item:"", | |||
| active:1, | |||
| // 待办列表 | |||
| todoList:[], | |||
| // 已办列表 | |||
| doneList:[], | |||
| // 已发起 | |||
| yfqList:[], | |||
| // 已制单 | |||
| yzdList:[], | |||
| //待办数量 | |||
| todoNum:0, | |||
| //已办数量 | |||
| doneNum:0, | |||
| //已发起数量 | |||
| yfqNum:0, | |||
| //已制单数量 | |||
| yzdNum:0, | |||
| //字典 | |||
| transferType:[ | |||
| {"dictVale":1,"dictLabel":"村账户转账"}, | |||
| {"dictVale":2,"dictLabel":"公务卡转账"}, | |||
| {"dictVale":3,"dictLabel":"虚拟挂账"}, | |||
| {"dictVale":4,"dictLabel":"代管账户转账"}, | |||
| {"dictVale":5,"dictLabel":"母子转账"}, | |||
| {"dictVale":10,"dictLabel":"现金提现"}, | |||
| {"dictVale":11,"dictLabel":"现金使用"}, | |||
| {"dictVale":12,"dictLabel":"汇票支出"} | |||
| ] | |||
| }, | |||
| onLoad: function (options) { | |||
| //获取用户信息 | |||
| this.getUserInfo() | |||
| //获取滚动条高度 | |||
| this.computeBarLocation(); | |||
| //查询待办 | |||
| this.getTaskList(); | |||
| //查询已办 | |||
| this.getTaskDoneList(); | |||
| //查询已发起 | |||
| this.getTransferList(); | |||
| this.getTransferList1(); | |||
| //查询已制单 | |||
| this.getTransferList2(); | |||
| }, | |||
| //跳转收入登记 | |||
| swichInCome:function(e){ | |||
| console.log(e.currentTarget.dataset.current); | |||
| // let cur = e.currentTarget.dataset.current; | |||
| // if (this.data.currentTaB == cur) { | |||
| // return false; | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../inCome/index?id=' + id, | |||
| // }) | |||
| // } | |||
| wx.navigateTo({ | |||
| url: '../inCome/inCome?', | |||
| }) | |||
| switchTab:function(e){ | |||
| this.setData({ | |||
| active:e.currentTarget.dataset.gid | |||
| }) | |||
| }, | |||
| dictTranslate(d,value){ | |||
| let val = "" | |||
| for(var index in d){ | |||
| if(d[index].dictVale==value){ | |||
| return val = d[index].dictLabel | |||
| } | |||
| } | |||
| }, | |||
| getTaskList:function(e){ | |||
| let data = { | |||
| pageNum:1, | |||
| pageSize:10, | |||
| orderByColumn:"A.ID_", | |||
| isAsc:"desc", | |||
| systemType:4, | |||
| method:"GET" | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_TASKLIST,data, { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| this.setData({todoNum:res.total}) | |||
| if(res.rows!=null&&res.rows!=""){ | |||
| for(let i = 0;i<res.total;i++){ | |||
| let d = this.dictTranslate(this.data.transferType,res.rows[i].formData.transferType) | |||
| res.rows[i].formData.transferType = d | |||
| } | |||
| this.setData({todoList:res.rows}) | |||
| } | |||
| } | |||
| }, fail: (res) => { | |||
| console.log(res); | |||
| }, | |||
| complete: (res) => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| }, | |||
| getTaskDoneList:function(e){ | |||
| let data = { | |||
| pageNum:1, | |||
| pageSize:10, | |||
| orderByColumn:"A.ID_", | |||
| isAsc:"desc", | |||
| systemType:4, | |||
| method:"GET" | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_TASKDONELIST,data, { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| this.setData({doneNum:res.total}) | |||
| if(res.rows!=null&&res.rows!=""){ | |||
| for(var index in res.rows){ | |||
| let d = this.dictTranslate(this.data.transferType,res.rows[index].formData.transferType) | |||
| res.rows[index].formData.transferType = d | |||
| } | |||
| this.setData({doneList:res.rows}) | |||
| } | |||
| } | |||
| }, fail: (res) => { | |||
| console.log(res); | |||
| }, | |||
| complete: (res) => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| }, | |||
| getTransferList:function(e){ | |||
| let data = { | |||
| // pageNum:1, | |||
| // pageSize:10, | |||
| transferType:"1", | |||
| auditStatus:"2", | |||
| method:"GET" | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| console.log(res); | |||
| let a = this.data.yfqNum+res.total | |||
| this.setData({yfqNum:a}) | |||
| this.setData({yfqList:res.rows}) | |||
| } | |||
| }, fail: (res) => { | |||
| console.log(res); | |||
| }, | |||
| complete: (res) => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| }, | |||
| getTransferList1:function(e){ | |||
| let data = { | |||
| // pageNum:1, | |||
| // pageSize:10, | |||
| transferType:"1", | |||
| auditStatus:"3", | |||
| method:"GET" | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| console.log(); | |||
| let a = this.data.yfqNum+res.total | |||
| this.setData({yfqNum:a}) | |||
| this.setData({yfqList:res.rows}) | |||
| } | |||
| }, fail: (res) => { | |||
| console.log(res); | |||
| }, | |||
| complete: (res) => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| }, | |||
| //已制单 | |||
| getTransferList2:function(e){ | |||
| let data = { | |||
| // pageNum:1, | |||
| // pageSize:10, | |||
| transferType:"1", | |||
| auditStatus:"0", | |||
| method:"GET" | |||
| } | |||
| UTIL.httpRequest(API.URL_GET_TRANSFERLIST,data, { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| this.setData({yzdNum:res.total}) | |||
| this.setData({yzdList:res.rows}) | |||
| } | |||
| }, fail: (res) => { | |||
| console.log(res); | |||
| }, | |||
| complete: (res) => { | |||
| console.log(res); | |||
| } | |||
| }) | |||
| }, | |||
| //跳转收入登记 | |||
| swichInCome:function(e){ | |||
| wx.navigateTo({ | |||
| url: '../inCome/inCome?', | |||
| }) | |||
| }, | |||
| //跳转支出申请 | |||
| swichPayment:function(e){ | |||
| console.log(e.currentTarget.dataset.current); | |||
| // let cur = e.currentTarget.dataset.current; | |||
| // if (this.data.currentTaB == cur) { | |||
| // return false; | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../inCome/index?id=' + id, | |||
| // }) | |||
| // } | |||
| wx.navigateTo({ | |||
| url: '../apply/index?', | |||
| }) | |||
| }, | |||
| swichPayment:function(e){ | |||
| wx.navigateTo({ | |||
| url: '../apply/index?', | |||
| }) | |||
| }, | |||
| //跳转个人设置 | |||
| swichSettle:function(e){ | |||
| console.log(e.currentTarget.dataset.current); | |||
| // let cur = e.currentTarget.dataset.current; | |||
| // if (this.data.currentTaB == cur) { | |||
| // return false; | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../inCome/index?id=' + id, | |||
| // }) | |||
| // } | |||
| wx.navigateTo({ | |||
| url: 'settle/index?', | |||
| }) | |||
| }, | |||
| swichSettle:function(e){ | |||
| // console.log(e.currentTarget.dataset.current); | |||
| // let cur = e.currentTarget.dataset.current; | |||
| // if (this.data.currentTaB == cur) { | |||
| // return false; | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../inCome/index?id=' + id, | |||
| // }) | |||
| // } | |||
| wx.navigateTo({ | |||
| url: 'settle/index?', | |||
| }) | |||
| }, | |||
| /* 计算bar 高度*/ | |||
| computeBarLocation() { | |||
| var that = this; | |||
| @@ -94,6 +254,7 @@ swichSettle:function(e){ | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| this.setData({userInfoObj:res.user}) | |||
| this.setData({item:JSON.stringify(res.user)}) | |||
| } | |||
| } | |||
| }) | |||
| @@ -4,7 +4,7 @@ | |||
| <view class="top_title" style="height:{{CustomMenuButton.bottom}}px;z-index: 7777;padding-top: {{CustomMenuButton.top}}px;"></view> | |||
| <!--账户信息--> | |||
| <view class="information_header"> | |||
| <navigator bindtap="swichSettle" class="setup" style="background:url('../../image/index/setup.png') no-repeat; background-size: 100% 100%;"></navigator> | |||
| <navigator url="{{'settle/index?item='+item}}" class="setup" style="background:url('../../image/index/setup.png') no-repeat; background-size: 100% 100%;"></navigator> | |||
| <view class="portrait_head"></view> | |||
| <view class="information_main"> | |||
| <view class="name_wrap"> | |||
| @@ -16,12 +16,12 @@ | |||
| </view> | |||
| <view class="task_wrap "> | |||
| <view class="flex_block"> | |||
| <view class="desc">已完成</view> | |||
| <view class="event">120件</view> | |||
| <view class="desc">未完成</view> | |||
| <view class="event">{{todoNum}}件</view> | |||
| </view> | |||
| <view class="flex_block unfinished"> | |||
| <view class="desc">已完成</view> | |||
| <view class="event">120件</view> | |||
| <view class="event">{{doneNum}}件</view> | |||
| </view> | |||
| </view> | |||
| <view class="address_wrap"> | |||
| @@ -83,166 +83,81 @@ | |||
| </view> | |||
| <!--工作计划--> | |||
| <view class="work_plan"> | |||
| <view class="menu_item active">待办<text class="remind">0</text></view> | |||
| <view class="menu_item">已办</view> | |||
| <view class="menu_item">已发起</view> | |||
| <view class="menu_item">已制单</view> | |||
| <view class="menu_item {{active==1?'active':''}}" bindtap="switchTab" data-gid='{{1}}'>待办<text class="remind">{{todoNum}}</text></view> | |||
| <view class="menu_item {{active==2?'active':''}}" bindtap="switchTab" data-gid='{{2}}'>已办<text class="remind">{{doneNum}}</text></view> | |||
| <view class="menu_item {{active==3?'active':''}}" bindtap="switchTab" data-gid='{{3}}'>已发起<text class="remind">{{yfqNum}}</text></view> | |||
| <view class="menu_item {{active==4?'active':''}}" bindtap="switchTab" data-gid='{{4}}'>已制单<text class="remind">{{yzdNum}}</text></view> | |||
| <view class="more">></view> | |||
| </view> | |||
| <scroll-view scroll-y="true" style="height: {{wrokScrollHeight}}px;"> | |||
| <view class="workflow"> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| </view> | |||
| </view> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| </view> | |||
| </view> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| </view> | |||
| </view> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| </view> | |||
| </view> | |||
| <scroll-view scroll-y="true" style="height: {{wrokScrollHeight}}px;" > | |||
| <view class="workflow" wx:if="{{active=='1'}}" wx:for-item="item" wx:for="{{todoList}}" wx:key="id"> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="name">{{item.formData.payer}}</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| <view class="time">{{item.formData.applyDate}}</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| </view> | |||
| </view> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| <text>{{item.formData.transferType}}</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| </view> | |||
| </view> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| <view class="amount"><text class="unit">¥</text>{{item.formData.expenditureAmount}}</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="workflow" wx:if="{{active=='2'}}" wx:for-item="item" wx:for="{{doneList}}" wx:key="id"> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| <view class="name">{{item.formData.payer}}</view> | |||
| <view class="state">已审</view> | |||
| <view class="time">{{item.formData.applyDate}}</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| <view class="amount"><text class="unit">¥</text>{{item.formData.expenditureAmount}}</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="workflow" wx:if="{{active=='3'}}" wx:for-item="item" wx:for="{{yfqList}}" wx:key="id"> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| <view class="name">{{item.payer}}</view> | |||
| <view class="state">已发起</view> | |||
| <view class="time">{{item.applyDate}}</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| <text>村账户转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| <view class="amount"><text class="unit">¥</text>{{item.expenditureAmount}}</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="workflow" wx:if="{{active=='4'}}" wx:for-item="item" wx:for="{{yzdList}}" wx:key="id"> | |||
| <!--1--> | |||
| <view class="workflow_list"> | |||
| <view class="process_intro"> | |||
| <view class="name">我的擦撒十大黑科技暗杀可接受的和</view> | |||
| <view class="state">待审</view> | |||
| <view class="time">2021-1-26</view> | |||
| <view class="name">{{item.payer}}</view> | |||
| <view class="state">已制单</view> | |||
| <view class="time">{{item.applyDate}}</view> | |||
| </view> | |||
| <view class="process_pay"> | |||
| <view class="describe"> | |||
| <image class="amount_icon" src="../../image/index/process_icon.png" mode="aspectFit"></image> | |||
| <text>银行转账</text> | |||
| <text>村账户转账</text> | |||
| </view> | |||
| <view class="amount"><text class="unit">¥</text>-2600.00</view> | |||
| <view class="amount"><text class="unit">¥</text>{{item.expenditureAmount}}</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </scroll-view> | |||
| @@ -1,4 +1,6 @@ | |||
| import SignaturePad from '../../../../utils/signature_pad' | |||
| import SignaturePad from '../../../../utils/signature_pad'; | |||
| import * as UTIL from '../../../../utils/util.js'; | |||
| import * as API from '../../../../utils/API.js'; | |||
| let signaturePad = {}; | |||
| let pix = 7; | |||
| let penColor = 'black'; | |||
| @@ -7,15 +9,19 @@ Page({ | |||
| data: { | |||
| penColor: 'black', | |||
| lineWidth: 0.6, | |||
| isEmpty: true | |||
| isEmpty: true, | |||
| baseItem:"", | |||
| item:{}, | |||
| }, | |||
| onLoad: function(options) { | |||
| this.setData({baseItem:options.item}); | |||
| this.setData({item:JSON.parse(options.item)}); | |||
| console.log(this.data.item); | |||
| var ctx = wx.createCanvasContext('handWriting'); | |||
| const data = { | |||
| devicePixelRatio: pix, | |||
| }; | |||
| signaturePad = new SignaturePad(ctx, data); | |||
| console.info(ctx, SignaturePad); | |||
| }, | |||
| uploadScaleStart(e) { | |||
| const item = { | |||
| @@ -60,17 +66,62 @@ Page({ | |||
| }, | |||
| //保存canvas图像 | |||
| subCanvas: function() { | |||
| let _this = this | |||
| if (this.data.isEmpty) { | |||
| return false | |||
| } | |||
| wx.canvasToTempFilePath({ | |||
| canvasId: 'handWriting', | |||
| success: function(res) { | |||
| console.log(res.tempFilePath) | |||
| }, | |||
| fail: function(res) { | |||
| console.log(res) | |||
| } | |||
| console.log(res); | |||
| wx.uploadFile({ | |||
| url: API.URL_POST_UPLOADFILE, //服务器地址 | |||
| filePath:res.tempFilePath,//本地照片地址 | |||
| name: 'file', | |||
| header: { | |||
| 'Content-Type': 'multipart/form-data', | |||
| 'Authorization':'Bearer '+getApp().globalData.userInfo.token, //如果需要token的话要传 | |||
| }, | |||
| success (res){ | |||
| let dd = JSON.parse(res.data) | |||
| // console.log(dd); | |||
| // let a = _this.data.item | |||
| // a.electronicSignature = dd.fileName | |||
| // _this.setData({item:a}); | |||
| // _this.saveESign(JSON.stringify(_this.data.item)); | |||
| if(dd.code==200){ | |||
| wx.showToast({ | |||
| title: dd.msg, | |||
| duration: 2000, | |||
| icon:"success" | |||
| }) | |||
| setTimeout(() => { | |||
| _this.back() | |||
| }, 2000); | |||
| }else{ | |||
| wx.showToast({ | |||
| title: dd.msg, | |||
| duration: 2000, | |||
| icon:"none" | |||
| }) | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| fail: function(res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| }, | |||
| // 保存电子签名 | |||
| saveESign : function(item){ | |||
| UTIL.httpRequest(API.URL_POST_USEREDIT,item,{ | |||
| success: (res) => { | |||
| console.log(res); | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| console.log(res); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| }) | |||
| @@ -3,7 +3,7 @@ | |||
| <image src="../../../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">电子签名</text> | |||
| </view> | |||
| <view class="wrapper"> | |||
| <view class="wrapper" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view class="hand-left"> | |||
| <button catchtap="retDraw" class="del-btn">清除</button> | |||
| <button catchtap="subCanvas" class="sub-btn">保存</button> | |||
| @@ -8,46 +8,18 @@ Page({ | |||
| data: { | |||
| isIPX: app.globalData.isIPX, | |||
| show:false, | |||
| baseItem:"", | |||
| item:{} | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| this.setData({baseItem:options.item}); | |||
| this.setData({item:JSON.parse(options.item)}); | |||
| }, | |||
| //跳转密码修改 | |||
| switchPassWord:function(e){ | |||
| console.log(e.currentTarget.dataset.current); | |||
| // let cur = e.currentTarget.dataset.current; | |||
| // if (this.data.currentTaB == cur) { | |||
| // return false; | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../inCome/index?id=' + id, | |||
| // }) | |||
| // } | |||
| wx.navigateTo({ | |||
| url: 'passWord/index?', | |||
| }) | |||
| }, | |||
| //跳转电子签名 | |||
| switchESign:function(e){ | |||
| console.log(e.currentTarget.dataset.current); | |||
| // let cur = e.currentTarget.dataset.current; | |||
| // if (this.data.currentTaB == cur) { | |||
| // return false; | |||
| // }else{ | |||
| // wx.navigateTo({ | |||
| // url: '../inCome/index?id=' + id, | |||
| // }) | |||
| // } | |||
| wx.navigateTo({ | |||
| url: 'eSign/index?', | |||
| }) | |||
| }, | |||
| back:function(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| @@ -1,16 +1,18 @@ | |||
| <!--pages/apply/index.wxml--> | |||
| <!--pages/index/settle/index.wxml--> | |||
| <view class="ns" style="height:{{isIPX?'88px':'64px'}};"> | |||
| <image src="../../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">设置</text> | |||
| </view> | |||
| <view class="main-box table-box"> | |||
| <view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view> | |||
| <view> | |||
| <image style="width: 25rpx; height: 30rpx; margin:0 20rpx;" mode="{{item.mode}}" src="../../../image/icon/password.png"></image> | |||
| <text>密码修改</text> | |||
| </view> | |||
| <view bindtap="switchPassWord" > | |||
| <image style="width: 30rpx; height: 30rpx; margin:0 20rpx;" mode="{{item.mode}}" src="../../../image/icon/arrowRight.png"></image> | |||
| <view> | |||
| <navigator url="{{'passWord/index?item='+baseItem}}"> | |||
| <image style="width: 30rpx; height: 30rpx; margin:0 20rpx;" mode="{{item.mode}}" src="../../../image/icon/arrowRight.png"></image> | |||
| </navigator> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| @@ -18,8 +20,10 @@ | |||
| <image style="width: 25rpx; height: 30rpx; margin:0 20rpx;" mode="{{item.mode}}" src="../../../image/icon/e-sign.png"></image> | |||
| <text>电子签名</text> | |||
| </view> | |||
| <view bindtap="switchESign" > | |||
| <image style="width: 25rpx; height: 30rpx; margin:0 20rpx;" bindtap="switchESign" mode="{{item.mode}}" src="../../../image/icon/arrowRight.png"></image> | |||
| <view> | |||
| <navigator url="{{'eSign/index?item='+baseItem}}"> | |||
| <image style="width: 30rpx; height: 30rpx; margin:0 20rpx;" mode="{{item.mode}}" src="../../../image/icon/arrowRight.png"></image> | |||
| </navigator> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -1,4 +1,6 @@ | |||
| // pages/apply/index.js | |||
| import * as UTIL from '../../../../utils/util.js'; | |||
| import * as API from '../../../../utils/API.js'; | |||
| const app = getApp(); | |||
| Page({ | |||
| @@ -8,17 +10,98 @@ Page({ | |||
| data: { | |||
| isIPX: app.globalData.isIPX, | |||
| show:false, | |||
| baseItem:"", | |||
| item:{}, | |||
| oldPwd:"", | |||
| newPwd:"", | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| this.setData({baseItem:options.item}); | |||
| this.setData({item:JSON.parse(options.item)}); | |||
| console.log(this.data.item); | |||
| }, | |||
| bindOldInput: function (e) { | |||
| console.log(e); | |||
| this.setData({ | |||
| oldPwd: e.detail.value | |||
| }) | |||
| }, | |||
| bindNewInput: function (e) { | |||
| console.log(e); | |||
| this.setData({ | |||
| newPwd: e.detail.value | |||
| }) | |||
| }, | |||
| updatePassword(){ | |||
| let newPassword = this.data.newPwd; | |||
| let oldPassword = this.data.oldPwd; | |||
| const d = {oldPassword, newPassword} | |||
| if(newPassword==""||oldPassword==""){ | |||
| wx.showToast({ | |||
| title: '新旧密码不能为空!', | |||
| duration: 2000, | |||
| icon:"none" | |||
| }) | |||
| }else if(newPassword==oldPassword){ | |||
| wx.showToast({ | |||
| title: '新旧密码不能相同!', | |||
| duration: 2000, | |||
| icon:"none" | |||
| }) | |||
| }else{ | |||
| wx.request({ | |||
| url:API.URL_POST_UPDATEPWD, | |||
| data: d, | |||
| method: 'POST', | |||
| timeout: 60000, | |||
| header: { | |||
| 'Content-Type': 'application/x-www-form-urlencoded', | |||
| 'Authorization':'Bearer '+getApp().globalData.userInfo.token, | |||
| }, | |||
| success: function (response) { | |||
| if(response.data.code==200){ | |||
| wx.showToast({ | |||
| title: response.data.msg, | |||
| duration: 2000, | |||
| icon:"success" | |||
| }) | |||
| }else{ | |||
| wx.showToast({ | |||
| title: response.data.msg, | |||
| duration: 2000, | |||
| icon:"none" | |||
| }) | |||
| } | |||
| }, | |||
| fail: function (response) { | |||
| console.log(response); | |||
| }, | |||
| complete: function (response) { | |||
| console.log(response); | |||
| } | |||
| }) | |||
| // UTIL.httpRequest(API.URL_POST_UPDATEPWD, d, { | |||
| // success: (res) => { | |||
| // console.log(res); | |||
| // if (res.code == API.SUCCESS_CODE) { | |||
| // } | |||
| // }, | |||
| // fail:(res) => { | |||
| // console.log(res); | |||
| // }, | |||
| // complete:(res) => { | |||
| // console.log(res); | |||
| // } | |||
| // }) | |||
| } | |||
| }, | |||
| back:function(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| @@ -3,14 +3,14 @@ | |||
| <image src="../../../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">密码修改</text> | |||
| </view> | |||
| <view class="main-box table-box"> | |||
| <view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view> | |||
| <view> | |||
| <image style="width: 25rpx; height: 30rpx; margin:0 20rpx;" mode="{{item.mode}}" src="../../../../image/icon/password.png"></image> | |||
| <text>旧密码</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" password="true" style="margin-top: 20rpx;text-align: right;"/> | |||
| <input type="text" password="true" value="{{oldPwd}}" bindinput="bindOldInput" style="margin-top: 20rpx;text-align: right;"/> | |||
| </view> | |||
| </view> | |||
| <view> | |||
| @@ -19,7 +19,12 @@ | |||
| <text>新密码</text> | |||
| </view> | |||
| <view> | |||
| <input type="text" password="true" style="margin-top: 20rpx;text-align: right;"/> | |||
| <input type="text" password="true" value="{{newPwd}}" bindinput="bindNewInput" style="margin-top: 20rpx;text-align: right;"/> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <view class="btn"> | |||
| <button type="primary" bindtap="updatePassword">保存</button> | |||
| </view> | |||
| @@ -65,4 +65,14 @@ | |||
| .table-box text{ | |||
| line-height: 80rpx; | |||
| } | |||
| .btn{ | |||
| text-align: center; | |||
| } | |||
| .btn button{ | |||
| line-height: 1.7; | |||
| padding-left:80rpx; | |||
| padding-right:80rpx; | |||
| border-radius: 30rpx; | |||
| display: inline-block; | |||
| margin: 50rpx auto; | |||
| } | |||
| @@ -6,20 +6,25 @@ const APP = getApp(); | |||
| Page({ | |||
| data: { | |||
| isIPhoneX:false, | |||
| privacyCheck:true //用户协议 | |||
| privacyCheck:true, //用户协议 | |||
| }, | |||
| onLoad: function (options) { | |||
| this.setData({ | |||
| isIPhoneX:UTIL.isIPhoneX() | |||
| }) | |||
| this.automaticLogin() | |||
| //this.getUserInfo() | |||
| //this.getPhoneNumber() | |||
| }, | |||
| //自动登录 | |||
| automaticLogin(){ | |||
| let automatic = STORAGE.getToken(); | |||
| let getOpenId = STORAGE.getOpenId(); | |||
| if(automatic == '' && getOpenId ==''){ | |||
| console.log(); | |||
| console.log(1); | |||
| UTIL.getCOdeFromWX({ | |||
| complate: (code) => { | |||
| let sendData = { | |||
| @@ -27,11 +32,14 @@ Page({ | |||
| } | |||
| UTIL.httpRequestNoneDetal(API.URL_GET_OPENID, sendData, "POST", { | |||
| success: (res) => { | |||
| console.log(res); | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| wx.navigateTo({ | |||
| url: '/pages/index/index', | |||
| }) | |||
| } | |||
| } else{ | |||
| this.getPhoneNumber() | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| @@ -54,6 +62,16 @@ Page({ | |||
| privacyCheck:checkStatus | |||
| }) | |||
| }, | |||
| /* 获取用户信息*/ | |||
| getUserInfo(){ | |||
| UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| this.setData({userInfoObj:res.user}) | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| //微信一键登录授权 | |||
| getPhoneNumber: function(res) { | |||
| let that = this; | |||
| @@ -73,7 +91,7 @@ Page({ | |||
| iv:detail.iv, | |||
| encryptedData:detail.encryptedData | |||
| } | |||
| UTIL.httpRequest(API.URL_POST_DECRYPTEDWXDATA, sendData,{ | |||
| UTIL.httpRequestNoneDetal(API.URL_POST_DECRYPTEDWXDATA, sendData, "POST", { | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| let phoneNumber = res.data.phoneNumber; | |||
| @@ -82,21 +100,40 @@ Page({ | |||
| // UTIL.showToastNoneIcon("数据共:" + res._data.length + "条"); | |||
| } else { | |||
| //待删 | |||
| UTIL.showToastNoneIcon(res.msg) | |||
| } | |||
| }, | |||
| fail: (res) => { | |||
| console.log("fail"); | |||
| UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP) | |||
| } | |||
| }); | |||
| }) | |||
| // UTIL.httpRequest(API.URL_POST_DECRYPTEDWXDATA, sendData,{ | |||
| // success: (res) => { | |||
| // console.log(res); | |||
| // // if (res.code == API.SUCCESS_CODE) { | |||
| // // let phoneNumber = res.data.phoneNumber; | |||
| // // //微信手机号码绑定 | |||
| // // that.wxUserBand(phoneNumber) | |||
| // // // UTIL.showToastNoneIcon("数据共:" + res._data.length + "条"); | |||
| // // } else { | |||
| // // //待删 | |||
| // // UTIL.showToastNoneIcon(res.msg) | |||
| // // } | |||
| // }, | |||
| // fail: (res) => { | |||
| // console.log("fail"); | |||
| // UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP) | |||
| // } | |||
| // }); | |||
| }, | |||
| wxUserBand(phone){ | |||
| let sendData = { | |||
| openId:STORAGE.getOpenId(), | |||
| phonenumber:phone | |||
| } | |||
| UTIL.httpRequest(API.URL_POST_USERBAND, sendData,{ | |||
| UTIL.httpRequestNoneDetal(API.URL_POST_USERBAND, sendData,"POST",{ | |||
| success: (res) => { | |||
| if (res.code == API.SUCCESS_CODE) { | |||
| wx.navigateTo({ | |||
| @@ -110,8 +147,7 @@ Page({ | |||
| UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP) | |||
| } | |||
| }); | |||
| console.log(sendData) | |||
| // | |||
| } | |||
| }) | |||
| @@ -1,4 +1,5 @@ | |||
| { | |||
| "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", | |||
| "packOptions": { | |||
| "ignore": [ | |||
| @@ -10,6 +11,7 @@ | |||
| "include": [] | |||
| }, | |||
| "setting": { | |||
| "urlCheck": false, | |||
| "es6": true, | |||
| "enhance": true, | |||
| @@ -33,7 +33,18 @@ const URL_POST_DECRYPTEDWXDATA = `${URL_PREFIX}/wechat/decryptedWXData`; | |||
| const URL_POST_USERBAND = `${URL_PREFIX}/register/wechat/band`; | |||
| //获取用户信息 | |||
| const URL_GET_GETINFO = `${URL_PREFIX}/getInfo`; | |||
| //获取待办 | |||
| const URL_GET_TASKLIST = `${URL_PREFIX}/activiti/process/taskList`; | |||
| //获取已办 | |||
| const URL_GET_TASKDONELIST = `${URL_PREFIX}/activiti/process/taskDoneList`; | |||
| //获取已发起、已制单 | |||
| const URL_GET_TRANSFERLIST = `${URL_PREFIX}/yinnong/transfer/list`; | |||
| // 修改密码 | |||
| const URL_POST_UPDATEPWD = `${URL_PREFIX}/system/user/profile/updatePwd`; | |||
| // 上传图片 | |||
| const URL_POST_UPLOADFILE = `${URL_PREFIX}/system/user/profile/electronicSignature`; | |||
| // 保存电子签名 | |||
| const URL_POST_USEREDIT = `${URL_PREFIX}/system/user/edit`; | |||
| /****************接口地址end****************/ | |||
| export { | |||
| @@ -50,5 +61,11 @@ export { | |||
| URL_GET_OPENID, | |||
| URL_POST_DECRYPTEDWXDATA, | |||
| URL_POST_USERBAND, | |||
| URL_GET_GETINFO | |||
| URL_GET_GETINFO, | |||
| URL_GET_TASKLIST, | |||
| URL_GET_TASKDONELIST, | |||
| URL_GET_TRANSFERLIST, | |||
| URL_POST_UPDATEPWD, | |||
| URL_POST_UPLOADFILE, | |||
| URL_POST_USEREDIT | |||
| } | |||
| @@ -113,14 +113,15 @@ function httpRequest(url, data, { | |||
| wx.showNavigationBarLoading(); | |||
| let finalData = {}; | |||
| Object.assign(finalData, data); | |||
| // finalData.token = getApp().globalData.userInfo.token; | |||
| finalData.token = getApp().globalData.userInfo.token; | |||
| wx.request({ | |||
| url, | |||
| data: finalData, | |||
| method: data.method || 'POST', | |||
| timeout: 60000, | |||
| header: { | |||
| 'Authorization':'Bearer '+getApp().globalData.userInfo.token | |||
| 'Authorization':'Bearer '+getApp().globalData.userInfo.token, | |||
| }, | |||
| success: function (response) { | |||
| if (response.data && response.data._code == API.INVALID_USER_TOKEN_CODE) { | |||
| @@ -171,7 +172,6 @@ function httpRequestNoneDetal(url, data, method, { | |||
| data: data, | |||
| method: method, | |||
| success: function (response) { | |||
| if (typeof success === FUNCTION_TEXT) { | |||
| success(response.data); | |||
| } | |||
| @@ -262,7 +262,6 @@ function getCOdeFromWX({ complate }) { | |||
| showLoadingHaveMask('正在加载数据..'); | |||
| wx.login({ | |||
| success: function (data) { | |||
| console.log(data) | |||
| complate(data.code); | |||
| hideLoadingHaveMask() | |||
| }, | |||