Commit cae8b14a1e15f4dda03dcf2afbb34b38171fd2d9

Authored by yvan.ni
1 parent e25276ca

1. 注册优化、

2.  会员分享要提示是谁分享的,并弹出框点击跳转
3.  会员分享邀请要有积分奖励
4.  一件代发
packageA/pages/profile/profile.js
@@ -23,6 +23,7 @@ var date = new Date(timestamp); @@ -23,6 +23,7 @@ var date = new Date(timestamp);
23 // barcode, 23 // barcode,
24 // qrcode 24 // qrcode
25 // } = require('../../../utils/index.js'); 25 // } = require('../../../utils/index.js');
  26 +var regeneratorRuntime = require('../../../utils/runtime.js');
26 27
27 Page({ 28 Page({
28 data: { 29 data: {
@@ -576,114 +577,104 @@ Page({ @@ -576,114 +577,104 @@ Page({
576 577
577 self = this; 578 self = this;
578 let url1 = '/api/weshop/storeconfig/get/'; 579 let url1 = '/api/weshop/storeconfig/get/';
579 - let url3 = '/api/weshop/users/getERPUser/'; 580 + let url3 = '/api/weshop/users/getErpvipidPickup';
580 url1 += r.stoid; 581 url1 += r.stoid;
581 - var user=app.globalData.userInfo;  
582 - if(!user) return false;  
583 -  
584 - //-- 赋予默认值 --  
585 - if(user['idcard']) this.data.id=user['idcard'];  
586 - if(user['vipname']) this.data.name=user['vipname'];  
587 - if(user['address']) this.data.address=user['address'];  
588 - 582 +
  583 + var uu=getApp().globalData.zc_dd;
  584 + if(uu){
  585 + this.setData({head_pic:uu.head_pic,nickname:uu.nickname})
  586 + }
  587 +
589 app.request.get(url1, { 588 app.request.get(url1, {
590 - success: function(res) {  
591 - console.log('x-->', res.data.code, res.data.data.reg_type, res.data.data.reg_info); 589 + success:async function(res) {
592 if(res.data.code == 0) { 590 if(res.data.code == 0) {
593 let reg_type = res.data.data.reg_type; 591 let reg_type = res.data.data.reg_type;
594 let reg_info = res.data.data.reg_info; 592 let reg_info = res.data.data.reg_info;
595 if(reg_type) { //reg_type为1才显示积分信息 593 if(reg_type) { //reg_type为1才显示积分信息
596 if(reg_info) { 594 if(reg_info) {
597 - reg_info = JSON.parse(reg_info); 595 + reg_info = JSON.parse(reg_info);
  596 + var user_id=0;
  597 +
  598 + //-- 获取会员信息 -
  599 + await getApp().request.promiseGet("/api/weshop/users/page", {data:{
  600 + store_id:r.stoid,mobile:uu.mobile
  601 + }}).then(res=>{
  602 + if(ut.ajax_ok(res)){
  603 + user_id=res.data.data.pageData[0].user_id;
  604 + }
  605 + })
  606 +
598 if(reg_info.reginfo_coupon){ 607 if(reg_info.reginfo_coupon){
599 //判断有没有领过券 608 //判断有没有领过券
600 - self.check_is_send_quan(reg_info.reginfo_coupon,user.user_id);  
601 - } 609 + self.check_is_send_quan(reg_info.reginfo_coupon,user_id);
  610 + }
  611 +
  612 + if(reg_info.reginfo_lb_id){
  613 + //判断有没有领过礼包
  614 + self.check_is_send_libao(reg_info.reginfo_lb_id,user_id);
  615 + }
  616 +
602 }; 617 };
603 }; 618 };
604 self.setData({ 619 self.setData({
605 reg_type, 620 reg_type,
606 reg_info, 621 reg_info,
607 - user: app.globalData.userInfo,  
608 }); 622 });
609 - };  
610 - 623 + }
611 }, 624 },
612 }); 625 });
613 -  
614 - //获取默认信息  
615 - url3 += r.stoid + "/" +user.user_id;  
616 - app.request.get(url3, {  
617 - success: function(res) {  
618 - if(res.data.code == 0) {  
619 - console.log('url3', res.data.data.birthday);  
620 - let data = res.data.data;  
621 -  
622 - if(data.birthday){  
623 - data.birthday= ut.formar_no_full(data.birthday);  
624 - }  
625 -  
626 - if(user['sex'] && !data.sex){  
627 - data.sex=user['sex'];  
628 - }  
629 - if(user['birthday'] && !data.birthday){  
630 - data.birthday= ut.formar_no_full(user['birthday']);  
631 - }  
632 -  
633 - if(!data.pickup_name){  
634 - data.pickup_name="";  
635 - }  
636 - if(!data.pickup_id){  
637 - data.pickup_id=0;  
638 - }  
639 - //-- 获取门店 --  
640 - if(user['pickup_id'] && !data.pickup_id){  
641 - getApp().promiseGet("/api/weshop/pickup/get/"+r.stoid+"/"+user['pickup_id']).then(res=>{  
642 - if(res.data.code==0 && res.data.data){  
643 - data.pickup_name=res.data.data.pickup_name;  
644 - data.pickup_id=res.data.data.pickup_id;  
645 -  
646 - self.setData({  
647 - isGender: data.sex,  
648 - isLunar: data.islunar,  
649 - datet: data.birthday,  
650 - stoname: data.pickup_name,  
651 - sto_sele_id: data.pickup_id,  
652 - });  
653 - }  
654 - else{  
655 - self.setData({  
656 - isGender: data.sex,  
657 - isLunar: data.islunar,  
658 - datet: data.birthday,  
659 - stoname: data.pickup_name,  
660 - sto_sele_id: data.pickup_id,  
661 - });  
662 - }  
663 - if(!self.data.sto_sele_id){  
664 - self.get_store_set();  
665 - }  
666 - })  
667 - }else{  
668 - self.setData({  
669 - isGender: data.sex,  
670 - isLunar: data.islunar,  
671 - datet: data.birthday,  
672 - stoname: data.pickup_name,  
673 - sto_sele_id: data.pickup_id,  
674 - });  
675 - }  
676 -  
677 - if(!self.data.sto_sele_id){  
678 - self.get_store_set();  
679 - }  
680 - };  
681 - }  
682 - });  
683 -  
684 - if(user){  
685 - self.setData({user:user})  
686 - } 626 +
  627 +
  628 + //-- 获取线下会员的情况 --
  629 + var req_data={
  630 + stoid:r.stoid,
  631 + mobile:getApp().globalData.zc_dd.mobile
  632 + };
  633 + if(getApp().globalData.zc_dd.first_leade)
  634 + req_data.first_leader=getApp().globalData.zc_dd.first_leader
  635 +
  636 + wx.showLoading();
  637 + getApp().request.promiseGet(url3, {data:req_data}).then(res=>{
  638 + if(res.data.code==0){
  639 + var back_data=res.data.data; back_data=JSON.parse(back_data);
  640 + var set_data={is_fx:0};
  641 + //-- 如果有包含会员的线下的信息 --
  642 + if(back_data && back_data.erpviplist){
  643 + //-- data.data就是门店的数据 --
  644 + if(back_data.data){
  645 + back_data.erpviplist.pickup_id=back_data.data.pickup_id;
  646 + if(!back_data.erpviplist.pick) set_data.is_fx=1;
  647 + set_data.stoname=back_data.data.pickup_name;
  648 + set_data.sto_sele_id=back_data.data.pickup_id;
  649 + }
  650 +
  651 + //-- 推荐人姓名 --
  652 + if(back_data.erpviplist.fromuser) {
  653 + set_data.tjrname=back_data.erpviplist.fromuser;
  654 + back_data.erpviplist.fromuser_id=back_data.erpviplist.fromuser;
  655 + }
  656 + //性别
  657 + if(back_data.erpviplist.sex) set_data.isGender=back_data.erpviplist.sex;
  658 + //名称
  659 + if(back_data.erpviplist.vipname) set_data.name=back_data.erpviplist.vipname;
  660 + //身份证
  661 + if(back_data.erpviplist.idcard) set_data.id=back_data.erpviplist.idcard;
  662 + //地址
  663 + if(back_data.erpviplist.address) set_data.address=back_data.erpviplist.address;
  664 + //生日
  665 + if(back_data.erpviplist.birthday) {
  666 + set_data.datet=back_data.erpviplist.birthday;
  667 + set_data.isLunar=back_data.erpviplist.islunar;
  668 + }
  669 + set_data.user=back_data.erpviplist;
  670 + }
  671 + self.setData(set_data);
  672 + if(!self.data.sto_sele_id){
  673 + self.get_store_set();
  674 + }
  675 + }
  676 + wx.hideLoading();
  677 + })
687 678
688 var is_back=t.is_back; 679 var is_back=t.is_back;
689 if(is_back) this.data.is_back=1; 680 if(is_back) this.data.is_back=1;
@@ -694,9 +685,7 @@ Page({ @@ -694,9 +685,7 @@ Page({
694 685
695 getApp().check_can_share(); 686 getApp().check_can_share();
696 687
697 - var e = this;  
698 if (this.data.is_zy) return false; 688 if (this.data.is_zy) return false;
699 - this.wait_for_store_config();  
700 689
701 //如果有传值进行跳转的话 690 //如果有传值进行跳转的话
702 var choice_guide=null; 691 var choice_guide=null;
@@ -705,64 +694,108 @@ Page({ @@ -705,64 +694,108 @@ Page({
705 getApp().globalData.choice_guide=null; 694 getApp().globalData.choice_guide=null;
706 } 695 }
707 696
708 - var req = t;  
709 -  
710 - a.getUserInfo(function(a) {  
711 - var txt = util.formatTime(a.birthday, 'yyyy-M-d'),  
712 - arr = txt.split(' ');  
713 - a.birthday = arr[0];  
714 - var txt2 = util.formatTime(a.reg_time, 'yyyy-M-d'),  
715 - arr2 = txt.split(' ');  
716 - a.reg_time = arr2[0];  
717 - if (a.pickup_id != null) {  
718 - req.get("/api/weshop/pickup/get/" + r.stoid + "/" + a.pickup_id, {  
719 - success: function(da) {  
720 - if(da.data.data){  
721 - //设置门店  
722 - e.setData({  
723 - // stoname: da.data.data.pickup_name  
724 - });  
725 - }  
726 -  
727 - }  
728 - })  
729 - }  
730 -  
731 - }, !0);  
732 }, 697 },
733 698
734 check_is_send_quan:function(cid,uid){ 699 check_is_send_quan:function(cid,uid){
735 var self=this; 700 var self=this;
736 let url2 = '/api/weshop/prom/coupon/get/'; 701 let url2 = '/api/weshop/prom/coupon/get/';
737 - //看一下会员有没有领过注册的券  
738 - getApp().promiseGet("/api/weshop/couponList/page",{  
739 - data:{store_id:r.stoid,uid:uid,cid:cid}  
740 - }).then(res=>{  
741 - var is_ling=0;  
742 - if(res.data.code==0 && res.data.data && res.data.data.total>0){  
743 - is_ling=1;  
744 - }  
745 -  
746 - //没有领过券,就显示  
747 - if(!is_ling){  
748 - //获取优惠券  
749 - url2 += cid;  
750 - app.request.get(url2, {  
751 - success: function(r) {  
752 - if(r.data.code == 0) {  
753 - console.log('000res==>', r.data.data.name);  
754 - self.setData({  
755 - couponInfo: r.data.data.name,  
756 - });  
757 - };  
758 - },  
759 - });  
760 - }  
761 -  
762 - }) 702 + //-- 如果没有会员信息的时候 --
  703 + if(!uid){
  704 + //获取优惠券
  705 + url2 += cid;
  706 + app.request.get(url2, {
  707 + success: function(r) {
  708 + if(r.data.code == 0) {
  709 + self.setData({
  710 + couponInfo: r.data.data.name,
  711 + });
  712 + };
  713 + },
  714 + });
  715 +
  716 + }else{
  717 + //看一下会员有没有领过注册的券
  718 + getApp().promiseGet("/api/weshop/couponList/page",{
  719 + data:{store_id:r.stoid,uid:uid,cid:cid}
  720 + }).then(res=>{
  721 + var is_ling=0;
  722 + if(res.data.code==0 && res.data.data && res.data.data.total>0){
  723 + is_ling=1;
  724 + }
  725 +
  726 + //没有领过券,就显示
  727 + if(!is_ling){
  728 + //获取优惠券
  729 + url2 += cid;
  730 + app.request.get(url2, {
  731 + success: function(r) {
  732 + if(r.data.code == 0) {
  733 + console.log('000res==>', r.data.data.name);
  734 + self.setData({
  735 + couponInfo: r.data.data.name,
  736 + });
  737 + };
  738 + },
  739 + });
  740 + }
  741 +
  742 + })
  743 + }
  744 +
  745 +
  746 +
763 747
764 }, 748 },
765 749
  750 + //-- 有没有送过礼包 --
  751 + check_is_send_libao:function(lbid,uid){
  752 + var self=this;
  753 + let url2 = '/api/weshop/marketing/giftbag/get';
  754 + if(!uid){
  755 + //获取礼包
  756 + app.request.get(url2, {
  757 + data:{storeId:r.stoid,giftBagId:lbid},
  758 + success: function(r) {
  759 + if(r.data.code == 0) {
  760 + console.log('000res==>', r.data.data.name);
  761 + self.setData({
  762 + libao: r.data.data.lbTitle,
  763 + });
  764 + }
  765 + }
  766 + });
  767 +
  768 + }else{
  769 + //看一下会员有没有领过注册的券
  770 + getApp().promiseGet("/api/weshop/marketing/gift/getgiveone",{
  771 + data:{store_id:r.stoid,user_id:uid,lbid:lbid,act_type:7}
  772 + }).then(res=>{
  773 + var is_ling=0;
  774 + if(res.data.code==0 && res.data.data && res.data.data.total>0){
  775 + is_ling=1;
  776 + }
  777 + //没有领过礼包,就显示
  778 + if(!is_ling){
  779 + //获取礼包
  780 + app.request.get(url2, {
  781 + data:{storeId:r.stoid,giftBagId:lbid},
  782 + success: function(r) {
  783 + if(r.data.code == 0) {
  784 + self.setData({
  785 + libao: r.data.data.lbTitle,
  786 + });
  787 + }
  788 + }
  789 + });
  790 + }
  791 +
  792 + })
  793 + }
  794 +
  795 + },
  796 +
  797 +
  798 +
766 799
767 //------卡片的显示和关闭-------- 800 //------卡片的显示和关闭--------
768 show_tc: function() { 801 show_tc: function() {
@@ -782,8 +815,6 @@ Page({ @@ -782,8 +815,6 @@ Page({
782 tc_hide: true, 815 tc_hide: true,
783 }); 816 });
784 }, 817 },
785 -  
786 -  
787 818
788 //地址 819 //地址
789 address: function(e) { 820 address: function(e) {
@@ -854,39 +885,41 @@ Page({ @@ -854,39 +885,41 @@ Page({
854 datas.staffId=th.data.user.staffId; 885 datas.staffId=th.data.user.staffId;
855 } 886 }
856 887
857 - getApp().request.put("/api/weshop/users/updateUserInfo", {  
858 - data: datas,  
859 - success: function(res) {  
860 - if (res.data.code == 0) {  
861 - getApp().my_warnning("修改成功", 1, th);  
862 -  
863 - setTimeout(function () {  
864 - if(th.data.is_back){  
865 - wx.navigateBack({ delta: 1}) //返回上一页  
866 - }else{  
867 - getApp().goto("/pages/user/index/index");  
868 - }  
869 - },1000)  
870 -  
871 - } else {  
872 - getApp().my_warnning("系统繁忙,请稍后再试", 0, th);  
873 - }  
874 - }  
875 - }) 888 + var post_data={ ...getApp().globalData.zc_dd, ...datas }
  889 + this.zu_ce(post_data);
876 }, 890 },
  891 +
  892 +
  893 + zu_ce:function (dd) {
  894 + var th=this;
  895 + app.request.get("/api/weshop/users/thirdLogin", {
  896 + data: dd,
  897 + success: function (e) {
  898 + if (e.data.code == 0) {
  899 + app.globalData.user_id = e.data.data.user_id;
  900 + } else {
  901 + return app.showWarning("授权登入失败!"+e.data.msg);
  902 + }
  903 + getApp().globalData.login_back=1;
  904 + wx.setStorageSync("userinfo",e.data.data);
  905 + wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = s.getFullUrl(a.globalData.userInfo.head_pic);
  906 + wx.navigateBack({ delta: 1})
  907 +
  908 + },
  909 + failStatus: function (t) {
  910 + return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
  911 + },
  912 + fail: function (t) {
  913 + return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  914 + }
  915 + });
  916 + },
  917 +
877 //选择地址 918 //选择地址
878 goto_address: function() { 919 goto_address: function() {
879 // this.setData({ is_zy: 1 }); 920 // this.setData({ is_zy: 1 });
880 }, 921 },
881 - //更换手机  
882 - // go_phone: function(e) {  
883 - // var url = e.currentTarget.dataset.url;  
884 - // this.setData({  
885 - // is_zy: 1  
886 - // });  
887 - // getApp().goto(url);  
888 - // },  
889 - 922 +
890 //--点击分享事件--- 923 //--点击分享事件---
891 onShareAppMessage: function(t) { 924 onShareAppMessage: function(t) {
892 getApp().globalData.no_clear=1 925 getApp().globalData.no_clear=1
@@ -983,9 +1016,8 @@ Page({ @@ -983,9 +1016,8 @@ Page({
983 this.setData({ 1016 this.setData({
984 datet: e.detail.value, 1017 datet: e.detail.value,
985 }); 1018 });
986 - };  
987 -  
988 - // console.log(this.data.datet, this.data.isCalendar); 1019 + }
  1020 +
989 }, 1021 },
990 1022
991 // 生日判断 1023 // 生日判断
@@ -1074,7 +1106,6 @@ Page({ @@ -1074,7 +1106,6 @@ Page({
1074 1106
1075 var data = { 1107 var data = {
1076 store_id: r.stoid, 1108 store_id: r.stoid,
1077 - user_id: app.globalData.user_id,  
1078 }; 1109 };
1079 1110
1080 //-- 需要推荐人 -- 1111 //-- 需要推荐人 --
@@ -1083,11 +1114,7 @@ Page({ @@ -1083,11 +1114,7 @@ Page({
1083 if (tjrname == "" || tjrname == null) { 1114 if (tjrname == "" || tjrname == null) {
1084 app.my_warnning("请输入推荐人", 0, this); 1115 app.my_warnning("请输入推荐人", 0, this);
1085 return false; 1116 return false;
1086 - };  
1087 - if(tjrname==user.mobile || tjrname==user.erpvipno ){  
1088 - app.my_warnning("推荐人不能是自己", 0, this);  
1089 - return false;  
1090 - } 1117 + };
1091 data.tjrname=tjrname; 1118 data.tjrname=tjrname;
1092 } 1119 }
1093 1120
@@ -1119,7 +1146,7 @@ Page({ @@ -1119,7 +1146,7 @@ Page({
1119 }; 1146 };
1120 1147
1121 data.birthday=birthday; 1148 data.birthday=birthday;
1122 - data.islunar=self.data.isLunar; 1149 + data.islunar=self.data.isLunar?1:0;
1123 } 1150 }
1124 1151
1125 //-- 需要身份证 -- 1152 //-- 需要身份证 --
@@ -1155,97 +1182,19 @@ Page({ @@ -1155,97 +1182,19 @@ Page({
1155 app.my_warnning("请您先阅读和勾选指定的内容", 0, this); 1182 app.my_warnning("请您先阅读和勾选指定的内容", 0, this);
1156 return false; 1183 return false;
1157 }; 1184 };
1158 -  
1159 -  
1160 - console.log('data==>', data);  
1161 -  
1162 - app.request.put("/api/weshop/users/updateInfo", {  
1163 - data: data,  
1164 - success: function(res) {  
1165 - if (res.data.code == 0) {  
1166 - getApp().my_warnning("保存成功", 1, self);  
1167 - if(th.data.is_back){  
1168 - wx.navigateBack({ delta: 1}) //返回上一页  
1169 - }else{  
1170 - getApp().goto("/pages/user/index/index");  
1171 - }  
1172 - } else {  
1173 - getApp().my_warnning(res.data.msg, 0, self);  
1174 - };  
1175 - }  
1176 - }) 1185 +
  1186 +
  1187 +
  1188 +
  1189 + var post_data={ ...getApp().globalData.zc_dd, ...data };
  1190 +
  1191 + delete post_data.sessionKey;
  1192 + delete post_data.encryptedData;
  1193 + delete post_data.iv;
  1194 +
  1195 + this.zu_ce(post_data);
1177 1196
1178 - // } else {  
1179 - // app.my_warnning("请您先阅读和勾选指定的内容", 0, self);  
1180 - // };  
1181 - // var isstcsp = th.data.isstcsp; //是否启用消费密码  
1182 - // var phone = th.data.phone; //手机号码  
1183 - // if (phone == "" || phone == null) {  
1184 - // getApp().my_warnning("手机不能为空", 0, th);  
1185 - // return false;  
1186 - // }  
1187 - // var consumption = th.data.consumption; //消费密码  
1188 - // var isstcsp = th.data.isstcsp;  
1189 - // if (isstcsp == 1) {  
1190 -  
1191 - // if (consumption == null || consumption == "" || consumption == undefined) {  
1192 - // getApp().my_warnning("消费密码不能为空", 0, th);  
1193 - // return false;  
1194 - // }  
1195 - // if (consumption.length < 6) {  
1196 - // getApp().my_warnning("消费密码不能小于6位", 0, th);  
1197 - // return false;  
1198 - // }  
1199 - // }  
1200 - // var sex = th.data.isGender; //性别  
1201 -  
1202 - // if (sex != "1" && sex != "2") {  
1203 - // getApp().my_warnning("请选择性别", 0, th);  
1204 - // return false;  
1205 - // }  
1206 - // var vipname = th.data.user.vipname; //用户姓名  
1207 - // if (user_name == "" || user_name == null) {  
1208 - // getApp().my_warnning("请输入名字", 0, th);  
1209 - // return false;  
1210 - // }  
1211 - // var identity_card = th.data.identity_card; //身份证  
1212 -  
1213 - // if (identity_card!=null && identity_card!=undefined && identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) {  
1214 - // getApp().my_warnning("身份证号码错误", 0, th);  
1215 - // return false;  
1216 - // }  
1217 - // var address = th.data.address; //地址  
1218 - // var sto_sele_id = self.data.sto_sele_id;  
1219 - // var data = {  
1220 - // store_id: r.stoid,  
1221 - // user_id: app.globalData.user_id,  
1222 - // tjrname: self.data.referee, //推荐人  
1223 - // vipname: self.data.name, //名称  
1224 - // sex: self.data.isGender, //性别  
1225 - // birthday: self.data.datet,  
1226 - // islunar: self.data.isLunar,  
1227 - // idcard: self.data.id,  
1228 - // address: self.data.address,  
1229 - // pickup_id: sto_sele_id ,//自提门店 所属门店  
1230 - // };  
1231 -  
1232 - // console.log('data==>', data);  
1233 - //往上提交美导的ID  
1234 - // if(th.data.fir_guide_id!=th.data.user.staffId){  
1235 - // datas.staffId=th.data.user.staffId;  
1236 - // }  
1237 -  
1238 - // app.request.put("/api/weshop/users/updateInfo", {  
1239 - // data: data,  
1240 - // success: function(res) {  
1241 - // if (res.data.code == 0) {  
1242 - // getApp().my_warnning("保存成功", 1, self);  
1243 - // getApp().goto("/pages/user/index/index");  
1244 - // } else {  
1245 - // getApp().my_warnning("系统繁忙,请稍后再试", 0, self);  
1246 - // };  
1247 - // }  
1248 - // }) 1197 +
1249 }, 1198 },
1250 1199
1251 1200
packageA/pages/profile/profile.wxml
@@ -7,13 +7,13 @@ @@ -7,13 +7,13 @@
7 <view class="flex-center"> 7 <view class="flex-center">
8 8
9 <view class="flex-center"> 9 <view class="flex-center">
10 - <image class="Headportrait" src="{{user.head_pic}}"></image> 10 + <image class="Headportrait" src="{{head_pic}}"></image>
11 </view> 11 </view>
12 12
13 <view class="flex-center vipmax"> 13 <view class="flex-center vipmax">
14 <view> 14 <view>
15 <view class="fs32"> 15 <view class="fs32">
16 - <view class="ellipsis-1 Nickname">{{user.nickname}} 16 + <view class="ellipsis-1 Nickname">{{nickname}}
17 </view> 17 </view>
18 </view> 18 </view>
19 </view> 19 </view>
@@ -28,7 +28,9 @@ @@ -28,7 +28,9 @@
28 <!-- 如果需要接骚人信息 --> 28 <!-- 如果需要接骚人信息 -->
29 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}"> 29 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}">
30 <view class="user-name-txt">推荐人:</view> 30 <view class="user-name-txt">推荐人:</view>
31 - <input bindinput="getReferee" bindblur="" value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/> 31 +
  32 +
  33 + <input bindinput="getReferee" bindblur="" disabled="{{user['fromuser_id']}}" value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/>
32 34
33 <block wx:if="{{!user['fromuser_id']}}"> 35 <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> 36 <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>
@@ -41,7 +43,7 @@ @@ -41,7 +43,7 @@
41 <view class="user-name-txt">姓名:</view> 43 <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="请输入您的真实姓名"/> 44 <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']}}"> 45 <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> 46 + <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> 47 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
46 </block> 48 </block>
47 </view> 49 </view>
@@ -68,8 +70,8 @@ @@ -68,8 +70,8 @@
68 <view class="fs26">女</view> 70 <view class="fs26">女</view>
69 </view> 71 </view>
70 </view> 72 </view>
71 -  
72 - <block wx:if="{{!user['sex']}}"> 73 +
  74 + <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> 75 <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> 76 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view>
75 </block> 77 </block>
@@ -127,7 +129,7 @@ @@ -127,7 +129,7 @@
127 <view class="angle">∟</view> 129 <view class="angle">∟</view>
128 </view> 130 </view>
129 131
130 - <block wx:if="{{!user.pickup_id}}"> 132 + <block wx:if="{{!user.pickup_id && !is_fx }}">
131 <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view> 133 <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{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> 134 <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view>
133 </block> 135 </block>
@@ -174,6 +176,7 @@ @@ -174,6 +176,7 @@
174 <view class="confirm"> 176 <view class="confirm">
175 <view class="fs30 confirmtext" bindtap="save">保存</view> 177 <view class="fs30 confirmtext" bindtap="save">保存</view>
176 <view class="star fs24 t-c pdt10 c9" wx:if="{{couponInfo}}">保存成功即可获得一张{{couponInfo}}</view> 178 <view class="star fs24 t-c pdt10 c9" wx:if="{{couponInfo}}">保存成功即可获得一张{{couponInfo}}</view>
  179 + <view class="star fs24 t-c pdt10 c9" wx:if="{{libao}}">保存成功即可获得一个{{libao}}</view>
177 </view> 180 </view>
178 181
179 <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"--> 182 <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"-->
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -2238,6 +2238,11 @@ Page({ @@ -2238,6 +2238,11 @@ Page({
2238 goods.skinface_id=getApp().globalData.skinface_id; 2238 goods.skinface_id=getApp().globalData.skinface_id;
2239 } 2239 }
2240 2240
  2241 + if(th.data.bn_goods.whsle_id){
  2242 + item.is_whsle=1;
  2243 + goods.is_whsle_goods=1;
  2244 + }
  2245 +
2241 //-- 把导购的信息填入-- 2246 //-- 把导购的信息填入--
2242 if (gg.guide_id) { 2247 if (gg.guide_id) {
2243 goods.guide_id = gg.guide_id; 2248 goods.guide_id = gg.guide_id;
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
@@ -783,6 +783,12 @@ Page({ @@ -783,6 +783,12 @@ Page({
783 if(getApp().globalData.skinface_id){ 783 if(getApp().globalData.skinface_id){
784 goods.skinface_id=getApp().globalData.skinface_id; 784 goods.skinface_id=getApp().globalData.skinface_id;
785 } 785 }
  786 +
  787 + if(th.data.bn_goods.whsle_id){
  788 + item.is_whsle=1;
  789 + goods.is_whsle_goods=1;
  790 + }
  791 +
786 //--导购分享过来的id-- 792 //--导购分享过来的id--
787 if (gg.guide_id) { 793 if (gg.guide_id) {
788 goods.guide_id = gg.guide_id; 794 goods.guide_id = gg.guide_id;
packageC/pages/payForAnother/payForAnother.js
@@ -2119,6 +2119,11 @@ Page({ @@ -2119,6 +2119,11 @@ Page({
2119 'prom_id': th.data.bn_goods.prom_id, //促销活动id 2119 'prom_id': th.data.bn_goods.prom_id, //促销活动id
2120 }; 2120 };
2121 2121
  2122 + if(th.data.bn_goods.whsle_id){
  2123 + item.is_whsle=1;
  2124 + goods.is_whsle_goods=1;
  2125 + }
  2126 +
2122 //-- 把导购的信息填入-- 2127 //-- 把导购的信息填入--
2123 if (gg.guide_id) { 2128 if (gg.guide_id) {
2124 goods.guide_id = gg.guide_id; 2129 goods.guide_id = gg.guide_id;
packageC/pages/presell/cart/cart2.js
@@ -702,6 +702,7 @@ Page({ @@ -702,6 +702,7 @@ Page({
702 if (item['exp_sum_type'] == 2) { 702 if (item['exp_sum_type'] == 2) {
703 cut_good_weight += item['weight'] * item['buynum']; 703 cut_good_weight += item['weight'] * item['buynum'];
704 goods_weight += item['weight'] * item['buynum']; 704 goods_weight += item['weight'] * item['buynum'];
  705 +
705 } 706 }
706 if (back_data.weight_free > 0) { 707 if (back_data.weight_free > 0) {
707 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; 708 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
@@ -1054,6 +1055,11 @@ Page({ @@ -1054,6 +1055,11 @@ Page({
1054 goods.skinface_id=getApp().globalData.skinface_id; 1055 goods.skinface_id=getApp().globalData.skinface_id;
1055 } 1056 }
1056 1057
  1058 + if(th.data.bn_goods.whsle_id){
  1059 + item.is_whsle=1;
  1060 + goods.is_whsle_goods=1;
  1061 + }
  1062 +
1057 //-- 把导购的信息填入-- 1063 //-- 把导购的信息填入--
1058 if (gg.guide_id) { 1064 if (gg.guide_id) {
1059 goods.guide_id = gg.guide_id; 1065 goods.guide_id = gg.guide_id;
packageC/pages/presell/cart/cart2_pre.js
@@ -542,6 +542,11 @@ Page({ @@ -542,6 +542,11 @@ Page({
542 goods.skinface_id=getApp().globalData.skinface_id; 542 goods.skinface_id=getApp().globalData.skinface_id;
543 } 543 }
544 544
  545 + if(th.data.bn_goods.whsle_id){
  546 + item.is_whsle=1;
  547 + goods.is_whsle_goods=1;
  548 + }
  549 +
545 //--导购分享过来的id-- 550 //--导购分享过来的id--
546 if (gg.guide_id) { 551 if (gg.guide_id) {
547 goods.guide_id = gg.guide_id; 552 goods.guide_id = gg.guide_id;
pages/cart/cart/cart.js
@@ -612,8 +612,8 @@ Page({ @@ -612,8 +612,8 @@ Page({
612 } 612 }
613 613
614 } 614 }
615 -  
616 - else if(item.prom_type == 0) { 615 + //判断不是代发的商品
  616 + else if(item.prom_type == 0 && !item.whsle_id) {
617 617
618 //如果有优惠活动,要更新活动 618 //如果有优惠活动,要更新活动
619 await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => { 619 await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => {
pages/cart/cart2/cart2.js
@@ -451,8 +451,8 @@ Page({ @@ -451,8 +451,8 @@ Page({
451 //如果有购买活动 451 //如果有购买活动
452 item1.promgoodsbuynum = promgoodsbuynum; 452 item1.promgoodsbuynum = promgoodsbuynum;
453 453
454 - //要把优惠活动加入,prom_goods_map中,赠品不要运算  
455 - if (item1.prom_type == 3 && item1.is_gift != 1) { 454 + //要把优惠活动加入,prom_goods_map中,赠品不要运算,代发商品不算优惠
  455 + if (item1.prom_type == 3 && item1.is_gift != 1 && !item1.whsle_id) {
456 // th.check_is_youhui(item1.goods_id, item1.pick_id); 456 // th.check_is_youhui(item1.goods_id, item1.pick_id);
457 await th.add_prom_goods_map(item1); 457 await th.add_prom_goods_map(item1);
458 } 458 }
@@ -1187,6 +1187,8 @@ Page({ @@ -1187,6 +1187,8 @@ Page({
1187 var o_price = 0, q_conditin = 0; 1187 var o_price = 0, q_conditin = 0;
1188 //--------循环计算总价----------- 1188 //--------循环计算总价-----------
1189 for (var j = 0; j < ord_goods.length; j++) { 1189 for (var j = 0; j < ord_goods.length; j++) {
  1190 +
  1191 + if(ord_goods[j].whsle_id) continue;
1190 o_price += ord_goods[j].goods_price * ord_goods[j].goods_num; 1192 o_price += ord_goods[j].goods_price * ord_goods[j].goods_num;
1191 } 1193 }
1192 1194
@@ -1232,6 +1234,7 @@ Page({ @@ -1232,6 +1234,7 @@ Page({
1232 item_map.gift_weight = get_data.goodsinfo.weight; 1234 item_map.gift_weight = get_data.goodsinfo.weight;
1233 item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; 1235 item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
1234 item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; 1236 item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
  1237 + item_map.whsle_id = get_data.goodsinfo.whsle_id;
1235 1238
1236 } 1239 }
1237 item_map.s_libao = get_data.libao; 1240 item_map.s_libao = get_data.libao;
@@ -1491,12 +1494,16 @@ Page({ @@ -1491,12 +1494,16 @@ Page({
1491 1494
1492 //调用函数计算每件商品的单价 1495 //调用函数计算每件商品的单价
1493 await th.calc_per(c_arr); 1496 await th.calc_per(c_arr);
  1497 +
1494 //调用函数计算每件组合购商品的单价, 1498 //调用函数计算每件组合购商品的单价,
1495 await zh_calc.calc_zh_split_price(c_arr, th); 1499 await zh_calc.calc_zh_split_price(c_arr, th);
  1500 +
1496 //调用函数计算每件阶梯促销商品的单价, 1501 //调用函数计算每件阶梯促销商品的单价,
1497 await ladder_calc.calc_split_price(c_arr, th); 1502 await ladder_calc.calc_split_price(c_arr, th);
1498 //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品 1503 //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品
  1504 +
1499 await th.get_cart_quan(c_arr); 1505 await th.get_cart_quan(c_arr);
  1506 +
1500 //---循环购物车--- 1507 //---循环购物车---
1501 for (var i in c_arr) { 1508 for (var i in c_arr) {
1502 //因为搭配购买也是再这里计算,搭配购的is_b_now==1 1509 //因为搭配购买也是再这里计算,搭配购的is_b_now==1
@@ -1555,9 +1562,15 @@ Page({ @@ -1555,9 +1562,15 @@ Page({
1555 }) 1562 })
1556 } 1563 }
1557 1564
  1565 +
  1566 + var whsle_goods_price=0;
1558 //--------循环计算总价----------- 1567 //--------循环计算总价-----------
1559 for (var j = 0; j < item.length; j++) { 1568 for (var j = 0; j < item.length; j++) {
1560 1569
  1570 + if(item.whsle_id>0){
  1571 + whsle_goods_price+=item.goods_price*item.goods_num;
  1572 + }
  1573 +
1561 var is_no_zh = 0; 1574 var is_no_zh = 0;
1562 if (item[j].prom_type != 7 && item[j].prom_type != 10) is_no_zh = 1; 1575 if (item[j].prom_type != 7 && item[j].prom_type != 10) is_no_zh = 1;
1563 1576
@@ -1729,6 +1742,8 @@ Page({ @@ -1729,6 +1742,8 @@ Page({
1729 //--------循环计算总价----------- 1742 //--------循环计算总价-----------
1730 for (var j = 0; j < item.length; j++) { 1743 for (var j = 0; j < item.length; j++) {
1731 1744
  1745 + //如果是一件代发商品,不计算运费
  1746 + if(item[j].whsle_id) continue;
1732 //如果商品本身是包邮了 1747 //如果商品本身是包邮了
1733 if(item[j].is_free_shipping == 1) continue; 1748 if(item[j].is_free_shipping == 1) continue;
1734 //如果是优惠活动是包邮,就不用计算包邮的费用了 1749 //如果是优惠活动是包邮,就不用计算包邮的费用了
@@ -1812,6 +1827,10 @@ Page({ @@ -1812,6 +1827,10 @@ Page({
1812 o_condition = o_price_no_zh - quan_price; 1827 o_condition = o_price_no_zh - quan_price;
1813 } 1828 }
1814 1829
  1830 + if(whsle_goods_price>0){
  1831 + o_condition=o_condition-whsle_goods_price;
  1832 + }
  1833 +
1815 var order_m = 0; 1834 var order_m = 0;
1816 //---判断是不是有订单优惠--- 1835 //---判断是不是有订单优惠---
1817 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { 1836 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
@@ -2019,7 +2038,8 @@ Page({ @@ -2019,7 +2038,8 @@ Page({
2019 quan_no = th.data.using_quan[bn_pick].coupon_no; 2038 quan_no = th.data.using_quan[bn_pick].coupon_no;
2020 2039
2021 if (quan_no) { 2040 if (quan_no) {
2022 - if (th.data.using_quan[bn_pick].isby != 1) { 2041 + //如果是一件代发就不要找商品
  2042 + if (th.data.using_quan[bn_pick].isby != 1 && !good.whsle_id) {
2023 //---获取优惠券优惠--- 2043 //---获取优惠券优惠---
2024 await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { 2044 await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", {
2025 data: { 2045 data: {
@@ -2043,7 +2063,7 @@ Page({ @@ -2043,7 +2063,7 @@ Page({
2043 } 2063 }
2044 2064
2045 //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- 2065 //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
2046 - if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) { 2066 + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1) {
2047 //看是不是有调用过包邮券 2067 //看是不是有调用过包邮券
2048 if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) { 2068 if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) {
2049 var condition = allpice - cut_price - quan_price; 2069 var condition = allpice - cut_price - quan_price;
@@ -2129,8 +2149,13 @@ Page({ @@ -2129,8 +2149,13 @@ Page({
2129 var cut_good_weight = 0; 2149 var cut_good_weight = 0;
2130 for (let i in gd_arr_list) { 2150 for (let i in gd_arr_list) {
2131 let item = gd_arr_list[i]; 2151 let item = gd_arr_list[i];
2132 - 2152 +
  2153 + if(good.is_free_shipping==1) continue;
  2154 + //-- 代发商品不算运费 --
  2155 + if(good.whsle_id) continue;
  2156 +
2133 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { 2157 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
  2158 +
2134 if (item['exp_sum_type'] == 2) { 2159 if (item['exp_sum_type'] == 2) {
2135 goods_weight += item['weight'] * item['buynum']; 2160 goods_weight += item['weight'] * item['buynum'];
2136 cut_good_weight += item['weight'] * item['buynum']; 2161 cut_good_weight += item['weight'] * item['buynum'];
@@ -2211,6 +2236,10 @@ Page({ @@ -2211,6 +2236,10 @@ Page({
2211 } 2236 }
2212 //--看一下有没有订单优惠-- 2237 //--看一下有没有订单优惠--
2213 var o_condition = parseFloat(order_m); 2238 var o_condition = parseFloat(order_m);
  2239 + if(th.data.bn_goods.whsle_id>0){
  2240 + o_condition=0;
  2241 + }
  2242 +
2214 if (o_condition > 0) { 2243 if (o_condition > 0) {
2215 th.check_is_order_prom(o_condition, function () { 2244 th.check_is_order_prom(o_condition, function () {
2216 var order_prom_amount = 0; 2245 var order_prom_amount = 0;
@@ -2522,6 +2551,7 @@ Page({ @@ -2522,6 +2551,7 @@ Page({
2522 }) 2551 })
2523 } 2552 }
2524 2553
  2554 +
2525 var goods = { 2555 var goods = {
2526 'goods_id': gg.goods_id, 2556 'goods_id': gg.goods_id,
2527 'goods_name': gg.goods_name, 2557 'goods_name': gg.goods_name,
@@ -2535,6 +2565,11 @@ Page({ @@ -2535,6 +2565,11 @@ Page({
2535 'prom_id': th.data.bn_goods.prom_id, //促销活动id 2565 'prom_id': th.data.bn_goods.prom_id, //促销活动id
2536 }; 2566 };
2537 2567
  2568 + if(th.data.bn_goods.whsle_id){
  2569 + item.is_whsle=1;
  2570 + goods.is_whsle_goods=1;
  2571 + }
  2572 +
2538 if (getApp().globalData.skinface_id) { 2573 if (getApp().globalData.skinface_id) {
2539 goods.skinface_id = getApp().globalData.skinface_id; 2574 goods.skinface_id = getApp().globalData.skinface_id;
2540 } 2575 }
@@ -2564,7 +2599,7 @@ Page({ @@ -2564,7 +2599,7 @@ Page({
2564 if (gg.is_pd_normal) goods.is_pd_normal = 1; 2599 if (gg.is_pd_normal) goods.is_pd_normal = 1;
2565 2600
2566 //如果不立即购买或者秒杀,如果是线下库存购买的时候 2601 //如果不立即购买或者秒杀,如果是线下库存购买的时候
2567 - if (goods.prom_type != 1 && goods.prom_type != 6 && th.data.sales_rules == 2) { 2602 + if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 && th.data.sales_rules == 2) {
2568 var isok = 1; 2603 var isok = 1;
2569 await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) { 2604 await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) {
2570 isok = res; 2605 isok = res;
@@ -2681,7 +2716,7 @@ Page({ @@ -2681,7 +2716,7 @@ Page({
2681 } 2716 }
2682 2717
2683 var order_prom_list_cart = th.data.order_prom_list_cart;; 2718 var order_prom_list_cart = th.data.order_prom_list_cart;;
2684 - console.log('xxxxxxxxxxxxxxxx', order_prom_list_cart) 2719 +
2685 //--组装推送数据-- 2720 //--组装推送数据--
2686 for (var i = 0; i < order_prom_list_cart.length; i++) { 2721 for (var i = 0; i < order_prom_list_cart.length; i++) {
2687 var t_item = order_prom_list_cart[i]; 2722 var t_item = order_prom_list_cart[i];
@@ -2806,6 +2841,11 @@ Page({ @@ -2806,6 +2841,11 @@ Page({
2806 await th.split_set_goods_quanprice(you_item, t_item); 2841 await th.split_set_goods_quanprice(you_item, t_item);
2807 } 2842 }
2808 } 2843 }
  2844 +
  2845 + //代发商品的集合
  2846 + var df_goods=[];
  2847 + var df_price=0;
  2848 + var df_room_ids="";
2809 //-------------让商品添加到商品列表-------------------- 2849 //-------------让商品添加到商品列表--------------------
2810 for (var k = 0; k < t_item.goods.length; k++) { 2850 for (var k = 0; k < t_item.goods.length; k++) {
2811 var g_item = t_item.goods[k]; 2851 var g_item = t_item.goods[k];
@@ -2900,26 +2940,77 @@ Page({ @@ -2900,26 +2940,77 @@ Page({
2900 } 2940 }
2901 }) 2941 })
2902 } 2942 }
2903 - //如果房间号不为空的时候  
2904 - if (g_item.room_id) {  
2905 - goods.room_id = g_item.room_id;  
2906 - room_ids += g_item.room_id + ",";  
2907 - }  
2908 2943
2909 //如果有阶梯促销 2944 //如果有阶梯促销
2910 if (g_item.ladder_list_id) { 2945 if (g_item.ladder_list_id) {
2911 goods.ladder_list_id = g_item.ladder_list_id; 2946 goods.ladder_list_id = g_item.ladder_list_id;
2912 } 2947 }
2913 2948
2914 - item.order_goods.push(goods); 2949 + //-- 如果有代发商品,就要开始拆单 --
  2950 + if(g_item.whsle_id){
  2951 + df_price+= parseFloat(g_item.goods_num*g_item.goods_price);
  2952 + goods.is_whsle_goods=1;
  2953 + df_goods.push(goods);
  2954 + df_room_ids+= g_item.room_id + ",";
  2955 + }else{
  2956 + item.order_goods.push(goods);
  2957 + //如果房间号不为空的时候
  2958 + if (g_item.room_id) {
  2959 + goods.room_id = g_item.room_id;
  2960 + room_ids += g_item.room_id + ",";
  2961 + }
  2962 + }
2915 } 2963 }
2916 2964
2917 //如果房间号不为空的时候 2965 //如果房间号不为空的时候
2918 if (room_ids != "") item.room_ids = ut.sub_last(room_ids); 2966 if (room_ids != "") item.room_ids = ut.sub_last(room_ids);
  2967 +
  2968 +
  2969 + //处理代发商品的拆分
  2970 + if(df_goods.length>0){
  2971 + var df_item=JSON.parse(JSON.stringify(item));
  2972 + item.goods_price= parseFloat(item.goods_price-df_price).toFixed(2);
  2973 + item.total_amount= parseFloat(item.total_amount-df_price).toFixed(2);
  2974 +
  2975 + df_item.is_whsle=1;
  2976 + df_item.is_discount_amount=0;
  2977 + df_item.goods_price=df_price;
  2978 + df_item.total_amount=df_price;
  2979 + df_item.shipping_price=0; //没有运费
  2980 + if(df_item.order_prom_list) df_item.order_prom_list={};
  2981 +
  2982 + //看一下是用余额比较多,还是用钱比较多
  2983 + if(item.order_amount>item.user_money){
  2984 + if(item.order_amount>df_price){
  2985 + item.order_amount=parseFloat(item.order_amount-df_price).toFixed(2);
  2986 + df_item.order_amount=df_price.toFixed(2);
  2987 + }else {
  2988 + var more_p=parseFloat(df_price-item.order_amount).toFixed(2);
  2989 + item.order_amount=0;
  2990 + item.user_money=parseFloat(item.user_money-more_p).toFixed(2);
  2991 + df_item.user_money=more_p;
  2992 + }
  2993 + }else{
  2994 + if(item.user_money>df_price){
  2995 + item.user_money=parseFloat(item.user_money-df_price).toFixed(2);
  2996 + df_item.user_money=df_price.toFixed(2);
  2997 + }else {
  2998 + var more_p=parseFloat(df_price-item.user_money).toFixed(2);
  2999 + item.user_money=0;
  3000 + item.order_amount=parseFloat(item.user_money-more_p).toFixed(2);
  3001 + df_item.order_amount=more_p;
  3002 +
  3003 + }
  3004 + }
  3005 +
  3006 + if (df_room_ids != "") df_item.room_ids = ut.sub_last(df_room_ids);
  3007 + df_item.order_goods=df_goods;
  3008 + pdata.push(df_item);
  3009 + }
  3010 +
2919 pdata.push(item); 3011 pdata.push(item);
2920 } 3012 }
2921 3013
2922 -  
2923 } 3014 }
2924 3015
2925 if (pdata.length == 0) return; 3016 if (pdata.length == 0) return;
@@ -2951,7 +3042,7 @@ Page({ @@ -2951,7 +3042,7 @@ Page({
2951 } 3042 }
2952 var order_amount = 0; 3043 var order_amount = 0;
2953 pdata.forEach(function (em, ind) { 3044 pdata.forEach(function (em, ind) {
2954 - order_amount += em.order_amount; 3045 + order_amount += parseFloat(em.order_amount);
2955 }) 3046 })
2956 //要进行判断,如果是用微信支付,就要跳转到支付界面 3047 //要进行判断,如果是用微信支付,就要跳转到支付界面
2957 if (order_amount > 0) { 3048 if (order_amount > 0) {
@@ -3757,7 +3848,7 @@ Page({ @@ -3757,7 +3848,7 @@ Page({
3757 for (var i in goodlist) { 3848 for (var i in goodlist) {
3758 var gd = goodlist[i]; 3849 var gd = goodlist[i];
3759 //--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券-- 3850 //--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券--
3760 - if (gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act.is_xz_yh) || gd.is_xz_yh == 1) { 3851 + if (gd.whsle_id==1 || gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act.is_xz_yh) || gd.is_xz_yh == 1) {
3761 continue; 3852 continue;
3762 } 3853 }
3763 3854
@@ -3865,8 +3956,8 @@ Page({ @@ -3865,8 +3956,8 @@ Page({
3865 arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0); 3956 arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0);
3866 arr[ind].check_quan_ware_list = check_quan_ware_list; 3957 arr[ind].check_quan_ware_list = check_quan_ware_list;
3867 arr[ind].check_quan_price_list = check_quan_price_list; 3958 arr[ind].check_quan_price_list = check_quan_price_list;
3868 - //是否关闭使用优惠券  
3869 - if (th.data.is_close_quan != 1) { 3959 + //-- 是否关闭使用优惠券,循环有找到商品 --
  3960 + if (th.data.is_close_quan != 1 && check_quan_ware_list) {
3870 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求-- 3961 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
3871 var url = "/api/weshop/couponList/getUseCouponList"; 3962 var url = "/api/weshop/couponList/getUseCouponList";
3872 await app.request.promiseGet(url, { 3963 await app.request.promiseGet(url, {
@@ -3904,6 +3995,9 @@ Page({ @@ -3904,6 +3995,9 @@ Page({
3904 get_buy_now_quan: function () { 3995 get_buy_now_quan: function () {
3905 var quanlist = null, th = this, frozenQuan = null; 3996 var quanlist = null, th = this, frozenQuan = null;
3906 var good = this.data.bn_goods; 3997 var good = this.data.bn_goods;
  3998 +
  3999 + //一件代发商品不使用优惠券
  4000 + if(good.whsle_id) return false;
3907 if (good.prom_price) { 4001 if (good.prom_price) {
3908 th.data.ckeck_quan_price = good.prom_price; //如果有优惠价,就用优惠价 4002 th.data.ckeck_quan_price = good.prom_price; //如果有优惠价,就用优惠价
3909 } else if (good.is_offline) { 4003 } else if (good.is_offline) {
@@ -4025,6 +4119,7 @@ Page({ @@ -4025,6 +4119,7 @@ Page({
4025 arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; 4119 arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
4026 arr.gift_limit_num = get_data.limit_num; 4120 arr.gift_limit_num = get_data.limit_num;
4027 arr.gift_storecount = get_data.gift_storecount; 4121 arr.gift_storecount = get_data.gift_storecount;
  4122 + arr.whsle_id=get_data.goodsinfo.whsle_id;
4028 } 4123 }
4029 arr.s_libao = get_data.libao; 4124 arr.s_libao = get_data.libao;
4030 arr.s_lb_num = get_data.lb_num; 4125 arr.s_lb_num = get_data.lb_num;
@@ -4659,6 +4754,11 @@ Page({ @@ -4659,6 +4754,11 @@ Page({
4659 goods_color: gf_item.goodsinfo.goods_color, 4754 goods_color: gf_item.goodsinfo.goods_color,
4660 }; 4755 };
4661 4756
  4757 +
  4758 + //-- 如果是代发商品的时候 --
  4759 + if(gf_item.goodsinfo.whsle_id){
  4760 + newd.whsle_id=gf_item.goodsinfo.whsle_id;
  4761 + }
4662 await getApp().request.promisePost("/api/weshop/cart/save", { 4762 await getApp().request.promisePost("/api/weshop/cart/save", {
4663 data: newd 4763 data: newd
4664 }).then(res => { 4764 }).then(res => {
@@ -4714,6 +4814,11 @@ Page({ @@ -4714,6 +4814,11 @@ Page({
4714 goods_spec: gf_item.goodsinfo.goods_spec, 4814 goods_spec: gf_item.goodsinfo.goods_spec,
4715 goods_color: gf_item.goodsinfo.goods_color, 4815 goods_color: gf_item.goodsinfo.goods_color,
4716 }; 4816 };
  4817 + //-- 如果是代发商品的时候 --
  4818 + if(gf_item.goodsinfo.whsle_id){
  4819 + newd.whsle_id=gf_item.goodsinfo.whsle_id;
  4820 + }
  4821 +
4717 new_pk_list_goods.push(newd); 4822 new_pk_list_goods.push(newd);
4718 } 4823 }
4719 var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index]; 4824 var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
pages/cart/cart2_inte/cart2_inte.js
@@ -666,6 +666,12 @@ Page({ @@ -666,6 +666,12 @@ Page({
666 goods.skinface_id=getApp().globalData.skinface_id; 666 goods.skinface_id=getApp().globalData.skinface_id;
667 } 667 }
668 668
  669 + if(th.data.bn_goods.whsle_id){
  670 + item.is_whsle=1;
  671 + goods.is_whsle_goods=1;
  672 + }
  673 +
  674 +
669 //-- 把导购的信息填入-- 675 //-- 把导购的信息填入--
670 if (gg.guide_id) { 676 if (gg.guide_id) {
671 goods.guide_id = gg.guide_id; 677 goods.guide_id = gg.guide_id;
pages/cart/cart2_pt/cart2_pt.js
@@ -618,6 +618,12 @@ Page({ @@ -618,6 +618,12 @@ Page({
618 if(getApp().globalData.skinface_id){ 618 if(getApp().globalData.skinface_id){
619 goods.skinface_id=getApp().globalData.skinface_id; 619 goods.skinface_id=getApp().globalData.skinface_id;
620 } 620 }
  621 +
  622 + if(th.data.bn_goods.whsle_id){
  623 + item.is_whsle=1;
  624 + goods.is_whsle_goods=1;
  625 + }
  626 +
621 //--导购分享过来的id-- 627 //--导购分享过来的id--
622 if (gg.guide_id) { 628 if (gg.guide_id) {
623 goods.guide_id = gg.guide_id; 629 goods.guide_id = gg.guide_id;
pages/goods/goodsInfo/goodsInfo.js
@@ -352,6 +352,10 @@ Page({ @@ -352,6 +352,10 @@ Page({
352 getApp().globalData.guide_id = res.data.data.id; 352 getApp().globalData.guide_id = res.data.data.id;
353 } 353 }
354 }) 354 })
  355 +
  356 + if(!getApp().globalData.user_id){
  357 + ut.new_user_go(os.stoid,first_leader);
  358 + }
355 } 359 }
356 360
357 //-- 如果有房间号 -- 361 //-- 如果有房间号 --
@@ -886,7 +890,8 @@ Page({ @@ -886,7 +890,8 @@ Page({
886 } 890 }
887 891
888 892
889 - if (ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 2) { 893 + //一件代发商品不去计算优惠
  894 + if (!ee.data.whsle_id && ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 2) {
890 ee.check_is_youhui(ee.data.gid); 895 ee.check_is_youhui(ee.data.gid);
891 } 896 }
892 897
@@ -1390,6 +1395,13 @@ Page({ @@ -1390,6 +1395,13 @@ Page({
1390 prom_type: th.data.sele_g.prom_type, 1395 prom_type: th.data.sele_g.prom_type,
1391 }; 1396 };
1392 1397
  1398 +
  1399 + //-- 代发商品不参加优惠 --
  1400 + if(th.data.sele_g.whsle_id && newd.prom_type==3){
  1401 + newd.prom_type=0;
  1402 + newd.prom_id=0;
  1403 + }
  1404 +
1393 //---是不是从收藏夹出来的--- 1405 //---是不是从收藏夹出来的---
1394 if (th.data.c_guide_id) { 1406 if (th.data.c_guide_id) {
1395 newd['guide_id'] = th.data.c_guide_id; 1407 newd['guide_id'] = th.data.c_guide_id;
@@ -2847,7 +2859,7 @@ Page({ @@ -2847,7 +2859,7 @@ Page({
2847 }); 2859 });
2848 2860
2849 2861
2850 - that.check_is_youhui(gid, that.data.is_normal); 2862 + if(!item.whsle_id) that.check_is_youhui(gid, that.data.is_normal);
2851 2863
2852 //默认门店要拿下门店库存 2864 //默认门店要拿下门店库存
2853 if (that.data.sales_rules == 2 && that.data.def_pick_store) { 2865 if (that.data.sales_rules == 2 && that.data.def_pick_store) {
@@ -3619,7 +3631,7 @@ Page({ @@ -3619,7 +3631,7 @@ Page({
3619 this.get_sku(o.stoid, this.data.data, gid); 3631 this.get_sku(o.stoid, this.data.data, gid);
3620 this.check_has_flash(); 3632 this.check_has_flash();
3621 this.data.is_normal = 1; 3633 this.data.is_normal = 1;
3622 - this.check_is_youhui(gid, 1); 3634 + if(!this.data.data.whsle_id) this.check_is_youhui(gid, 1);
3623 return false; 3635 return false;
3624 } 3636 }
3625 3637
@@ -4262,7 +4274,7 @@ Page({ @@ -4262,7 +4274,7 @@ Page({
4262 }); 4274 });
4263 }); 4275 });
4264 } 4276 }
4265 - th.check_is_youhui(th.data.gid, 1); 4277 + if(!th.data.sele_g.whsle_id) th.check_is_youhui(th.data.gid, 1);
4266 } else { 4278 } else {
4267 4279
4268 if (th.data.is_normal) { 4280 if (th.data.is_normal) {
@@ -6637,7 +6649,7 @@ Page({ @@ -6637,7 +6649,7 @@ Page({
6637 }); 6649 });
6638 }); 6650 });
6639 } 6651 }
6640 - this.check_is_youhui(th.data.gid, 1); 6652 + if(!th.data.sele_g.whsle_id) this.check_is_youhui(th.data.gid, 1);
6641 }, 6653 },
6642 6654
6643 closeSpecModal_inte: function () { 6655 closeSpecModal_inte: function () {
@@ -6845,7 +6857,8 @@ Page({ @@ -6845,7 +6857,8 @@ Page({
6845 }); 6857 });
6846 this.get_sku(os.stoid, this.data.data, gid); 6858 this.get_sku(os.stoid, this.data.data, gid);
6847 this.get_sto(); 6859 this.get_sto();
6848 - this.check_is_youhui(gid, 1); 6860 + if(!this.data.data.whsle_id)
  6861 + this.check_is_youhui(gid, 1);
6849 this.data.is_normal = 1; 6862 this.data.is_normal = 1;
6850 }, 6863 },
6851 6864
@@ -6944,7 +6957,7 @@ Page({ @@ -6944,7 +6957,7 @@ Page({
6944 }); 6957 });
6945 }); 6958 });
6946 } 6959 }
6947 - this.check_is_youhui(th.data.gid, 1); 6960 + if(!this.data.data.whsle_id) this.check_is_youhui(th.data.gid, 1);
6948 }, 6961 },
6949 6962
6950 closeSpecModal_flash_normal: function () { 6963 closeSpecModal_flash_normal: function () {
pages/goods/goodsList/goodsList.js
@@ -41,6 +41,9 @@ Page({ @@ -41,6 +41,9 @@ Page({
41 getApp().globalData.guide_id=res.data.data.id; 41 getApp().globalData.guide_id=res.data.data.id;
42 } 42 }
43 }) 43 })
  44 + if(!getApp().globalData.user_id){
  45 + ut.new_user_go(oo.stoid,first_leader);
  46 + }
44 } 47 }
45 48
46 var th=this; 49 var th=this;
pages/index/index/index.js
@@ -173,6 +173,11 @@ Page({ @@ -173,6 +173,11 @@ Page({
173 getApp().globalData.guide_id = res.data.data.id; 173 getApp().globalData.guide_id = res.data.data.id;
174 } 174 }
175 }) 175 })
  176 +
  177 + if(!getApp().globalData.user_id){
  178 + ut.new_user_go(os.stoid,first_leader);
  179 + }
  180 +
176 } 181 }
177 182
178 // 判断是否有红包活动 183 // 判断是否有红包活动
pages/index/index/index.wxml
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
18 <view class="top-bar"> 18 <view class="top-bar">
19 <!-- 顶部关注公众号 --> 19 <!-- 顶部关注公众号 -->
20 <view id="off_top" wx:if="{{is_gz_h5}}"><official-account></official-account></view> 20 <view id="off_top" wx:if="{{is_gz_h5}}"><official-account></official-account></view>
21 -  
22 <!-- 控制要不要显示顶部门店选择 --> 21 <!-- 控制要不要显示顶部门店选择 -->
23 <block wx:if="{{is_topstore}}"> 22 <block wx:if="{{is_topstore}}">
24 <store_select style="z-index: 999;"></store_select> 23 <store_select style="z-index: 999;"></store_select>
@@ -45,17 +44,11 @@ @@ -45,17 +44,11 @@
45 </view> 44 </view>
46 </view> 45 </view>
47 </view> 46 </view>
48 -  
49 -  
50 -  
51 -  
52 -  
53 -  
54 - <!-- 如果有关注,要 -->  
55 - <!-- <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view> -->  
56 - <!-- 如果有顶部门店 -->  
57 - <!-- <view wx:if="{{is_topstore}}" style="height: 60rpx"></view> -->  
58 47
  48 + <!-- 如果有关注,要顶开位置,不能注释 -->
  49 + <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px;;flex-shrink:0"></view>
  50 + <!-- 如果有顶部门店,顶开位置的,不能注释 -->
  51 + <view wx:if="{{is_topstore}}" style="height:60rpx;flex-shrink:0"></view>
59 <!--滚动广告--> 52 <!--滚动广告-->
60 <view class="rel title-img" wx:if="{{banner}}"> 53 <view class="rel title-img" wx:if="{{banner}}">
61 <swiper circular="true" indicator-dots indicator-active-color="#fff" autoplay="true" class="swiper_box" duration="1000" interval="3000" vertical="" bindchange="bannerSwiperChange" style="height:{{max_sw_height}}rpx"> 54 <swiper circular="true" indicator-dots indicator-active-color="#fff" autoplay="true" class="swiper_box" duration="1000" interval="3000" vertical="" bindchange="bannerSwiperChange" style="height:{{max_sw_height}}rpx">
@@ -595,3 +588,5 @@ @@ -595,3 +588,5 @@
595 588
596 589
597 590
  591 +
  592 +
pages/togoin/togoin.js
@@ -187,15 +187,7 @@ Page({ @@ -187,15 +187,7 @@ Page({
187 }; 187 };
188 //--如果有邀请人的时候-- 188 //--如果有邀请人的时候--
189 if(th.data.first_leader){ 189 if(th.data.first_leader){
190 - //判断一下分享人是不是分享商  
191 - await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+th.data.first_leader,{}).then(res=>{  
192 - if(res.data.code==0){  
193 - var user= res.data.data;  
194 - if(user.is_distribut==1){  
195 - dd.first_leader=th.data.first_leader;  
196 - }  
197 - }  
198 - }) 190 + dd.first_leader=th.data.first_leader;
199 } 191 }
200 //-- 导购会员ID -- 192 //-- 导购会员ID --
201 if(getApp().globalData.guide_id){ 193 if(getApp().globalData.guide_id){
@@ -209,50 +201,70 @@ Page({ @@ -209,50 +201,70 @@ Page({
209 201
210 console.log("-----会员注册的信息-------"); 202 console.log("-----会员注册的信息-------");
211 console.log(dd); 203 console.log(dd);
212 - app.request.get("/api/weshop/users/thirdLogin", {  
213 - data: dd,  
214 - success: function (e) {  
215 -  
216 - if (e.data.code == 0) {  
217 - app.globalData.user_id = e.data.data.user_id;  
218 - } else {  
219 - return app.showWarning("授权登入失败!"+e.data.msg);  
220 - }  
221 -  
222 -  
223 - var need_go=0;  
224 - var t_user=e.data.data;  
225 -  
226 -  
227 - getApp().globalData.login_back=1;  
228 - wx.setStorageSync("userinfo",e.data.data);  
229 - wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);  
230 -  
231 - //如果有需要完善的信息没有完善,就需要跳转  
232 - if(!t_user['vipname'] && th.data.name_need_go){ need_go=1;}  
233 - if(!t_user['birthday'] && th.data.birth_need_go){ need_go=1;}  
234 - if(!t_user['idcard'] && th.data.idcard_need_go){ need_go=1;}  
235 - if(!t_user['address'] && th.data.address_need_go){ need_go=1;}  
236 - if(!t_user['pickup_id'] && th.data.pick_need_go){ need_go=1;}  
237 - if(!t_user['sex'] && th.data.sex_need_go){ need_go=1;}  
238 - if(!t_user['fromuser_id'] && th.data.introducer_need_go){ need_go=1;}  
239 -  
240 - if(need_go){  
241 - getApp().goto("/packageA/pages/profile/profile");  
242 - }else{  
243 - wx.navigateBack({ delta: 1})  
244 - }  
245 204
246 - },  
247 - failStatus: function (t) {  
248 - return app.my_warnning("授权登入失败,请稍后再试!", 0, that);  
249 - },  
250 - fail: function (t) {  
251 - return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1; 205 +
  206 + var need_go=0;
  207 + //如果有需要完善的信息没有完善,就需要跳转
  208 + if(th.data.name_need_go){ need_go=1;}
  209 + if(th.data.birth_need_go){ need_go=1;}
  210 + if(th.data.idcard_need_go){ need_go=1;}
  211 + if(th.data.address_need_go){ need_go=1;}
  212 + if(th.data.pick_need_go){ need_go=1;}
  213 + if(th.data.sex_need_go){ need_go=1;}
  214 + if(th.data.introducer_need_go){ need_go=1;}
  215 +
  216 + if(need_go){
  217 +
  218 + var req_data={
  219 + sessionKey: sessionKey,
  220 + encryptedData: e.encryptedData,
  221 + iv: e.iv,
  222 + store_id: getApp().globalData.setting.stoid,
  223 + }
  224 + //-- 获取一下手机 --
  225 + getApp().request.promiseGet("/api/weshop/users/getmobile", {data:req_data}).then(res=>{
  226 + if(res.data.code==0){
  227 + dd.mobile=res.data.data;
  228 + getApp().globalData.zc_dd=dd;
  229 + wx.redirectTo({
  230 + url:"/packageA/pages/profile/profile?is_back=1"
  231 + })
  232 + }
  233 + })
  234 +
  235 +
  236 + }else{
  237 + this.zu_ce(dd); //调用注册的函数
252 } 238 }
253 - }); 239 +
254 }, 240 },
255 241
  242 + zu_ce:function (dd) {
  243 + var th=this;
  244 + app.request.get("/api/weshop/users/thirdLogin", {
  245 + data: dd,
  246 + success: function (e) {
  247 + if (e.data.code == 0) {
  248 + app.globalData.user_id = e.data.data.user_id;
  249 + } else {
  250 + return app.showWarning("授权登入失败!"+e.data.msg);
  251 + }
  252 + getApp().globalData.login_back=1;
  253 + wx.setStorageSync("userinfo",e.data.data);
  254 + wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(app.globalData.userInfo.head_pic);
  255 + wx.navigateBack({ delta: 1})
  256 +
  257 + },
  258 + failStatus: function (t) {
  259 + return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
  260 + },
  261 + fail: function (t) {
  262 + return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  263 + }
  264 + });
  265 + },
  266 +
  267 +
256 bind_bnerr:function(e){ 268 bind_bnerr:function(e){
257 var _errImg = e.target.dataset.errorimg; 269 var _errImg = e.target.dataset.errorimg;
258 var _errObj = {}; 270 var _errObj = {};
pages/user/index/index.js
@@ -75,7 +75,25 @@ Page({ @@ -75,7 +75,25 @@ Page({
75 } 75 }
76 } 76 }
77 }) 77 })
78 - app.getUserFir(); 78 +
  79 + var first_leader = options.first_leader;
  80 + if(first_leader){
  81 + //-- user_id代过来免登录 --
  82 + getApp().globalData.first_leader = first_leader;
  83 + //调用接口判断是不是会员
  84 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  85 + if (res.data.code == 0) {
  86 + getApp().globalData.guide_id = res.data.data.id;
  87 + }
  88 + })
  89 +
  90 + if(!getApp().globalData.user_id){
  91 + ut.new_user_go(os.stoid,first_leader);
  92 + }
  93 +
  94 + }else{
  95 + app.getUserFir();
  96 + }
79 this.init_user_tool() 97 this.init_user_tool()
80 }, 98 },
81 99
@@ -484,7 +502,26 @@ Page({ @@ -484,7 +502,26 @@ Page({
484 /** 502 /**
485 * 用户点击右上角分享 503 * 用户点击右上角分享
486 */ 504 */
487 - onShareAppMessage: function () { getApp().globalData.no_clear = 1; }, 505 + onShareAppMessage: function () {
  506 + getApp().globalData.no_clear = 1;
  507 + var url = "/pages/user/index/index";
  508 +
  509 + if (userInfo) {
  510 + url += "?first_leader=" + getApp().globalData.user_id;
  511 + }
  512 + var title = "会员中心"
  513 + //分享
  514 + if (getApp().globalData.config && getApp().globalData.config.store_name) {
  515 + title = getApp().globalData.config.store_name;
  516 + } else if (getApp().globalData.setting.appName) {
  517 + title = getApp().globalData.setting.appName;
  518 + }
  519 +
  520 + var ob = {
  521 + title: title,path: url,
  522 + };
  523 + return ob;
  524 + },
488 525
489 //------卡片的显示和关闭-------- 526 //------卡片的显示和关闭--------
490 show_tc: function () { 527 show_tc: function () {
pages/user/order_detail/order_detail.js
@@ -1197,7 +1197,7 @@ Page({ @@ -1197,7 +1197,7 @@ Page({
1197 } 1197 }
1198 1198
1199 //如果有优惠促销的时候,要看下商品的优惠活动有没有过期 1199 //如果有优惠促销的时候,要看下商品的优惠活动有没有过期
1200 - if(g_item.prom_type==3 || good.prom_type==3){ 1200 + if((g_item.prom_type==3 || good.prom_type==3) && good.whsle_id<=0){
1201 var is_g_prom=0; 1201 var is_g_prom=0;
1202 //因为有全场优惠活动,商品参加的活动还未开始 1202 //因为有全场优惠活动,商品参加的活动还未开始
1203 var url="/api/weshop/activitylist/getGoodActInfo"; 1203 var url="/api/weshop/activitylist/getGoodActInfo";
pages/user/order_detail/order_detail.wxml
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 <view class="goods-num">×{{item.goods_num}}</view> 36 <view class="goods-num">×{{item.goods_num}}</view>
37 37
38 <!-- 不是整单退的时候 --> 38 <!-- 不是整单退的时候 -->
39 - <block wx:if="{{order.is_all_return!=1 && order.discount<=0 && order.coupon_price<=0 && order.order_prom_amount<=0 && order.discount_amount<=0 && item.prom_type!=5 && !order.is_prom}}"> 39 + <block wx:if="{{order.is_all_return!=1 && order.discount<=0 && order.coupon_price<=0 && order.order_prom_amount<=0 && order.discount_amount<=0 && item.prom_type!=5 && !order.is_prom && item.is_whsle_goods!=1}}">
40 <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}" 40 <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}"
41 data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==1 && !order.is_bedistri}}">申请退款</view> 41 data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==1 && !order.is_bedistri}}">申请退款</view>
42 <view bindtap="gotoreturn" class="return-btn" data-oid="{{item.order_id}}" 42 <view bindtap="gotoreturn" class="return-btn" data-oid="{{item.order_id}}"
pages/user/order_list/order_list.js
@@ -1439,7 +1439,7 @@ Page({ @@ -1439,7 +1439,7 @@ Page({
1439 } 1439 }
1440 1440
1441 //如果有优惠促销的时候,要看下商品的优惠活动有没有过期 1441 //如果有优惠促销的时候,要看下商品的优惠活动有没有过期
1442 - if(g_item.prom_type==3 || good.prom_type==3){ 1442 + if((g_item.prom_type==3 || good.prom_type==3) && good.whsle_id<=0){
1443 var is_g_prom=0; 1443 var is_g_prom=0;
1444 //因为有全场优惠活动,商品参加的活动还未开始 1444 //因为有全场优惠活动,商品参加的活动还未开始
1445 var url="/api/weshop/activitylist/getGoodActInfo"; 1445 var url="/api/weshop/activitylist/getGoodActInfo";
pages/user/order_list/order_list.wxml
@@ -150,7 +150,7 @@ @@ -150,7 +150,7 @@
150 </view> 150 </view>
151 <view class="flex-level-right fs26 refund"> 151 <view class="flex-level-right fs26 refund">
152 <!-- 不是整单退的时候 --> 152 <!-- 不是整单退的时候 -->
153 - <block wx:if="{{item.is_all_return!=1 && item.discount<=0 && item.coupon_price<=0 && item.order_prom_amount<=0 && item.discount_amount<=0 && goods.prom_type!=5 && !item.is_prom}}"> 153 + <block wx:if="{{item.is_all_return!=1 && item.discount<=0 && item.coupon_price<=0 && item.order_prom_amount<=0 && item.discount_amount<=0 && goods.prom_type!=5 && !item.is_prom && goods.is_whsle_goods!=1}}">
154 <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1 && !item.is_bedistri }}">申请退款</view> 154 <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1 && !item.is_bedistri }}">申请退款</view>
155 <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view> 155 <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view>
156 <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view> 156 <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view>
pages/user/userinfo/userinfo.js
@@ -88,12 +88,17 @@ Page({ @@ -88,12 +88,17 @@ Page({
88 console.log('ee',ee); 88 console.log('ee',ee);
89 var sms_conf = ee.switch_list; 89 var sms_conf = ee.switch_list;
90 sms_conf = JSON.parse(sms_conf); 90 sms_conf = JSON.parse(sms_conf);
91 - th.setData({  
92 - rank_switch:sms_conf.rank_switch,  
93 - is_lable_set: sms_conf.user_label_set, //是不是会员标签设置  
94 - guide_title:sms_conf.guide_consultant, //系统参数 导购标题  
95 - guide_change_time:sms_conf.guide_change_time, //每月能修改几次  
96 - }) 91 + let reg_type = ee.reg_type;
  92 + let reg_info = ee.reg_info;
  93 + var con_f={
  94 + rank_switch:sms_conf.rank_switch,
  95 + is_lable_set: sms_conf.user_label_set, //是不是会员标签设置
  96 + guide_title:sms_conf.guide_consultant, //系统参数 导购标题
  97 + guide_change_time:sms_conf.guide_change_time, //每月能修改几次
  98 + }
  99 + if(reg_type) con_f.reg_info= JSON.parse(reg_info);
  100 + th.setData(con_f)
  101 +
97 if (sms_conf.usercode_vailtime!=null && parseInt(sms_conf.usercode_vailtime)>0) 102 if (sms_conf.usercode_vailtime!=null && parseInt(sms_conf.usercode_vailtime)>0)
98 { 103 {
99 th.setData({ getusercode_vailtime: sms_conf.usercode_vailtime }); 104 th.setData({ getusercode_vailtime: sms_conf.usercode_vailtime });
@@ -101,7 +106,7 @@ Page({ @@ -101,7 +106,7 @@ Page({
101 if (sms_conf.user_label_set) { 106 if (sms_conf.user_label_set) {
102 th.query_checklabels(); 107 th.query_checklabels();
103 } 108 }
104 - }) 109 + },1)
105 }, 110 },
106 //查找会员选择的兴趣标签 111 //查找会员选择的兴趣标签
107 query_checklabels: function() { 112 query_checklabels: function() {
@@ -816,15 +821,7 @@ Page({ @@ -816,15 +821,7 @@ Page({
816 } 821 }
817 }) 822 })
818 } 823 }
819 - // var phone = "";  
820 - // phone+=a.mobile.substr(0, 3)+"****";  
821 - // phone += a.mobile.substr(7, 12);  
822 -  
823 -  
824 824
825 - // e.setData({  
826 - // isGender:e.data.user.sex  
827 - // })  
828 }, !0); 825 }, !0);
829 }, 826 },
830 827
pages/user/userinfo/userinfo.wxml
@@ -113,6 +113,12 @@ @@ -113,6 +113,12 @@
113 </block> 113 </block>
114 <view class="fs26">女</view> 114 <view class="fs26">女</view>
115 </view> 115 </view>
  116 +
  117 + <block wx:if="{{!user.sex}}">
  118 + <text class="lb_txt" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</text>
  119 + <text class="lb_txt" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</text>
  120 + </block>
  121 +
116 </view> 122 </view>
117 123
118 </view> 124 </view>
@@ -140,7 +146,7 @@ @@ -140,7 +146,7 @@
140 <view class="Mleft">农历</view> 146 <view class="Mleft">农历</view>
141 </view> 147 </view>
142 </view> 148 </view>
143 - <view class="user-txt-right"> 149 + <view class="user-txt-right flex ai_c">
144 <!-- 填充数据的时候要判断是否已经有出生日期,有值的话就不可修改 --> 150 <!-- 填充数据的时候要判断是否已经有出生日期,有值的话就不可修改 -->
145 <block wx:if="{{user.birthday==''||user.birthday==null}}"> 151 <block wx:if="{{user.birthday==''||user.birthday==null}}">
146 <picker bindchange='bindChange' value="{{datet}}" mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31"> 152 <picker bindchange='bindChange' value="{{datet}}" mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
@@ -150,7 +156,12 @@ @@ -150,7 +156,12 @@
150 <block wx:else> 156 <block wx:else>
151 <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view> 157 <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view>
152 </block> 158 </block>
153 - 159 +
  160 + <block wx:if="{{!user.birthday}}">
  161 + <text class="lb_txt" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</text>
  162 + <text class="lb_txt" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</text>
  163 + </block>
  164 +
154 </view> 165 </view>
155 </view> 166 </view>
156 </view> 167 </view>
@@ -158,18 +169,25 @@ @@ -158,18 +169,25 @@
158 <view class="Bbottom"> 169 <view class="Bbottom">
159 <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname"> 170 <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname">
160 <view class="user-name-txt">姓名</view> 171 <view class="user-name-txt">姓名</view>
161 - <input bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' /> 172 + <view class="flex ai_c">
  173 + <input bindblur="user_name" class="user-txt-right t-r" placeholder="*姓名" value='{{user.vipname}}' />
  174 + <block wx:if="{{!user.vipname}}">
  175 + <text class="lb_txt" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</text>
  176 + <text class="lb_txt" wx:if="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</text>
  177 + </block>
  178 + </view>
162 </view> 179 </view>
163 180
164 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname"> 181 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname">
165 <view class="user-name-txt">身份证</view> 182 <view class="user-name-txt">身份证</view>
  183 + <view class="flex ai_c">
  184 + <input bindblur="identity_card" class="user-txt-right t-r" value="{{user.idcard}}" placeholder="*身份证" />
  185 + <block wx:if="{{!user.idcard}}">
  186 + <text class="lb_txt" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</text>
  187 + <text class="lb_txt" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</text>
  188 + </block>
  189 + </view>
166 190
167 - <input bindblur="identity_card" class="user-txt-right t-r" value="{{user.idcard}}" placeholder="*身份证"></input>  
168 -  
169 -  
170 - <!-- <block wx:else>  
171 - <input class="user-txt-right" bindblur="IdentityIDCard" value="" type="idcard" maxlength="18" placeholder="*身份证" />  
172 - </block> -->  
173 </view> 191 </view>
174 <view data-url="/packageB/pages/user/Change_phone/Change_phone" bindtap="go_phone" class="user-name flex-vertical-between" data-type="mobile"> 192 <view data-url="/packageB/pages/user/Change_phone/Change_phone" bindtap="go_phone" class="user-name flex-vertical-between" data-type="mobile">
175 <view class="user-name-txt">更换手机</view> 193 <view class="user-name-txt">更换手机</view>
@@ -185,8 +203,14 @@ @@ -185,8 +203,14 @@
185 <view>{{user.address}}</view> 203 <view>{{user.address}}</view>
186 </block> 204 </block>
187 <block wx:else> --> 205 <block wx:else> -->
188 - <input bindblur="address" maxlength="30" value="{{user.address}}" class="user-txt-right" placeholder="*地址" style="text-align:right" />  
189 - <!-- </block> --> 206 + <view class="flex ai_c">
  207 + <input bindblur="address" maxlength="30" value="{{user.address}}" class="user-txt-right" placeholder="*地址" style="text-align:right" />
  208 + <block wx:if="{{!user.address}}">
  209 + <text class="lb_txt" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</text>
  210 + <text class="lb_txt" wx:if="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</text>
  211 + </block>
  212 + </view>
  213 +
190 </view> 214 </view>
191 215
192 <!-- 选择门店 --> 216 <!-- 选择门店 -->
@@ -194,7 +218,14 @@ @@ -194,7 +218,14 @@
194 <view class="user-name-txt">所属门店</view> 218 <view class="user-name-txt">所属门店</view>
195 <view class="flex-center user-txt-right"> 219 <view class="flex-center user-txt-right">
196 <view class="one-line">{{stoname}}</view> 220 <view class="one-line">{{stoname}}</view>
197 - <view class="angle">∟</view> 221 + <view class="flex ai_c">
  222 + <view class="angle">∟</view>
  223 + <block wx:if="{{!user.pickup_id}}">
  224 + <text class="lb_txt" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</text>
  225 + <text class="lb_txt" wx:if="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</text>
  226 + </block>
  227 + </view>
  228 +
198 </view> 229 </view>
199 </view> 230 </view>
200 231
@@ -239,7 +270,6 @@ @@ -239,7 +270,6 @@
239 <navigator bindtap="goto-address" class="user-name mt flex-vertical-between" url="/pages/user/address_list/address_list"> 270 <navigator bindtap="goto-address" class="user-name mt flex-vertical-between" url="/pages/user/address_list/address_list">
240 <view class="user-name-txt">收货地址</view> 271 <view class="user-name-txt">收货地址</view>
241 <view class="flex-center user-txt-right"> 272 <view class="flex-center user-txt-right">
242 - <!-- <view class="flex">{{user.address_id}}</view> -->  
243 <view class="angle">∟</view> 273 <view class="angle">∟</view>
244 </view> 274 </view>
245 </navigator> 275 </navigator>
pages/user/userinfo/userinfo.wxss
@@ -662,3 +662,7 @@ input { @@ -662,3 +662,7 @@ input {
662 height: 46rpx; 662 height: 46rpx;
663 line-height: 46rpx; 663 line-height: 46rpx;
664 } 664 }
  665 +
  666 +.lb_txt{
  667 + color: red; font-size: 24rpx;
  668 +}
utils/util.js
@@ -677,6 +677,28 @@ module.exports = { @@ -677,6 +677,28 @@ module.exports = {
677 url: r + o 677 url: r + o
678 }); 678 });
679 }, 679 },
  680 +
  681 + //分享注册,跳转到授权
  682 + new_user_go:function (stoid,first_leader) {
  683 + getApp().request.get("/api/weshop/users/get/" + stoid + "/" + first_leader,{
  684 + success: function(e) {
  685 + if (e.data.code == 0 && e.data.data ) {
  686 + // 提示框
  687 + wx.showModal({
  688 + title: '注册邀请',
  689 + content: e.data.data.vipname+'邀请你成为会员?',
  690 + success: function (res) {
  691 + if (res.confirm) {
  692 + getApp().goto("/pages/togoin/togoin");
  693 + }
  694 + }
  695 + })
  696 + }
  697 + }
  698 + })
  699 + },
  700 +
  701 +
680 unserialize: unserialize, 702 unserialize: unserialize,
681 _throttle:_throttle, 703 _throttle:_throttle,
682 unserialize_o: unserialize_o, 704 unserialize_o: unserialize_o,