Commit 3a3e37f86d09f5d85f03b88823d4fd2796bf0ba4

Authored by yvan.ni
1 parent 85ba155d

完善信息送积分的优化

packageA/pages/goodsInfo/goodsInfo.wxml
@@ -42,9 +42,7 @@ @@ -42,9 +42,7 @@
42 <view class="sales">销量:{{data.sales_sum}}</view> 42 <view class="sales">销量:{{data.sales_sum}}</view>
43 <view class="sales">有效天数:{{data.validDays?data.validDays:0}}</view> 43 <view class="sales">有效天数:{{data.validDays?data.validDays:0}}</view>
44 </view> 44 </view>
45 -  
46 -  
47 - 45 +
48 </view> 46 </view>
49 </block> 47 </block>
50 48
packageA/pages/profile/profile.js
@@ -141,8 +141,6 @@ Page({ @@ -141,8 +141,6 @@ Page({
141 } 141 }
142 }, 142 },
143 143
144 -  
145 -  
146 //---点击二级之后的选择--- 144 //---点击二级之后的选择---
147 choose_for_store: function(e) { 145 choose_for_store: function(e) {
148 var index_c = e.currentTarget.dataset.ind; 146 var index_c = e.currentTarget.dataset.ind;
@@ -387,12 +385,7 @@ Page({ @@ -387,12 +385,7 @@ Page({
387 } 385 }
388 } 386 }
389 }, 200) 387 }, 200)
390 - //检验门店的点击,看下次数是不是到了  
391 - // this.check_click_ok(function(){  
392 -  
393 -  
394 - // },2)  
395 - 388 +
396 }, 389 },
397 390
398 //选择更多门店 391 //选择更多门店
@@ -535,6 +528,14 @@ Page({ @@ -535,6 +528,14 @@ Page({
535 let url2 = '/api/weshop/prom/coupon/get/'; 528 let url2 = '/api/weshop/prom/coupon/get/';
536 let url3 = '/api/weshop/users/getERPUser/'; 529 let url3 = '/api/weshop/users/getERPUser/';
537 url1 += r.stoid; 530 url1 += r.stoid;
  531 + var user=app.globalData.userInfo;
  532 +
  533 + //-- 赋予默认值 --
  534 + if(user['idcard']) this.data.id=user['idcard'];
  535 + if(user['vipname']) this.data.name=user['vipname'];
  536 + if(user['address']) this.data.address=user['address'];
  537 +
  538 +
538 539
539 app.request.get(url1, { 540 app.request.get(url1, {
540 success: function(res) { 541 success: function(res) {
@@ -568,31 +569,78 @@ Page({ @@ -568,31 +569,78 @@ Page({
568 569
569 }, 570 },
570 }); 571 });
571 -  
572 - 572 +
573 //获取默认信息 573 //获取默认信息
574 - url3 += r.stoid + "/" + app.globalData.user_id; 574 + url3 += r.stoid + "/" +user.user_id;
575 app.request.get(url3, { 575 app.request.get(url3, {
576 success: function(res) { 576 success: function(res) {
577 if(res.data.code == 0) { 577 if(res.data.code == 0) {
578 console.log('url3', res.data.data.birthday); 578 console.log('url3', res.data.data.birthday);
579 let data = res.data.data; 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 - }); 580 +
  581 + if(data.birthday){
  582 + data.birthday= ut.formar_no_full(data.birthday);
  583 + }
  584 +
  585 + if(user['sex'] && !data.sex){
  586 + data.sex=user['sex'];
  587 + }
  588 + if(user['birthday'] && !data.birthday){
  589 + data.birthday= ut.formar_no_full(user['birthday']);
  590 + }
  591 +
  592 + if(!data.pickup_name){
  593 + data.pickup_name="";
  594 + }
  595 + if(!data.pickup_id){
  596 + data.pickup_id=0;
  597 + }
  598 + //-- 获取门店 --
  599 + if(user['pickup_id'] && !data.pickup_id){
  600 + getApp().promiseGet("/api/weshop/pickup/get/"+r.stoid+"/"+user['pickup_id']).then(res=>{
  601 + if(res.data.code==0 && res.data.data){
  602 + data.pickup_name=res.data.data.pickup_name;
  603 + data.pickup_id=res.data.data.pickup_id;
  604 +
  605 + self.setData({
  606 + isGender: data.sex,
  607 + isLunar: data.islunar,
  608 + datet: data.birthday,
  609 + stoname: data.pickup_name,
  610 + sto_sele_id: data.pickup_id,
  611 + });
  612 + }
  613 + else{
  614 + self.setData({
  615 + isGender: data.sex,
  616 + isLunar: data.islunar,
  617 + datet: data.birthday,
  618 + stoname: data.pickup_name,
  619 + sto_sele_id: data.pickup_id,
  620 + });
  621 + }
  622 + })
  623 + }else{
  624 + self.setData({
  625 + isGender: data.sex,
  626 + isLunar: data.islunar,
  627 + datet: data.birthday,
  628 + stoname: data.pickup_name,
  629 + sto_sele_id: data.pickup_id,
  630 + });
  631 + }
587 }; 632 };
588 } 633 }
589 }); 634 });
590 635
591 636
  637 + if(user){
  638 + self.setData({user:user})
  639 + }
  640 +
592 }, 641 },
593 642
594 643
595 -  
596 644
597 onShow: function() { 645 onShow: function() {
598 var e = this; 646 var e = this;
@@ -607,44 +655,7 @@ Page({ @@ -607,44 +655,7 @@ Page({
607 } 655 }
608 656
609 var req = t; 657 var req = t;
610 - // req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, {  
611 - // success: function(src) {  
612 - // var a = src.data.data;  
613 -  
614 - // if(!a) a={};  
615 - // var time ="",birthday ="";  
616 - // if(a && a.reg_time) time=util.formatTime(a.reg_time, "'Y/M/D");  
617 - // if(a && a.birthday) birthday=util.formatTime(a.birthday, "'Y/M/D");  
618 -  
619 - // a.reg_time = time;  
620 - // a.birthday = birthday  
621 -  
622 - // if(a.address=='null' || !a.address){  
623 - // a.address="";  
624 - // }  
625 -  
626 - // e.data.fir_guide_id=a.staffId;  
627 - // if(choice_guide){  
628 - // a.staffName=choice_guide.StaffName;  
629 - // a.staffId=choice_guide.Id;  
630 - // }  
631 -  
632 -  
633 - // e.setData({  
634 - // // phone: a.mobile,  
635 - // user: a,  
636 - // openid: a.openid,  
637 - // sto_sele_id: a.pickup_id,  
638 - // consumption: a.paypwd,  
639 - // // identity_card: a.idcard,  
640 - // address: a.address,  
641 - // // isGender: a.sex,  
642 - // // isstcsp: a.vipnopwd,  
643 - // // iscalendar:a.islunar  
644 - // });  
645 -  
646 - // }  
647 - // }) 658 +
648 a.getUserInfo(function(a) { 659 a.getUserInfo(function(a) {
649 var txt = util.formatTime(a.birthday, 'yyyy-M-d'), 660 var txt = util.formatTime(a.birthday, 'yyyy-M-d'),
650 arr = txt.split(' '); 661 arr = txt.split(' ');
@@ -665,15 +676,7 @@ Page({ @@ -665,15 +676,7 @@ Page({
665 } 676 }
666 }) 677 })
667 } 678 }
668 - // var phone = "";  
669 - // phone+=a.mobile.substr(0, 3)+"****";  
670 - // phone += a.mobile.substr(7, 12);  
671 -  
672 -  
673 -  
674 - // e.setData({  
675 - // isGender:e.data.user.sex  
676 - // }) 679 +
677 }, !0); 680 }, !0);
678 }, 681 },
679 682
@@ -710,19 +713,6 @@ Page({ @@ -710,19 +713,6 @@ Page({
710 }, 713 },
711 714
712 715
713 - //用户名字  
714 - // user_name: function(e) {  
715 - // var th = this;  
716 - // var name = e.detail.value;  
717 - // var vipname = 'user.vipname';  
718 - // if (name != "" || name != null) {  
719 - // th.setData({  
720 - // [vipname]: name  
721 - // });  
722 - // }  
723 -  
724 - // },  
725 -  
726 //点击确认修改信息 716 //点击确认修改信息
727 confirm_revision: function() { 717 confirm_revision: function() {
728 var th = this; 718 var th = this;
@@ -988,65 +978,99 @@ Page({ @@ -988,65 +978,99 @@ Page({
988 978
989 //保存 979 //保存
990 save: function() { 980 save: function() {
991 - var th = this;  
992 - // let isAgree = this.data.isAgree;  
993 - // 同意协议  
994 - // if(isAgree) { 981 + var th = this;
995 var sto_sele_id = this.data.sto_sele_id; 982 var sto_sele_id = this.data.sto_sele_id;
996 - let tjrname = this.data.referee;  
997 - if (tjrname == "" || tjrname == null) {  
998 - app.my_warnning("请输入推荐人", 0, this);  
999 - return false;  
1000 - };  
1001 - let vipname = this.data.name;  
1002 - if (vipname == "" || vipname == null) {  
1003 - app.my_warnning("请输入姓名", 0, this);  
1004 - return false;  
1005 - };  
1006 - let sex = this.data.isGender;  
1007 - if (sex != "1" && sex != "2") {  
1008 - app.my_warnning("请选择性别", 0, this);  
1009 - return false;  
1010 - };  
1011 - let birthday = this.data.datet;  
1012 - if (birthday == "" || birthday == null) {  
1013 - app.my_warnning("请选择出生日期", 0, this);  
1014 - return false;  
1015 - };  
1016 - let idcard = this.data.id;  
1017 - if (idcard == "" || idcard == null) {  
1018 - app.my_warnning("请输入身份证号码", 0, this);  
1019 - return false;  
1020 - };  
1021 - let address = this.data.address;  
1022 - if (address == "" || address == null) {  
1023 - app.my_warnning("请输入地址", 0, this);  
1024 - return false;  
1025 - };  
1026 - let pickup_id = sto_sele_id;  
1027 - if (pickup_id == "" || pickup_id == null) {  
1028 - app.my_warnning("请输入地址", 0, this);  
1029 - return false; 983 + var user=app.globalData.userInfo;
  984 +
  985 + var data = {
  986 + store_id: r.stoid,
  987 + user_id: app.globalData.user_id,
1030 }; 988 };
  989 +
  990 + //-- 需要推荐人 --
  991 + if(this.data.reg_info.introducer_state){
  992 + let tjrname = this.data.referee;
  993 + if (tjrname == "" || tjrname == null) {
  994 + app.my_warnning("请输入推荐人", 0, this);
  995 + return false;
  996 + };
  997 + if(ut.check_mobile(tjrname).code==-1){
  998 + app.my_warnning("请输入推荐人正确的手机号", 0, this);
  999 + return false;
  1000 + }
  1001 +
  1002 + if(tjrname==user.mobile){
  1003 + app.my_warnning("推荐人不能是自己", 0, this);
  1004 + return false;
  1005 + }
  1006 + data.tjrname=tjrname;
  1007 + }
  1008 +
  1009 + //-- 需要姓名 --
  1010 + if(this.data.reg_info.name_state){
  1011 + let vipname = this.data.name;
  1012 + if (vipname == "" || vipname == null) {
  1013 + app.my_warnning("请输入姓名", 0, this);
  1014 + return false;
  1015 + };
  1016 + data.vipname=vipname;
  1017 + }
  1018 + //需要性别
  1019 + if(this.data.reg_info.sex_state){
  1020 + let sex = this.data.isGender;
  1021 + if (sex != "1" && sex != "2") {
  1022 + app.my_warnning("请选择性别", 0, this);
  1023 + return false;
  1024 + };
  1025 + data.sex=sex;
  1026 + }
  1027 +
  1028 + //需要生日
  1029 + if(this.data.reg_info.birthday_state){
  1030 + let birthday = this.data.datet;
  1031 + if (birthday == "" || birthday == null) {
  1032 + app.my_warnning("请选择出生日期", 0, this);
  1033 + return false;
  1034 + };
  1035 +
  1036 + data.birthday=birthday;
  1037 + data.islunar=self.data.isLunar;
  1038 + }
  1039 +
  1040 + //-- 需要身份证 --
  1041 + if(this.data.reg_info.idcard_state){
  1042 + let idcard = this.data.id;
  1043 + if (idcard == "" || idcard == null) {
  1044 + app.my_warnning("请输入身份证号码", 0, this);
  1045 + return false;
  1046 + };
  1047 + data.idcard=idcard;
  1048 + }
  1049 + //需要地址
  1050 + if(this.data.reg_info.address_state){
  1051 + let address = this.data.address;
  1052 + if (address == "" || address == null) {
  1053 + app.my_warnning("请输入地址", 0, this);
  1054 + return false;
  1055 + };
  1056 + data.address=address;
  1057 + }
  1058 + //需要门店
  1059 + if(this.data.reg_info.pick_state){
  1060 + let pickup_id = sto_sele_id;
  1061 + if (pickup_id == "" || pickup_id == null) {
  1062 + app.my_warnning("请输入门店", 0, this);
  1063 + return false;
  1064 + };
  1065 + data.pickup_id=sto_sele_id;
  1066 + }
  1067 +
1031 let isAgree = this.data.isAgree; 1068 let isAgree = this.data.isAgree;
1032 if(!isAgree) { 1069 if(!isAgree) {
1033 app.my_warnning("请您先阅读和勾选指定的内容", 0, this); 1070 app.my_warnning("请您先阅读和勾选指定的内容", 0, this);
1034 return false; 1071 return false;
1035 }; 1072 };
1036 -  
1037 - var data = {  
1038 - store_id: r.stoid,  
1039 - user_id: app.globalData.user_id,  
1040 - tjrname: tjrname, //推荐人  
1041 - vipname: vipname, //名称  
1042 - sex: sex, //性别  
1043 - birthday: self.data.datet,  
1044 - islunar: self.data.isLunar,  
1045 - idcard: self.data.id,  
1046 - address: address,  
1047 - pickup_id: sto_sele_id ,//自提门店 所属门店  
1048 - };  
1049 - 1073 +
1050 1074
1051 console.log('data==>', data); 1075 console.log('data==>', data);
1052 1076
packageA/pages/profile/profile.wxml
@@ -24,21 +24,29 @@ @@ -24,21 +24,29 @@
24 24
25 <view class="user-container"> 25 <view class="user-container">
26 <view class="Bbottom"> 26 <view class="Bbottom">
27 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}"> 27 +
  28 + <!-- 如果需要接骚人信息 -->
  29 + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}">
28 <view class="user-name-txt">推荐人:</view> 30 <view class="user-name-txt">推荐人:</view>
29 - <input bindinput="getReferee" bindblur="" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>  
30 - <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>  
31 - <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view> 31 + <input bindinput="getReferee" bindblur="" value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>
  32 +
  33 + <block wx:if="{{!user['fromuser_id']}}">
  34 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>
  35 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view>
  36 + </block>
32 </view> 37 </view>
33 -  
34 - <view bindtap="editUserInfo1" class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}">  
35 - <view class="user-name-txt">姓名:</view>  
36 - <input bindinput="getName" bindblur="" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>  
37 - <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view>  
38 - <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view> 38 +
  39 + <!-- 如果需要接姓名信息 -->
  40 + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}">
  41 + <view class="user-name-txt">姓名:</view>
  42 + <input bindinput="getName" bindblur="" value="{{user['vipname']?user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>
  43 + <block wx:if="{{!user['vipname']}}">
  44 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view>
  45 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
  46 + </block>
39 </view> 47 </view>
40 48
41 - <view class="user-name flex-vertical" data-type="sex" wx:if="{{reg_info.sex_state}}"> 49 + <view class="user-name flex-vertical" data-type="sex" wx:if="{{reg_info.sex_state }}">
42 <view>性别:</view> 50 <view>性别:</view>
43 <view class="flex f1 pdl20 jc_fe"> 51 <view class="flex f1 pdl20 jc_fe">
44 <view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="getGender"> 52 <view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="getGender">
@@ -60,11 +68,14 @@ @@ -60,11 +68,14 @@
60 <view class="fs26">女</view> 68 <view class="fs26">女</view>
61 </view> 69 </view>
62 </view> 70 </view>
63 - <view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view>  
64 - <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view> 71 +
  72 + <block wx:if="{{!user['sex']}}">
  73 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view>
  74 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view>
  75 + </block>
65 </view> 76 </view>
66 77
67 - <view class="user-name flex-vertical" data-type="sex" wx:if="{{reg_info.birthday_state}}"> 78 + <view class="user-name flex-vertical" data-type="birthday" wx:if="{{reg_info.birthday_state}}" style="justify-content: space-between;">
68 <view class="shrink0">出生日期:</view> 79 <view class="shrink0">出生日期:</view>
69 <view class="flex fs28 Birth pdl20 jc_fe"> 80 <view class="flex fs28 Birth pdl20 jc_fe">
70 <view class="user-txt-right pdl20 flex ai-center"> 81 <view class="user-txt-right pdl20 flex ai-center">
@@ -74,45 +85,52 @@ @@ -74,45 +85,52 @@
74 </label> 85 </label>
75 </checkbox-group> 86 </checkbox-group>
76 <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31"> 87 <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
77 - <view class="flex ai-center">{{datet? filters.format_time(datet):"请选择时间"}}<view class="angle">∟</view></view> 88 + <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view>
78 </picker> 89 </picker>
79 90
80 91
81 </view> 92 </view>
82 </view> 93 </view>
83 - <view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view>  
84 - <view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view> 94 +
  95 + <block wx:if="{{!user['birthday']}}">
  96 + <view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view>
  97 + <view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view>
  98 + </block>
85 </view> 99 </view>
86 100
87 101
88 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.idcard_state}}"> 102 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.idcard_state}}">
89 - <view class="user-name-txt shrink0">身份证:</view>  
90 - <input bindinput="getId" bindblur="IdentityIDCard" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码" value="{{id}}"></input> 103 + <view class="user-name-txt shrink0">身份证:</view>
  104 + <input bindinput="getId" bindblur="IdentityIDCard" value="{{user.idcard?user.idcard:''}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码" value="{{id}}"></input>
  105 + <block wx:if="{{!user.idcard}}">
91 <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view> 106 <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view>
92 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view> 107 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view>
  108 + </block>
93 </view> 109 </view>
94 110
95 111
96 <view class="user-name flex-vertical" data-type="mobile" wx:if="{{reg_info.address_state}}"> 112 <view class="user-name flex-vertical" data-type="mobile" wx:if="{{reg_info.address_state}}">
97 <view class="user-name-txt">地址:</view> 113 <view class="user-name-txt">地址:</view>
98 - <input bindinput="getAddress" bindblur="" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />  
99 - <view class="c-red pdl20 fs24" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view>  
100 - <view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view> 114 + <input bindinput="getAddress" bindblur="" value="{{user.address?user.address:''}}" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />
  115 + <block wx:if="{{!user.address}}">
  116 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view>
  117 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view>
  118 + </block>
101 </view> 119 </view>
102 120
103 -  
104 -  
105 -  
106 - 121 +
107 <!-- 选择门店 --> 122 <!-- 选择门店 -->
108 <view bindtap="onclickstore" class="user-name flex-vertical" data-type="email" wx:if="{{reg_info.pick_state}}"> 123 <view bindtap="onclickstore" class="user-name flex-vertical" data-type="email" wx:if="{{reg_info.pick_state}}">
109 <view class="user-name-txt">所属门店:</view> 124 <view class="user-name-txt">所属门店:</view>
110 <view class="user-txt-right f1 flex ai_c jc_fe"> 125 <view class="user-txt-right f1 flex ai_c jc_fe">
111 - <view class="one-line">{{stoname}}</view> 126 + <view class="one-line">{{stoname?stoname:'请选择门店'}}</view>
112 <view class="angle">∟</view> 127 <view class="angle">∟</view>
113 </view> 128 </view>
  129 +
  130 + <block wx:if="{{!user.pickup_id}}">
114 <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view> 131 <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view>
115 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view> 132 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view>
  133 + </block>
116 </view> 134 </view>
117 135
118 <!-- 我的兴趣 --> 136 <!-- 我的兴趣 -->
pages/togoin/togoin.js
@@ -31,22 +31,20 @@ Page({ @@ -31,22 +31,20 @@ Page({
31 var logo=th.data.imghots+e.store_logo; 31 var logo=th.data.imghots+e.store_logo;
32 th.setData({ store: e,store_logo:logo}); 32 th.setData({ store: e,store_logo:logo});
33 }) 33 })
34 - 34 +
  35 + //判断注册的条件
35 app.getConfig2(function (e) { 36 app.getConfig2(function (e) {
36 - if(e.reg_type==1){  
37 - var need_go=0; 37 + if(e.reg_type==1){
38 var arr=JSON.parse(e.reg_info); 38 var arr=JSON.parse(e.reg_info);
39 - if(arr['name_state']==1) need_go=1;  
40 - if(!need_go && arr['birthday_state']==1) need_go=1;  
41 - if(!need_go && arr['idcard_state']==1) need_go=1;  
42 - if(!need_go && arr['address_state']==1) need_go=1;  
43 - if(!need_go && arr['pick_state']==1) need_go=1;  
44 - if(!need_go && arr['sex_state']==1) need_go=1;  
45 - if(!need_go && arr['introducer_state']==1) need_go=1;  
46 - th.setData({need_go:1});  
47 - }  
48 -  
49 - }) 39 + if(arr['name_state']==1) th.data.name_need_go=1;
  40 + if(arr['birthday_state']==1) th.data.birth_need_go=1;
  41 + if(arr['idcard_state']==1) th.data.idcard_need_go=1;
  42 + if(arr['address_state']==1) th.data.address_need_go=1;
  43 + if(arr['pick_state']==1) th.data.pick_need_go=1;
  44 + if(arr['sex_state']==1) th.data.sex_need_go=1;
  45 + if(arr['introducer_state']==1) th.data.introducer_need_go=1;
  46 + }
  47 + },1)
50 }, 48 },
51 //绑定手机号 49 //绑定手机号
52 getphone:function (e) { 50 getphone:function (e) {
@@ -60,8 +58,7 @@ Page({ @@ -60,8 +58,7 @@ Page({
60 var th=this; 58 var th=this;
61 var sessionKey = getApp().globalData.sessionKey; 59 var sessionKey = getApp().globalData.sessionKey;
62 var openid = getApp().globalData.openid; 60 var openid = getApp().globalData.openid;
63 - var r=getApp().globalData.getu;  
64 - 61 + var r=getApp().globalData.getu;
65 th.save_the_data(r,e,sessionKey,openid) 62 th.save_the_data(r,e,sessionKey,openid)
66 }, 63 },
67 64
@@ -186,14 +183,24 @@ Page({ @@ -186,14 +183,24 @@ Page({
186 } else { 183 } else {
187 return app.showWarning("授权登入失败!"+e.data.msg); 184 return app.showWarning("授权登入失败!"+e.data.msg);
188 } 185 }
189 -  
190 - wx.setStorageSync("userinfo",e.data.data); 186 +
  187 +
  188 + var need_go=0;
  189 + var t_user=e.data.data;
  190 +
  191 + wx.setStorageSync("userinfo",e.data.data);
191 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); 192 wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);
192 - //如果有需要跳转,就跳转到.如果微信端有注册,就不需要跳转  
193 - if(app.globalData.userInfo['openid']){  
194 - th.data.need_go=0;  
195 - }  
196 - if(th.data.need_go){ 193 +
  194 + //如果有需要完善的信息没有完善,就需要跳转
  195 + if(!t_user['vipname'] && th.data.name_need_go){ need_go=1;}
  196 + if(!t_user['birthday'] && th.data.birth_need_go){ need_go=1;}
  197 + if(!t_user['idcard'] && th.data.idcard_need_go){ need_go=1;}
  198 + if(!t_user['address'] && th.data.address_need_go){ need_go=1;}
  199 + if(!t_user['pickup_id'] && th.data.pick_need_go){ need_go=1;}
  200 + if(!t_user['sex'] && th.data.sex_need_go){ need_go=1;}
  201 + if(!t_user['fromuser_id'] && th.data.introducer_need_go){ need_go=1;}
  202 +
  203 + if(need_go){
197 getApp().goto("/packageA/pages/profile/profile"); 204 getApp().goto("/packageA/pages/profile/profile");
198 }else{ 205 }else{
199 wx.navigateBack({ delta: 1}) 206 wx.navigateBack({ delta: 1})
@@ -227,7 +234,7 @@ Page({ @@ -227,7 +234,7 @@ Page({
227 wx.login({ 234 wx.login({
228 success: function (o) { 235 success: function (o) {
229 var dd = { 236 var dd = {
230 - js_code:o.code, 237 + js_code:o.code,
231 store_id: os.stoid, 238 store_id: os.stoid,
232 nickname: app.clear_word(app.globalData.getu.nickName), 239 nickname: app.clear_word(app.globalData.getu.nickName),
233 head_pic: app.clear_word(app.globalData.getu.avatarUrl) 240 head_pic: app.clear_word(app.globalData.getu.avatarUrl)