提交 8bbeca1ed96e4b81fe418160caffd7d48917a38d

作者 wangyu
1 个父辈 552ea856

优化

@@ -61,12 +61,12 @@ App({ @@ -61,12 +61,12 @@ App({
61 }) 61 })
62 } else if (user && user.type == "1") {//注册用户 62 } else if (user && user.type == "1") {//注册用户
63 if (relaunch) { 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 "pages": [ 2 "pages": [
  3 + "pages/main/guide/guide",
3 "pages/main/home/home", 4 "pages/main/home/home",
4 -  
5 "pages/getPhone/getPhone", 5 "pages/getPhone/getPhone",
6 "pages/main/editinfo/editinfo", 6 "pages/main/editinfo/editinfo",
7 "pages/main/addinfo/addinfo", 7 "pages/main/addinfo/addinfo",
@@ -66,7 +66,7 @@ Page({ @@ -66,7 +66,7 @@ Page({
66 app.globalData.wx_open_id = user.wx_open_id; 66 app.globalData.wx_open_id = user.wx_open_id;
67 67
68 wx.reLaunch({ 68 wx.reLaunch({
69 - url: '../main/home/home' 69 + url: '../main/guide/guide'
70 }) 70 })
71 71
72 } else { 72 } else {
@@ -81,7 +81,7 @@ Page({ @@ -81,7 +81,7 @@ Page({
81 }, 81 },
82 complete:function (res){ 82 complete:function (res){
83 wx.reLaunch({ 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,7 +119,7 @@ Page({
119 app.globalData.wx_open_id = user.wx_open_id; 119 app.globalData.wx_open_id = user.wx_open_id;
120 120
121 wx.reLaunch({ 121 wx.reLaunch({
122 - url: '../main/home/home' 122 + url: '../main/guide/guide'
123 }) 123 })
124 } else { 124 } else {
125 wx.showToast({ 125 wx.showToast({
@@ -133,7 +133,7 @@ Page({ @@ -133,7 +133,7 @@ Page({
133 }, 133 },
134 complete: function (res) { 134 complete: function (res) {
135 wx.reLaunch({ 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,7 +3,7 @@ var format = require('../../../utils/util.js');
3 var app = getApp(); 3 var app = getApp();
4 var baseUrl = app.globalData.baseUrl; 4 var baseUrl = app.globalData.baseUrl;
5 Page({ 5 Page({
6 - 6 +
7 /** 7 /**
8 * 页面的初始数据 8 * 页面的初始数据
9 */ 9 */
@@ -22,7 +22,7 @@ Page({ @@ -22,7 +22,7 @@ Page({
22 mobile: '', 22 mobile: '',
23 birthday: '', 23 birthday: '',
24 id_error: false, 24 id_error: false,
25 - curAddress_haschanged:false, 25 + curAddress_haschanged: false,
26 birthAddress_haschanged: false, 26 birthAddress_haschanged: false,
27 contactAddress_haschanged: false, 27 contactAddress_haschanged: false,
28 card_number: '', 28 card_number: '',
@@ -166,7 +166,7 @@ Page({ @@ -166,7 +166,7 @@ Page({
166 selected: '', 166 selected: '',
167 mode: "date", 167 mode: "date",
168 fields: "day", 168 fields: "day",
169 - start:'1949-01-01', 169 + start: '1949-01-01',
170 onChange: 'birthdayChange', 170 onChange: 'birthdayChange',
171 }, 171 },
172 startDate: { 172 startDate: {
@@ -270,21 +270,21 @@ Page({ @@ -270,21 +270,21 @@ Page({
270 }, 270 },
271 271
272 //对各参数初始赋值 272 //对各参数初始赋值
273 - handleDatas: function() { 273 + handleDatas: function() {
274 //todo 274 //todo
275 var curdate = format.curDateTime() 275 var curdate = format.curDateTime()
276 - console.log('curdate', curdate) 276 + console.log('curdate', curdate)
277 277
278 var tax_info = this.data.taxInfo 278 var tax_info = this.data.taxInfo
279 this.data.name = tax_info.name 279 this.data.name = tax_info.name
280 - if(this.data.isself){ 280 + if (this.data.isself) {
281 this.data.relativeData.disabled = true 281 this.data.relativeData.disabled = true
282 this.data.relativeData.placeholder = tax_info.family_ties 282 this.data.relativeData.placeholder = tax_info.family_ties
283 - }else{ 283 + } else {
284 this.data.relativeData.disabled = false 284 this.data.relativeData.disabled = false
285 this.data.relativeData.selected = tax_info.family_ties 285 this.data.relativeData.selected = tax_info.family_ties
286 } 286 }
287 - 287 +
288 this.data.personstatusData.selected = tax_info.taxpayer_status 288 this.data.personstatusData.selected = tax_info.taxpayer_status
289 289
290 this.data.cardtypeData.selected = tax_info.id_card_type 290 this.data.cardtypeData.selected = tax_info.id_card_type
@@ -294,7 +294,7 @@ Page({ @@ -294,7 +294,7 @@ Page({
294 this.data.specificIndustryInfo.selected = tax_info.is_specific_profession 294 this.data.specificIndustryInfo.selected = tax_info.is_specific_profession
295 //非必填 295 //非必填
296 this.data.genderData.selected = tax_info.gender 296 this.data.genderData.selected = tax_info.gender
297 - if (tax_info.birth_date>1000){ 297 + if (tax_info.birth_date > 1000) {
298 this.data.birthDate.selected = format.yearFormString(tax_info.birth_date) + '-' + format.monthFormString(tax_info.birth_date) + '-' + format.dayFormString(tax_info.birth_date) 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 if (tax_info.join_date > 1000) { 300 if (tax_info.join_date > 1000) {
@@ -303,9 +303,9 @@ Page({ @@ -303,9 +303,9 @@ Page({
303 if (tax_info.separate_date > 1000) { 303 if (tax_info.separate_date > 1000) {
304 this.data.endDate.selected = format.yearFormString(tax_info.separate_date) + '-' + format.monthFormString(tax_info.separate_date) + '-' + format.dayFormString(tax_info.separate_date) 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 this.data.professionData.selected = tax_info.profession.three_level_name 307 this.data.professionData.selected = tax_info.profession.three_level_name
308 - 308 +
309 this.data.birthDate.end = curdate 309 this.data.birthDate.end = curdate
310 this.data.startDate.end = curdate 310 this.data.startDate.end = curdate
311 this.data.endDate.end = curdate 311 this.data.endDate.end = curdate
@@ -501,13 +501,14 @@ Page({ @@ -501,13 +501,14 @@ Page({
501 gender_Data.selected = id_info.gender 501 gender_Data.selected = id_info.gender
502 502
503 that.data.birthDate.selected = birth_day 503 that.data.birthDate.selected = birth_day
  504 + console.log('name***card_number', that.data.name + '***' + that.data.card_number)
504 505
505 if (that.data.name.length > 0 && id_info.name != that.data.name) { 506 if (that.data.name.length > 0 && id_info.name != that.data.name) {
506 that.showtoast("姓名冲突") 507 that.showtoast("姓名冲突")
507 id_error = true 508 id_error = true
508 return 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 that.showtoast("证照号码冲突") 512 that.showtoast("证照号码冲突")
512 id_error = true 513 id_error = true
513 return 514 return
@@ -711,7 +712,7 @@ Page({ @@ -711,7 +712,7 @@ Page({
711 contact_address.address_value = e.detail.value 712 contact_address.address_value = e.detail.value
712 contact_address.address_code = e.detail.code 713 contact_address.address_code = e.detail.code
713 this.setData({ 714 this.setData({
714 - contactAddress_haschanged:true, 715 + contactAddress_haschanged: true,
715 contactaddressInfo: contact_address 716 contactaddressInfo: contact_address
716 }) 717 })
717 console.log('contactaddressInfo', this.data.contactaddressInfo) 718 console.log('contactaddressInfo', this.data.contactaddressInfo)
@@ -724,7 +725,7 @@ Page({ @@ -724,7 +725,7 @@ Page({
724 current_address.address_value = e.detail.value 725 current_address.address_value = e.detail.value
725 current_address.address_code = e.detail.code 726 current_address.address_code = e.detail.code
726 this.setData({ 727 this.setData({
727 - curAddress_haschanged:true, 728 + curAddress_haschanged: true,
728 currentaddressInfo: current_address 729 currentaddressInfo: current_address
729 }) 730 })
730 }, 731 },
@@ -769,12 +770,10 @@ Page({ @@ -769,12 +770,10 @@ Page({
769 } else if (!regname.test(formdata.name)) { 770 } else if (!regname.test(formdata.name)) {
770 this.showtoast('请输入正确姓名'); 771 this.showtoast('请输入正确姓名');
771 return 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 this.showtoast('有必填项未填写'); 774 this.showtoast('有必填项未填写');
775 return 775 return
776 - }  
777 - else if (this.data.personstatusData.selected.length < 1) { 776 + } else if (this.data.personstatusData.selected.length < 1) {
778 this.showtoast('有必填项未填写'); 777 this.showtoast('有必填项未填写');
779 return 778 return
780 } else if (this.data.cardtypeData.selected.length < 1) { 779 } else if (this.data.cardtypeData.selected.length < 1) {
@@ -789,7 +788,7 @@ Page({ @@ -789,7 +788,7 @@ Page({
789 } else if (!this.data.isIdCard && (!formdata.id_card_no || formdata.id_card_no.length < 1)) { 788 } else if (!this.data.isIdCard && (!formdata.id_card_no || formdata.id_card_no.length < 1)) {
790 this.showtoast('有必填项未填写'); 789 this.showtoast('有必填项未填写');
791 return 790 return
792 - } else if (formdata.mobile.length < 1) { 791 + } else if (formdata.mobile.length < 1) {
793 this.showtoast('有必填项未填写'); 792 this.showtoast('有必填项未填写');
794 return 793 return
795 } else if (this.data.investInfo.selected.length < 1) { 794 } else if (this.data.investInfo.selected.length < 1) {
@@ -834,11 +833,11 @@ Page({ @@ -834,11 +833,11 @@ Page({
834 url: baseUrl + 'persontax/v1/personal-taxes/' + that.data.cur_id, 833 url: baseUrl + 'persontax/v1/personal-taxes/' + that.data.cur_id,
835 method: "PUT", 834 method: "PUT",
836 data: { 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 "family_ties": that.data.relativeData.selected, 837 "family_ties": that.data.relativeData.selected,
839 "native": "中国", 838 "native": "中国",
840 "id_card_type": that.data.cardtypeData.selected, 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 "gender": that.data.genderData.selected, 841 "gender": that.data.genderData.selected,
843 "birth_date": that.data.long_birth_date, 842 "birth_date": that.data.long_birth_date,
844 "profession": request_profession, 843 "profession": request_profession,
@@ -966,7 +965,7 @@ Page({ @@ -966,7 +965,7 @@ Page({
966 wx.showToast({ 965 wx.showToast({
967 title: str, 966 title: str,
968 duration: 2000, 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 +})
  1 +{
  2 + "navigationBarTitleText": "自然人税收"
  3 +}
  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>
  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 +}
@@ -8,7 +8,7 @@ Page({ @@ -8,7 +8,7 @@ Page({
8 */ 8 */
9 data: { 9 data: {
10 load_finish: false, 10 load_finish: false,
11 - text_tip: "完善", 11 + text_tip: "自然人信息不完善,立即完善",
12 taxlist: [''] 12 taxlist: ['']
13 }, 13 },
14 14
@@ -133,7 +133,7 @@ Page({ @@ -133,7 +133,7 @@ Page({
133 }) 133 })
134 } else { 134 } else {
135 this.setData({ 135 this.setData({
136 - text_tip: ' 尚未录入个人信息,立即完善' 136 + text_tip: '自然人信息不完善,立即完善'
137 }) 137 })
138 } 138 }
139 }, 139 },
@@ -8,6 +8,7 @@ Page({ @@ -8,6 +8,7 @@ Page({
8 */ 8 */
9 data: { 9 data: {
10 facepath: '', 10 facepath: '',
  11 + already_getdata:false,
11 front_card_info: {}, 12 front_card_info: {},
12 backpath: '', 13 backpath: '',
13 back_card_info: {}, 14 back_card_info: {},
@@ -64,7 +65,7 @@ Page({ @@ -64,7 +65,7 @@ Page({
64 * 生命周期函数--监听页面显示 65 * 生命周期函数--监听页面显示
65 */ 66 */
66 onShow: function() { 67 onShow: function() {
67 - 68 + console.log('onShow')
68 }, 69 },
69 70
70 chooseImage: function(e) { 71 chooseImage: function(e) {
@@ -72,7 +73,7 @@ Page({ @@ -72,7 +73,7 @@ Page({
72 var that = this 73 var that = this
73 wx.chooseImage({ 74 wx.chooseImage({
74 sourceType: ['camera', 'album'], 75 sourceType: ['camera', 'album'],
75 - sizeType: ['original'], 76 + // sizeType: ['original'],
76 count: 1, 77 count: 1,
77 success: function(res) { 78 success: function(res) {
78 console.log('success', res) 79 console.log('success', res)
@@ -102,7 +103,7 @@ Page({ @@ -102,7 +103,7 @@ Page({
102 filePath: path, 103 filePath: path,
103 name: 'file', 104 name: 'file',
104 formData: { 105 formData: {
105 - 'key': 'imagepath_' + path.substring(path.length - 10, path.length)+".png", 106 + 'key': 'imagepath_' + path.substring(path.length - 15, path.length),
106 'OSSAccessKeyId': OSSInit.access_key_id, 107 'OSSAccessKeyId': OSSInit.access_key_id,
107 'policy': OSSInit.policy, 108 'policy': OSSInit.policy,
108 'signature': OSSInit.signature, 109 'signature': OSSInit.signature,
@@ -186,13 +187,15 @@ Page({ @@ -186,13 +187,15 @@ Page({
186 }, 187 },
187 success: function(res) { 188 success: function(res) {
188 console.log('suc', res) 189 console.log('suc', res)
189 - if (res.statusCode == 300) { 190 + if (res.statusCode == 200) {
190 that.setData({ 191 that.setData({
  192 + already_getdata:true,
191 idInfo: res.data.item 193 idInfo: res.data.item
192 }) 194 })
193 console.log('suc', that.data.idInfo) 195 console.log('suc', that.data.idInfo)
194 } else { 196 } else {
195 wx.showModal({ 197 wx.showModal({
  198 + showCancel: false,
196 title: '', 199 title: '',
197 content: res.data.message ? res.data.message : "数据错误", 200 content: res.data.message ? res.data.message : "数据错误",
198 }) 201 })
@@ -209,13 +212,22 @@ Page({ @@ -209,13 +212,22 @@ Page({
209 }, 212 },
210 213
211 savedata: function() { 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,6 +241,7 @@ Page({
229 * 生命周期函数--监听页面卸载 241 * 生命周期函数--监听页面卸载
230 */ 242 */
231 onUnload: function() { 243 onUnload: function() {
  244 + console.log('onUnload')
232 // wx.showModal({ 245 // wx.showModal({
233 // title: '', 246 // title: '',
234 // content: '\n您的信息还未保存是否确认返回?\n', 247 // content: '\n您的信息还未保存是否确认返回?\n',
注册登录 后发表评论