提交 db3e7c79d27cdc3b2fae79bef3cc45a7542fc4a5

作者 wangyu
1 个父辈 d9b8a039

优化逻辑

@@ -6,7 +6,7 @@ Page({ @@ -6,7 +6,7 @@ Page({
6 6
7 7
8 data: { 8 data: {
9 - year: 2019, 9 + year: "2019",
10 unit_id:"", 10 unit_id:"",
11 }, 11 },
12 12
@@ -49,18 +49,58 @@ Page({ @@ -49,18 +49,58 @@ Page({
49 method: "POST", 49 method: "POST",
50 data: { 50 data: {
51 "declaring_unit_id":that.data.unit_id, 51 "declaring_unit_id":that.data.unit_id,
52 - "item": request_data, 52 + "item": {
  53 + "total_salary": that.parseToFloat(request_data.total_salary), //工资薪金,
  54 + "remuneration_labor": that.parseToFloat(request_data.setData), //劳务报酬,
  55 + "author_payment": that.parseToFloat(request_data.remuneration_labor), //稿酬,
  56 + "special_manage_cost": that.parseToFloat(request_data.special_manage_cost), //特许经营权使用费,
  57 + "other_free_income": that.parseToFloat(request_data.other_free_income), //其他免税收入,
  58 +
  59 + "personal_endowment": that.parseToFloat(request_data.personal_endowment), //基本养老保险,
  60 + "personal_medical": that.parseToFloat(request_data.personal_medical), //基本医疗保险,
  61 + "personal_unemployment": that.parseToFloat(request_data.personal_unemployment), //失业险,
  62 + "personal_house_fund": that.parseToFloat(request_data.personal_house_fund), //住房公积金,
  63 + "childrens_education": that.parseToFloat(request_data.childrens_education), //子女教育支出,
  64 + "caring_old_people": that.parseToFloat(request_data.caring_old_people), //赡养老人
  65 + "housing_loan_interest": that.parseToFloat(request_data.housing_loan_interest), //住房贷款利息支出
  66 + "housing_rent": that.parseToFloat(request_data.housing_rent), //住房租金支出
  67 + "serious_illness_medical": that.parseToFloat(request_data.serious_illness_medical),//大病医疗支出
  68 + "continuing_education": that.parseToFloat(request_data.continuing_education), //继续教育支出
  69 +
  70 + "annuity": that.parseToFloat(request_data.annuity), //年金
  71 + "commercial_insurance": that.parseToFloat(request_data.commercial_insurance), //商业健康保险
  72 + "tax_extension": that.parseToFloat(request_data.tax_extension), //税延养老保险
  73 + "other_fee": that.parseToFloat(request_data.other_fee),//其他税前扣除额
  74 + "donation_deducted": that.parseToFloat(request_data.donation_deducted), //准予扣除的捐赠
  75 + "years_bouns": that.parseToFloat(request_data.years_bouns), //全年一次性奖金
  76 +
  77 + "tax_savings": that.parseToFloat(request_data.tax_savings), //减免税额
  78 + "accumulated_withholding_tax": that.parseToFloat(request_data.accumulated_withholding_tax), //应扣缴税额
  79 + },
53 "years": that.data.year 80 "years": that.data.year
54 }, 81 },
55 success: function(result) { 82 success: function(result) {
56 console.log("refund", result) 83 console.log("refund", result)
57 if (result.statusCode == 200) { 84 if (result.statusCode == 200) {
58 that.showToast("提交成功!") 85 that.showToast("提交成功!")
  86 + wx.navigateBack({
  87 + delta:1
  88 + })
59 } 89 }
60 }, 90 },
61 }) 91 })
62 }, 92 },
63 93
  94 + parseToFloat(s){
  95 + if(s&&s.length>0){
  96 + var num = parseFloat(s)
  97 + return Math.round(num*100)/100
  98 + }else{
  99 + return 0
  100 + }
  101 +
  102 + },
  103 +
64 showToast: function(data) { 104 showToast: function(data) {
65 if (data && data.length > 0) { 105 if (data && data.length > 0) {
66 wx.showToast({ 106 wx.showToast({
@@ -7,25 +7,29 @@ Page({ @@ -7,25 +7,29 @@ Page({
7 7
8 data: { 8 data: {
9 year: "2019", 9 year: "2019",
10 - declare_status: "", //申报状态"0" //待申报 "1" //申报成功  
11 - refund_status: "", //退税状态 "0" 无需退税; "1" 待退税;"2" 退税中;"3" 退税成功;"4"退税失败;"5"放弃退税  
12 - pay_status: "", //补税状态 "0" 无需补税; "1" 待补税;"2" 补税成功 10 + declare_status: "", //申报状态"0" //待申报 "1" //申报成功 “2” 申报中
  11 + refund_status: "", //退税状态 "0" 无需退税; "1" 待退税;"2" 退税中"3" 退税成功;"4"退税失败;"5"放弃退税;
  12 + pay_status: "", //补税状态 "0" 豁免; "1" 待补税;"2" 补税成功
13 declaring_unit_status: "", //1:本单位申报,2:本单位其他申报,3:其他单位申报,4:待确认申报//用户自行申报 13 declaring_unit_status: "", //1:本单位申报,2:本单位其他申报,3:其他单位申报,4:待确认申报//用户自行申报
14 payinfo: {}, 14 payinfo: {},
15 unitInfo: [], 15 unitInfo: [],
16 showUnit: false, 16 showUnit: false,
17 declaring_unit_id: "", 17 declaring_unit_id: "",
  18 + declaring_unit:"",
18 showModal_selfDeclare: false, 19 showModal_selfDeclare: false,
19 uniqual_title01:"", 20 uniqual_title01:"",
  21 + uniqual_content01: "",
  22 + declare_text_extra: "",//请等候申报结果
20 new_refund_tax:0, 23 new_refund_tax:0,
21 declare_end_date:"", 24 declare_end_date:"",
22 declare_end_days: 0, 25 declare_end_days: 0,
23 show_other_unit_view:false, 26 show_other_unit_view:false,
  27 + exempt_status:""
24 }, 28 },
25 29
26 30
27 onLoad: function(options) { 31 onLoad: function(options) {
28 - this.getPayInfo(); 32 +
29 }, 33 },
30 34
31 35
@@ -35,7 +39,7 @@ Page({ @@ -35,7 +39,7 @@ Page({
35 39
36 40
37 onShow: function() { 41 onShow: function() {
38 - 42 + this.getPayInfo();
39 }, 43 },
40 44
41 yearPick: function() { 45 yearPick: function() {
@@ -55,24 +59,17 @@ Page({ @@ -55,24 +59,17 @@ Page({
55 }, 59 },
56 success: function(result) { 60 success: function(result) {
57 console.log("payinfo", result) 61 console.log("payinfo", result)
58 - var text01="应补退税额"  
59 if (result.statusCode == 200) { 62 if (result.statusCode == 200) {
60 - if (that.data.declare_status=='1'){//申报成功  
61 - if (result.data.refund_tax > 0 || result.data.refund_tax == 0){  
62 - text01="应补税额"  
63 - } else {  
64 - text01 = "应退税额"  
65 - }  
66 - } 63 + that.updateText(result.data)
67 that.setData({ 64 that.setData({
68 declare_status: result.data.declare_status, 65 declare_status: result.data.declare_status,
69 refund_status: result.data.refund_status, 66 refund_status: result.data.refund_status,
70 pay_status: result.data.pay_status, 67 pay_status: result.data.pay_status,
71 declaring_unit_status: result.data.declaring_unit_status, 68 declaring_unit_status: result.data.declaring_unit_status,
72 new_refund_tax: Math.abs(result.data.refund_tax), 69 new_refund_tax: Math.abs(result.data.refund_tax),
73 - uniqual_title01:text01,  
74 declare_end_date: format.yearFormString(result.data.declare_end_time) + "年" + format.monthFormString(result.data.declare_end_time) + "月" + format.dayFormString(result.data.declare_end_time) + "日", 70 declare_end_date: format.yearFormString(result.data.declare_end_time) + "年" + format.monthFormString(result.data.declare_end_time) + "月" + format.dayFormString(result.data.declare_end_time) + "日",
75 declare_end_days: format.daysTillNow(Date.parse(new Date())/1000,result.data.declare_end_time), 71 declare_end_days: format.daysTillNow(Date.parse(new Date())/1000,result.data.declare_end_time),
  72 + exempt_status: result.data.exempt,
76 payinfo: result.data 73 payinfo: result.data
77 }) 74 })
78 } 75 }
@@ -146,7 +143,7 @@ Page({ @@ -146,7 +143,7 @@ Page({
146 method: "PUT", 143 method: "PUT",
147 data: { 144 data: {
148 "years": that.data.year, 145 "years": that.data.year,
149 - 'refund_status': '' 146 + 'refund_status': s
150 }, 147 },
151 success: function(result) { 148 success: function(result) {
152 console.log("refund", result) 149 console.log("refund", result)
@@ -231,8 +228,10 @@ Page({ @@ -231,8 +228,10 @@ Page({
231 228
232 unitPick: function(e) { //选择申报单位 229 unitPick: function(e) { //选择申报单位
233 console.log("unitPick", e) 230 console.log("unitPick", e)
  231 + var info_arr = e.currentTarget.id.split("~")
234 this.setData({ 232 this.setData({
235 - declaring_unit_id: e.currentTarget.id, 233 + declaring_unit_id: info_arr[1] ,
  234 + declaring_unit: info_arr[0],
236 showUnit: false, 235 showUnit: false,
237 show_other_unit_view:true, 236 show_other_unit_view:true,
238 }) 237 })
@@ -257,7 +256,7 @@ Page({ @@ -257,7 +256,7 @@ Page({
257 }, 256 },
258 257
259 noOtherUnitInfo: function() { //没有其他单位个税申报 258 noOtherUnitInfo: function() { //没有其他单位个税申报
260 - this.updateDeclareState(e.currentTarget.id) 259 + this.updateDeclareState(this.data.declaring_unit_id)
261 this.setData({ 260 this.setData({
262 show_other_unit_view:false 261 show_other_unit_view:false
263 }) 262 })
@@ -281,6 +280,7 @@ Page({ @@ -281,6 +280,7 @@ Page({
281 280
282 // 放弃退税 281 // 放弃退税
283 doNotRefund: function() { 282 doNotRefund: function() {
  283 + var that = this
284 wx.showModal({ 284 wx.showModal({
285 title: '确认放弃退税吗?', 285 title: '确认放弃退税吗?',
286 content: '', 286 content: '',
@@ -288,7 +288,7 @@ Page({ @@ -288,7 +288,7 @@ Page({
288 success(res) { 288 success(res) {
289 if (res.confirm) { 289 if (res.confirm) {
290 console.log('用户点击确定') 290 console.log('用户点击确定')
291 - this.forgiveRefund("5") 291 + that.forgiveRefund("5")
292 } else if (res.cancel) { 292 } else if (res.cancel) {
293 console.log('用户点击取消') 293 console.log('用户点击取消')
294 } 294 }
@@ -296,6 +296,48 @@ Page({ @@ -296,6 +296,48 @@ Page({
296 }) 296 })
297 }, 297 },
298 298
  299 + updateText:function(data){
  300 + var text = ""
  301 + var text_status = ""
  302 + var text_title = "应补退税额"
  303 + if (data.declare_status=='1'){//申报中
  304 + text = "请等候申报结果"
  305 + } else {//申报成功
  306 + if (data.refund_tax > 0 || data.refund_tax == 0) {
  307 + text_title = "应补税额"
  308 + } else {
  309 + text_title = "应退税额"
  310 + }
  311 +
  312 + if (data.refund_status == "1") {
  313 + text = "请确认是否申请退款?"
  314 + } else if (data.refund_status == '2') {
  315 + text = "申请退税中"
  316 + text_status = "退税中"
  317 + } else if (data.refund_status == '4') {
  318 + text = "退税失败,请确认您的银行卡信息是否正确?"
  319 + text_status = "退税失败"
  320 + } else if (data.refund_status == '5') {
  321 + text = "您已放弃退税"
  322 + text_status = "已放弃"
  323 + } else if (data.exempt == 'yes') {
  324 + text = "您已享受豁免"
  325 + text_status = "豁免"
  326 + } else if (data.pay_status == '1') {
  327 + text = "请等待企业为您代缴税款"
  328 + text_status = "待缴款"
  329 + } else if (data.pay_status == '2') {
  330 + text = "单位已为您代缴税款"
  331 + text_status = "已缴款"
  332 + }
  333 + }
  334 + this.setData({
  335 + declare_text_extra:text,
  336 + uniqual_content01:text_status,
  337 + uniqual_title01: text_title,
  338 + })
  339 + },
  340 +
299 onHide: function() { 341 onHide: function() {
300 342
301 }, 343 },
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <image class="arrow_wrap" src="/images/arrow_down.png"></image> 8 <image class="arrow_wrap" src="/images/arrow_down.png"></image>
9 </view> 9 </view>
10 </view> 10 </view>
11 - <scroll-view style="margin-bottom: 360rpx;"> 11 + <scroll-view style="padding-bottom: 360rpx;">
12 <view style="background:#fff;padding:30rpx 30rpx 50rpx 30rpx;margin-top:20rpx"> 12 <view style="background:#fff;padding:30rpx 30rpx 50rpx 30rpx;margin-top:20rpx">
13 <text class="text_gray3_26">了解汇算清缴具体内容,请阅读 </text> 13 <text class="text_gray3_26">了解汇算清缴具体内容,请阅读 </text>
14 <text class="text_blue_26" bindtap="skipH5_01"> 《2019年度汇算清缴事项公告》 </text> 14 <text class="text_blue_26" bindtap="skipH5_01"> 《2019年度汇算清缴事项公告》 </text>
@@ -29,15 +29,15 @@ @@ -29,15 +29,15 @@
29 <text class="text_gray6_28">您已选择自行申报,可继续查看在本单位的个税申报记录 </text> 29 <text class="text_gray6_28">您已选择自行申报,可继续查看在本单位的个税申报记录 </text>
30 </view> 30 </view>
31 <view wx:else> 31 <view wx:else>
32 - <text class="text_gray6_28">您选择在 北京小爱智能科技有限公司 完成2019年度的个人综合所得汇算清缴。 </text> 32 + <text class="text_gray6_28">您选择在 {{declaring_unit}} 完成2019年度的个人综合所得汇算清缴。 </text>
33 </view> 33 </view>
34 </view> 34 </view>
35 35
36 <view wx:if="{{declaring_unit_status!='4'&&declaring_unit_status!='5'&&!show_other_unit_view}}" style="background:#fff;padding:30rpx 30rpx 50rpx 30rpx;"> 36 <view wx:if="{{declaring_unit_status!='4'&&declaring_unit_status!='5'&&!show_other_unit_view}}" style="background:#fff;padding:30rpx 30rpx 50rpx 30rpx;">
37 - <text class="text_black_bold">{{declare_status=='0'?'汇算清缴申报中…':'汇算清缴申报完成!'}}</text>  
38 - <view style="display: flex;margin:20rpx 0"> 37 + <text class="text_black_bold">{{declare_status=='1'?'汇算清缴申报中…':'汇算清缴申报完成!'}}</text>
  38 + <view hidden="{{declare_text_extra.length<1}}" style="display: flex;margin:20rpx 0">
39 <image style="width:28rpx;height:28rpx;margin-right:12rpx;margin-top:4rpx" src="/images/warn_yellow.png"></image> 39 <image style="width:28rpx;height:28rpx;margin-right:12rpx;margin-top:4rpx" src="/images/warn_yellow.png"></image>
40 - <text class="text_gray6_28">请等候申报结果 </text> 40 + <text class="text_gray6_28">{{declare_text_extra}} </text>
41 </view> 41 </view>
42 <view class="divide_line_f5f5f5"></view> 42 <view class="divide_line_f5f5f5"></view>
43 <view style="margin-top:20rpx"> 43 <view style="margin-top:20rpx">
@@ -60,23 +60,23 @@ @@ -60,23 +60,23 @@
60 <view class="divide_line_f5f5f5"></view> 60 <view class="divide_line_f5f5f5"></view>
61 <view style="margin:20rpx 0"> 61 <view style="margin:20rpx 0">
62 <text class="text_black_bold">{{uniqual_title01}}:</text> 62 <text class="text_black_bold">{{uniqual_title01}}:</text>
63 - <text wx:if="{{declare_status=='0'}}" class="text_gray3_28 float_right" style="line-height:50rpx">计算中</text> 63 + <text wx:if="{{declare_status=='1'}}" class="text_gray3_28 float_right" style="line-height:50rpx">计算中</text>
64 <text wx:else class="text_orange_28 float_right" style="line-height:50rpx">¥{{new_refund_tax}}</text> 64 <text wx:else class="text_orange_28 float_right" style="line-height:50rpx">¥{{new_refund_tax}}</text>
65 - <view wx:if="{{refund_status=='5'}}" class="light_gray_bg">  
66 - <text style="font-size:11px;color:rgba(0,0,0,0.35);margin: 0 auto">已放弃</text> 65 + <view wx:if="{{uniqual_content01=='已放弃'}}" class="light_gray_bg">
  66 + <text style="font-size:11px;color:rgba(0,0,0,0.35);margin: 0 auto">{{uniqual_content01}}</text>
67 </view> 67 </view>
68 - <view wx:elif="{{refund_status=='4'}}" class="light_red_bg">  
69 - <text style="font-size:11px;color:#fff;margin: 0 auto">退税失败</text> 68 + <view wx:elif="{{uniqual_content01=='退税失败'}}" class="light_red_bg">
  69 + <text style="font-size:11px;color:#fff;margin: 0 auto">{{uniqual_content01}}</text>
70 </view> 70 </view>
71 - <view wx:elif="{{refund_status=='4'}}" class="light_yellow_bg">  
72 - <text style="font-size:11px;color:#fff;margin: 0 auto">申请中</text> 71 + <view wx:else class="light_yellow_bg">
  72 + <text style="font-size:11px;color:#fff;margin: 0 auto">{{uniqual_content01}}</text>
73 </view> 73 </view>
74 </view> 74 </view>
75 <view class="divide_line_f5f5f5"></view> 75 <view class="divide_line_f5f5f5"></view>
76 <view class="text_blue_28 float_right" style="line-height:50rpx;" bindtap="finalpay_detail">查看详情</view> 76 <view class="text_blue_28 float_right" style="line-height:50rpx;" bindtap="finalpay_detail">查看详情</view>
77 </view> 77 </view>
78 </scroll-view> 78 </scroll-view>
79 - <view wx:if="{{declaring_unit_status=='4'}}" style="width:100%;height:300rpx;position: fixed;bottom: 0;background-color:#fff"> 79 + <view wx:if="{{declaring_unit_status=='4'&&!show_other_unit_view}}" style="width:100%;height:300rpx;position: fixed;bottom: 0;background-color:#fff">
80 <view style="display: flex;justify-content: center;margin-top:20rpx"> 80 <view style="display: flex;justify-content: center;margin-top:20rpx">
81 <text class="text_gray6_28">距离确认是否在本单位进行汇算清缴时间还有 </text> 81 <text class="text_gray6_28">距离确认是否在本单位进行汇算清缴时间还有 </text>
82 <text class="text_yellow_28"> {{declare_end_days}} </text> 82 <text class="text_yellow_28"> {{declare_end_days}} </text>
@@ -146,7 +146,7 @@ @@ -146,7 +146,7 @@
146 <view wx:if="{{showUnit&&unitInfo.length>0}}" style="background-color:#fff"> 146 <view wx:if="{{showUnit&&unitInfo.length>0}}" style="background-color:#fff">
147 <view class="text_gray3_34" style="padding:30rpx">选择申报单位</view> 147 <view class="text_gray3_34" style="padding:30rpx">选择申报单位</view>
148 <view class="divide_line"></view> 148 <view class="divide_line"></view>
149 - <view wx:for="{{unitInfo}}" style="height:104rpx;margin-left:50rpx;margin-right:30rpx" bindtap="unitPick" id="{{item.declaring_unit_id}}"> 149 + <view wx:for="{{unitInfo}}" style="height:104rpx;margin-left:50rpx;margin-right:30rpx" bindtap="unitPick" id="{{item.declaring_unit}}~{{item.declaring_unit_id}}" >
150 <text class="text_gray3_32" style="line-height:104rpx">{{item.declaring_unit}}</text> 150 <text class="text_gray3_32" style="line-height:104rpx">{{item.declaring_unit}}</text>
151 <image class="icon_choosed" hidden="true" src="/images/icon_chat_choosed.png"></image> 151 <image class="icon_choosed" hidden="true" src="/images/icon_chat_choosed.png"></image>
152 <view class="divide_line"></view> 152 <view class="divide_line"></view>
@@ -8,7 +8,7 @@ Page({ @@ -8,7 +8,7 @@ Page({
8 */ 8 */
9 data: { 9 data: {
10 currentTab:1, 10 currentTab:1,
11 - year:2019, 11 + year:"2019",
12 incomeInfo:{}, 12 incomeInfo:{},
13 }, 13 },
14 14
1 // pages/main/finalpay/refundInfo/refundInfo.js 1 // pages/main/finalpay/refundInfo/refundInfo.js
  2 +var OSSInit;
2 var app = getApp(); 3 var app = getApp();
3 var baseUrl = app.globalData.baseUrl; 4 var baseUrl = app.globalData.baseUrl;
  5 +var format = require('../../../../utils/util.js');
4 Page({ 6 Page({
5 7
6 /** 8 /**
7 * Page initial data 9 * Page initial data
8 */ 10 */
9 data: { 11 data: {
10 - show_modal:false 12 + name: '',
  13 + bank: '',
  14 + bank_card_no: '',
  15 + bank_card_province: '',
  16 + show_modal: false
11 }, 17 },
12 18
13 /** 19 /**
@@ -15,6 +21,11 @@ Page({ @@ -15,6 +21,11 @@ Page({
15 */ 21 */
16 onLoad: function(options) { 22 onLoad: function(options) {
17 this.initOSS() 23 this.initOSS()
  24 + var userinfo = app.globalData.userInfo
  25 + console.log("userinfo", userinfo)
  26 + this.setData({
  27 + name: userinfo ? userinfo.name : ""
  28 + })
18 }, 29 },
19 30
20 /** 31 /**
@@ -70,13 +81,22 @@ Page({ @@ -70,13 +81,22 @@ Page({
70 count: 1, 81 count: 1,
71 success: function(res) { 82 success: function(res) {
72 console.log('success', res) 83 console.log('success', res)
73 - that.ocrBankImage(res.tempFilePaths[0]) 84 + wx.showLoading({
  85 + title: "识别中"
  86 + })
  87 + wx.getFileSystemManager().readFile({
  88 + filePath: res.tempFilePaths[0], // 选择图片返回的相对路径
  89 + encoding: 'base64', // 编码格式
  90 + success: res => { // 成功的回调
  91 + that.ocrBankImage(res.data)
  92 + }
  93 + })
74 } 94 }
75 }) 95 })
76 }, 96 },
77 97
78 // 识别银行卡照片 98 // 识别银行卡照片
79 - ocrBankImage: function(path) { 99 + ocrBankImage: function(imginfo) {
80 var that = this 100 var that = this
81 this.Authorization = getApp().globalData.Authorization; 101 this.Authorization = getApp().globalData.Authorization;
82 wx.request({ 102 wx.request({
@@ -86,33 +106,64 @@ Page({ @@ -86,33 +106,64 @@ Page({
86 'Authorization': this.Authorization 106 'Authorization': this.Authorization
87 }, 107 },
88 data: { 108 data: {
89 - "image": path 109 + "image": imginfo
90 }, 110 },
91 success: function(result) { 111 success: function(result) {
92 - console.log("payinfo", result) 112 + console.log("bankinfo", result)
93 if (result.statusCode == 200) { 113 if (result.statusCode == 200) {
94 - 114 + wx.hideLoading()
  115 + that.setData({
  116 + bank: result.data.bank.split("银行")[0] + "银行",
  117 + bank_card_no: result.data.bank_card_no
  118 + })
95 } 119 }
96 }, 120 },
97 }) 121 })
98 }, 122 },
99 123
  124 + bindRegionChange: function (e) {
  125 + console.log('picker发送选择改变,携带值为', e.detail.value)
  126 + this.setData({
  127 + region: e.detail.value
  128 + })
  129 + },
  130 +
100 formSubmit: function(e) { 131 formSubmit: function(e) {
101 - console.log("formSubmit", e);  
102 var formdata = e.detail.value 132 var formdata = e.detail.value
  133 + console.log("formdata", formdata);
  134 + if (formdata.name.length < 1) {
  135 + this.showToast("请输入姓名")
  136 + return
  137 + }
  138 + if (formdata.bank_card_no.length < 1) {
  139 + this.showToast("请输入银行卡号")
  140 + return
  141 + }
  142 + if (!format.banknoCheck(formdata.bank_card_no)) {
  143 + this.showToast('银行卡号格式有误')
  144 + return
  145 + }
  146 + if (formdata.bank.length < 1) {
  147 + this.showToast("请输入银行名称")
  148 + return
  149 + }
  150 + if (!formdata.bank_card_province.length < 1) {
  151 + this.showToast("请输入开户银行省份")
  152 + return
  153 + }
103 this.setData({ 154 this.setData({
104 - show_modal:true 155 + show_modal: true
105 }) 156 })
106 }, 157 },
107 158
108 - commitCancel:function(){ 159 + commitCancel: function() {
109 this.setData({ 160 this.setData({
110 show_modal: false 161 show_modal: false
111 }) 162 })
112 }, 163 },
113 164
114 165
115 - commitConfirm: function () { 166 + commitConfirm: function() {
116 this.setData({ 167 this.setData({
117 show_modal: false 168 show_modal: false
118 }) 169 })
@@ -124,14 +175,14 @@ Page({ @@ -124,14 +175,14 @@ Page({
124 header: { 175 header: {
125 'Authorization': this.Authorization 176 'Authorization': this.Authorization
126 }, 177 },
127 - method:"PUT", 178 + method: "PUT",
128 data: { 179 data: {
129 'name': '', 180 'name': '',
130 "bank": '', 181 "bank": '',
131 "bank_card_no": '', 182 "bank_card_no": '',
132 "bank_card_province": '' 183 "bank_card_province": ''
133 }, 184 },
134 - success: function (result) { 185 + success: function(result) {
135 console.log("submit", result) 186 console.log("submit", result)
136 if (result.statusCode == 200) { 187 if (result.statusCode == 200) {
137 that.setData({ 188 that.setData({
@@ -140,7 +191,18 @@ Page({ @@ -140,7 +191,18 @@ Page({
140 } 191 }
141 }, 192 },
142 }) 193 })
143 - }, 194 + },
  195 +
  196 + showToast: function(data) {
  197 + if (data && data.length > 0) {
  198 + wx.showToast({
  199 + title: data,
  200 + icon: "none",
  201 + duration: 2000
  202 + })
  203 + }
  204 + },
  205 +
144 206
145 /** 207 /**
146 * Lifecycle function--Called when page hide 208 * Lifecycle function--Called when page hide
@@ -3,24 +3,33 @@ @@ -3,24 +3,33 @@
3 <form style="width:100%;" bindsubmit='formSubmit'> 3 <form style="width:100%;" bindsubmit='formSubmit'>
4 <view style="height:104rpx;padding:0 30rpx;background-color:#fff;margin-bottom:1rpx"> 4 <view style="height:104rpx;padding:0 30rpx;background-color:#fff;margin-bottom:1rpx">
5 <text class="text_gray7_34">开户人姓名</text> 5 <text class="text_gray7_34">开户人姓名</text>
6 - <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='name' value="汪闲僧"></input> 6 + <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='name' value="{{name}}"></input>
7 </view> 7 </view>
8 <view class='divide_line_30'></view> 8 <view class='divide_line_30'></view>
9 <view style="height:104rpx;padding:0 30rpx;background-color:#fff"> 9 <view style="height:104rpx;padding:0 30rpx;background-color:#fff">
10 <text class="text_gray7_34" style="line-height:104rpx">银行卡号</text> 10 <text class="text_gray7_34" style="line-height:104rpx">银行卡号</text>
11 <image class='image_camera' src='/images/camera.png' bindtap='bindbank'></image> 11 <image class='image_camera' src='/images/camera.png' bindtap='bindbank'></image>
12 - <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='bank_card_no'></input> 12 + <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='bank_card_no' value="{{bank_card_no}}" maxlength='19' type='number'></input>
13 </view> 13 </view>
14 <view class='divide_line_30'></view> 14 <view class='divide_line_30'></view>
15 <view style="height:104rpx;padding:0 30rpx;background-color:#fff"> 15 <view style="height:104rpx;padding:0 30rpx;background-color:#fff">
16 <text class="text_gray7_34" style="line-height:104rpx">开户银行名称</text> 16 <text class="text_gray7_34" style="line-height:104rpx">开户银行名称</text>
17 - <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='bank'></input> 17 + <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='bank' value="{{bank}}"></input>
18 </view> 18 </view>
19 <view class='divide_line_30'></view> 19 <view class='divide_line_30'></view>
20 - <view style="height:104rpx;padding:0 30rpx;background-color:#fff"> 20 + <!-- <view style="height:104rpx;padding:0 30rpx;background-color:#fff">
21 <text class="text_gray7_34" style="line-height:104rpx">开户银行省份</text> 21 <text class="text_gray7_34" style="line-height:104rpx">开户银行省份</text>
22 - <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='bank_card_province'></input>  
23 - </view> 22 + <input class='input_wrap' style='text-align: right;color:#000;' placeholder='请输入' name='bank_card_province' value="{{bank_card_province}}"></input>
  23 + </view> -->
  24 +
  25 + <picker style="height:104rpx;padding:0 30rpx;background-color:#fff" mode="province" bindchange="bindRegionChange" value="{{region}}">
  26 + <text class="text_gray7_34">开户银行省份</text>
  27 + <view class="input_wrap rigion_notchoosed}}">
  28 + 请选择 </view>
  29 + <view class="input_wrap rigion_choosed">
  30 + {{region[0]}}
  31 + </view>
  32 + </picker>
24 33
25 <view class="btn_bottom"> 34 <view class="btn_bottom">
26 <button class="btn_bottom" formType="submit">保存</button> 35 <button class="btn_bottom" formType="submit">保存</button>
@@ -31,20 +40,20 @@ @@ -31,20 +40,20 @@
31 <!-- <view style='width:100%;display:flex;flex-direction:column;max-height:560rpx;overflow-y: scroll;'></view> --> 40 <!-- <view style='width:100%;display:flex;flex-direction:column;max-height:560rpx;overflow-y: scroll;'></view> -->
32 <view class="text_title"> 确认提交吗?</view> 41 <view class="text_title"> 确认提交吗?</view>
33 <view style="margin:2rpx 40rpx"> 42 <view style="margin:2rpx 40rpx">
34 - <text class="text_gray6_28">姓名:</text>  
35 - <text class="text_gray6_28 float_right">张三</text> 43 + <text class="text_gray6_28">姓名:</text>
  44 + <text class="text_gray6_28 float_right">{{name}}</text>
36 </view> 45 </view>
37 <view style="margin:2rpx 40rpx"> 46 <view style="margin:2rpx 40rpx">
38 - <text class="text_gray6_28">银行卡号:</text>  
39 - <text class="text_gray6_28 float_right">4832588325825925</text> 47 + <text class="text_gray6_28">银行卡号:</text>
  48 + <text class="text_gray6_28 float_right">{{bank_card_no}}</text>
40 </view> 49 </view>
41 <view style="margin:2rpx 40rpx"> 50 <view style="margin:2rpx 40rpx">
42 - <text class="text_gray6_28">开户行名称:</text>  
43 - <text class="text_gray6_28 float_right">中国邮政储蓄银行</text> 51 + <text class="text_gray6_28">开户行名称:</text>
  52 + <text class="text_gray6_28 float_right">{{bank}}</text>
44 </view> 53 </view>
45 <view style="margin:2rpx 40rpx"> 54 <view style="margin:2rpx 40rpx">
46 - <text class="text_gray6_28">开户行省份:</text>  
47 - <text class="text_gray6_28 float_right">湖北</text> 55 + <text class="text_gray6_28">开户行省份:</text>
  56 + <text class="text_gray6_28 float_right">{{bank_card_province}}</text>
48 </view> 57 </view>
49 <view class='divide_line_f5f5f5' style="margin-top:30rpx"></view> 58 <view class='divide_line_f5f5f5' style="margin-top:30rpx"></view>
50 59
@@ -33,11 +33,19 @@ @@ -33,11 +33,19 @@
33 color: #fff; 33 color: #fff;
34 text-align: right; 34 text-align: right;
35 overflow: hidden; 35 overflow: hidden;
36 - text-overflow: ellipsis;  
37 - white-space: nowrap;  
38 float: right; 36 float: right;
39 } 37 }
40 38
  39 +.rigion_choosed{
  40 + color:#000;
  41 + line-height:104rpx
  42 +}
  43 +
  44 +.rigion_notchoosed{
  45 + color:#777;
  46 + line-height:104rpx
  47 +}
  48 +
41 .image_camera { 49 .image_camera {
42 width: 42rpx; 50 width: 42rpx;
43 height: 42rpx; 51 height: 42rpx;
注册登录 后发表评论