提交 8bbeca1ed96e4b81fe418160caffd7d48917a38d

作者 wangyu
1 个父辈 552ea856

优化

... ... @@ -61,12 +61,12 @@ App({
61 61 })
62 62 } else if (user && user.type == "1") {//注册用户
63 63 if (relaunch) {
64   - wx.reLaunch({ //重新加载
65   - url: '../home/home'
66   - })
67   - // wx.redirectTo({
68   - // url: '../../getPhone/getPhone'
  64 + // wx.reLaunch({ //重新加载
  65 + // url: '../home/home'
69 66 // })
  67 + wx.reLaunch({
  68 + url: '../guide/guide'
  69 + })
70 70 }
71 71 }
72 72 },
... ...
1 1 {
2 2 "pages": [
  3 + "pages/main/guide/guide",
3 4 "pages/main/home/home",
4   -
5 5 "pages/getPhone/getPhone",
6 6 "pages/main/editinfo/editinfo",
7 7 "pages/main/addinfo/addinfo",
... ...
... ... @@ -66,7 +66,7 @@ Page({
66 66 app.globalData.wx_open_id = user.wx_open_id;
67 67
68 68 wx.reLaunch({
69   - url: '../main/home/home'
  69 + url: '../main/guide/guide'
70 70 })
71 71
72 72 } else {
... ... @@ -81,7 +81,7 @@ Page({
81 81 },
82 82 complete:function (res){
83 83 wx.reLaunch({
84   - url: '../main/home/home'
  84 + url: '../main/guide/guide'
85 85 })
86 86 }
87 87 })
... ...
... ... @@ -119,7 +119,7 @@ Page({
119 119 app.globalData.wx_open_id = user.wx_open_id;
120 120
121 121 wx.reLaunch({
122   - url: '../main/home/home'
  122 + url: '../main/guide/guide'
123 123 })
124 124 } else {
125 125 wx.showToast({
... ... @@ -133,7 +133,7 @@ Page({
133 133 },
134 134 complete: function (res) {
135 135 wx.reLaunch({
136   - url: '../main/home/home'
  136 + url: '../main/guide/guide'
137 137 })
138 138 }
139 139 })
... ...
... ... @@ -3,7 +3,7 @@ var format = require('../../../utils/util.js');
3 3 var app = getApp();
4 4 var baseUrl = app.globalData.baseUrl;
5 5 Page({
6   -
  6 +
7 7 /**
8 8 * 页面的初始数据
9 9 */
... ... @@ -22,7 +22,7 @@ Page({
22 22 mobile: '',
23 23 birthday: '',
24 24 id_error: false,
25   - curAddress_haschanged:false,
  25 + curAddress_haschanged: false,
26 26 birthAddress_haschanged: false,
27 27 contactAddress_haschanged: false,
28 28 card_number: '',
... ... @@ -166,7 +166,7 @@ Page({
166 166 selected: '',
167 167 mode: "date",
168 168 fields: "day",
169   - start:'1949-01-01',
  169 + start: '1949-01-01',
170 170 onChange: 'birthdayChange',
171 171 },
172 172 startDate: {
... ... @@ -270,21 +270,21 @@ Page({
270 270 },
271 271
272 272 //对各参数初始赋值
273   - handleDatas: function() {
  273 + handleDatas: function() {
274 274 //todo
275 275 var curdate = format.curDateTime()
276   - console.log('curdate', curdate)
  276 + console.log('curdate', curdate)
277 277
278 278 var tax_info = this.data.taxInfo
279 279 this.data.name = tax_info.name
280   - if(this.data.isself){
  280 + if (this.data.isself) {
281 281 this.data.relativeData.disabled = true
282 282 this.data.relativeData.placeholder = tax_info.family_ties
283   - }else{
  283 + } else {
284 284 this.data.relativeData.disabled = false
285 285 this.data.relativeData.selected = tax_info.family_ties
286 286 }
287   -
  287 +
288 288 this.data.personstatusData.selected = tax_info.taxpayer_status
289 289
290 290 this.data.cardtypeData.selected = tax_info.id_card_type
... ... @@ -294,7 +294,7 @@ Page({
294 294 this.data.specificIndustryInfo.selected = tax_info.is_specific_profession
295 295 //非必填
296 296 this.data.genderData.selected = tax_info.gender
297   - if (tax_info.birth_date>1000){
  297 + if (tax_info.birth_date > 1000) {
298 298 this.data.birthDate.selected = format.yearFormString(tax_info.birth_date) + '-' + format.monthFormString(tax_info.birth_date) + '-' + format.dayFormString(tax_info.birth_date)
299 299 }
300 300 if (tax_info.join_date > 1000) {
... ... @@ -303,9 +303,9 @@ Page({
303 303 if (tax_info.separate_date > 1000) {
304 304 this.data.endDate.selected = format.yearFormString(tax_info.separate_date) + '-' + format.monthFormString(tax_info.separate_date) + '-' + format.dayFormString(tax_info.separate_date)
305 305 }
306   -
  306 +
307 307 this.data.professionData.selected = tax_info.profession.three_level_name
308   -
  308 +
309 309 this.data.birthDate.end = curdate
310 310 this.data.startDate.end = curdate
311 311 this.data.endDate.end = curdate
... ... @@ -501,13 +501,14 @@ Page({
501 501 gender_Data.selected = id_info.gender
502 502
503 503 that.data.birthDate.selected = birth_day
  504 + console.log('name***card_number', that.data.name + '***' + that.data.card_number)
504 505
505 506 if (that.data.name.length > 0 && id_info.name != that.data.name) {
506 507 that.showtoast("姓名冲突")
507 508 id_error = true
508 509 return
509 510 }
510   - if (that.data.card_number.length > 0 && id_info.card_number != that.data.id_card_no) {
  511 + if (that.data.card_number.length > 0 && id_info.card_number != that.data.card_number) {
511 512 that.showtoast("证照号码冲突")
512 513 id_error = true
513 514 return
... ... @@ -711,7 +712,7 @@ Page({
711 712 contact_address.address_value = e.detail.value
712 713 contact_address.address_code = e.detail.code
713 714 this.setData({
714   - contactAddress_haschanged:true,
  715 + contactAddress_haschanged: true,
715 716 contactaddressInfo: contact_address
716 717 })
717 718 console.log('contactaddressInfo', this.data.contactaddressInfo)
... ... @@ -724,7 +725,7 @@ Page({
724 725 current_address.address_value = e.detail.value
725 726 current_address.address_code = e.detail.code
726 727 this.setData({
727   - curAddress_haschanged:true,
  728 + curAddress_haschanged: true,
728 729 currentaddressInfo: current_address
729 730 })
730 731 },
... ... @@ -769,12 +770,10 @@ Page({
769 770 } else if (!regname.test(formdata.name)) {
770 771 this.showtoast('请输入正确姓名');
771 772 return
772   - }
773   - else if (!this.data.isself && this.data.relativeData.placeholder.length < 1) {
  773 + } else if (!this.data.isself && this.data.relativeData.placeholder.length < 1) {
774 774 this.showtoast('有必填项未填写');
775 775 return
776   - }
777   - else if (this.data.personstatusData.selected.length < 1) {
  776 + } else if (this.data.personstatusData.selected.length < 1) {
778 777 this.showtoast('有必填项未填写');
779 778 return
780 779 } else if (this.data.cardtypeData.selected.length < 1) {
... ... @@ -789,7 +788,7 @@ Page({
789 788 } else if (!this.data.isIdCard && (!formdata.id_card_no || formdata.id_card_no.length < 1)) {
790 789 this.showtoast('有必填项未填写');
791 790 return
792   - } else if (formdata.mobile.length < 1) {
  791 + } else if (formdata.mobile.length < 1) {
793 792 this.showtoast('有必填项未填写');
794 793 return
795 794 } else if (this.data.investInfo.selected.length < 1) {
... ... @@ -834,11 +833,11 @@ Page({
834 833 url: baseUrl + 'persontax/v1/personal-taxes/' + that.data.cur_id,
835 834 method: "PUT",
836 835 data: {
837   - "name": formdata.name.length > 0 ? formdata.name:that.data.name ,
  836 + "name": formdata.name.length > 0 ? formdata.name : that.data.name,
838 837 "family_ties": that.data.relativeData.selected,
839 838 "native": "中国",
840 839 "id_card_type": that.data.cardtypeData.selected,
841   - "id_card_no": formdata.id_card_no ?formdata.id_card_no:that.data.card_number,
  840 + "id_card_no": formdata.id_card_no ? formdata.id_card_no : that.data.card_number,
842 841 "gender": that.data.genderData.selected,
843 842 "birth_date": that.data.long_birth_date,
844 843 "profession": request_profession,
... ... @@ -966,7 +965,7 @@ Page({
966 965 wx.showToast({
967 966 title: str,
968 967 duration: 2000,
969   - image:'/images/error.png'
  968 + image: '/images/error.png'
970 969 })
971 970 },
972 971
... ...
  1 +// pages/main/guide/guide.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + gotaxPerson:function(){
  33 + wx.navigateTo({
  34 + url: '../home/home',
  35 + })
  36 + },
  37 +
  38 + gotaxCalculate: function () {
  39 +
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面隐藏
  44 + */
  45 + onHide: function () {
  46 +
  47 + },
  48 +
  49 + /**
  50 + * 生命周期函数--监听页面卸载
  51 + */
  52 + onUnload: function () {
  53 +
  54 + },
  55 +
  56 + /**
  57 + * 页面相关事件处理函数--监听用户下拉动作
  58 + */
  59 + onPullDownRefresh: function () {
  60 +
  61 + },
  62 +
  63 + /**
  64 + * 页面上拉触底事件的处理函数
  65 + */
  66 + onReachBottom: function () {
  67 +
  68 + },
  69 +
  70 + /**
  71 + * 用户点击右上角分享
  72 + */
  73 + onShareAppMessage: function () {
  74 +
  75 + }
  76 +})
\ No newline at end of file
... ...
  1 +{
  2 + "navigationBarTitleText": "自然人税收"
  3 +}
\ No newline at end of file
... ...
  1 +<!--pages/main/guide/guide.wxml-->
  2 +
  3 +<view class='page'>
  4 + <image src='/images/tax_person.png' style='height:460rpx;width:690rpx;margin:30rpx ;align-items:center' bindtap='gotaxPerson'>
  5 + </image>
  6 + <image src='/images/tax_calculate.png' style='height:460rpx;width:690rpx;margin:0 30rpx ;align-items:center' bindtap='gotaxCalculate'>
  7 + </image>
  8 + <!-- <image class='img_wrap' src='/images/tax_calculate.png' style='margin-top:30rpx'></image> -->
  9 +</view>
\ No newline at end of file
... ...
  1 +/* pages/main/guide/guide.wxss */
  2 +
  3 +img_wrap {
  4 + width: 100%;
  5 + height: 460rpx;
  6 + align-items: center;
  7 + margin-left: 30rpx;
  8 + margin-right: 30rpx;
  9 + border-radius: 8rpx;
  10 +}
  11 +
  12 +.text_wrap1 {
  13 + position: relative;
  14 + font-family: PingFangSC-Semibold;
  15 + font-size: 30px;
  16 + color: #fff;
  17 + letter-spacing: 0;
  18 + margin-left: 90rpx;
  19 + margin-top: 20rpx
  20 +}
  21 +
  22 +text_wrap2{
  23 + font-family: PingFang-SC-Medium;
  24 +font-size: 16px;
  25 +color: #FFFFFF;
  26 +letter-spacing: 0;
  27 +}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@ Page({
8 8 */
9 9 data: {
10 10 load_finish: false,
11   - text_tip: "完善",
  11 + text_tip: "自然人信息不完善,立即完善",
12 12 taxlist: ['']
13 13 },
14 14
... ... @@ -133,7 +133,7 @@ Page({
133 133 })
134 134 } else {
135 135 this.setData({
136   - text_tip: ' 尚未录入个人信息,立即完善'
  136 + text_tip: '自然人信息不完善,立即完善'
137 137 })
138 138 }
139 139 },
... ...
... ... @@ -8,6 +8,7 @@ Page({
8 8 */
9 9 data: {
10 10 facepath: '',
  11 + already_getdata:false,
11 12 front_card_info: {},
12 13 backpath: '',
13 14 back_card_info: {},
... ... @@ -64,7 +65,7 @@ Page({
64 65 * 生命周期函数--监听页面显示
65 66 */
66 67 onShow: function() {
67   -
  68 + console.log('onShow')
68 69 },
69 70
70 71 chooseImage: function(e) {
... ... @@ -72,7 +73,7 @@ Page({
72 73 var that = this
73 74 wx.chooseImage({
74 75 sourceType: ['camera', 'album'],
75   - sizeType: ['original'],
  76 + // sizeType: ['original'],
76 77 count: 1,
77 78 success: function(res) {
78 79 console.log('success', res)
... ... @@ -102,7 +103,7 @@ Page({
102 103 filePath: path,
103 104 name: 'file',
104 105 formData: {
105   - 'key': 'imagepath_' + path.substring(path.length - 10, path.length)+".png",
  106 + 'key': 'imagepath_' + path.substring(path.length - 15, path.length),
106 107 'OSSAccessKeyId': OSSInit.access_key_id,
107 108 'policy': OSSInit.policy,
108 109 'signature': OSSInit.signature,
... ... @@ -186,13 +187,15 @@ Page({
186 187 },
187 188 success: function(res) {
188 189 console.log('suc', res)
189   - if (res.statusCode == 300) {
  190 + if (res.statusCode == 200) {
190 191 that.setData({
  192 + already_getdata:true,
191 193 idInfo: res.data.item
192 194 })
193 195 console.log('suc', that.data.idInfo)
194 196 } else {
195 197 wx.showModal({
  198 + showCancel: false,
196 199 title: '',
197 200 content: res.data.message ? res.data.message : "数据错误",
198 201 })
... ... @@ -209,13 +212,22 @@ Page({
209 212 },
210 213
211 214 savedata: function() {
212   - wx.setStorage({
213   - key: 'id_info',
214   - data: JSON.stringify(this.data.idInfo),
215   - })
216   - wx.navigateBack({
217   - delta: 1
218   - })
  215 + if (this.data.already_getdata){
  216 + wx.setStorage({
  217 + key: 'id_info',
  218 + data: JSON.stringify(this.data.idInfo),
  219 + })
  220 + wx.navigateBack({
  221 + delta: 1
  222 + })
  223 + }else{
  224 + wx.showModal({
  225 + showCancel:false,
  226 + title: '',
  227 + content: "未能获取到信息,不能保存",
  228 + })
  229 + }
  230 +
219 231 },
220 232
221 233 /**
... ... @@ -229,6 +241,7 @@ Page({
229 241 * 生命周期函数--监听页面卸载
230 242 */
231 243 onUnload: function() {
  244 + console.log('onUnload')
232 245 // wx.showModal({
233 246 // title: '',
234 247 // content: '\n您的信息还未保存是否确认返回?\n',
... ...
注册登录 后发表评论