正在显示
6 个修改的文件
包含
74 行增加
和
47 行删除
| 1 | 1 | //app.js |
| 2 | +const appId = 'wxe91c67adba6ac02d'; | |
| 2 | 3 | App({ |
| 3 | 4 | onLaunch: function () { |
| 4 | 5 | var that = this; |
| ... | ... | @@ -39,7 +40,7 @@ App({ |
| 39 | 40 | data: { |
| 40 | 41 | "grant_type": "wx_app_code", |
| 41 | 42 | "code": code, |
| 42 | - "scope": "global_access:end_user,tenant:wxe91c67adba6ac02d" | |
| 43 | + "scope": "global_access:end_user,tenant:" + appId | |
| 43 | 44 | }, |
| 44 | 45 | method: "POST", |
| 45 | 46 | header: { |
| ... | ... | @@ -89,6 +90,7 @@ App({ |
| 89 | 90 | }, |
| 90 | 91 | |
| 91 | 92 | globalData: { |
| 93 | + appId: appId, | |
| 92 | 94 | onshow_count: 0, |
| 93 | 95 | baseUrl: "http://47.96.75.229:20000/", |
| 94 | 96 | // baseUrl: "https://api.workai.com.cn/", | ... | ... |
| 1 | 1 | // pages/main/addinfo/addinfo.js |
| 2 | 2 | var app = getApp(); |
| 3 | +var format = require('../../../utils/util.js'); | |
| 3 | 4 | var baseUrl = app.globalData.baseUrl; |
| 4 | 5 | Page({ |
| 5 | 6 | |
| ... | ... | @@ -54,7 +55,7 @@ Page({ |
| 54 | 55 | isrequre: true, |
| 55 | 56 | label: '是否境外人员', |
| 56 | 57 | bindtype: 'forigner', |
| 57 | - selected: '否', | |
| 58 | + placeholder: '否', | |
| 58 | 59 | disabled: true, |
| 59 | 60 | values: ["否", "是"], |
| 60 | 61 | onChange: 'onPickerSelect' |
| ... | ... | @@ -376,7 +377,6 @@ Page({ |
| 376 | 377 | birthDate: that.data.birthDate, |
| 377 | 378 | card_number: id_info.id_card_number |
| 378 | 379 | }) |
| 379 | - console.log('-cardtypeData--', that.data.cardtypeData) | |
| 380 | 380 | |
| 381 | 381 | } |
| 382 | 382 | }, |
| ... | ... | @@ -604,11 +604,17 @@ Page({ |
| 604 | 604 | // var profession_datas = this.data.professionData.values[pro_index[pro_index[0]]][0] |
| 605 | 605 | // console.log('profession_datas', profession_datas) |
| 606 | 606 | var regMobile = /^1[3|4|5|7|8][0-9]{9}$/; |
| 607 | + var regname = /^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/; | |
| 608 | + var regEmail = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); | |
| 607 | 609 | var formdata = e.detail.value; |
| 608 | 610 | console.log("formdata", formdata); |
| 611 | + console.log('idnum', this.data.card_number.length < 1&&!format.isIDCardNum(formdata.id_card_no)) | |
| 609 | 612 | if (formdata.name.length < 1) { |
| 610 | 613 | this.showtoast('请输入姓名'); |
| 611 | 614 | return |
| 615 | + } else if (!regname.test(formdata.name)) { | |
| 616 | + this.showtoast('请输入正确姓名'); | |
| 617 | + return | |
| 612 | 618 | } else if (this.data.relativeData.selected.length < 1) { |
| 613 | 619 | this.showtoast('请选择成员关系'); |
| 614 | 620 | return |
| ... | ... | @@ -618,14 +624,17 @@ Page({ |
| 618 | 624 | } else if (this.data.cardtypeData.selected.length < 1) { |
| 619 | 625 | this.showtoast('请选择证照类型'); |
| 620 | 626 | return |
| 621 | - } else if (this.data.isIdCard && this.data.card_number.length < 1) { | |
| 622 | - this.showtoast('请上传有效证件照片'); | |
| 627 | + } else if (this.data.isIdCard && (this.data.card_number.length < 1 && !format.isIDCardNum(formdata.id_card_no))) { | |
| 628 | + this.showtoast('请填写有效证件号'); | |
| 623 | 629 | return |
| 624 | 630 | } else if (!this.data.isIdCard && (!formdata.id_card_no || formdata.id_card_no.length < 1)) { |
| 625 | 631 | this.showtoast('请输入证件号码'); |
| 626 | 632 | return |
| 627 | - } else if (formdata.mobile.length < 1 || !regMobile.test(formdata.mobile) ) { | |
| 628 | - this.showtoast('请输入有效手机号'); | |
| 633 | + } else if (formdata.mobile.length < 1) { | |
| 634 | + this.showtoast('请输入手机号'); | |
| 635 | + return | |
| 636 | + } else if (!regMobile.test(formdata.mobile)){ | |
| 637 | + this.showtoast('请输入正确手机号'); | |
| 629 | 638 | return |
| 630 | 639 | } else if (this.data.investInfo.selected.length < 1) { |
| 631 | 640 | this.showtoast('请选择是否股东投资者'); |
| ... | ... | @@ -633,6 +642,9 @@ Page({ |
| 633 | 642 | } else if (this.data.specificIndustryInfo.selected.length < 1) { |
| 634 | 643 | this.showtoast('请选择是否特定行业'); |
| 635 | 644 | return |
| 645 | + } else if (formdata.email && formdata.email.length > 0 && !regEmail.test(formdata.email)){ | |
| 646 | + this.showtoast('请输入正确的邮箱'); | |
| 647 | + return | |
| 636 | 648 | } |
| 637 | 649 | var new_card_num = '' |
| 638 | 650 | if (this.data.isIdCard && this.data.card_number.length > 0) { |
| ... | ... | @@ -662,7 +674,7 @@ Page({ |
| 662 | 674 | "name": that.data.name.length > 0 ? that.data.name : formdata.name, |
| 663 | 675 | "family_ties": that.data.relativeData.selected, |
| 664 | 676 | "native": "中国", |
| 665 | - "id_card_type": that.data.relativeData.selected, | |
| 677 | + "id_card_type": that.data.cardtypeData.selected, | |
| 666 | 678 | "id_card_no": that.data.card_number, |
| 667 | 679 | "gender": that.data.genderData.selected, |
| 668 | 680 | "birth_date": Date.parse(new Date(this.data.birthday)) / 1000, | ... | ... |
| ... | ... | @@ -75,15 +75,16 @@ |
| 75 | 75 | <template is="picker_cell_normal" data="{{...cardtypeData}}" /> |
| 76 | 76 | <view class="divide_line"></view> |
| 77 | 77 | |
| 78 | - <view class='item_body' bindtap='getIdInfo'> | |
| 78 | + <view class='item_body'> | |
| 79 | 79 | <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> |
| 80 | 80 | <text class='text_black_28 float_left'>证照号码</text> |
| 81 | - <view wx:if="{{isIdCard}}" > | |
| 82 | - <image class='image_camera float_right' src='/images/camera.png'></image> | |
| 83 | - <text class='text_333_28 float_right'>{{card_number}}</text> | |
| 81 | + <view wx:if="{{isIdCard}}" > | |
| 82 | + <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo'></image> | |
| 83 | + <!-- <text class='text_333_28 float_right'>{{card_number}}</text> --> | |
| 84 | + <input class='input_wrap float_right' placeholder='请输入证件号码' placeholder-class='text_999_28' name='id_card_no' maxlength='24' value='{{card_number}}'></input> | |
| 84 | 85 | </view> |
| 85 | 86 | <view wx:else> |
| 86 | - <input class='input_wrap float_right' placeholder='请输入证件号码' placeholder-class='text_999_28' name='id_card_no' maxlength='24'></input> | |
| 87 | + <input class='input_wrap float_right' placeholder='请输入证件号码' placeholder-class='text_999_28' name='id_card_no' maxlength='24' value='{{card_number}}'></input> | |
| 87 | 88 | </view> |
| 88 | 89 | </view> |
| 89 | 90 | <view class="divide_line"></view> |
| ... | ... | @@ -313,7 +314,7 @@ |
| 313 | 314 | <view class="divide_line"></view> |
| 314 | 315 | <view class='item_body'> |
| 315 | 316 | <text class='text_666_28 float_left'>工号</text> |
| 316 | - <input class='input_wrap float_right' name='employee_no' type='number' placeholder-class='text_999_28' placeholder='请输入工号' maxlength='24'></input> | |
| 317 | + <input class='input_wrap float_right' name='employee_no' placeholder-class='text_999_28' placeholder='请输入工号' maxlength='24'></input> | |
| 317 | 318 | </view> |
| 318 | 319 | <view class="divide_line"></view> |
| 319 | 320 | <!-- <view class='item_body'> |
| ... | ... | @@ -322,8 +323,8 @@ |
| 322 | 323 | <text class='text_333_28 float_right'></text> |
| 323 | 324 | </view> --> |
| 324 | 325 | <template is="picker_cell_normal" data="{{...investpersonalInfo}}" /> |
| 325 | - <view class="divide_line" hidden="{{investpersonalInfo.selected!='是'}}"></view> | |
| 326 | - <view class='item_body' hidden="{{investpersonalInfo.selected!='是'}}"> | |
| 326 | + <view class="divide_line" hidden="{{investpersonalInfo.selected=='否'}}"></view> | |
| 327 | + <view class='item_body' hidden="{{investpersonalInfo.selected=='否'}}"> | |
| 327 | 328 | <text class='text_666_28 float_left'>个人投资总额</text> |
| 328 | 329 | <input class='input_wrap float_right' name='personal_equity_total' type='digit' placeholder-class='text_999_28' placeholder='请输入个人投资总额' maxlength='20'></input> |
| 329 | 330 | </view> | ... | ... |
| ... | ... | @@ -33,7 +33,7 @@ Page({ |
| 33 | 33 | isrequre: true, |
| 34 | 34 | label: '关系', |
| 35 | 35 | bindtype: 'relative', |
| 36 | - placeholder: '请选择关系', | |
| 36 | + placeholder: '', | |
| 37 | 37 | selected: '', |
| 38 | 38 | disabled: true, |
| 39 | 39 | values: ["子女", "配偶"], |
| ... | ... | @@ -63,7 +63,7 @@ Page({ |
| 63 | 63 | isrequre: true, |
| 64 | 64 | label: '是否境外人员', |
| 65 | 65 | bindtype: 'forigner', |
| 66 | - selected: '否', | |
| 66 | + placeholder: '否', | |
| 67 | 67 | disabled: true, |
| 68 | 68 | values: ["否", "是"], |
| 69 | 69 | onChange: 'onPickerSelect' |
| ... | ... | @@ -226,6 +226,7 @@ Page({ |
| 226 | 226 | * 生命周期函数--监听页面加载 |
| 227 | 227 | */ |
| 228 | 228 | onLoad: function(options) { |
| 229 | + | |
| 229 | 230 | console.log('options.id', options.id) |
| 230 | 231 | if (options.id && options.id.length > 0) { |
| 231 | 232 | this.setData({ |
| ... | ... | @@ -269,13 +270,14 @@ Page({ |
| 269 | 270 | }, |
| 270 | 271 | |
| 271 | 272 | //对各参数初始赋值 |
| 272 | - handleDatas: function() { | |
| 273 | + handleDatas: function() { | |
| 273 | 274 | //todo |
| 274 | - // var curdate = format.getNowFormatDate() | |
| 275 | - console.log('curdate', curdate) | |
| 275 | + var curdate = format.curDateTime() | |
| 276 | + console.log('curdate', curdate) | |
| 277 | + | |
| 276 | 278 | var tax_info = this.data.taxInfo |
| 277 | 279 | this.data.name = tax_info.name |
| 278 | - this.data.relativeData.selected = tax_info.family_ties | |
| 280 | + this.data.relativeData.placeholder = tax_info.family_ties | |
| 279 | 281 | this.data.personstatusData.selected = tax_info.taxpayer_status |
| 280 | 282 | |
| 281 | 283 | this.data.cardtypeData.selected = tax_info.id_card_type |
| ... | ... | @@ -288,7 +290,9 @@ Page({ |
| 288 | 290 | this.data.birthDate.selected = format.yearFormString(tax_info.birth_date) + '-' + format.monthFormString(tax_info.birth_date) + '-' + format.dayFormString(tax_info.birth_date) |
| 289 | 291 | this.data.professionData.selected = tax_info.profession.three_level_name |
| 290 | 292 | this.data.startDate.selected = format.yearFormString(tax_info.join_date) + '-' + format.monthFormString(tax_info.join_date) + '-' + format.dayFormString(tax_info.join_date) |
| 293 | + this.data.startDate.end = curdate | |
| 291 | 294 | this.data.endDate.selected = format.yearFormString(tax_info.separate_date) + '-' + format.monthFormString(tax_info.separate_date) + '-' + format.dayFormString(tax_info.separate_date) |
| 295 | + this.data.endDate.end = curdate | |
| 292 | 296 | this.data.degreeData.selected = tax_info.education |
| 293 | 297 | this.data.disabilityInfo.selected = tax_info.is_disability |
| 294 | 298 | this.data.lieshuInfo.selected = tax_info.is_martyr_family |
| ... | ... | @@ -737,17 +741,19 @@ Page({ |
| 737 | 741 | |
| 738 | 742 | formSubmit: function(e) { |
| 739 | 743 | console.log("date", Date.parse(new Date(this.data.birthday)) / 1000) |
| 740 | - | |
| 744 | + var regEmail = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); | |
| 741 | 745 | var formdata = e.detail.value; |
| 742 | 746 | console.log("formdata", formdata) |
| 743 | 747 | console.log("card_number", this.data.card_number) |
| 744 | 748 | if (this.data.name && this.data.name.length < 1 && formdata.name.length < 1) { |
| 745 | 749 | this.showtoast('请输入姓名'); |
| 746 | 750 | return |
| 747 | - } else if (!this.data.isself && this.data.relativeData.selected.length < 1) { | |
| 748 | - this.showtoast('请选择成员关系'); | |
| 749 | - return | |
| 750 | - } else if (this.data.personstatusData.selected.length < 1) { | |
| 751 | + } | |
| 752 | + // else if (!this.data.isself && this.data.relativeData.placeholder.length < 1) { | |
| 753 | + // this.showtoast('请选择成员关系'); | |
| 754 | + // return | |
| 755 | + // } | |
| 756 | + else if (this.data.personstatusData.selected.length < 1) { | |
| 751 | 757 | this.showtoast('请选择纳税人状态'); |
| 752 | 758 | return |
| 753 | 759 | } else if (this.data.cardtypeData.selected.length < 1) { |
| ... | ... | @@ -768,6 +774,9 @@ Page({ |
| 768 | 774 | } else if (this.data.specificIndustryInfo.selected.length < 1) { |
| 769 | 775 | this.showtoast('请选择是否特定行业'); |
| 770 | 776 | return |
| 777 | + } else if (formdata.email && formdata.email.length > 0 && !regEmail.test(formdata.email)) { | |
| 778 | + this.showtoast('请输入正确的邮箱'); | |
| 779 | + return | |
| 771 | 780 | } |
| 772 | 781 | var new_ard_num = '' |
| 773 | 782 | if (this.data.isIdCard && this.data.card_number.length > 0) { | ... | ... |
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | <view class='item_body'> |
| 14 | 14 | <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> |
| 15 | 15 | <text class='text_black_28 float_left'>姓名</text> |
| 16 | - <input class='input_wrap float_right' placeholder='请填写姓名' name='name' value='{{name}}' disabled='true'></input> | |
| 16 | + <input class='input_wrap float_right' placeholder="{{name?name:'请填写姓名'}}" name='name' disabled='true'></input> | |
| 17 | 17 | </view> |
| 18 | 18 | <view class="divide_line"></view> |
| 19 | 19 | <!-- <view class='item_body' bindtap='openpicker'> |
| ... | ... | @@ -46,7 +46,7 @@ |
| 46 | 46 | <view class='item_body' hidden="{{!isself}}"> |
| 47 | 47 | <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> |
| 48 | 48 | <text class='text_black_28 float_left'>姓名</text> |
| 49 | - <input class='input_wrap float_right' placeholder='请填写姓名' value='{{taxInfo.name}}' disabled='true'></input> | |
| 49 | + <input class='input_wrap float_right' placeholder="{{name?name:'请填写姓名'}}"disabled='true'></input> | |
| 50 | 50 | </view> |
| 51 | 51 | <view class="divide_line"></view> |
| 52 | 52 | |
| ... | ... | @@ -314,7 +314,7 @@ |
| 314 | 314 | <view class="divide_line"></view> |
| 315 | 315 | <view class='item_body '> |
| 316 | 316 | <text class='text_666_28 float_left '>工号</text> |
| 317 | - <input class='input_wrap float_right ' name='employee_no' type='number' value='{{taxInfo.employee_no}}' placeholder-class='text_999_28' placeholder='请输入工号' maxlength='20'></input> | |
| 317 | + <input class='input_wrap float_right ' name='employee_no' value='{{taxInfo.employee_no}}' placeholder-class='text_999_28' placeholder='请输入工号' maxlength='20'></input> | |
| 318 | 318 | </view> |
| 319 | 319 | <view class="divide_line"></view> |
| 320 | 320 | <!-- <view class='item_body '> |
| ... | ... | @@ -323,8 +323,8 @@ |
| 323 | 323 | <text class='text_333_28 float_right '></text> |
| 324 | 324 | </view> --> |
| 325 | 325 | <template is="picker_cell_normal" data="{{...investpersonalInfo}}" /> |
| 326 | - <view class="divide_line" hidden="{{investpersonalInfo.selected!='是'}}"></view> | |
| 327 | - <view class='item_body ' hidden="{{investpersonalInfo.selected!='是'}}"> | |
| 326 | + <view class="divide_line" hidden="{{investpersonalInfo.selected=='否'}}"></view> | |
| 327 | + <view class='item_body ' hidden="{{investpersonalInfo.selected=='否'}}"> | |
| 328 | 328 | <text class='text_666_28 float_left '>个人投资总额</text> |
| 329 | 329 | <input class='input_wrap float_right ' name='personal_equity_total' type='digit' value='{{taxInfo.personal_equity_total}}' placeholder-class='text_999_28' placeholder='请输入个人投资总额' maxlength='20'></input> |
| 330 | 330 | </view> | ... | ... |
| ... | ... | @@ -41,20 +41,22 @@ function dayFormString(dateStr) { |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | //获取当前时间,格式YYYY-MM-DD |
| 44 | -function getNowFormatDate() { | |
| 45 | - var date = new Date(); | |
| 46 | - var seperator1 = "-"; | |
| 47 | - var year = date.getFullYear(); | |
| 48 | - var month = date.getMonth() + 1; | |
| 49 | - var strDate = date.getDate(); | |
| 50 | - if (month >= 1 && month <= 9) { | |
| 51 | - month = "0" + month; | |
| 52 | - } | |
| 53 | - if (strDate >= 0 && strDate <= 9) { | |
| 54 | - strDate = "0" + strDate; | |
| 55 | - } | |
| 56 | - var currentdate = year + seperator1 + month + seperator1 + strDate; | |
| 57 | - return currentdate; | |
| 44 | +function curDateTime() { | |
| 45 | + var d = new Date(); | |
| 46 | + var year = d.getFullYear(); | |
| 47 | + var month = d.getMonth() + 1; | |
| 48 | + var date = d.getDate(); | |
| 49 | + var day = d.getDay(); | |
| 50 | + var curDateTime = year; | |
| 51 | + if (month > 9) | |
| 52 | + curDateTime = curDateTime + "-" + month; | |
| 53 | + else | |
| 54 | + curDateTime = curDateTime + "-0" + month; | |
| 55 | + if (date > 9) | |
| 56 | + curDateTime = curDateTime + "-" + date; | |
| 57 | + else | |
| 58 | + curDateTime = curDateTime + "-0" + date; | |
| 59 | + return curDateTime; | |
| 58 | 60 | } |
| 59 | 61 | |
| 60 | 62 | /** |
| ... | ... | @@ -91,5 +93,6 @@ module.exports = { |
| 91 | 93 | yearFormString: yearFormString, |
| 92 | 94 | monthFormString: monthFormString, |
| 93 | 95 | dayFormString: dayFormString, |
| 94 | - isIDCardNum: isIDCardNum | |
| 96 | + isIDCardNum: isIDCardNum, | |
| 97 | + curDateTime: curDateTime | |
| 95 | 98 | } | ... | ... |
请
注册
或
登录
后发表评论