Commit 3ab8dba1d3579c986acad4bc1c0628d195f35d79

Authored by taiyuan
1 parent 4707643c

个人信息加载默认数据

packageA/pages/profile/profile.js
@@ -529,20 +529,11 @@ Page({ @@ -529,20 +529,11 @@ Page({
529 }, 529 },
530 //------初始化加载---------- 530 //------初始化加载----------
531 onLoad: function(t) { 531 onLoad: function(t) {
532 - // var user = getApp().globalData.userInfo;  
533 - // if (user.card_field != '' && user.card_field != null && user.card_field != undefined && user.card_expiredate) {  
534 - // var now = ut.gettimestamp();  
535 - // var str = user.card_expiredate.replace(/-/g, '/');;  
536 - // var end = new Date(str);  
537 - // end = Date.parse(end) / 1000;  
538 - // if (now < end) {  
539 - // this.puls_user();  
540 - // }  
541 - // };  
542 - // this.initial_user(); 532 +
543 self = this; 533 self = this;
544 let url1 = '/api/weshop/storeconfig/get/'; 534 let url1 = '/api/weshop/storeconfig/get/';
545 let url2 = '/api/weshop/prom/coupon/get/'; 535 let url2 = '/api/weshop/prom/coupon/get/';
  536 + let url3 = '/api/weshop/users/getERPUser/';
546 url1 += r.stoid; 537 url1 += r.stoid;
547 538
548 app.request.get(url1, { 539 app.request.get(url1, {
@@ -579,6 +570,25 @@ Page({ @@ -579,6 +570,25 @@ Page({
579 }); 570 });
580 571
581 572
  573 + //获取默认信息
  574 + url3 += r.stoid + "/" + app.globalData.user_id;
  575 + app.request.get(url3, {
  576 + success: function(res) {
  577 + if(res.data.code == 0) {
  578 + console.log('url3', res.data.data.birthday);
  579 + let data = res.data.data;
  580 + self.setData({
  581 + isGender: data.sex,
  582 + isLunar: data.islunar,
  583 + datet: data.birthday,
  584 + stoname: data.pickup_name,
  585 + sto_sele_id: data.pickup_id,
  586 + });
  587 + };
  588 + }
  589 + });
  590 +
  591 +
582 }, 592 },
583 593
584 594
packageA/pages/profile/profile.wxml
@@ -70,11 +70,11 @@ @@ -70,11 +70,11 @@
70 <view class="user-txt-right pdl20 flex ai-center"> 70 <view class="user-txt-right pdl20 flex ai-center">
71 <checkbox-group bindchange="isLunar"> 71 <checkbox-group bindchange="isLunar">
72 <label class="flex ai-center"> 72 <label class="flex ai-center">
73 - <checkbox value="{{isLunar}}"/>农历 73 + <checkbox value="{{isLunar}}" checked="{{isLunar}}"/>农历
74 </label> 74 </label>
75 </checkbox-group> 75 </checkbox-group>
76 <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31"> 76 <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
77 - <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view> 77 + <view class="flex ai-center">{{datet? filters.format_time(datet):"请选择时间"}}<view class="angle">∟</view></view>
78 </picker> 78 </picker>
79 79
80 80