Commit 97a16fba286f05a29b684aa4e980e3dbe6473b59

Authored by 后端研发-苏明海
2 parents fc266ee9 d92cdc87

Merge branch 'qa' into 'master'

Qa

See merge request !1044
Showing 43 changed files with 3140 additions and 619 deletions
app.json
... ... @@ -201,7 +201,9 @@
201 201 "pages/user/member/account/account",
202 202 "pages/user/member/account_unable/account_unable",
203 203 "pages/user/member/cash_record/cash_record",
204   - "pages/gift/gift"
  204 + "pages/gift/gift",
  205 +
  206 + "pages/shop/order_detail/order_detail"
205 207 ]
206 208 }
207 209  
... ...
packageA/pages/profile/profile.js
... ... @@ -23,6 +23,7 @@ var date = new Date(timestamp);
23 23 // barcode,
24 24 // qrcode
25 25 // } = require('../../../utils/index.js');
  26 +var regeneratorRuntime = require('../../../utils/runtime.js');
26 27  
27 28 Page({
28 29 data: {
... ... @@ -71,8 +72,9 @@ Page({
71 72 check_label: [], //我选择的兴趣标签
72 73 fir_guide_id:null, //存储会员详情接口出来的美导ID
73 74 isLunar: 0,
74   - lat: null, //维度
75   - lon: null, //经度
  75 + lat: null, //维度
  76 + lon: null, //经度
  77 + loading:0,
76 78  
77 79 },
78 80 //通过路径跳转到其他页面
... ... @@ -576,114 +578,104 @@ Page({
576 578  
577 579 self = this;
578 580 let url1 = '/api/weshop/storeconfig/get/';
579   - let url3 = '/api/weshop/users/getERPUser/';
  581 + let url3 = '/api/weshop/users/getErpvipidPickup';
580 582 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   -
  583 +
  584 + var uu=getApp().globalData.zc_dd;
  585 + if(uu){
  586 + this.setData({head_pic:uu.head_pic,nickname:uu.nickname})
  587 + }
  588 +
589 589 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);
  590 + success:async function(res) {
592 591 if(res.data.code == 0) {
593 592 let reg_type = res.data.data.reg_type;
594 593 let reg_info = res.data.data.reg_info;
595 594 if(reg_type) { //reg_type为1才显示积分信息
596 595 if(reg_info) {
597   - reg_info = JSON.parse(reg_info);
  596 + reg_info = JSON.parse(reg_info);
  597 + var user_id=0;
  598 +
  599 + //-- 获取会员信息 -
  600 + await getApp().request.promiseGet("/api/weshop/users/page", {data:{
  601 + store_id:r.stoid,mobile:uu.mobile
  602 + }}).then(res=>{
  603 + if(ut.ajax_ok(res)){
  604 + user_id=res.data.data.pageData[0].user_id;
  605 + }
  606 + })
  607 +
598 608 if(reg_info.reginfo_coupon){
599 609 //判断有没有领过券
600   - self.check_is_send_quan(reg_info.reginfo_coupon,user.user_id);
601   - }
  610 + self.check_is_send_quan(reg_info.reginfo_coupon,user_id);
  611 + }
  612 +
  613 + if(reg_info.reginfo_lb_id){
  614 + //判断有没有领过礼包
  615 + self.check_is_send_libao(reg_info.reginfo_lb_id,user_id);
  616 + }
  617 +
602 618 };
603 619 };
604 620 self.setData({
605 621 reg_type,
606 622 reg_info,
607   - user: app.globalData.userInfo,
608 623 });
609   - };
610   -
  624 + }
611 625 },
612 626 });
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   - }
  627 +
  628 +
  629 + //-- 获取线下会员的情况 --
  630 + var req_data={
  631 + stoid:r.stoid,
  632 + mobile:getApp().globalData.zc_dd.mobile
  633 + };
  634 + if(getApp().globalData.zc_dd.first_leade)
  635 + req_data.first_leader=getApp().globalData.zc_dd.first_leader
  636 +
  637 + wx.showLoading();
  638 + getApp().request.promiseGet(url3, {data:req_data}).then(res=>{
  639 + if(res.data.code==0){
  640 + var back_data=res.data.data; back_data=JSON.parse(back_data);
  641 + var set_data={is_fx:0};
  642 + //-- 如果有包含会员的线下的信息 --
  643 + if(back_data && back_data.erpviplist){
  644 + //-- data.data就是门店的数据 --
  645 + if(back_data.data){
  646 + back_data.erpviplist.pickup_id=back_data.data.pickup_id;
  647 + if(!back_data.erpviplist.pick) set_data.is_fx=1;
  648 + set_data.stoname=back_data.data.pickup_name;
  649 + set_data.sto_sele_id=back_data.data.pickup_id;
  650 + }
  651 +
  652 + //-- 推荐人姓名 --
  653 + if(back_data.erpviplist.fromuser) {
  654 + set_data.tjrname=back_data.erpviplist.fromuser;
  655 + back_data.erpviplist.fromuser_id=back_data.erpviplist.fromuser;
  656 + }
  657 + //性别
  658 + if(back_data.erpviplist.sex) set_data.isGender=back_data.erpviplist.sex;
  659 + //名称
  660 + if(back_data.erpviplist.vipname) set_data.name=back_data.erpviplist.vipname;
  661 + //身份证
  662 + if(back_data.erpviplist.idcard) set_data.id=back_data.erpviplist.idcard;
  663 + //地址
  664 + if(back_data.erpviplist.address) set_data.address=back_data.erpviplist.address;
  665 + //生日
  666 + if(back_data.erpviplist.birthday) {
  667 + set_data.datet=back_data.erpviplist.birthday;
  668 + set_data.isLunar=back_data.erpviplist.islunar;
  669 + }
  670 + set_data.user=back_data.erpviplist;
  671 + }
  672 + self.setData(set_data);
  673 + if(!self.data.sto_sele_id){
  674 + self.get_store_set();
  675 + }
  676 + }
  677 + wx.hideLoading();
  678 + })
687 679  
688 680 var is_back=t.is_back;
689 681 if(is_back) this.data.is_back=1;
... ... @@ -694,9 +686,7 @@ Page({
694 686  
695 687 getApp().check_can_share();
696 688  
697   - var e = this;
698 689 if (this.data.is_zy) return false;
699   - this.wait_for_store_config();
700 690  
701 691 //如果有传值进行跳转的话
702 692 var choice_guide=null;
... ... @@ -705,64 +695,108 @@ Page({
705 695 getApp().globalData.choice_guide=null;
706 696 }
707 697  
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 698 },
733 699  
734 700 check_is_send_quan:function(cid,uid){
735 701 var self=this;
736 702 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   - })
  703 + //-- 如果没有会员信息的时候 --
  704 + if(!uid){
  705 + //获取优惠券
  706 + url2 += cid;
  707 + app.request.get(url2, {
  708 + success: function(r) {
  709 + if(r.data.code == 0) {
  710 + self.setData({
  711 + couponInfo: r.data.data.name,
  712 + });
  713 + };
  714 + },
  715 + });
  716 +
  717 + }else{
  718 + //看一下会员有没有领过注册的券
  719 + getApp().promiseGet("/api/weshop/couponList/page",{
  720 + data:{store_id:r.stoid,uid:uid,cid:cid}
  721 + }).then(res=>{
  722 + var is_ling=0;
  723 + if(res.data.code==0 && res.data.data && res.data.data.total>0){
  724 + is_ling=1;
  725 + }
  726 +
  727 + //没有领过券,就显示
  728 + if(!is_ling){
  729 + //获取优惠券
  730 + url2 += cid;
  731 + app.request.get(url2, {
  732 + success: function(r) {
  733 + if(r.data.code == 0) {
  734 + console.log('000res==>', r.data.data.name);
  735 + self.setData({
  736 + couponInfo: r.data.data.name,
  737 + });
  738 + };
  739 + },
  740 + });
  741 + }
  742 +
  743 + })
  744 + }
  745 +
  746 +
  747 +
763 748  
764 749 },
765 750  
  751 + //-- 有没有送过礼包 --
  752 + check_is_send_libao:function(lbid,uid){
  753 + var self=this;
  754 + let url2 = '/api/weshop/marketing/giftbag/get';
  755 + if(!uid){
  756 + //获取礼包
  757 + app.request.get(url2, {
  758 + data:{storeId:r.stoid,giftBagId:lbid},
  759 + success: function(r) {
  760 + if(r.data.code == 0) {
  761 + console.log('000res==>', r.data.data.name);
  762 + self.setData({
  763 + libao: r.data.data.lbTitle,
  764 + });
  765 + }
  766 + }
  767 + });
  768 +
  769 + }else{
  770 + //看一下会员有没有领过注册的券
  771 + getApp().promiseGet("/api/weshop/marketing/gift/getgiveone",{
  772 + data:{store_id:r.stoid,user_id:uid,lbid:lbid,act_type:7}
  773 + }).then(res=>{
  774 + var is_ling=0;
  775 + if(res.data.code==0 && res.data.data && res.data.data.total>0){
  776 + is_ling=1;
  777 + }
  778 + //没有领过礼包,就显示
  779 + if(!is_ling){
  780 + //获取礼包
  781 + app.request.get(url2, {
  782 + data:{storeId:r.stoid,giftBagId:lbid},
  783 + success: function(r) {
  784 + if(r.data.code == 0) {
  785 + self.setData({
  786 + libao: r.data.data.lbTitle,
  787 + });
  788 + }
  789 + }
  790 + });
  791 + }
  792 +
  793 + })
  794 + }
  795 +
  796 + },
  797 +
  798 +
  799 +
766 800  
767 801 //------卡片的显示和关闭--------
768 802 show_tc: function() {
... ... @@ -782,8 +816,6 @@ Page({
782 816 tc_hide: true,
783 817 });
784 818 },
785   -
786   -
787 819  
788 820 //地址
789 821 address: function(e) {
... ... @@ -854,39 +886,54 @@ Page({
854 886 datas.staffId=th.data.user.staffId;
855 887 }
856 888  
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   - })
  889 + var post_data={ ...getApp().globalData.zc_dd, ...datas }
  890 + this.zu_ce(post_data);
876 891 },
  892 +
  893 +
  894 + zu_ce:function (dd) {
  895 + var th=this;
  896 + wx.showLoading({
  897 + title: "处理中.",
  898 + mask:true
  899 + })
  900 +
  901 + app.request.get("/api/weshop/users/thirdLogin", {
  902 + data: dd,
  903 + success: function (e) {
  904 +
  905 + wx.hideLoading();
  906 + th.setData({loading:0}) ;
  907 +
  908 + if (e.data.code == 0) {
  909 + app.globalData.user_id = e.data.data.user_id;
  910 + } else {
  911 + return app.showWarning("授权登入失败!"+e.data.msg);
  912 + }
  913 + getApp().globalData.login_back=1;
  914 + wx.setStorageSync("userinfo",e.data.data);
  915 + wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = s.getFullUrl(a.globalData.userInfo.head_pic);
  916 + wx.navigateBack({ delta: 1})
  917 +
  918 + },
  919 + failStatus: function (t) {
  920 + wx.hideLoading();
  921 + th.setData({loading:0}) ;
  922 + return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
  923 + },
  924 + fail: function (t) {
  925 + wx.hideLoading();
  926 + th.setData({loading:0}) ;
  927 + return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  928 + }
  929 + });
  930 + },
  931 +
877 932 //选择地址
878 933 goto_address: function() {
879 934 // this.setData({ is_zy: 1 });
880 935 },
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   -
  936 +
890 937 //--点击分享事件---
891 938 onShareAppMessage: function(t) {
892 939 getApp().globalData.no_clear=1
... ... @@ -983,9 +1030,8 @@ Page({
983 1030 this.setData({
984 1031 datet: e.detail.value,
985 1032 });
986   - };
987   -
988   - // console.log(this.data.datet, this.data.isCalendar);
  1033 + }
  1034 +
989 1035 },
990 1036  
991 1037 // 生日判断
... ... @@ -1074,7 +1120,6 @@ Page({
1074 1120  
1075 1121 var data = {
1076 1122 store_id: r.stoid,
1077   - user_id: app.globalData.user_id,
1078 1123 };
1079 1124  
1080 1125 //-- 需要推荐人 --
... ... @@ -1083,11 +1128,7 @@ Page({
1083 1128 if (tjrname == "" || tjrname == null) {
1084 1129 app.my_warnning("请输入推荐人", 0, this);
1085 1130 return false;
1086   - };
1087   - if(tjrname==user.mobile || tjrname==user.erpvipno ){
1088   - app.my_warnning("推荐人不能是自己", 0, this);
1089   - return false;
1090   - }
  1131 + };
1091 1132 data.tjrname=tjrname;
1092 1133 }
1093 1134  
... ... @@ -1119,7 +1160,7 @@ Page({
1119 1160 };
1120 1161  
1121 1162 data.birthday=birthday;
1122   - data.islunar=self.data.isLunar;
  1163 + data.islunar=self.data.isLunar?1:0;
1123 1164 }
1124 1165  
1125 1166 //-- 需要身份证 --
... ... @@ -1155,97 +1196,23 @@ Page({
1155 1196 app.my_warnning("请您先阅读和勾选指定的内容", 0, this);
1156 1197 return false;
1157 1198 };
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   - })
  1199 +
  1200 +
  1201 +
  1202 +
  1203 + var post_data={ ...getApp().globalData.zc_dd, ...data };
  1204 +
  1205 + delete post_data.sessionKey;
  1206 + delete post_data.encryptedData;
  1207 + delete post_data.iv;
  1208 +
  1209 +
  1210 + if(th.data.loading) return false;
  1211 + th.setData({loading:1}) ;
  1212 +
  1213 + this.zu_ce(post_data);
1177 1214  
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   - // })
  1215 +
1249 1216 },
1250 1217  
1251 1218  
... ...
packageA/pages/profile/profile.wxml
... ... @@ -7,13 +7,13 @@
7 7 <view class="flex-center">
8 8  
9 9 <view class="flex-center">
10   - <image class="Headportrait" src="{{user.head_pic}}"></image>
  10 + <image class="Headportrait" src="{{head_pic}}"></image>
11 11 </view>
12 12  
13 13 <view class="flex-center vipmax">
14 14 <view>
15 15 <view class="fs32">
16   - <view class="ellipsis-1 Nickname">{{user.nickname}}
  16 + <view class="ellipsis-1 Nickname">{{nickname}}
17 17 </view>
18 18 </view>
19 19 </view>
... ... @@ -28,11 +28,13 @@
28 28 <!-- 如果需要接骚人信息 -->
29 29 <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}">
30 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 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>
35   - <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view>
  36 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && reg_info.introducer_state && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view>
  37 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && reg_info.introducer_state && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view>
36 38 </block>
37 39 </view>
38 40  
... ... @@ -41,8 +43,8 @@
41 43 <view class="user-name-txt">姓名:</view>
42 44 <input bindinput="getName" bindblur="" value="{{user['vipname']?user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/>
43 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>
45   - <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
  46 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view>
  47 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view>
46 48 </block>
47 49 </view>
48 50  
... ... @@ -68,10 +70,10 @@
68 70 <view class="fs26">女</view>
69 71 </view>
70 72 </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>
  73 +
  74 + <block wx:if="{{!user['sex']}}">
  75 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && reg_info.sex_state && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view>
  76 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && reg_info.sex_state && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view>
75 77 </block>
76 78 </view>
77 79  
... ... @@ -93,8 +95,8 @@
93 95 </view>
94 96  
95 97 <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 + <view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && reg_info.birthday_state && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view>
  99 + <view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && reg_info.birthday_state && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view>
98 100 </block>
99 101 </view>
100 102  
... ... @@ -103,8 +105,8 @@
103 105 <view class="user-name-txt shrink0">身份证:</view>
104 106 <input bindinput="getId" bindblur="IdentityIDCard" value="{{user.idcard}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码"></input>
105 107 <block wx:if="{{!user.idcard}}">
106   - <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{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 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && reg_info.idcard_state && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view>
  109 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && reg_info.idcard_state && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view>
108 110 </block>
109 111 </view>
110 112  
... ... @@ -113,8 +115,8 @@
113 115 <view class="user-name-txt">地址:</view>
114 116 <input bindinput="getAddress" bindblur="" value="{{user.address?user.address:''}}" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" />
115 117 <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 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.address && reg_info.address_state && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view>
  119 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && reg_info.address_state && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view>
118 120 </block>
119 121 </view>
120 122  
... ... @@ -127,9 +129,9 @@
127 129 <view class="angle">∟</view>
128 130 </view>
129 131  
130   - <block wx:if="{{!user.pickup_id}}">
131   - <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>
  132 + <block wx:if="{{!user.pickup_id && !is_fx }}">
  133 + <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && reg_info.pick_state && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view>
  134 + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && reg_info.pick_state && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view>
133 135 </block>
134 136 </view>
135 137  
... ... @@ -172,8 +174,9 @@
172 174  
173 175 <!-- 保存按钮 -->
174 176 <view class="confirm">
175   - <view class="fs30 confirmtext" bindtap="save">保存</view>
  177 + <view class="fs30 confirmtext {{loading?'gray':''}}" bindtap="save">保存</view>
176 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 180 </view>
178 181  
179 182 <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"-->
... ...
packageA/pages/profile/profile.wxss
... ... @@ -130,6 +130,11 @@ input {
130 130 margin: 0 auto;
131 131 }
132 132  
  133 +.confirmtext.gray{
  134 + background-color:darkgrey;
  135 +}
  136 +
  137 +
133 138 .cmleft {
134 139 margin-left: 45rpx;
135 140 }
... ...
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... ... @@ -2238,6 +2238,11 @@ Page({
2238 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 2247 if (gg.guide_id) {
2243 2248 goods.guide_id = gg.guide_id;
... ...
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... ... @@ -495,7 +495,7 @@ Page({
495 495 });
496 496 },
497 497 //---------计算立即购买----------
498   - calculatePrice2: function () {
  498 + calculatePrice2: async function () {
499 499 console.log('calculatePrice2');
500 500 var th = this,
501 501 good = this.data.bn_goods;
... ... @@ -506,12 +506,14 @@ Page({
506 506 th.setData({
507 507 [txt]: allpice,
508 508 });
509   - console.log(th.data.formData);
510   -
511 509  
512   - to.getwuliuprice(async function (rs) {
  510 + wx.showLoading({
  511 + title: "处理中.",
  512 + mask:true
  513 + })
  514 + //to.getwuliuprice(async function (rs) {
513 515  
514   - var o_shipping_price = 0,
  516 + var o_shipping_price = 0,
515 517 goods_weight = -1,
516 518 goods_piece = -1;
517 519 var out_of_weight = null; //超出多少重量
... ... @@ -539,8 +541,7 @@ Page({
539 541 let item = gd_arr_list[i];
540 542  
541 543 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
542   -
543   -
  544 + if (goods_weight < 0) goods_weight = 0;
544 545 if (item['exp_sum_type'] == 2) {
545 546 goods_weight += item['weight'] * item['buynum'];
546 547 cut_good_weight += item['weight'] * item['buynum'];
... ... @@ -581,9 +582,36 @@ Page({
581 582 else out_of_weight = -back_data.weight_free * 1000;
582 583  
583 584 var code = th.data.wu_arr[th.data.index].code;
584   - var shipping_price =
585   - ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
586   - goods_piece, th.data.user_addr, back_data,rs);
  585 + var shipping_price =0;
  586 + // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  587 + // goods_piece, th.data.user_addr, back_data,rs);
  588 +
  589 + var w_data={
  590 + store_id:os.stoid, code:code,
  591 + o_shipping_price:o_shipping_price,
  592 + goods_weight:goods_weight,
  593 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  594 + user_addr_province:th.data.user_addr.province,
  595 + user_addr_city:th.data.user_addr.city,
  596 + user_addr_district:th.data.user_addr.district,
  597 + is_by_all:back_data && back_data.is_by_all?1:0,
  598 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  599 + }
  600 +
  601 + var is_ok=0;
  602 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  603 + if(res.data.code==0){
  604 + shipping_price=res.data.data; is_ok=1;
  605 + }
  606 + })
  607 + if(!is_ok){
  608 + wx.showToast({
  609 + title: "计算物流错误", icon: 'none',duration: 2000
  610 + })
  611 + th.setData({ show_submit:0 });
  612 + wx.hideLoading();
  613 + }
  614 +
587 615  
588 616 shipping_price = parseFloat(shipping_price).toFixed(2);
589 617 var wl_txt = "formData.shipping_price";
... ... @@ -616,24 +644,27 @@ Page({
616 644 if (parseFloat(th.data.yuer) > total_m) {
617 645 th.setData({
618 646 [txt]: total_m,
619   - [txt2]: 0
  647 + [txt2]: 0,
  648 + is_show_sub:1
620 649 })
621 650 } else {
622 651 order_m = parseFloat(order_m) - parseFloat(th.data.yuer);
623 652 order_m = order_m.toFixed(2);
624 653 th.setData({
625 654 [txt]: th.data.yuer,
626   - [txt2]: order_m
  655 + [txt2]: order_m,
  656 + is_show_sub:1
627 657 })
628 658 }
629 659 } else {
630 660 th.setData({
631 661 [txt]: 0,
632   - [txt2]: order_m
  662 + [txt2]: order_m,
  663 + is_show_sub:1
633 664 })
634 665 }
635   -
636   - });
  666 + wx.hideLoading();
  667 + //});
637 668  
638 669 },
639 670  
... ... @@ -783,6 +814,12 @@ Page({
783 814 if(getApp().globalData.skinface_id){
784 815 goods.skinface_id=getApp().globalData.skinface_id;
785 816 }
  817 +
  818 + if(th.data.bn_goods.whsle_id){
  819 + item.is_whsle=1;
  820 + goods.is_whsle_goods=1;
  821 + }
  822 +
786 823 //--导购分享过来的id--
787 824 if (gg.guide_id) {
788 825 goods.guide_id = gg.guide_id;
... ...
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml
... ... @@ -154,7 +154,7 @@
154 154 </view>
155 155 </view>
156 156  
157   - <view class="btn-wrap">
  157 + <view class="btn-wrap" wx:if="{{is_show_sub}}">
158 158 <view class="pay-amount">
159 159 <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
160 160 <!-- <view class="co-red big"></view> -->
... ...
packageC/pages/payForAnother/payForAnother.js
... ... @@ -2119,6 +2119,11 @@ Page({
2119 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 2128 if (gg.guide_id) {
2124 2129 goods.guide_id = gg.guide_id;
... ...
packageC/pages/presell/cart/cart.js
... ... @@ -1716,9 +1716,9 @@ Page({
1716 1716  
1717 1717  
1718 1718 //----计算物流的钱----
1719   - calculate_wuliu() {
  1719 + async calculate_wuliu() {
1720 1720 var to = getApp(), th = this;
1721   - to.getwuliuprice(async function (rs) {
  1721 + //to.getwuliuprice(async function (rs) {
1722 1722 var o_shipping_price = 0,
1723 1723 goods_weight = -1,
1724 1724 goods_piece = -1,
... ... @@ -1823,6 +1823,7 @@ Page({
1823 1823 let item = gd_arr_list[i];
1824 1824  
1825 1825 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
  1826 + if (goods_weight < 0) goods_weight = 0;
1826 1827 if (item['exp_sum_type'] == 2) {
1827 1828 goods_weight += item['weight'] * item['buynum'];
1828 1829 cut_good_weight += item['weight'] * item['buynum'];
... ... @@ -1867,8 +1868,36 @@ Page({
1867 1868 th.data.is_no_by[th.data.bn_pick] = 0;
1868 1869  
1869 1870 //--------------开始计算物流------------------
1870   - var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
1871   - goods_piece, th.data.user_addr, back_data, rs);
  1871 + var shipping_price =0;
  1872 +
  1873 + //ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  1874 + //goods_piece, th.data.user_addr, back_data, rs);
  1875 + var w_data={
  1876 + store_id:os.stoid, code:code,
  1877 + o_shipping_price:o_shipping_price,
  1878 + goods_weight:goods_weight,
  1879 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  1880 + user_addr_province:th.data.user_addr.province,
  1881 + user_addr_city:th.data.user_addr.city,
  1882 + user_addr_district:th.data.user_addr.district,
  1883 + is_by_all:back_data && back_data.is_by_all?1:0,
  1884 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  1885 + }
  1886 +
  1887 + var is_ok=0;
  1888 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  1889 + if(res.data.code==0){
  1890 + shipping_price=res.data.data; is_ok=1;
  1891 + }
  1892 + })
  1893 + if(!is_ok){
  1894 + wx.showToast({
  1895 + title: "计算物流错误", icon: 'none',duration: 2000
  1896 + })
  1897 + th.setData({ show_submit:0 });
  1898 + wx.hideLoading();
  1899 + return false;
  1900 + }
1872 1901  
1873 1902 exp_price = parseFloat(shipping_price).toFixed(2);
1874 1903 }
... ... @@ -1876,7 +1905,7 @@ Page({
1876 1905 } else {
1877 1906 th.wuliu_next(allpice, quan_price, exp_price);
1878 1907 }
1879   - });
  1908 + //});
1880 1909 },
1881 1910 //相同的东西统一在一起
1882 1911 wuliu_next(allpice, quan_price, exp_price) {
... ...
packageC/pages/presell/cart/cart.wxml
... ... @@ -346,6 +346,9 @@
346 346 </view>
347 347 </view>
348 348  
  349 +
  350 +
  351 +
349 352 <!-- 要支付尾款的时候 -->
350 353 <view class="fixedToBottom shadow-1" wx:if="{{wait_wk}}">
351 354 <view wx:if="{{no_start}}" class="date-container">尾款时间{{filters.format_time(act.pay_begindate,1)}} -
... ... @@ -363,7 +366,7 @@
363 366 </view>
364 367 </view>
365 368 <button wx:if="{{no_start || is_end || is_complete}}" class="tips-btn gray">支付尾款</button>
366   - <button wx:else class="tips-btn" bindtap="show_pay">支付尾款</button>
  369 + <button wx:else class="tips-btn" bindtap="show_pay" hidden="{{!show_submit}}">支付尾款</button>
367 370 <!-- 预售 -->
368 371 <!-- <button class="tips-btn" formType="submit" id="submitOrder">立即支付</button> -->
369 372 </view>
... ... @@ -371,14 +374,13 @@
371 374 <!-- 当订单不是支付尾款的时候 -->
372 375 <view class="fixedToBottom shadow-1" wx:else style="background-color: #fff;display: flex; justify-content: flex-end; padding: 10rpx 0">
373 376 <view bindtap="cancelOrder" data-id="{{order.order_id}}" class="tips-btn2" wx:if="{{wait_dj}}">取消订单</view>
374   - <view bindtap="jumpToCart4" class="tips-btn2" wx:if="{{wait_dj}}">立即付款</view>
  377 +
  378 + <view hidden="{{!show_submit}}" bindtap="jumpToCart4" class="tips-btn2" wx:if="{{wait_dj}}">立即付款</view>
375 379 <block wx:if="{{!(order.has_rt || order.return_btn==2 || order.return_btn==4) && wait_sh && !wait_fh }}">
376 380 <navigator bindtap="confirmOrder" class="tips-btn2" hidden="{{!wait_sh}}">收货确认</navigator>
377 381 </block>
378 382  
379 383 <view class="tips-btn2" wx:if="{{order.order_status==3}}" bindtap="deleteOrderData" data-order_id="{{order.order_id}}" >删除订单</view>
380   -
381   -
382 384 <navigator class="tips-btn2" hidden="{{!order.shipping_btn}}" url="/pages/user/express/express?order_id={{order.order_id}}">查看物流</navigator>
383 385  
384 386  
... ... @@ -401,6 +403,8 @@
401 403 </view>
402 404  
403 405  
  406 +
  407 +
404 408 </form>
405 409  
406 410 <!-- 使用券列表的弹窗 -->
... ...
packageC/pages/presell/cart/cart2.js
... ... @@ -571,7 +571,7 @@ Page({
571 571  
572 572  
573 573 //---------计算立即购买----------
574   - calculatePrice2: function () {
  574 + calculatePrice2: async function () {
575 575 var th = this, good = this.data.bn_goods;
576 576 if (!good) return false;
577 577  
... ... @@ -582,7 +582,7 @@ Page({
582 582 }
583 583  
584 584 wx.showLoading({
585   - title: "处理中."
  585 + title: "处理中.",mask:true
586 586 })
587 587 //-----------计算商品总价--------------
588 588 var allpice = good.shop_price * good.buynum;
... ... @@ -609,8 +609,8 @@ Page({
609 609 }
610 610  
611 611  
612   - to.getConfig2(function (ee) {
613   - to.getwuliuprice(async function (rs) {
  612 + // to.getConfig2(function (ee) {
  613 + // to.getwuliuprice(async function (rs) {
614 614  
615 615 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
616 616 var out_of_weight = null; //超出多少重量
... ... @@ -699,9 +699,11 @@ Page({
699 699 let item = gd_arr_list[i];
700 700  
701 701 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
  702 + if (goods_weight < 0) goods_weight = 0;
702 703 if (item['exp_sum_type'] == 2) {
703 704 cut_good_weight += item['weight'] * item['buynum'];
704 705 goods_weight += item['weight'] * item['buynum'];
  706 +
705 707 }
706 708 if (back_data.weight_free > 0) {
707 709 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
... ... @@ -743,9 +745,35 @@ Page({
743 745 if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
744 746  
745 747 //--------------开始计算物流------------------
746   - var shipping_price =
747   - ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
748   - goods_piece, th.data.user_addr, back_data, rs);
  748 + var shipping_price =0;
  749 + // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  750 + // goods_piece, th.data.user_addr, back_data, rs);
  751 + var w_data={
  752 + store_id:os.stoid, code:code,
  753 + o_shipping_price:o_shipping_price,
  754 + goods_weight:goods_weight,
  755 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  756 + user_addr_province:th.data.user_addr.province,
  757 + user_addr_city:th.data.user_addr.city,
  758 + user_addr_district:th.data.user_addr.district,
  759 + is_by_all:back_data && back_data.is_by_all?1:0,
  760 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  761 + }
  762 +
  763 + var is_ok=0;
  764 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  765 + if(res.data.code==0){
  766 + shipping_price=res.data.data; is_ok=1;
  767 + }
  768 + })
  769 + if(!is_ok){
  770 + wx.showToast({
  771 + title: "计算物流错误", icon: 'none',duration: 2000
  772 + })
  773 + th.setData({ show_submit:0 });
  774 + wx.hideLoading();
  775 + return false;
  776 + }
749 777  
750 778  
751 779 if (shipping_price <= 0) {
... ... @@ -914,8 +942,8 @@ Page({
914 942  
915 943 wx.hideLoading();
916 944  
917   - });
918   - });
  945 + // });
  946 + // });
919 947 },
920 948  
921 949 //--------------------提交订单-----------------------
... ... @@ -1054,6 +1082,11 @@ Page({
1054 1082 goods.skinface_id=getApp().globalData.skinface_id;
1055 1083 }
1056 1084  
  1085 + if(th.data.bn_goods.whsle_id){
  1086 + item.is_whsle=1;
  1087 + goods.is_whsle_goods=1;
  1088 + }
  1089 +
1057 1090 //-- 把导购的信息填入--
1058 1091 if (gg.guide_id) {
1059 1092 goods.guide_id = gg.guide_id;
... ...
packageC/pages/presell/cart/cart2_pre.js
... ... @@ -542,6 +542,11 @@ Page({
542 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 550 //--导购分享过来的id--
546 551 if (gg.guide_id) {
547 552 goods.guide_id = gg.guide_id;
... ...
packageD/pages/shop/order_detail/order_detail.js 0 → 100644
  1 +var e = getApp(), r = e.request,rq=r,t = require("../../../../utils/util.js"), o = require("../../../../utils/common.js"),oo=e.globalData,os=oo.setting;
  2 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  3 +var ut= require('../../../../utils/util.js');
  4 +var py = require("../../../../utils/pay.js");
  5 +
  6 +
  7 +Page({
  8 + data: {
  9 + url: os.url,
  10 + resourceUrl: os.imghost,
  11 + iurl: os.imghost,
  12 + order: null,
  13 + optionIsGoup: !1,
  14 + user_note: "",
  15 + conf:null,
  16 + },
  17 + onLoad: function(e) {
  18 + var th=this;
  19 + var r = void 0 !== e.isGoup && e.isGoup;
  20 +
  21 + getApp().getConfig2(function (e) {
  22 +
  23 + th.setData({conf: e,sales_rules:e.sales_rules, userInfo: getApp().globalData.userInfo});
  24 + //--- 看后台是不是有开通等级卡 ---
  25 +
  26 + },1)
  27 +
  28 + this.setData({
  29 + optionIsGoup: r
  30 + }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update");
  31 + },
  32 + onShow: function() {
  33 + wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"),
  34 + this.requestOrderDetail(this.data.order.order_id));
  35 + },
  36 + requestOrderDetail: function(e) {
  37 + var o = this,oid=e,th=this;
  38 + r.get(o.data.url + "/api/weshop/order/get/"+os.stoid+"/"+e, {
  39 + success: function(e) {
  40 + var r = e.data.data;
  41 + r.addTimeFormat = t.format(r.add_time);
  42 + if (r.order_status == 0 && r.pay_status==0 ){
  43 + r.order_status_detail="待支付"; r.pay_btn=1;
  44 + }
  45 + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status== 0)
  46 + r.order_status_detail = "待发货";
  47 +
  48 + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 1){
  49 + r.order_status_detail = "待收货";r.receive_btn=1;
  50 + if (r.exp_type == 0) r.shipping_btn=1;
  51 + }
  52 + if (r.order_status == 1 && r.pay_status == 1 && r.shipping_status == 2){
  53 + r.order_status_detail = "待收货"; r.receive_btn = 1;
  54 + if (r.exp_type == 0) r.shipping_btn = 1;
  55 + }
  56 + if (r.order_status == 2){
  57 + r.order_status_detail = "待评价"; if (r.exp_type == 0) r.shipping_btn = 1;
  58 + }
  59 + if (r.order_status == 3)
  60 + r.order_status_detail = "已取消";
  61 + if (r.order_status == 4){
  62 + r.order_status_detail = "已完成"; if (r.exp_type == 0) r.shipping_btn = 1;
  63 + }
  64 + if (r.order_status == 5)
  65 + r.order_status_detail = "已作废";
  66 + if (r.order_status == 6)
  67 + r.order_status_detail = "退款完成";
  68 + if (r.pt_status == 1 && r.pt_prom_id>0)
  69 + r.order_status_detail = "组团中";
  70 +
  71 +
  72 + r['is_all_return'] = 0;
  73 +
  74 + var discount_price=r['discount_amount'];
  75 + var dis_json=r['prom_pt_json'];
  76 +
  77 + if(dis_json && discount_price){
  78 + var prom_pt_json=JSON.parse(dis_json);
  79 + var ladder_amount=0;
  80 + for (var ll_item of prom_pt_json) {
  81 + if(ll_item['ladder_prom_id']){
  82 + ladder_amount += ll_item['dis'];
  83 + }
  84 + }
  85 + r['ladder_amount']=ladder_amount;
  86 + r['discount_amount']=Math.floor((discount_price-ladder_amount)*100)/100;
  87 + }
  88 +
  89 +
  90 +
  91 +
  92 + //------获取订单商品-------
  93 + rq.get("/api/weshop/ordergoods/list",{
  94 + data: { store_id: os.stoid, order_id: oid},
  95 + success:async function (eb) {
  96 + r.order_goods=eb.data.data.pageData;
  97 + var glist = r.order_goods;
  98 + for(var i in glist){
  99 + if(glist[i].is_gift){
  100 + r.is_prom=1;
  101 + }
  102 + }
  103 +
  104 + //------------对比一下有没有退款记录------------
  105 + await getApp().request.promiseGet("/api/weshop/order/returngoods/page",{
  106 + data: { order_id: r.order_id, store_id: os.stoid,
  107 + user_id:oo.user_id, pageSize: 20 }
  108 + }).then(rs=>{
  109 + var ttd=rs;
  110 + //--看一下订单的总数量--
  111 + var gtype_num = r.order_goods.length;
  112 + if(ttd.data.data.pageData == undefined) return false;
  113 + var goodslist = r.order_goods;
  114 +
  115 + //----没有相关的退款记录----
  116 + if (ttd.data.data.total==0){
  117 + r['is_all_return'] = 0;
  118 +
  119 + goodslist.forEach(function (ee, ii) {
  120 + if (r['order_status'] == 1 && r['pay_status'] == 1 && gtype_num>1){
  121 + //是不是可以单个商品退款
  122 + if(th.check_for_return_btn(r) ) {
  123 + goodslist[ii]['return_btn']=1;
  124 + }
  125 + }
  126 + });
  127 + }else{
  128 + //--------整单退--------
  129 + if (ttd.data.data.pageData[0]['goods_id_list'] != null
  130 + && ttd.data.data.pageData[0]['goods_id_list'] != ''){
  131 +
  132 +
  133 + var eea = ttd.data.data.pageData[0];
  134 + //1.退款正在进行中,
  135 + //2.退款被拒绝就要显示可以退款
  136 + //3.退款已经完成
  137 + r['is_all_return']=1;
  138 + r['is_all_return_status'] = ttd.data.data.pageData[0].status;
  139 +
  140 + if (r['order_status'] == 1 && r['pay_status'] == 1) {
  141 + switch (eea.status) {
  142 + case 0:
  143 + case 1:
  144 + r.order_status_detail="退款中";
  145 + r['return_btn'] = 2; break;
  146 + case 2:
  147 + r.order_status_detail="退款完成";
  148 + r['return_btn'] = 4; break;
  149 + case 3:
  150 + r['return_btn'] = 3; break;
  151 + default:
  152 + r['return_btn'] = 0;
  153 + }
  154 + }
  155 + }else{
  156 + //1.退款正在进行中,
  157 + //2.退款被拒绝就要显示可以退款
  158 + //3.退款已经完成
  159 + r['is_all_return'] = 0;
  160 + var rt_ok_num=0;
  161 +
  162 + //if(r['order_status'] == 1 && r['pay_status'] == 1) {
  163 + goodslist.forEach(function (eeb, iii) {
  164 + if(r['order_status'] == 1 && r['pay_status'] == 1)
  165 + goodslist[iii]['return_btn'] = 1; //申请退款
  166 + ttd.data.data.pageData.forEach(function (eea, ii) {
  167 + var st = eea.status;
  168 + if (eea.goods_id == eeb.goods_id){
  169 +
  170 + switch (eea.status){
  171 + case 0:
  172 + case 1://退款处理中
  173 + r['has_rt'] = 1; //有部分退
  174 + goodslist[iii]['return_btn'] = 2; break;
  175 + case 2://退款完成
  176 + r['has_rt'] = 1; //有部分退
  177 + goodslist[iii]['return_btn'] = 4;rt_ok_num++; break;
  178 + case 3://已拒绝,重新退款
  179 + goodslist[iii]['return_btn'] = 3; break;
  180 + default:
  181 + if(r['order_status'] == 1 && r['pay_status'] == 1)
  182 + goodslist[iii]['return_btn'] = 1; //申请退款
  183 + }
  184 + return;
  185 + }
  186 + });
  187 + });
  188 + //}
  189 + }
  190 + }
  191 +
  192 + //--如果是全部退款,也就可以删除--
  193 + if(rt_ok_num==goodslist.length){
  194 + r['is_all_return_status']=2;
  195 + }
  196 + r['order_goods'] = goodslist;
  197 + var g_num = 0;
  198 + goodslist.forEach(function (ee, ii) {
  199 + if(ee.return_btn!=4)
  200 + g_num += ee.goods_num;
  201 + });
  202 + r['g_num'] = g_num;
  203 + })
  204 +
  205 +
  206 + //--------获取门店-----------
  207 + rq.get("/api/weshop/pickup/get/" + os.stoid + "/" + r.pickup_id, {
  208 + success: function (ebb) {
  209 + r.pickname = ebb.data.data.pickup_name;
  210 + o.setData({
  211 + order: r,
  212 + });
  213 + }
  214 + })
  215 +
  216 +
  217 + }
  218 + })
  219 + }
  220 + });
  221 + },
  222 + /*-----联系客户------*/
  223 + contactService: function() {
  224 + getApp().con_Service();
  225 + },
  226 +
  227 + //--------取消订单---------
  228 + cancelOrder: function(e) {
  229 + var t = this,th=t, o = e.currentTarget.dataset.id,order=this.data.order;
  230 + var is_skill=0;
  231 + var order_goods=order.order_goods;
  232 + var is_zsorder=order.is_zsorder;
  233 +
  234 + //--判断是不是秒杀--
  235 + order_goods.forEach(function (val,ind) {
  236 + if(val.prom_type==1){
  237 + is_skill=1; return false;
  238 + }
  239 + })
  240 +
  241 + wx.showModal({
  242 + title: "是否取消订单?",
  243 + success: function(e) {
  244 + if(!e.confirm) return false;
  245 + //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单
  246 + //if(is_skill==1 || is_zsorder>=2){
  247 + getApp().request.post("/api/weshop/order/cancelOrder/"+os.stoid+"/"+o+"/"+getApp().globalData.user_id,{
  248 + data:{},
  249 + success: function(t) {
  250 + if(t.data.code==0)
  251 + th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0);
  252 + },
  253 + })
  254 + /*----
  255 + }else{
  256 + getApp().request.put("/api/weshop/order/updatebyId", {
  257 + data: {order_id: o, order_status: 3},
  258 + success: function(e) {
  259 + th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0);
  260 + }
  261 + });
  262 + }--*/
  263 + }
  264 + });
  265 + },
  266 +
  267 + //--------确认收货---------
  268 + confirmOrder: function(e) {
  269 + var th=this;
  270 + var t = this, o = this.data.order.order_id,order=this.data.order;
  271 + var is_zsorder=order.is_zsorder;
  272 + wx.showModal({
  273 + title: "是否确认收货?",
  274 + success: function(t) {
  275 + t.confirm && rq.post("/api/weshop/order/confirmOrder/"+os.stoid+"/"+o+"/"+getApp().globalData.user_id,{
  276 + success:function (e) {
  277 + if(e.data.code==0){
  278 + th.requestOrderDetail(o)
  279 + }
  280 + }
  281 + })
  282 + }
  283 + });
  284 + },
  285 +
  286 + //--------立即支付----------
  287 + async jumpToCart4(e) {
  288 +
  289 + if(this.data.paying) return false;
  290 + this.setData({paying:1});
  291 +
  292 + var th=this;
  293 + if(this.data.optionIsGoup)
  294 + wx.navigateTo({
  295 + url: "/pages/team/team_confirm/team_confirm?orderSn=" + this.data.order.order_sn + "&orderPay=true"
  296 + })
  297 + var order=this.data.order;
  298 + var order_goods=order.order_goods;
  299 + var user_id=order.user_id;
  300 +
  301 + var wlist="";
  302 + for(var i in order_goods){
  303 + var good=order_goods[i];
  304 + //线下取价功能已经关闭或者过期
  305 + if(!th.data.is_open_offline && good.offline_cut>0){
  306 + wx.showModal({
  307 + title: '提示',
  308 + content: '线下取价功能已经关闭或者过期!'
  309 + });
  310 + th.setData({paying:0});
  311 + return false;
  312 + }
  313 +
  314 + //要每件每件的商品进行检查,看有么有超出库存,超出限购
  315 + var good= order_goods[i],goodsbuynum=0,promgoodsbuynum=0,gg=null;
  316 + //获取单品的现在的活动状态
  317 + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + good.goods_id, {
  318 + }).then(res=>{
  319 + gg=res.data.data;
  320 + })
  321 + var limit = gg.viplimited;
  322 + var store_count = gg.store_count;
  323 + good.erpwareid=gg.erpwareid;
  324 +
  325 + //---要获得商品,该用户买了多少件,同步应用---
  326 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  327 + data: {
  328 + store_id: os.stoid,
  329 + user_id: getApp().globalData.user_id,
  330 + goods_id: good.goods_id,
  331 + prom_type: good.prom_type,
  332 + prom_id: good.prom_id
  333 + },
  334 + }).then(res => {
  335 + var buy_num_data = res.data.data;
  336 + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum;
  337 + goodsbuynum = buy_num_data.goodsbuynum;
  338 + })
  339 +
  340 + var buyed_mum2=goodsbuynum+good.goods_num;
  341 + if (buyed_mum2 > limit && limit > 0) {
  342 +
  343 + var content=gg.goods_name+'购买数量超出商品限购,请取消订单';
  344 + th.toast(content);
  345 + th.setData({paying:0});
  346 + return false;
  347 + }
  348 + //当是组合优惠的时候
  349 + if(good.prom_type==7){
  350 + //如果有组合购
  351 + var isok = 1;
  352 + var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+good.prom_id+"/"+getApp().globalData.userInfo.user_id;
  353 + await getApp().request.promiseGet(url, {}).then(res => {
  354 + if(res.data.code==0 && res.data.data){
  355 + if(res.data.data.is_show!=1){
  356 + isok=0;
  357 + }
  358 + //如果活动已经结束
  359 + if(res.data.data.is_end==1){
  360 + isok=0;
  361 + }
  362 + //已经结束
  363 + if(ut.gettimestamp()>res.data.data.end_time){
  364 + isok=0;
  365 + }
  366 + //还未开始
  367 + if(ut.gettimestamp()<res.data.data.start_time){
  368 + isok=0;
  369 + }
  370 +
  371 + }else{
  372 + //未找到商品的活动
  373 + isok = 0;
  374 + }
  375 +
  376 + })
  377 + if (!isok){
  378 + var content=gg.goods_name+'活动已经结束,请取消订单';
  379 + th.toast(content);
  380 + th.setData({paying:0});
  381 + return false;
  382 + }
  383 +
  384 + var url1 = "/api/weshop/prom/zhbuyGoods/page";
  385 + var req_data = {
  386 + page: 1,
  387 + pageSize: 1,
  388 + store_id: os.stoid,
  389 + zh_id: good.prom_id,
  390 + goods_id:good.goods_id
  391 + }
  392 + await getApp().request.promiseGet(url1, {
  393 + data: req_data
  394 + }).then(res => {
  395 + if (ut.ajax_ok(res)) {
  396 + var gdlist = res.data.data.pageData[0];
  397 + good.buyqty=gdlist.buyqty;
  398 + }
  399 + })
  400 +
  401 + var num=good['buyqty'];
  402 + console.log(1111);
  403 + console.log(num);
  404 + //---- 要计算商品的限购 -----
  405 + if(good['buyqty']>0){
  406 + if(good.goods_num+promgoodsbuynum>good['buyqty']){
  407 +
  408 + var content= good['goods_name']+"超出活动限购\n";
  409 + th.toast(content);
  410 + th.setData({paying:0});
  411 + return false;
  412 + }
  413 + }
  414 + }
  415 +
  416 + //如果优惠促销和搭配购的时候
  417 + if((good.prom_type==3 || good.prom_type==5) && good.is_collocation!=1 && good.is_gift!=1){
  418 + var p_ok = 1,is_g_prom=0;
  419 + //因为有全场优惠活动,商品参加的活动还未开始
  420 + var url="/api/weshop/activitylist/getGoodActInfo";
  421 + var req_data={
  422 + store_id:os.stoid,goodsidlist:good.goods_id,is_detail:1,user_id:user_id
  423 + };
  424 + await getApp().request.promiseGet(url, {data:req_data}).then(async function (res) {
  425 + if(res.data.code==0 && res.data.data && res.data.data.length){
  426 + for(let i in res.data.data){
  427 + let item=res.data.data[i];
  428 + if(item.prom_type==3) {
  429 + is_g_prom=1; break;
  430 + }
  431 + }
  432 + }
  433 + })
  434 + if(is_g_prom){
  435 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => {
  436 + if (res.data.code == 0) {
  437 + var r_data = res.data.data;
  438 + if (!r_data.collocationPromList && good.prom_type == 5) {
  439 +
  440 + var content = good.goods_name + '未找到活动,请取消订单重新购买';
  441 + th.toast(content)
  442 + p_ok = 0;
  443 + }
  444 + if (!r_data.promGoodsLists && good.prom_type == 3) {
  445 +
  446 + var content = good.goods_name + '未找到活动,请取消订单重新购买';
  447 + th.toast(content);
  448 + p_ok = 0;
  449 + }
  450 + } else {
  451 +
  452 + var content = good.goods_name + '未找到活动,请取消订单重新购买'
  453 + th.toast(content);
  454 + th.setData({paying:0});
  455 + p_ok = 0;
  456 + }
  457 + })
  458 + }else{
  459 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromNormal/" + os.stoid + "/" + good.goods_id, {}).then(res => {
  460 + if (res.data.code == 0) {
  461 + var r_data = res.data.data;
  462 + if (!r_data.collocationPromList && good.prom_type == 5) {
  463 +
  464 + var content = good.goods_name + '未找到活动,请取消订单重新购买';
  465 + th.toast(content)
  466 +
  467 + p_ok = 0;
  468 + }
  469 + if (!r_data.promGoodsLists && good.prom_type == 3) {
  470 +
  471 + var content = good.goods_name + '未找到活动,请取消订单重新购买';
  472 + th.toast(content);
  473 + p_ok = 0;
  474 + }
  475 + } else {
  476 +
  477 + var content = good.goods_name + '未找到活动,请取消订单重新购买'
  478 + th.toast(content);
  479 + p_ok = 0;
  480 + }
  481 + })
  482 +
  483 + }
  484 + if (!p_ok){
  485 + th.setData({paying:0});return false;
  486 + }
  487 + }
  488 +
  489 + //商品的普通购买 ,不要进行判断
  490 + if((good.prom_type==1 || good.prom_type==2 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){
  491 + if(gg.prom_type!=good.prom_type && gg.prom_type>0) {
  492 + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
  493 + th.toast(content);
  494 + th.setData({paying:0});
  495 + return false;
  496 + }
  497 + }else{
  498 + if((gg.prom_type==1 || gg.prom_type==3 || gg.prom_type==5 || gg.prom_type==6 || gg.prom_type==4)
  499 + && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
  500 + var prom=null;
  501 + //---如果是活动的时候---
  502 + var prom=null,th=this;
  503 + if(gg.prom_type==1){
  504 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+gg.prom_id,{
  505 + }).then(res=>{
  506 + if(res.data.code==0){
  507 + prom=res.data.data;
  508 + prom.price=prom.user_price;
  509 + }
  510 + })
  511 + }
  512 +
  513 + if (gg.prom_type == 2) {
  514 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ gg.goods_id + "/" + gg.prom_id, {}).then(res => {
  515 + if (res.data.code == 0) {
  516 + prom = res.data.data;
  517 + prom.price=prom.price;
  518 + }
  519 + })
  520 + }
  521 +
  522 +
  523 + if(gg.prom_type==6){
  524 + await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+gg.prom_id,{
  525 + }).then(res=>{
  526 + if(res.data.code==0){
  527 + prom=res.data.data;
  528 + }
  529 + })
  530 + }
  531 +
  532 + if(gg.prom_type==4){
  533 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  534 + data:{store_id:os.stoid,goods_id:gg.goods_id}
  535 + }).then(res=>{
  536 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
  537 + prom=res.data.data.pageData[0];
  538 + }
  539 + })
  540 + }
  541 +
  542 + if(prom){
  543 + var t_now=ut.gettimestamp();
  544 + if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){
  545 +
  546 + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
  547 + th.toast(content);
  548 + th.setData({paying:0});
  549 + return false;
  550 + }
  551 + }
  552 + }else{
  553 + //不是赠品的时候
  554 + if(!good.is_gift && good.prom_type!=3){
  555 + var t_ok=1;
  556 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0"+"/"+getApp().globalData.user_id, {}).then(res => {
  557 + if(res.data.code==0){
  558 + var r_data=res.data.data;
  559 + //-- 参加了全局的优惠活动 --
  560 + if(r_data.promGoodsLists){
  561 +
  562 + var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
  563 + th.toast(content);
  564 + t_ok=0;
  565 + }
  566 + }
  567 + })
  568 + if(!t_ok) {
  569 + th.setData({paying:0});return false;
  570 + }
  571 + }
  572 +
  573 + //-- 如果有参加线下取价 --
  574 + if(good.offline_cut>0) wlist+=encodeURIComponent(gg.erpwareid)+",";
  575 + }
  576 + //赠品和搭配购不判断商品金额
  577 + var isok=1;
  578 + var card_field=th.data.card_field; // 会员等级
  579 + //如果会员是等级会员,商品有等级价,且不是活动商品
  580 + if(!good.is_gift && !good.is_collocation) {
  581 + if (card_field && gg[card_field] > 0) {
  582 + if (good.goods_price != gg[card_field] && good.offline_cut<=0) isok = 0;
  583 + if (good.goods_price >gg[card_field] && good.offline_cut>0) isok = 0; //如果线下价格比较贵,则不通过
  584 +
  585 + } else {
  586 + if (good.goods_price != gg.shop_price && good.offline_cut<=0) isok = 0;
  587 + if (good.goods_price> gg.shop_price && good.offline_cut>0) isok = 0; //如果线下价格比较贵,则不通过
  588 + }
  589 + var is_h=0;
  590 + if (!isok) {
  591 +
  592 + var content=gg.goods_name + '商品的价格发生了变化,请取消订单重新购买22';
  593 + th.toast(content);
  594 + th.setData({paying:0});
  595 + return false;
  596 + }
  597 + }
  598 +
  599 + //--如果是线下库存的时候--
  600 + if(th.data.conf.sales_rules==2){
  601 + var ob={};
  602 + await th.check_down_line_next(gg,good.goods_num,order.pickup_id,function(obj){
  603 + ob=obj;
  604 + })
  605 + if(ob.code==-1){
  606 + var content=gg.goods_name+'门店库存不足,请取消订单';
  607 + th.toast(content);
  608 + th.setData({paying:0});
  609 + return false;
  610 + }
  611 +
  612 + }else{
  613 + if(good.goods_num>store_count){
  614 +
  615 + var content=gg.goods_name+'商品的库存不足,请取消订单';
  616 + th.toast(content);
  617 + th.setData({paying:0});
  618 + return false;
  619 + }
  620 +
  621 + }
  622 + }
  623 +
  624 + console.log("------------------------------------");
  625 + //---如果是活动的时候---
  626 + var prom=null,goodsinfo=good,th=this;
  627 + if(goodsinfo.prom_type==1){
  628 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+goodsinfo.prom_id,{
  629 + }).then(res=>{
  630 + if(res.data.code==0){
  631 + prom=res.data.data;
  632 + prom.price=prom.user_price;
  633 + }
  634 + })
  635 + }
  636 +
  637 + if (goodsinfo.prom_type == 2) {
  638 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ good.goods_id + "/" + goodsinfo.prom_id, {}).then(res => {
  639 + if (res.data.code == 0) {
  640 + prom = res.data.data;
  641 + prom.price=prom.price;
  642 + }
  643 + })
  644 + }
  645 +
  646 +
  647 + if(goodsinfo.prom_type==6 && !good.is_pd_normal){
  648 + await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  649 + }).then(res=>{
  650 + if(res.data.code==0){
  651 + prom=res.data.data;
  652 + }
  653 + })
  654 + }
  655 +
  656 + if(goodsinfo.prom_type==4 && !good.is_integral_normal){
  657 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  658 + data:{store_id:os.stoid,goods_id:goodsinfo.goods_id}
  659 + }).then(res=>{
  660 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
  661 + prom=res.data.data.pageData[0];
  662 + }
  663 + })
  664 + }
  665 +
  666 + //----------如果有活动,并且在进行中,就不计算线下库存---------------
  667 + if(prom){
  668 + var now=ut.gettimestamp();
  669 + if(prom.is_end==1 && prom.end_time<now){
  670 +
  671 + var content=goodsinfo.goods_name+'商品的活动已经结束,请取消订单重新购买';
  672 + th.toast(content);
  673 + th.setData({paying:0});
  674 + return false;
  675 + }
  676 +
  677 + buyed_mum2=promgoodsbuynum+good.goods_num;
  678 + if (buyed_mum2 > prom.buy_limit && prom.buy_limit > 0) {
  679 + var content=goodsinfo.goods_name+'购买数量超出商品活动限购,请取消订单重新购买';
  680 + th.toast(content);
  681 + th.setData({paying:0});
  682 + return false;
  683 + }
  684 + //看一下会员的秒杀价格是不是发生了变化
  685 + if(goodsinfo.prom_type==1 && goodsinfo.goods_price!=prom.price){
  686 + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
  687 + th.toast(content);
  688 + th.setData({paying:0});
  689 + return false;
  690 + }
  691 +
  692 + //看一下会员的团购价格是不是发生了变化
  693 + if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){
  694 + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
  695 + th.toast(content);
  696 + th.setData({paying:0});
  697 + return false;
  698 + }
  699 +
  700 + if(goodsinfo.prom_type==4){
  701 + if (good.goods_num > prom.limitqty-prom.buy_num) {
  702 +
  703 + var content=goodsinfo.goods_name+'购买数量超出商品活动库存,请取消订单';
  704 + th.toast(content);
  705 + th.setData({paying:0});
  706 + return false;
  707 + }
  708 + }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) {
  709 + if(order.add_time+5*60<ut.gettimestamp()) {
  710 + var content = gg.goods_name + '该订单已经超时无法支付,请取消订单';
  711 + th.toast(content);
  712 + th.setData({paying:0});
  713 + return false;
  714 + }
  715 + }
  716 +
  717 + }
  718 +
  719 + }
  720 +
  721 + //-- 要判断一下线下取价价格是不是发生改变 --
  722 + if(wlist!="" && th.data.is_open_offline && th.data.is_open_offline>0){
  723 + wlist=ut.sub_last(wlist);
  724 + var keyid=order.pickup_id;
  725 + var user_info=getApp().globalData.userInfo;
  726 + if(!keyid) {
  727 + th.setData({paying:0});return false;
  728 + }
  729 + var offarr=null;
  730 + await getApp().request.promiseGet("/api/weshop/goods/listWarePrice", {
  731 + data:{
  732 + VIPId:encodeURIComponent(user_info.erpvipid),
  733 + store_id:os.stoid,
  734 + PickupId:keyid,
  735 + WareIds:wlist},
  736 + },
  737 + ).then(res=>{
  738 + if(res.data.code==0 && res.data.data && res.data.data.length>0){
  739 + offarr=res.data.data;
  740 + }
  741 + })
  742 + if(!offarr && offarr.length<=0 ){
  743 + wx.showModal({ title: '获取线下取价失败',});
  744 + }
  745 + var newarr=ut.convert_arr_key(offarr,'WareId');
  746 + //-- 循环判断线下的价格 --
  747 + for(var k in order_goods){
  748 + var good=order_goods[k];
  749 + //判断线下取价是不是一样
  750 + if(newarr[good.erpwareid] &&
  751 + parseFloat(newarr[good.erpwareid].WarePrice)!=parseFloat(good.goods_price)){
  752 +
  753 + var content=good.goods_name + '商品的价格发生了变化,请取消订单重新购买';
  754 + th.toast(content);
  755 + th.setData({paying:0});
  756 + return false;
  757 + }
  758 + }
  759 +
  760 + }
  761 +
  762 + /*---
  763 + o.jumpToCart4({
  764 + order_sn: this.data.order.order_sn,
  765 + order_amount: this.data.order.order_amount,
  766 + type: 1 //正常单
  767 + }, 1);--*/
  768 +
  769 + py.pay(this.data.order.order_sn, function() {
  770 + th.setData({paying:0});
  771 + wx.showToast({title: '支付成功'})
  772 + wx.navigateBack();
  773 + },function () {
  774 + th.setData({paying:0});
  775 + },os.stoid,1);
  776 +
  777 +
  778 + },
  779 + checkTeam: function() {
  780 + wx.navigateTo({
  781 + url: "/pages/team/team_detail/team_detail?foundId=" + this.data.order.orderTeamFound.found_id
  782 + });
  783 + },
  784 +
  785 + //------图片失败,默认图片---------
  786 + bind_bnerr: function (e) {
  787 + var _errImg = e.target.dataset.errorimg;
  788 + var _errObj = {};
  789 + _errObj[_errImg] = "public/images/default_goods_image_240.gif";
  790 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  791 + },
  792 +
  793 + zfwk:function(){
  794 + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id;
  795 + wx.redirectTo({
  796 + url:url,
  797 + })
  798 + },
  799 +
  800 + //--------跳转到退款详情-----------
  801 + gotoreturn: function (t) {
  802 + var e = t.currentTarget.dataset.recid;
  803 + var oid = t.currentTarget.dataset.oid;
  804 + var wh = "";
  805 + if (e != undefined && e != null && e != "") {
  806 + wh = "&goods_id=" + e;
  807 + }
  808 + wx.navigateTo({
  809 + url: "/pages/user/return_goods_info/return_goods_info?order_id=" + oid + wh,
  810 + });
  811 + },
  812 +
  813 + //---判断是不是有退款-----
  814 + checkReturnGoodsStatus: function (t) {
  815 + var e = t.currentTarget.dataset.recid;
  816 + var oid = t.currentTarget.dataset.oid;
  817 + r.get("/api/weshop/order/returngoods/page", {
  818 + data: {
  819 + goods_id: e,
  820 + order_id: oid,
  821 + store_id: os.stoid
  822 + },
  823 + success: function (t) {
  824 + if (t.data.code == 0) {
  825 + var r = t.data.data.total;
  826 + if (0 == r) return wx.navigateTo({
  827 + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid,
  828 + });
  829 + //--如果拒绝,就重新申请退款--
  830 + if (t.data.data.pageData[0].status == 3) {
  831 + return wx.navigateTo({
  832 + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid,
  833 + });
  834 + }
  835 +
  836 + wx.navigateTo({
  837 + url: "/pages/user/return_goods_info/return_goods_info?id=" + r
  838 + });
  839 + }
  840 + }
  841 + });
  842 + },
  843 +
  844 + //-----删除订单-----
  845 + deleteOrderData: function(t) {
  846 + var th=this;
  847 + var order_id=t.currentTarget.dataset.order_id;
  848 + var up_data={
  849 + order_id: order_id,isdel:1
  850 + };
  851 + if(th.data.order.order_status!=6){
  852 + up_data.order_status=5;
  853 + }
  854 + wx.showModal({
  855 + title: "是否删除订单?",
  856 + success: function(tt) {
  857 + tt.confirm && rq.put("/api/weshop/order/updatebyId", {
  858 + data: up_data,
  859 + success: function (t) {
  860 + getApp().my_warnning("删除成功",1,th);
  861 + setTimeout(function () {
  862 + getApp().goto("/pages/user/order_list/order_list");
  863 + },1000);
  864 + }
  865 + })
  866 + }
  867 + });
  868 + },
  869 +
  870 + //--判断是不是可以单个商品退--
  871 + check_for_return_btn:function (item) {
  872 + if(item.coupon_no) return false; //有用优惠券
  873 + if(item.order_prom_id) return false; //有订单优惠
  874 + if(item.order_status>=2) return false; //订单状态>2
  875 + var istrue=true;
  876 + //----判断是不是有优惠活动和赠送商品----
  877 + for (var g in item.order_goods) {
  878 + var g_item=item.order_goods[g];
  879 + if ((g_item.prom_type == 3 && g_item.discount_amount> 0)
  880 + || (g_item.prom_type== 3 && g_item.goods_price <= 0)
  881 + ) {
  882 + istrue=false; break
  883 + }
  884 + if (g_item.prom_type== 5) {
  885 + istrue=false; break
  886 + }
  887 + }
  888 + if(!istrue) return false;
  889 + var conf=this.data.conf;
  890 + //判断是不是原路退回
  891 + if(conf.refund_type==1) return true;
  892 + else{
  893 + if(item.order_amount==0 || item.user_money==0) return true;
  894 + }
  895 + return false;
  896 + },
  897 +
  898 +
  899 +
  900 + //---检验线下库存的数量的子函数---
  901 + async check_down_line_next(gg,num,pick_id,func){
  902 +
  903 + var lock=0,pick_no,plist;
  904 + //先读取门店的lock
  905 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  906 + data:{store_id:os.stoid,wareId:gg.goods_id,storageId:pick_id}
  907 + }).then(res=>{
  908 + if(res.data.code==0 && res.data.data.total>0){
  909 + for(var i in res.data.data.pageData)
  910 + lock+=res.data.data.pageData[i].outQty;
  911 + }
  912 + })
  913 + //先获取门店的编号
  914 + await getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{
  915 + data:{storeId:os.stoid,goodsId:gg.goods_id,pickupId:pick_id}
  916 + }).then(res=>{
  917 + if(res.data.code==0){
  918 + pick_no=res.data.data.pickup_no;
  919 + }
  920 + })
  921 + //读取线下的门店库存
  922 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  923 + data:{storageNos:pick_no,wareIds:encodeURIComponent(gg.erpwareid),storeId:os.stoid}
  924 + }).then(res=>{
  925 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  926 + plist=res.data.data.pageData[0];
  927 + }
  928 + })
  929 + var ob={}; ob.code=1;
  930 + if(!plist){
  931 + ob.code=-1; ob.CanOutQty=0;
  932 + func(ob);return false;
  933 + }
  934 +
  935 + if(num>plist.CanOutQty-lock){
  936 + ob.code=-1;
  937 + ob.CanOutQty=plist.CanOutQty-lock
  938 + if(ob.CanOutQty<0) ob.CanOutQty=0;
  939 + }
  940 + func(ob)
  941 + },
  942 +
  943 +
  944 + //再来一单的功能的实现
  945 + moreOrder:function(e){
  946 + var th=this;
  947 + var item=th.data.order;
  948 +
  949 + if(this.data.moring) return false;
  950 + this.data.moring=1;
  951 +
  952 + th.check_more_order(item);
  953 + },
  954 +
  955 + check_more_order:async function(item){
  956 + var pickup=null,th=this;
  957 + var user_id=getApp().globalData.userInfo.user_id;
  958 + wx.showLoading();
  959 + //--------获取门店-----------
  960 + await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + item.pickup_id, {
  961 +
  962 + }).then(res=>{
  963 + pickup = res.data.data;
  964 + })
  965 + if(!pickup){
  966 + wx.hideLoading();
  967 + getApp().confirmBox("找不到门店");
  968 + this.data.moring=0;
  969 + return false;
  970 + }
  971 +
  972 + if(pickup.isstop){
  973 + wx.hideLoading();
  974 + getApp().confirmBox("门店已停用");
  975 + this.data.moring=0;
  976 + return false;
  977 + }
  978 +
  979 + if(!pickup.is_pos){
  980 + wx.hideLoading();
  981 + getApp().confirmBox("门店不允许销售");
  982 + this.data.moring=0;
  983 + return false;
  984 + }
  985 +
  986 + //--------获取商品----------
  987 + var goods_list=item.order_goods;
  988 + //--- 返回的内容 ---
  989 + var back_goods_arr=[];
  990 + var err_text="";
  991 + for(var i in goods_list){
  992 + var g_item=goods_list[i];
  993 + var b_item={};
  994 + //--如果是赠品,不加入购物车--
  995 + if(g_item['is_gift']) continue;
  996 + if(g_item['prom_type']==4 ){
  997 + err_text+= g_item['goods_name']+"积分购商品不加入购物车\n";
  998 + continue;
  999 + }
  1000 + if(g_item['prom_type']==5){
  1001 + err_text+= g_item['goods_name']+"搭配购商品不加入购物车\n";
  1002 + continue;
  1003 + }
  1004 + if(g_item['prom_type']==6 ){
  1005 + err_text+= g_item['goods_name']+"拼团商品不加入购物车\n";
  1006 + continue;
  1007 + }
  1008 +
  1009 + //--获取商品--
  1010 + var good=null;
  1011 + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + g_item.goods_id, {
  1012 +
  1013 + }).then(res=>{
  1014 + good=res.data.data;
  1015 + })
  1016 +
  1017 + //调用接口判断订单优惠,
  1018 + const res = await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + g_item.goods_id + "/0"+"/"+getApp().globalData.user_id, {})
  1019 + if (res.data.code == 0 && res.data.data) {
  1020 + var r_data = res.data.data;
  1021 + if (r_data.ladderLists) {
  1022 + var act_id = r_data.ladderLists[0].form_id;
  1023 + //-- 判断会员能不能参与阶梯促销 --
  1024 + const data = await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {})
  1025 + if (data.data.code == 0 && data.data.data && data.data.data.isuse && data.data.data.is_end == 0) {
  1026 + b_item.prom_type = 10;
  1027 + b_item.prom_id = data.data.data.id;
  1028 + }
  1029 + }
  1030 + }
  1031 +
  1032 + if(!good){
  1033 + err_text+= g_item['goods_name']+"未找到商品\n";
  1034 + continue;
  1035 + }
  1036 + if (good.is_on_sale != 1) {
  1037 + err_text+= g_item['goods_name']+"已经下架\n";
  1038 + continue;
  1039 + }
  1040 +
  1041 + var timestamp = ut.gettimestamp();
  1042 + if (good.on_time > timestamp) {
  1043 + err_text+= g_item['goods_name']+"还未上架\n";
  1044 + continue;
  1045 + }
  1046 + if (good.down_time > 0) {
  1047 + if (good.down_time < timestamp) {
  1048 + err_text+=g_item['goods_name']+"已经下架\n";
  1049 + continue;
  1050 + }
  1051 + }
  1052 +
  1053 + //如果商品的配送方式和门店不匹配
  1054 + if(good['distr_type']>0 && pickup['distr_type']>0 && good['distr_type']!=pickup['distr_type'] ){
  1055 + err_text+= good['goods_name']+"配送方式不一致\n";
  1056 + continue;
  1057 + }
  1058 +
  1059 + var prom=null;
  1060 +
  1061 + b_item.goods_id=g_item.goods_id;
  1062 + b_item.goods_name=g_item.goods_name;
  1063 + b_item.goods_num=g_item.goods_num;
  1064 + b_item.guide_id=g_item.guide_id;
  1065 + b_item.guide_type=g_item.guide_type;
  1066 + b_item.pickup_id=item.pickup_id;
  1067 + b_item.price=good.shop_price;
  1068 + b_item.goods_sn=good.goods_sn;
  1069 + b_item.sku=good.sku;
  1070 + b_item.is_integral_normal=g_item.is_integral_normal;
  1071 +
  1072 + //-- 如果会员是等级卡的时候,同时商品也有设置相应的卡价格 --
  1073 + var card_field=th.data.card_field;
  1074 + if(card_field && good[card_field]>0){
  1075 + b_item.price=good[card_field];
  1076 + }
  1077 +
  1078 + var url="/api/weshop/activitylist/getGoodActInfo";
  1079 + var req_data={
  1080 + store_id:g_item.store_id,goodsidlist:g_item.goods_id,is_detail:1,user_id:user_id
  1081 + };
  1082 + await getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  1083 + if(res.data.code==0){
  1084 + var list = res.data.data;
  1085 + for(let i in list){
  1086 + let item=list[i];
  1087 + if(item.prom_type==1){ good.prom_type=1; good.prom_id=item.act_id; }
  1088 + }
  1089 + }
  1090 + })
  1091 +
  1092 + if(!prom) {
  1093 + //--判断商品当前的活动情况--
  1094 + switch (good.prom_type) {
  1095 + case 1:
  1096 + var flash = null;
  1097 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + good.prom_id, {}).then(res => {
  1098 + if (res.data.code == 0) {
  1099 + flash = res.data.data;
  1100 + }
  1101 + })
  1102 + //----已经结束-----
  1103 + if (flash && flash.is_end == 0) {
  1104 +
  1105 + if( flash.end_time > timestamp && flash.start_time < timestamp){
  1106 + prom = flash;
  1107 + prom.price = prom.user_price;
  1108 + b_item.price = prom.price;
  1109 + good.prom_type = 1;
  1110 + good.prom_id = prom.id;
  1111 + }else{
  1112 + if(g_item.prom_type==0 && !flash.is_shop_buy ){
  1113 + err_text+=g_item['goods_name']+"秒杀活动不允许普通价\n";
  1114 + continue;
  1115 + }
  1116 + }
  1117 +
  1118 + }
  1119 + break;
  1120 + case 2:
  1121 + var group = null;
  1122 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id, {}).then(res => {
  1123 + if (res.data.code == 0) {
  1124 + group = res.data.data;
  1125 + }
  1126 + })
  1127 + //----已经结束-----
  1128 + if (group && group.is_end == 0 && group.end_time > timestamp && group.start_time < timestamp) {
  1129 + prom = group;
  1130 + prom.price = prom.price;
  1131 + b_item.price = prom.price;
  1132 + }
  1133 + break;
  1134 + case 6:
  1135 + b_item.is_pd_normal = 1;
  1136 + break;
  1137 + case 7:
  1138 + //如果有组合购
  1139 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + good.prom_id + "/" + getApp().globalData.userInfo.user_id;
  1140 + await getApp().request.promiseGet(url, {}).then(res => {
  1141 + if (res.data.code == 0 && res.data.data) {
  1142 + if (res.data.data.is_show == 1 && res.data.data.is_end == 0
  1143 + && ut.gettimestamp() < res.data.data.end_time
  1144 + && ut.gettimestamp() > res.data.data.start_time
  1145 + ) {
  1146 + b_item.prom_type = 7;
  1147 + b_item.prom_id = res.data.data.id;
  1148 + good.prom_type = 7;
  1149 + good.prom_id = res.data.data.id;
  1150 + }
  1151 + }
  1152 + })
  1153 + break;
  1154 + case 10:
  1155 + let user_id = getApp().globalData.userInfo.user_id;
  1156 + var url = `/api/weshop/prom/ladderForm/getNew/${os.stoid}/${user_id}/${good.prom_id}`;
  1157 + await getApp().request.promiseGet(url, {}).then(res => {
  1158 + if (res.data.code == 0 && res.data.data && res.data.data.isuse && res.data.data.is_end == 0) {
  1159 + b_item.prom_type = 10;
  1160 + b_item.prom_id = res.data.data.id;
  1161 + }
  1162 + })
  1163 + break;
  1164 + }
  1165 + }
  1166 +
  1167 + //如果有优惠促销的时候,要看下商品的优惠活动有没有过期
  1168 + if((g_item.prom_type==3 || good.prom_type==3) && good.whsle_id<=0){
  1169 + var is_g_prom=0;
  1170 + //因为有全场优惠活动,商品参加的活动还未开始
  1171 + var url="/api/weshop/activitylist/getGoodActInfo";
  1172 + var req_data={
  1173 + store_id:os.stoid,goodsidlist:good.goods_id,is_detail:1,user_id:user_id
  1174 + };
  1175 + await getApp().request.promiseGet(url, {data:req_data}).then(async function (res) {
  1176 + if(res.data.code==0 && res.data.data && res.data.data.length){
  1177 + for(let i in res.data.data){
  1178 + let item=res.data.data[i];
  1179 + if(item.prom_type==3) {
  1180 + is_g_prom=1; break;
  1181 + }
  1182 + }
  1183 + }
  1184 + })
  1185 + if(is_g_prom) {
  1186 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => {
  1187 + if (res.data.code == 0) {
  1188 + var r_data = res.data.data;
  1189 + if (r_data.promGoodsLists) {
  1190 + b_item.prom_type = 3;
  1191 + b_item.prom_id = r_data.promGoodsLists[0].prom_id;
  1192 + }
  1193 + }
  1194 + })
  1195 + }else{
  1196 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromNormal/" + os.stoid + "/" + good.goods_id, {}).then(res => {
  1197 + if (res.data.code == 0) {
  1198 + var r_data = res.data.data;
  1199 + if (r_data.promGoodsLists) {
  1200 + b_item.prom_type = 3;
  1201 + b_item.prom_id = r_data.promGoodsLists[0].prom_id;
  1202 + }
  1203 + }
  1204 + })
  1205 + }
  1206 + }
  1207 +
  1208 +
  1209 + //判断是不是线下库存的购买, 是不是秒杀活动
  1210 + if(th.data.sales_rules==2 && !prom){
  1211 +
  1212 + //-- 看一下购物车上有多少商品 --
  1213 + var cart_num=0;
  1214 + await getApp().request.promiseGet("/api/weshop/cart/page", {
  1215 + data: {
  1216 + store_id: os.stoid,
  1217 + user_id: getApp().globalData.user_id,
  1218 + state:0, is_gift:0,
  1219 + goods_id:good.goods_id,
  1220 + pick_id: b_item.pickup_id
  1221 + }
  1222 + }).then(res=>{
  1223 + var num = 0;
  1224 + if(res.data.code==0 && res.data.data && res.data.data.pageData) {
  1225 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  1226 + num += res.data.data.pageData[i].goods_num;
  1227 + }
  1228 + }
  1229 + cart_num=num;
  1230 + })
  1231 +
  1232 + var lock=0,plist=null;
  1233 +
  1234 + if(b_item.prom_type!=7) {
  1235 + //先读取门店的lock,
  1236 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  1237 + data: {store_id: os.stoid, wareId: good.goods_id, storageId: b_item.pickup_id, pageSize: 1000}
  1238 + }).then(res => {
  1239 + if (res.data.code == 0 && res.data.data.total > 0) {
  1240 + for (var i in res.data.data.pageData)
  1241 + lock += res.data.data.pageData[i].outQty
  1242 + }
  1243 + })
  1244 +
  1245 + //---通过接口获取门店的线下库存信息--
  1246 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  1247 + data: {
  1248 + storageNos: pickup.pickup_no,
  1249 + wareIds: encodeURIComponent(good.erpwareid),
  1250 + storeId: os.stoid
  1251 + }
  1252 + }).then(res => {
  1253 + if (res.data.code == 0 && res.data.data.total > 0) {
  1254 + plist = res.data.data.pageData[0];
  1255 + }
  1256 + })
  1257 +
  1258 + if (!plist) {
  1259 + err_text += good['goods_name'] + "库存不足\n";
  1260 + continue;
  1261 + }
  1262 + if (plist.CanOutQty - lock <= 0) {
  1263 + err_text += good['goods_name'] + "库存不足\n";
  1264 + continue;
  1265 + }
  1266 + if (b_item.goods_num > (plist.CanOutQty - lock)) {
  1267 + b_item.goods_num = plist.CanOutQty - lock;
  1268 + }
  1269 + }
  1270 + var req_data={
  1271 + store_id: os.stoid,
  1272 + user_id: getApp().globalData.user_id,
  1273 + goods_id: good.goods_id,
  1274 + };
  1275 + if(b_item.prom_type==7){
  1276 + req_data.prom_type=7;
  1277 + req_data.prom_id=b_item.prom_id;
  1278 + }
  1279 +
  1280 + var buynum=0;
  1281 + var promnum=0;
  1282 + //---要获得商品,该用户买了多少件,同步应用---
  1283 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  1284 + data: req_data,
  1285 + }).then(res => {
  1286 + if(res.data.code==0){
  1287 + var buy_num_data = res.data.data;
  1288 + buynum = buy_num_data.goodsbuynum;
  1289 + if(buy_num_data.promgoodsbuynum){
  1290 + promnum=buy_num_data.promgoodsbuynum;
  1291 + }
  1292 + }
  1293 + })
  1294 +
  1295 + //---- 要计算商品的限购 -----
  1296 + if(good['viplimited']>0){
  1297 + if(cart_num+buynum>good['viplimited']){
  1298 + err_text+= good['goods_name']+"超出限购\n";
  1299 + continue;
  1300 + }
  1301 + good['viplimited']-=(cart_num+buynum);
  1302 + if(b_item.goods_num>good['viplimited']){
  1303 + b_item.goods_num=good['viplimited'];
  1304 + }
  1305 + }
  1306 + //不需要计算组合购的限购
  1307 +
  1308 + back_goods_arr.push(b_item); //返回商品元素
  1309 +
  1310 + }else{
  1311 + //-- 看一下购物车上有多少商品 --
  1312 + var cart_num=0;
  1313 + await getApp().request.promiseGet("/api/weshop/cart/page", {
  1314 + data: {
  1315 + store_id: os.stoid,
  1316 + user_id: getApp().globalData.user_id,
  1317 + state:0, is_gift:0,
  1318 + goods_id:good.goods_id
  1319 + }
  1320 + }).then(res=>{
  1321 + var num = 0;
  1322 + if(res.data.code==0 && res.data.data && res.data.data.pageData) {
  1323 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  1324 + num += res.data.data.pageData[i].goods_num;
  1325 + }
  1326 + }
  1327 + cart_num=num;
  1328 + })
  1329 +
  1330 + if(good.store_count<=0){
  1331 + err_text+= good['goods_name']+"库存不足\n";
  1332 + continue;
  1333 + }
  1334 + if(b_item.goods_num>good.store_count)
  1335 + b_item.goods_num=good.store_count;
  1336 +
  1337 + var buynum=0; //商品已经购买多少件
  1338 + var promgoodsbuynum=0; //活动已经购买多少件
  1339 + var redis_num = 0; //redis库存
  1340 +
  1341 + var req_data={
  1342 + store_id: os.stoid,
  1343 + user_id: getApp().globalData.user_id,
  1344 + goods_id: good.goods_id,
  1345 + };
  1346 +
  1347 + if(prom){
  1348 + req_data.prom_type= good.prom_type;
  1349 + req_data.prom_id= good.prom_id;
  1350 + b_item.prom_type=good.prom_type;
  1351 + b_item.prom_id=good.prom_id;
  1352 +
  1353 + //------判断活动是否抢光-----
  1354 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1355 + os.stoid + "/" + good.prom_type + "/" + good.prom_id, {
  1356 + 1: 1
  1357 + }).then(res => {
  1358 + redis_num = res.data.data;
  1359 + });
  1360 + if(redis_num<=0){
  1361 + //不允许商品普通价格修改
  1362 + if(!prom.is_shop_buy && prom.is_shop_buy!=undefined) {
  1363 + err_text += good['goods_name'] + "活动不足\n";
  1364 + continue;
  1365 + }
  1366 + }
  1367 +
  1368 + }
  1369 +
  1370 + //---要获得商品,该用户买了多少件,同步应用---
  1371 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  1372 + data: req_data,
  1373 + }).then(res => {
  1374 + if(res.data.code==0){
  1375 + var buy_num_data = res.data.data;
  1376 + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum;
  1377 + buynum = buy_num_data.goodsbuynum;
  1378 + }
  1379 + })
  1380 +
  1381 + //---- 要计算商品的限购 -----
  1382 + if(good['viplimited']>0){
  1383 + if(cart_num+buynum>good['viplimited']){
  1384 + err_text+= good['goods_name']+"超出限购\n";
  1385 + continue;
  1386 + }
  1387 + good['viplimited']-=(cart_num+buynum);
  1388 + if(b_item.goods_num>good['viplimited']){
  1389 + b_item.goods_num=good['viplimited'];
  1390 + }
  1391 +
  1392 + }
  1393 +
  1394 + //-- 判断活动的库存 --
  1395 + if(prom){
  1396 + if(prom['goods_num']<=prom['buy_num']){
  1397 + err_text+= good['goods_name']+"超出活动库存\n";continue;
  1398 + }
  1399 +
  1400 + if(b_item.goods_num>prom['goods_num']-prom['buy_num']){
  1401 + b_item['goods_num']= b_item['goods_num']-b_item['buy_num'];
  1402 + }
  1403 +
  1404 + if(b_item.goods_num>redis_num){
  1405 + b_item.goods_num=redis_num;
  1406 + }
  1407 +
  1408 + if(prom['buy_limit']>0){
  1409 + if(cart_num+promgoodsbuynum>=prom['buy_limit'] ){
  1410 + err_text+= good['goods_name']+"超出活动限购\n";continue;
  1411 + }
  1412 + prom['buy_limit'] -= (cart_num+buynum);
  1413 + if(b_item.goods_num>prom['buy_limit']){
  1414 + b_item.goods_num=prom['buy_limit'];
  1415 + }
  1416 + }
  1417 +
  1418 +
  1419 + }
  1420 + back_goods_arr.push(b_item); //返回商品元素
  1421 + }
  1422 + }
  1423 +
  1424 + //有重新购买的数据是时候,就要重新生成订单
  1425 + if(back_goods_arr.length>0){
  1426 + th.setData({back_goods_arr:back_goods_arr});
  1427 + if(!err_text){
  1428 + th.more_add_cart();
  1429 + }else{
  1430 + wx.hideLoading();
  1431 + // 如果没有获取用户信息
  1432 + wx.showModal({
  1433 + title:'确定',
  1434 + content: err_text+',确定要买其他商品码?',
  1435 + success(res) {
  1436 + if (res.confirm) {
  1437 + //跳转到登录页
  1438 + th.more_add_cart();
  1439 + }else{
  1440 + th.data.moring=0;
  1441 + wx.hideLoading();
  1442 + }
  1443 + },fail(){
  1444 + th.data.moring=0;
  1445 + wx.hideLoading();
  1446 + }
  1447 + });
  1448 +
  1449 + }
  1450 + }else{
  1451 + th.data.moring=0;
  1452 + wx.hideLoading();
  1453 + getApp().confirmBox(err_text);
  1454 + }
  1455 + },
  1456 +
  1457 + more_add_cart:async function(){
  1458 + var back_goods_arr=this.data.back_goods_arr;
  1459 + var err_text="";
  1460 + var ok_num=0;
  1461 +
  1462 + for(var i in back_goods_arr){
  1463 + //商品ID
  1464 + var g_item=back_goods_arr[i];
  1465 + var newd = {
  1466 + goods_id: g_item.goods_id,
  1467 + goods_num: g_item.goods_num,
  1468 + pick_id: g_item.pickup_id,
  1469 + user_id: oo.user_id,
  1470 + store_id: os.stoid,
  1471 + goods_price: g_item.price,
  1472 + member_goods_price: g_item.price,
  1473 + goods_name: g_item.goods_name,
  1474 + goods_sn: g_item.goods_sn,
  1475 + sku: g_item.sku,
  1476 + };
  1477 +
  1478 + if(g_item.guide_id){
  1479 + newd['guide_id']=g_item.guide_id;
  1480 + newd['guide_type']=g_item.guide_type;
  1481 + }
  1482 +
  1483 + if(g_item.is_integral_normal){
  1484 + newd['is_integral_normal']=g_item.is_integral_normal;
  1485 + }
  1486 + if(g_item.is_pd_normal){
  1487 + newd['is_pd_normal']=g_item.is_pd_normal;
  1488 + }
  1489 + if(g_item.prom_type){
  1490 + newd['prom_type']=g_item.prom_type;
  1491 + newd['prom_id']=g_item.prom_id;
  1492 + }
  1493 +
  1494 +
  1495 +
  1496 + var b_cart_goods=null;
  1497 + await getApp().request.promiseGet("/api/weshop/cart/page", {
  1498 + data: {
  1499 + store_id: os.stoid,
  1500 + user_id: oo.user_id,
  1501 + goods_id: g_item.goods_id,
  1502 + pick_id: g_item.pickup_id,
  1503 + },
  1504 + }).then(res=>{
  1505 + //-------如果购物车中有相关的数据-------
  1506 + if (res.data.data.total > 0) {
  1507 + b_cart_goods= res.data.data.pageData[0];
  1508 + }
  1509 + })
  1510 +
  1511 + //-- 如果就加入过购物车 --
  1512 + if(b_cart_goods){
  1513 + var updata = {
  1514 + id: b_cart_goods.id,
  1515 + goods_num: newd.goods_num + b_cart_goods.goods_num,
  1516 + goods_price: newd.goods_price,
  1517 + member_goods_price:newd.goods_price,
  1518 + store_id: os.stoid,
  1519 + };
  1520 + if(newd.guide_id){
  1521 + updata.guide_id=newd.guide_id;
  1522 + updata.guide_type=newd.guide_type;
  1523 + }
  1524 + await getApp().request.promisePut("/api/weshop/cart/update", {
  1525 + data: updata
  1526 + }).then(res=>{
  1527 + if(res.data.code==0) {
  1528 + ok_num++;
  1529 + }else{
  1530 + err_text+=newd.goods_name+"加入购物车失败\n";
  1531 + }
  1532 + })
  1533 +
  1534 + }else{
  1535 + await getApp().request.promisePost("/api/weshop/cart/save", {
  1536 + data: newd
  1537 + }).then(res=>{
  1538 + if(res.data.code==0) {
  1539 + ok_num++;
  1540 + }else{
  1541 + err_text+=newd.goods_name+"加入购物车失败\n";
  1542 + }
  1543 + })
  1544 + }
  1545 + }
  1546 +
  1547 + wx.hideLoading();
  1548 + this.data.moring=0;
  1549 + if(ok_num==0){
  1550 + //-- 如果没有获取用户信息 --
  1551 + wx.showModal({
  1552 + title:'提示',
  1553 + content: err_text,
  1554 + success(res) {}
  1555 + });
  1556 + }else{
  1557 + if(err_text==""){
  1558 + getApp().goto("/pages/cart/cart/cart");
  1559 + }else{
  1560 + // 如果没有获取用户信息
  1561 + wx.showModal({
  1562 + title:'提示',
  1563 + content: err_text,
  1564 + success(res) {
  1565 + if (res.confirm) {
  1566 + //跳转到登录页
  1567 + getApp().goto("/pages/cart/cart/cart");
  1568 + }
  1569 + }
  1570 + });
  1571 +
  1572 + }
  1573 +
  1574 + }
  1575 + },
  1576 +
  1577 + toast(msg){
  1578 + wx.showToast({
  1579 + title: msg,
  1580 + icon: 'none',
  1581 + duration: 3000
  1582 + })
  1583 + },
  1584 +
  1585 + con_weixin:function () {
  1586 + getApp().con_wx(this);
  1587 + },
  1588 +
  1589 + //跳转到商品
  1590 + go_gd:function (e) {
  1591 + var user_id=getApp().globalData.user_id;
  1592 + if(!user_id) user_id=0;
  1593 +
  1594 + var gd= e.currentTarget.dataset.gd;
  1595 + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd;
  1596 + var url="/api/weshop/activitylist/getGoodActInfo";
  1597 + var req_data={
  1598 + store_id:os.stoid,goodsidlist:gd,is_detail:1,user_id:user_id
  1599 + };
  1600 + //获取秒杀的多规格
  1601 + getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  1602 + if(res.data.code==0 && res.data.data){
  1603 + if(res.data.data.length==1){
  1604 + var item=res.data.data[0];
  1605 + switch (item.prom_type){
  1606 + case 9:
  1607 + good_url= '/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + gd + '&group_id=' + item.act_id;
  1608 + break;
  1609 + case 8:
  1610 + good_url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+gd+"&prom_id="+item.act_id
  1611 + break;
  1612 + default:
  1613 + good_url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gd+"&prom_id="+item.act_id+"&prom_type=1";
  1614 + break
  1615 + }
  1616 + }
  1617 + getApp().goto(good_url);
  1618 +
  1619 + }else{
  1620 + getApp().goto(good_url);
  1621 + }
  1622 + })
  1623 + },
  1624 +
  1625 +
  1626 +
  1627 + click_contact:function () {
  1628 + getApp().globalData.no_clear=1;
  1629 + }
  1630 +
  1631 +
  1632 +
  1633 +
  1634 +});
0 1635 \ No newline at end of file
... ...
packageD/pages/shop/order_detail/order_detail.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "订单详情",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageD/pages/shop/order_detail/order_detail.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
  2 +<view class="container">
  3 + <view class="user-mes" wx:if="{{order.exp_type==0}}">
  4 + <view class="user-contact">
  5 + <text selectable> {{order.consignee}}{{'  '}}{{order.mobile}} </text>
  6 + </view>
  7 + <view class="location" wx:if="{{order.order_prom_type!=5}}">
  8 + <view class="address"><text selectable>{{order.more_address}} {{order.address}}</text></view>
  9 + <view class="pos-icon">
  10 + <image class="wh100" src="{{iurl}}/miniapp/images/iconfont-shouhuodizhi.png"></image>
  11 + </view>
  12 + </view>
  13 + <view class="border-img">
  14 + <image class="wh100" src="{{iurl}}/miniapp/images/tt.png"></image>
  15 + </view>
  16 + </view>
  17 + <view class="order-meg">
  18 + <view class="order-state"><view class="shop_name" > <text selectable>门店:{{order.pickname}}</text></view>
  19 + <view> <text selectable>{{order.order_status_detail}}</text></view>
  20 + </view>
  21 + <!--wx:if="{{item.return_btn!=4}}" -->
  22 + <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" >
  23 + <view class="goods-img" bindtap="go_gd" data-gd="{{item.goods_id}}">
  24 + <image class="wh100" src="{{resourceUrl+item.original_img}}" binderror="bind_bnerr" lazy-load="true"
  25 + data-errorimg="order.order_goods[{{index}}].original_img"></image>
  26 + </view>
  27 + <!-- 跳转到商品 -->
  28 + <navigator class="order-cont" bindtap="go_gd" data-gd="{{item.goods_id}}">
  29 + <view class="goods-name">{{item.goods_name}}</view>
  30 + <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>-->
  31 + <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view>
  32 + </navigator>
  33 +
  34 + <view class="order-num">
  35 + <view class="goods-price">¥{{item.member_goods_price}}<text wx:if="{{item.prom_type==10}}" style="margin-left: 5rpx">({{item.ladder_discount}}折)</text> </view>
  36 + <view class="goods-num">×{{item.goods_num}}</view>
  37 +
  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 && item.is_whsle_goods!=1}}">
  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>
  42 + <view bindtap="gotoreturn" class="return-btn" data-oid="{{item.order_id}}"
  43 + data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==2}}">退款中</view>
  44 + <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}"
  45 + data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==3}}">重新退款</view>
  46 + <view bindtap="gotoreturn" class="goods-num" data-oid="{{item.order_id}}"
  47 + data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==4}}">退款完成</view>
  48 + </block>
  49 +
  50 +
  51 + </view>
  52 + </view>
  53 +
  54 + </view>
  55 + <view class="basic-information information">
  56 + <view class="title">基本信息</view>
  57 + <view class="item">
  58 + <view>订单编号</view>
  59 + <view><text selectable>{{order.order_sn}}</text></view>
  60 + </view>
  61 + <view class="item">
  62 + <view>下单时间</view>
  63 + <view><text selectable>{{order.addTimeFormat}}</text></view>
  64 + </view>
  65 +
  66 + <view class="item" wx:if="{{order.order_prom_type!=5}}">
  67 + <view>配送方式</view>
  68 + <view wx:if="{{order.pt_status<4 && order.is_zsorder==4}}">
  69 + --
  70 + </view>
  71 + <view wx:else>{{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'自提'}}</view>
  72 + </view>
  73 + <view class="item">
  74 + <view>买家留言</view>
  75 + <view class="leave-word"><text selectable>{{order.user_note!=''?order.user_note:'无'}}</text></view>
  76 + </view>
  77 + </view>
  78 + <view class="price-information information" style="margin-bottom: 120rpx;">
  79 + <view class="title" style="margin-bottom:10rpx" >价格信息</view>
  80 + <view class="item pnew" wx:if="{{order.is_zsorder==4}}">
  81 + <view>商品总价</view>
  82 + <view>¥ {{filters.toFix(order.order_goods[0].member_goods_price*order.order_goods[0].goods_num,2)}}元</view>
  83 + </view>
  84 + <view class="item pnew" wx:else>
  85 + <view>商品总价</view>
  86 + <view>¥ {{order.goods_price}}元</view>
  87 + </view>
  88 +
  89 + <view class="item pnew" wx:if="{{order.is_zsorder==4}}">
  90 + <view>定金金额</view>
  91 + <view>¥ {{filters.toFix(order.order_amount+order.user_money,2)}}元</view>
  92 + </view>
  93 + <view class="item pnew" wx:if="{{order.pt_tail_money>0}}">
  94 + <view>尾款金额</view>
  95 + <view>¥ {{filters.toFix(order.pt_tail_money-order.shipping_price,2)}}元</view>
  96 + </view>
  97 +
  98 + <view class="item pnew" wx:if="{{order.shipping_price>0}}">
  99 + <view>配送费用</view>
  100 + <view>¥ {{order.shipping_price}}元</view>
  101 + </view>
  102 + <view class="item pnew" wx:if="{{order.coupon_price>0}}">
  103 + <view>优惠券</view>
  104 + <view> ¥ {{order.coupon_price}}元</view>
  105 + </view>
  106 +
  107 + <view class="item pnew" wx:if="{{order.integral>0}}">
  108 + <view>积分</view>
  109 + <view>{{order.integral}}积分</view>
  110 + </view>
  111 +
  112 + <view class="item pnew" wx:if="{{order.discount_amount>0}}">
  113 + <view>优惠活动</view>
  114 + <view>¥ {{filters.toFix(order.discount_amount,2)}}元</view>
  115 + </view>
  116 +
  117 + <view class="item pnew" wx:if="{{order.ladder_amount>0}}">
  118 + <view>阶梯优惠活动</view>
  119 + <view>¥ {{filters.toFix(order.ladder_amount,2)}}元</view>
  120 + </view>
  121 +
  122 + <view class="item pnew" wx:if="{{order.order_prom_amount>0}}">
  123 + <view>订单优惠</view>
  124 + <view>¥ {{order.order_prom_amount}}元</view>
  125 + </view>
  126 +
  127 + <view class="item">
  128 + <view>订单总价</view>
  129 + <view>¥ {{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元</view>
  130 + </view>
  131 +
  132 + <view class="item-line"></view>
  133 + <view class="item" wx:if="{{order.user_money>0}}">
  134 + <view>使用余额</view>
  135 + <view wx:if="{{order.tail_pay_type==1}}">¥ {{filters.toFix(order.user_money+order.pt_tail_money,2)}}元</view>
  136 + <view wx:else>¥ {{filters.toFix(order.user_money,2)}}元</view>
  137 + </view>
  138 + <view style="height:10rpx"></view>
  139 + </view>
  140 +
  141 +
  142 +</view>
  143 +
  144 +<warn id="warn"></warn>
... ...
packageD/pages/shop/order_detail/order_detail.wxss 0 → 100644
  1 +.user-mes {
  2 + background-color: #fff;
  3 + font-size: 32rpx;
  4 + color: #333;
  5 +}
  6 +
  7 +.user-contact {
  8 + padding: 24rpx 80rpx;
  9 +}
  10 +
  11 +.location {
  12 + position: relative;
  13 + padding: 0 80rpx 24rpx;
  14 +}
  15 +
  16 +.pos-icon {
  17 + position: absolute;
  18 + left: 30rpx;
  19 + top: 0;
  20 + width: 32rpx;
  21 + height: 32.5rpx;
  22 +}
  23 +
  24 +.border-img {
  25 + width: 100%;
  26 + height: 16rpx;
  27 +}
  28 +
  29 +.order-meg {
  30 + margin-bottom: 20rpx;
  31 + font-size: 30rpx;
  32 +}
  33 +
  34 +.order-state {
  35 + height: 100rpx;
  36 + line-height: 100rpx;
  37 + padding-right: 40rpx;
  38 + padding-left: 40rpx;
  39 + background-color: #fff;
  40 + color: #f23030;
  41 + justify-content: space-between;
  42 + display: flex;
  43 +}
  44 +.shop_name{color: #333}
  45 +.order-detail {
  46 + padding: 30rpx 0;
  47 + border-bottom: 1px solid #ddd;
  48 + color: #666;
  49 + min-height: 115rpx;
  50 +}
  51 +.goods-img {
  52 + float: left;
  53 + width: 100rpx;
  54 + height: 100rpx;
  55 + margin: 0 30rpx;
  56 +}
  57 +
  58 +.order-cont {
  59 + float: left;
  60 + width: 410rpx;
  61 +}
  62 +
  63 +.goods-name {
  64 + height: 60rpx;
  65 + line-height: 30rpx;
  66 + overflow: hidden;
  67 + margin-bottom: 16rpx;
  68 +}
  69 +
  70 +.goods-color {
  71 + font-size: 24rpx;
  72 +}
  73 +
  74 +.order-num {
  75 + float: right;
  76 + font-size: 24rpx;
  77 + margin-top: 10rpx;
  78 + margin-right: 20rpx;
  79 + text-align: right;
  80 + line-height: 42rpx;
  81 +}
  82 +
  83 +.order-operate {
  84 + height: 100rpx;
  85 + padding-right: 20rpx;
  86 + background-color: #fff;
  87 + display: flex;
  88 + align-items: center;
  89 + justify-content: flex-end;
  90 +}
  91 +
  92 +.check-btn {
  93 + width: 180rpx;
  94 + height: 60rpx;
  95 + line-height: 60rpx;
  96 + text-align: center;
  97 + margin-right: 10rpx;
  98 + border: 1px solid #eee;
  99 +}
  100 +
  101 +.goods-btn {
  102 + width: 150rpx;
  103 + height: 60rpx;
  104 + line-height: 60rpx;
  105 + text-align: center;
  106 + border: 1px solid #eee;
  107 +}
  108 +
  109 +.cancel-order {
  110 + margin-left: 20rpx;
  111 +}
  112 +
  113 +.information {
  114 + padding: 0 20rpx;
  115 + background-color: #fff;
  116 + margin-bottom: 20rpx;
  117 +}
  118 +
  119 +.information .title {
  120 + height: 70rpx;
  121 + line-height: 70rpx;
  122 + border-bottom: 1rpx solid #ddd;
  123 + font-size: 34rpx;
  124 + color: #333;
  125 +}
  126 +
  127 +.information .item {
  128 + display: flex;
  129 + justify-content: space-between;
  130 + height: 60rpx;
  131 + line-height: 60rpx;
  132 + font-size: 30rpx;
  133 + color: #333;
  134 +}
  135 +
  136 +.information .item.pnew{
  137 + height: 50rpx;
  138 + line-height: 50rpx;
  139 + color: #999;
  140 +}
  141 +.item-line{ margin: 5rpx 0; height: 1rpx; border-bottom:1rpx solid #ddd }
  142 +
  143 +.delivery-address,.leave-word {
  144 + width: 500rpx;
  145 + text-align: right;
  146 + overflow: hidden;
  147 + white-space: nowrap;
  148 + text-overflow: ellipsis;
  149 +}
  150 +
  151 +.pay-amount {
  152 + color: #f23030;
  153 +}
  154 +
  155 +.btn-wrap {
  156 + height: 100rpx;
  157 + background-color: #fff;
  158 + text-align: right;
  159 + position: fixed; width: 100%; bottom: 0; border-top: 1rpx solid #ddd
  160 +}
  161 +
  162 +.tips-btn {
  163 + display: inline-block;
  164 + width: 200rpx;
  165 + height: 100rpx;
  166 + line-height: 100rpx;
  167 + text-align: center;
  168 + font-size: 30rpx;
  169 + color: #fff;
  170 + background-color: #f23030;
  171 + /* margin-left: 2rpx; */
  172 + margin-right: 8rpx
  173 +}
  174 +
  175 +
  176 +.contact-us.goods-btn::after {
  177 + content: none;
  178 +}
0 179 \ No newline at end of file
... ...
pages/cart/cart/cart.js
... ... @@ -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 619 await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => {
... ... @@ -1731,7 +1731,7 @@ Page({
1731 1731  
1732 1732 function normal_check(store_count, goodsinfo, wareIds) {
1733 1733 //--- 看一下是不是线下库存 ---
1734   - if (th.data.sales_rules == 2 && goodsinfo.prom_type != 7) {
  1734 + if (th.data.sales_rules == 2 && goodsinfo.prom_type != 7 && !goodsinfo.whsle_id) {
1735 1735 th.check_down_line(t, pitem, item, wareIds);
1736 1736 } else {
1737 1737 if (t.goods_num > store_count) {
... ... @@ -2491,7 +2491,7 @@ Page({
2491 2491 ab = 1;
2492 2492 //--普通商品,如果有开启线下库存的功能,要调用线下库存进行计算,赠品不要进行调用线下库存---
2493 2493 if ((i_arr[j].prom_type == 0 || i_arr[j].prom_type == 3 || i_arr[j].prom_type == 5 ||
2494   - i_arr[j].need_downlow_num) && th.data.sales_rules == 2 && i_arr[j].is_gift != 1) {
  2494 + i_arr[j].need_downlow_num) && th.data.sales_rules == 2 && i_arr[j].is_gift != 1 && !i_arr[j].whsle_id) {
2495 2495 //--获取商品的线下商品ID--
2496 2496 var gd = null;
2497 2497 await getApp().request.promiseGet("/api/weshop/goods/get/" + oo.stoid + "/" + i_arr[j].goods_id, {}).then(res => {
... ...
pages/cart/cart2/cart2.js
... ... @@ -451,8 +451,8 @@ Page({
451 451 //如果有购买活动
452 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 456 // th.check_is_youhui(item1.goods_id, item1.pick_id);
457 457 await th.add_prom_goods_map(item1);
458 458 }
... ... @@ -702,7 +702,7 @@ Page({
702 702 user_money: 0,
703 703 total_amount: 0,
704 704 order_amount: 0,
705   - user_note: 0
  705 + user_note: ""
706 706 };
707 707  
708 708 //-- 把等级卡会优惠多少钱装进去 --
... ... @@ -882,6 +882,11 @@ Page({
882 882 gd.prom_type = gg.prom_type ? gg.prom_type : 0;
883 883 gd.prom_id = gg.prom_id ? gg.prom_id : 0;
884 884  
  885 + if(gd.whsle_id>0){
  886 + gd.prom_type =gg.prom_type=0;
  887 + gd.prom_id =gg.prom_id=0;
  888 + }
  889 +
885 890 switch (gd.prom_type) {
886 891 case 0:
887 892 case 3:
... ... @@ -1021,7 +1026,7 @@ Page({
1021 1026 user_money: 0,
1022 1027 total_amount: 0,
1023 1028 order_amount: 0,
1024   - user_note: 0
  1029 + user_note: ""
1025 1030 };
1026 1031 cart_arr.push(ie);
1027 1032 th.data.old_cartlist = cart_arr;
... ... @@ -1187,6 +1192,8 @@ Page({
1187 1192 var o_price = 0, q_conditin = 0;
1188 1193 //--------循环计算总价-----------
1189 1194 for (var j = 0; j < ord_goods.length; j++) {
  1195 +
  1196 + if(ord_goods[j].whsle_id) continue;
1190 1197 o_price += ord_goods[j].goods_price * ord_goods[j].goods_num;
1191 1198 }
1192 1199  
... ... @@ -1232,6 +1239,7 @@ Page({
1232 1239 item_map.gift_weight = get_data.goodsinfo.weight;
1233 1240 item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
1234 1241 item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
  1242 + item_map.whsle_id = get_data.goodsinfo.whsle_id;
1235 1243  
1236 1244 }
1237 1245 item_map.s_libao = get_data.libao;
... ... @@ -1323,10 +1331,11 @@ Page({
1323 1331 //如果有限制使用优惠券,就要减掉参与的活动商品的钱
1324 1332 if (!item_map.is_xz_yh) q_conditin = o_price;
1325 1333 }
1326   -
  1334 +
1327 1335 //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表-----------
1328 1336 for (var j = 0; j < ord_goods.length; j++) {
1329 1337 if (ord_goods[j].is_gift) continue;
  1338 + if (ord_goods[j].whsle_id) continue;
1330 1339 if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) {
1331 1340 ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh;
1332 1341 ord_goods[j].is_past = item_map.is_past;
... ... @@ -1455,10 +1464,16 @@ Page({
1455 1464 },
1456 1465  
1457 1466 //-------------------计算订单价格-------------------
1458   - calculatePrice: function (t, s) {
  1467 + calculatePrice:async function (t, s) {
1459 1468 var th = this;
1460   - to.getwuliuprice(async function (rs) {
1461   - wx.showLoading({ title: "处理中." })
  1469 + th.setData({submit:1});
  1470 +
  1471 + wx.showLoading({
  1472 + title: "处理中.",
  1473 + mask:true
  1474 + })
  1475 + //-- to.getwuliuprice(async function (rs) { --
  1476 +
1462 1477 //是不是区域包邮
1463 1478 th.data.is_area_by = 0;
1464 1479 //当不是区域不包邮的时候,没有不包邮商品的时候
... ... @@ -1491,12 +1506,16 @@ Page({
1491 1506  
1492 1507 //调用函数计算每件商品的单价
1493 1508 await th.calc_per(c_arr);
  1509 +
1494 1510 //调用函数计算每件组合购商品的单价,
1495 1511 await zh_calc.calc_zh_split_price(c_arr, th);
  1512 +
1496 1513 //调用函数计算每件阶梯促销商品的单价,
1497 1514 await ladder_calc.calc_split_price(c_arr, th);
1498 1515 //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品
  1516 +
1499 1517 await th.get_cart_quan(c_arr);
  1518 +
1500 1519 //---循环购物车---
1501 1520 for (var i in c_arr) {
1502 1521 //因为搭配购买也是再这里计算,搭配购的is_b_now==1
... ... @@ -1555,9 +1574,15 @@ Page({
1555 1574 })
1556 1575 }
1557 1576  
  1577 +
  1578 + var whsle_goods_price=0;
1558 1579 //--------循环计算总价-----------
1559 1580 for (var j = 0; j < item.length; j++) {
1560 1581  
  1582 + if(item[j].whsle_id>0){
  1583 + whsle_goods_price+=item[j].goods_price*item[j].goods_num;
  1584 + }
  1585 +
1561 1586 var is_no_zh = 0;
1562 1587 if (item[j].prom_type != 7 && item[j].prom_type != 10) is_no_zh = 1;
1563 1588  
... ... @@ -1678,7 +1703,7 @@ Page({
1678 1703 var user_addr=th.data.user_addr;
1679 1704 var req_d = {
1680 1705 province: user_addr.province, city: user_addr.city, district: user_addr.district,
1681   - wuliu:parseFloat(o_price - quan_price).toFixed(2),store_id: os.stoid
  1706 + wuliu:parseFloat(o_price - quan_price-whsle_goods_price).toFixed(2),store_id: os.stoid
1682 1707 }
1683 1708 await getApp().request.promisePost("/api/weshop/order/areaFreight", {
1684 1709 is_json: 1, data: req_d
... ... @@ -1729,6 +1754,8 @@ Page({
1729 1754 //--------循环计算总价-----------
1730 1755 for (var j = 0; j < item.length; j++) {
1731 1756  
  1757 + //如果是一件代发商品,不计算运费
  1758 + if(item[j].whsle_id) continue;
1732 1759 //如果商品本身是包邮了
1733 1760 if(item[j].is_free_shipping == 1) continue;
1734 1761 //如果是优惠活动是包邮,就不用计算包邮的费用了
... ... @@ -1738,8 +1765,8 @@ Page({
1738 1765 continue;
1739 1766 }
1740 1767  
1741   - if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) {
1742   -
  1768 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) {
  1769 + if (goods_weight < 0) goods_weight = 0;
1743 1770 if (item[j]['exp_sum_type'] == 2) {
1744 1771 cut_good_weight += item[j]['weight'] * item[j]['goods_num'];
1745 1772 goods_weight += item[j]['weight'] * item[j]['goods_num'];
... ... @@ -1784,8 +1811,38 @@ Page({
1784 1811 var code = "";
1785 1812 if (th.data.wu_arr && th.data.wu_arr[cart_item.wind])
1786 1813 code = th.data.wu_arr[cart_item.wind].code;
1787   - cart_item.shipping_price =
1788   - ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,goods_piece, th.data.user_addr, back_data, rs);
  1814 +
  1815 + // cart_item.shipping_price =
  1816 + // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,goods_piece, th.data.user_addr, back_data, rs);
  1817 +
  1818 + var w_data={
  1819 + store_id:os.stoid, code:code,
  1820 + o_shipping_price:o_shipping_price,
  1821 + goods_weight:goods_weight,
  1822 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  1823 + user_addr_province:th.data.user_addr.province,
  1824 + user_addr_city:th.data.user_addr.city,
  1825 + user_addr_district:th.data.user_addr.district,
  1826 + is_by_all:back_data && back_data.is_by_all?1:0,
  1827 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  1828 + }
  1829 +
  1830 + var is_ok=1;
  1831 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  1832 + if(res.data.code==0){
  1833 + cart_item.shipping_price=res.data.data;
  1834 + }else{
  1835 + is_ok=0;
  1836 + }
  1837 + })
  1838 +
  1839 + if(!is_ok){
  1840 + wx.showToast({
  1841 + title: "计算物流错误", icon: 'none',duration: 2000
  1842 + })
  1843 + th.setData({ show_submit:0 });
  1844 + wx.hideLoading();
  1845 + }
1789 1846  
1790 1847 if (!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby != 1) {
1791 1848 if (cart_item.shipping_price == 0) th.data.is_by[pickid] = 1; //已经全场包邮,就不要选择券了
... ... @@ -1812,6 +1869,10 @@ Page({
1812 1869 o_condition = o_price_no_zh - quan_price;
1813 1870 }
1814 1871  
  1872 + if(whsle_goods_price>0){
  1873 + o_condition=o_condition-whsle_goods_price;
  1874 + }
  1875 +
1815 1876 var order_m = 0;
1816 1877 //---判断是不是有订单优惠---
1817 1878 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
... ... @@ -1829,6 +1890,10 @@ Page({
1829 1890 break;
1830 1891 case 1:
1831 1892 //order_m = o_condition - ord_prom['expression'];//满额优惠金额
  1893 + var bs=1;
  1894 + if(ord_prom.is_bz){
  1895 + bs=Math.floor(o_condition/ord_prom.money);
  1896 + }
1832 1897 order_prom_amount = ord_prom['expression'];
1833 1898 break;
1834 1899 }
... ... @@ -1929,13 +1994,13 @@ Page({
1929 1994 [atxt]: all_total_m, [atxt1]: all_order_m,
1930 1995 [atxt2]: all_price, [atxt3]: all_user_m, [atxt4]: all_shipping_m,
1931 1996 [atxt5]: all_coupon_price_m, [atxt6]: all_cutprice,
1932   - [atxt7]: all_order_prom, show_submit: 1, [atxt8]: all_zh_cutprice, [atxt9]: all_ladder_cutprice
  1997 + [atxt7]: all_order_prom, show_submit: 1, [atxt8]: all_zh_cutprice, [atxt9]: all_ladder_cutprice,submit:0
1933 1998 })
1934 1999 th.data.order_prom_list_cart = c_arr;
1935 2000 th.set_can_num();
1936 2001 wx.hideLoading();
1937 2002  
1938   - });
  2003 + //});
1939 2004 },
1940 2005  
1941 2006 set_can_num: function () {
... ... @@ -1969,7 +2034,7 @@ Page({
1969 2034  
1970 2035  
1971 2036 //---------计算立即购买----------
1972   - calculatePrice2: function () {
  2037 + calculatePrice2: async function () {
1973 2038 var th = this, good = this.data.bn_goods;
1974 2039  
1975 2040 if (!good) return false;
... ... @@ -1980,8 +2045,10 @@ Page({
1980 2045 return false;
1981 2046 }
1982 2047  
  2048 + th.setData({submit:1});
1983 2049 wx.showLoading({
1984   - title: "处理中."
  2050 + title: "处理中.",
  2051 + mask:true
1985 2052 })
1986 2053 //-----------计算商品总价--------------
1987 2054 var allpice = good.shop_price * good.buynum;
... ... @@ -2007,7 +2074,7 @@ Page({
2007 2074 allpice = good.offline_price * good.buynum;
2008 2075 }
2009 2076  
2010   - to.getwuliuprice(async function (rs) {
  2077 + //to.getwuliuprice(async function (rs) {
2011 2078  
2012 2079 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
2013 2080 var out_of_weight = null; //超出多少重量
... ... @@ -2019,7 +2086,8 @@ Page({
2019 2086 quan_no = th.data.using_quan[bn_pick].coupon_no;
2020 2087  
2021 2088 if (quan_no) {
2022   - if (th.data.using_quan[bn_pick].isby != 1) {
  2089 + //如果是一件代发就不要找商品
  2090 + if (th.data.using_quan[bn_pick].isby != 1 && !good.whsle_id) {
2023 2091 //---获取优惠券优惠---
2024 2092 await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", {
2025 2093 data: {
... ... @@ -2043,7 +2111,7 @@ Page({
2043 2111 }
2044 2112  
2045 2113 //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
2046   - if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) {
  2114 + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1) {
2047 2115 //看是不是有调用过包邮券
2048 2116 if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) {
2049 2117 var condition = allpice - cut_price - quan_price;
... ... @@ -2081,6 +2149,7 @@ Page({
2081 2149 var shipping_price =0;
2082 2150 var quan_no_goods_arr=null;
2083 2151 var is_by_quan=0;
  2152 + var pickid=th.data.bn_pick;
2084 2153  
2085 2154 //如果是包邮券的时候,要看看券的情况,判断一下包邮有没有不包邮模板
2086 2155 if (quan_no && th.data.using_quan[pickid].isby == 1) {
... ... @@ -2129,8 +2198,14 @@ Page({
2129 2198 var cut_good_weight = 0;
2130 2199 for (let i in gd_arr_list) {
2131 2200 let item = gd_arr_list[i];
2132   -
  2201 +
  2202 + if(good.is_free_shipping==1) continue;
  2203 + //-- 代发商品不算运费 --
  2204 + if(good.whsle_id) continue;
  2205 +
2133 2206 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
  2207 +
  2208 + if (goods_weight < 0) goods_weight = 0;
2134 2209 if (item['exp_sum_type'] == 2) {
2135 2210 goods_weight += item['weight'] * item['buynum'];
2136 2211 cut_good_weight += item['weight'] * item['buynum'];
... ... @@ -2177,8 +2252,37 @@ Page({
2177 2252 th.data.is_by[th.data.bn_pick] = 0;
2178 2253  
2179 2254 //--------------开始计算物流------------------
2180   - shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
2181   - goods_piece, th.data.user_addr, back_data, rs);
  2255 + // shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  2256 + // goods_piece, th.data.user_addr, back_data, rs);
  2257 +
  2258 + var w_data={
  2259 + store_id:os.stoid, code:code,
  2260 + o_shipping_price:o_shipping_price,
  2261 + goods_weight:goods_weight,
  2262 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  2263 + user_addr_province:th.data.user_addr.province,
  2264 + user_addr_city:th.data.user_addr.city,
  2265 + user_addr_district:th.data.user_addr.district,
  2266 + is_by_all:back_data && back_data.is_by_all?1:0,
  2267 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  2268 + }
  2269 +
  2270 + var is_ok=1;
  2271 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  2272 + if(res.data.code==0){
  2273 + shipping_price=res.data.data;
  2274 + }else{
  2275 + is_ok=0;
  2276 + }
  2277 + })
  2278 +
  2279 + if(!is_ok){
  2280 + wx.showToast({
  2281 + title: "计算物流错误", icon: 'none',duration: 2000
  2282 + })
  2283 + th.setData({ show_submit:0 });
  2284 + wx.hideLoading();
  2285 + }
2182 2286  
2183 2287 if (shipping_price <= 0) {
2184 2288 th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
... ... @@ -2211,6 +2315,10 @@ Page({
2211 2315 }
2212 2316 //--看一下有没有订单优惠--
2213 2317 var o_condition = parseFloat(order_m);
  2318 + if(th.data.bn_goods.whsle_id>0){
  2319 + o_condition=0;
  2320 + }
  2321 +
2214 2322 if (o_condition > 0) {
2215 2323 th.check_is_order_prom(o_condition, function () {
2216 2324 var order_prom_amount = 0;
... ... @@ -2226,7 +2334,13 @@ Page({
2226 2334 order_prom_amount = (o_condition - order_m).toFixed(2);
2227 2335 break;
2228 2336 case 1:
2229   - order_m = o_condition - ord_prom['expression'];//满额优惠金额
  2337 + //-- 如果有优惠促销倍减的时候 --
  2338 + var bs=1;
  2339 + if(ord_prom.is_bz){
  2340 + bs=Math.floor(o_condition/ord_prom.money);
  2341 + }
  2342 +
  2343 + order_m = o_condition - bs*ord_prom['expression'];//满额优惠金额
2230 2344 order_prom_amount = ord_prom['expression'];
2231 2345 break;
2232 2346 }
... ... @@ -2258,14 +2372,14 @@ Page({
2258 2372 if (th.data.bn_use_money == 1) {
2259 2373 if (amoney > order_m) {
2260 2374 order_m = parseFloat(order_m).toFixed(2);
2261   - th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 })
  2375 + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,submit:0 })
2262 2376 } else {
2263 2377 order_m = parseFloat(order_m) - parseFloat(amoney);
2264 2378 order_m = order_m.toFixed(2);
2265   - th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
  2379 + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,submit:0 })
2266 2380 }
2267 2381 } else {
2268   - th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
  2382 + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,submit:0 })
2269 2383 }
2270 2384 //优惠活动送积分
2271 2385 if (good.s_intValue) {
... ... @@ -2325,14 +2439,14 @@ Page({
2325 2439 if (th.data.bn_use_money == 1) {
2326 2440 if (amoney > order_m) {
2327 2441 order_m = parseFloat(order_m).toFixed(2);
2328   - th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 })
  2442 + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 ,submit:0})
2329 2443 } else {
2330 2444 order_m = parseFloat(order_m) - parseFloat(amoney);
2331 2445 order_m = order_m.toFixed(2);
2332   - th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
  2446 + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,submit:0 })
2333 2447 }
2334 2448 } else {
2335   - th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
  2449 + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,submit:0 })
2336 2450 }
2337 2451 //优惠活动送积分
2338 2452 if (good.s_intValue) {
... ... @@ -2372,7 +2486,7 @@ Page({
2372 2486  
2373 2487 wx.hideLoading();
2374 2488  
2375   - });
  2489 + //});
2376 2490  
2377 2491 },
2378 2492  
... ... @@ -2445,7 +2559,7 @@ Page({
2445 2559 'user_money': parseFloat(th.data.formData.user_money).toFixed(2), //使用余额
2446 2560 'total_amount': parseFloat(th.data.formData.total_amount).toFixed(2), //订单总价
2447 2561 'order_amount': parseFloat(th.data.formData.order_amount).toFixed(2), //应付
2448   - 'user_note': th.data.user_note['0'] ? th.data.user_note['0'] : 0, //用户备注
  2562 + 'user_note': th.data.user_note['0'] ? th.data.user_note['0'] : "", //用户备注
2449 2563 'store_id': oo.stoid, //商家
2450 2564 'pickup_id': th.data.bn_pick, //门店
2451 2565 'exp_type': th.data.bn_exp_type, //配送方式
... ... @@ -2522,6 +2636,7 @@ Page({
2522 2636 })
2523 2637 }
2524 2638  
  2639 +
2525 2640 var goods = {
2526 2641 'goods_id': gg.goods_id,
2527 2642 'goods_name': gg.goods_name,
... ... @@ -2535,6 +2650,11 @@ Page({
2535 2650 'prom_id': th.data.bn_goods.prom_id, //促销活动id
2536 2651 };
2537 2652  
  2653 + if(th.data.bn_goods.whsle_id){
  2654 + item.is_whsle=1;
  2655 + goods.is_whsle_goods=1;
  2656 + }
  2657 +
2538 2658 if (getApp().globalData.skinface_id) {
2539 2659 goods.skinface_id = getApp().globalData.skinface_id;
2540 2660 }
... ... @@ -2564,7 +2684,7 @@ Page({
2564 2684 if (gg.is_pd_normal) goods.is_pd_normal = 1;
2565 2685  
2566 2686 //如果不立即购买或者秒杀,如果是线下库存购买的时候
2567   - if (goods.prom_type != 1 && goods.prom_type != 6 && th.data.sales_rules == 2) {
  2687 + if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 && th.data.sales_rules == 2 && !th.data.bn_goods.whsle_id) {
2568 2688 var isok = 1;
2569 2689 await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) {
2570 2690 isok = res;
... ... @@ -2681,7 +2801,7 @@ Page({
2681 2801 }
2682 2802  
2683 2803 var order_prom_list_cart = th.data.order_prom_list_cart;;
2684   - console.log('xxxxxxxxxxxxxxxx', order_prom_list_cart)
  2804 +
2685 2805 //--组装推送数据--
2686 2806 for (var i = 0; i < order_prom_list_cart.length; i++) {
2687 2807 var t_item = order_prom_list_cart[i];
... ... @@ -2806,120 +2926,192 @@ Page({
2806 2926 await th.split_set_goods_quanprice(you_item, t_item);
2807 2927 }
2808 2928 }
2809   - //-------------让商品添加到商品列表--------------------
2810   - for (var k = 0; k < t_item.goods.length; k++) {
2811   - var g_item = t_item.goods[k];
2812   - if (g_item.goods_num <= 0) continue;
2813   - var goods = {
2814   - 'goods_id': g_item.goods_id,
2815   - 'goods_name': g_item.goods_name,
2816   - 'goods_sn': g_item.goods_sn,
2817   - 'goods_num': g_item.goods_num,
2818   - 'market_price': g_item.market_price,
2819   - 'goods_price': g_item.goods_price,
2820   - 'member_goods_price': g_item.goods_price,
2821   - 'store_id': oo.stoid,
2822   - };
2823 2929  
2824   - if (getApp().globalData.skinface_id) {
2825   - goods.skinface_id = getApp().globalData.skinface_id;
2826   - }
  2930 + //代发商品的集合
  2931 + var df_goods = [];
  2932 + var df_price = 0;
  2933 + var df_room_ids = "";
  2934 +
  2935 + //-------------让商品添加到商品列表--------------------
  2936 + for (var k = 0; k < t_item.goods.length; k++) {
  2937 +
  2938 + console.log("222");
  2939 + var g_item = t_item.goods[k];
  2940 + if (g_item.goods_num <= 0) continue;
  2941 + var goods = {
  2942 + 'goods_id': g_item.goods_id,
  2943 + 'goods_name': g_item.goods_name,
  2944 + 'goods_sn': g_item.goods_sn,
  2945 + 'goods_num': g_item.goods_num,
  2946 + 'market_price': g_item.market_price,
  2947 + 'goods_price': g_item.goods_price,
  2948 + 'member_goods_price': g_item.goods_price,
  2949 + 'store_id': oo.stoid,
  2950 + };
2827 2951  
2828   - //-- 线下取价也要写入,组合购的商品不能去线下价格 --
2829   - if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type != 7) {
2830   - goods.goods_price = g_item.offline_price;
2831   - goods.member_goods_price = g_item.offline_price;
2832   - goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2);
2833   - goods.pricing_type = g_item.pricing_type;
2834   - }
2835   - if (g_item.quan_num) {
2836   - goods.quan_num = g_item.quan_num;
2837   - goods.quan_no = g_item.quan_no;
2838   - }
2839   - //--判断活动的类型--
2840   - switch (g_item.prom_type) {
2841   - case 1:
2842   - case 2:
2843   - case 10:
2844   - goods.prom_type = g_item.prom_type;
2845   - goods.prom_id = g_item.prom_id;
2846   - break;
2847   - case 3:
2848   - goods.prom_type = 3;
2849   - goods.prom_id = g_item.prom_id;
2850   - if (g_item.is_gift) {
2851   - goods.is_gift = g_item.is_gift;
2852   - goods.gift_id = g_item.gift_id;
2853   - }
2854   - break;
2855   - case 5:
2856   - goods.prom_type = 5;
2857   - goods.prom_id = g_item.prom_id;
2858   - if (g_item.is_collocation) {
2859   - goods.is_collocation = g_item.is_collocation;
  2952 + if (getApp().globalData.skinface_id) {
  2953 + goods.skinface_id = getApp().globalData.skinface_id;
  2954 + }
  2955 +
  2956 + //-- 线下取价也要写入,组合购的商品不能去线下价格 --
  2957 + if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type != 7) {
  2958 + goods.goods_price = g_item.offline_price;
  2959 + goods.member_goods_price = g_item.offline_price;
  2960 + goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2);
  2961 + goods.pricing_type = g_item.pricing_type;
  2962 + }
  2963 + if (g_item.quan_num) {
  2964 + goods.quan_num = g_item.quan_num;
  2965 + goods.quan_no = g_item.quan_no;
  2966 + }
  2967 + //--判断活动的类型--
  2968 + switch (g_item.prom_type) {
  2969 + case 1:
  2970 + case 2:
  2971 + case 10:
  2972 + goods.prom_type = g_item.prom_type;
  2973 + goods.prom_id = g_item.prom_id;
  2974 + break;
  2975 + case 3:
  2976 + goods.prom_type = 3;
  2977 + goods.prom_id = g_item.prom_id;
  2978 + if (g_item.is_gift) {
  2979 + goods.is_gift = g_item.is_gift;
  2980 + goods.gift_id = g_item.gift_id;
  2981 + }
  2982 + break;
  2983 + case 5:
  2984 + goods.prom_type = 5;
  2985 + goods.prom_id = g_item.prom_id;
  2986 + if (g_item.is_collocation) {
  2987 + goods.is_collocation = g_item.is_collocation;
  2988 + }
  2989 + break
  2990 + case 7:
  2991 + goods.prom_type = 7;
  2992 + goods.prom_id = g_item.prom_id;
  2993 + break
  2994 + default:
  2995 + goods.prom_type = 0;
  2996 + goods.prom_id = 0;
  2997 + }
  2998 +
  2999 + //如果不立即购买或者秒杀,如果是线下库存购买的时候
  3000 + if (goods.prom_type == 0 && th.data.sales_rules == 2) {
  3001 + var isok = 1;
  3002 + await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) {
  3003 + isok = res;
  3004 + });
  3005 + if (!isok) {
  3006 + getApp().confirmBox(goods.goods_name + "的门店库存不足");
  3007 + th.data.is_summit_ing = 0;
  3008 + return false;
2860 3009 }
2861   - break
2862   - case 7:
2863   - goods.prom_type = 7;
2864   - goods.prom_id = g_item.prom_id;
2865   - break
2866   - default:
2867   - goods.prom_type = 0;
2868   - goods.prom_id = 0;
2869   - }
  3010 + }
2870 3011  
2871   - //如果不立即购买或者秒杀,如果是线下库存购买的时候
2872   - if (goods.prom_type == 0 && th.data.sales_rules == 2) {
2873   - var isok = 1;
2874   - await th.check_store_num(goods.goods_id, t_item.pickup_id, goods.goods_num, function (res) {
2875   - isok = res;
2876   - });
2877   - if (!isok) {
2878   - getApp().confirmBox(goods.goods_name + "的门店库存不足");
2879   - th.data.is_summit_ing = 0;
2880   - return false;
  3012 + //把优惠的平摊结果写进去
  3013 + if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account != undefined)) {
  3014 + if (g_item.account >= 0) goods.account = g_item.account;
  3015 + if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu;
  3016 + item.is_discount_amount = 1;
2881 3017 }
2882   - }
2883 3018  
2884   - //把优惠的平摊结果写进去
2885   - if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account != undefined)) {
2886   - if (g_item.account >= 0) goods.account = g_item.account;
2887   - if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu;
2888   - item.is_discount_amount = 1;
2889   - }
  3019 + //导购ID
  3020 + if (g_item.guide_id) {
  3021 + goods.guide_id = g_item.guide_id;
  3022 + goods.guide_type = g_item.guide_type;
  3023 + //调用接口判断是不是会员
  3024 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => {
  3025 + if (res.data.code == 0) {
  3026 + goods.guide_name = res.data.data.salesman;
  3027 + goods.guide_sn = res.data.data.salesman_no;
  3028 + }
  3029 + })
  3030 + }
2890 3031  
2891   - //导购ID
2892   - if (g_item.guide_id) {
2893   - goods.guide_id = g_item.guide_id;
2894   - goods.guide_type = g_item.guide_type;
2895   - //调用接口判断是不是会员
2896   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => {
2897   - if (res.data.code == 0) {
2898   - goods.guide_name = res.data.data.salesman;
2899   - goods.guide_sn = res.data.data.salesman_no;
  3032 + //如果有阶梯促销
  3033 + if (g_item.ladder_list_id) {
  3034 + goods.ladder_list_id = g_item.ladder_list_id;
  3035 + }
  3036 +
  3037 + //-- 如果有代发商品,就要开始拆单 --
  3038 + if (g_item.whsle_id && t_item.goods.length>1) {
  3039 + df_price += parseFloat(g_item.goods_num * g_item.goods_price);
  3040 + goods.is_whsle_goods = 1;
  3041 + df_goods.push(goods);
  3042 + df_room_ids += g_item.room_id + ",";
  3043 + } else {
  3044 +
  3045 + //-- 如果只有一件的时候,商品又是代发商品,订单的状态要改成代发订单 --
  3046 + if(g_item.whsle_id){
  3047 + goods.is_whsle_goods=1;
  3048 + item.is_whsle=1;
2900 3049 }
2901   - })
2902   - }
2903   - //如果房间号不为空的时候
2904   - if (g_item.room_id) {
2905   - goods.room_id = g_item.room_id;
2906   - room_ids += g_item.room_id + ",";
2907   - }
2908 3050  
2909   - //如果有阶梯促销
2910   - if (g_item.ladder_list_id) {
2911   - goods.ladder_list_id = g_item.ladder_list_id;
  3051 + item.order_goods.push(goods);
  3052 + //如果房间号不为空的时候
  3053 + if (g_item.room_id) {
  3054 + goods.room_id = g_item.room_id;
  3055 + room_ids += g_item.room_id + ",";
  3056 + }
  3057 + }
2912 3058 }
2913 3059  
2914   - item.order_goods.push(goods);
2915   - }
2916 3060  
2917 3061 //如果房间号不为空的时候
2918 3062 if (room_ids != "") item.room_ids = ut.sub_last(room_ids);
  3063 +
  3064 + //处理代发商品的拆分
  3065 + if(df_goods.length>0 && item.order_goods.length>0 ){
  3066 + var df_item=JSON.parse(JSON.stringify(item));
  3067 + item.goods_price= parseFloat(item.goods_price-df_price).toFixed(2);
  3068 + item.total_amount= parseFloat(item.total_amount-df_price).toFixed(2);
  3069 +
  3070 + df_item.is_whsle=1;
  3071 + df_item.is_discount_amount=0;
  3072 + df_item.goods_price=df_price;
  3073 + df_item.total_amount=df_price;
  3074 + df_item.shipping_price=0; //没有运费
  3075 + if(df_item.order_prom_list) df_item.order_prom_list={};
  3076 + if(df_item.coupon_price) delete(df_item.coupon_price);
  3077 + if(df_item.coupon_no) delete(df_item.coupon_no);
  3078 +
  3079 + //看一下是用余额比较多,还是用钱比较多
  3080 + if(item.order_amount>item.user_money){
  3081 + if(item.order_amount>df_price){
  3082 + item.order_amount=parseFloat(item.order_amount-df_price).toFixed(2);
  3083 + df_item.order_amount=df_price.toFixed(2);
  3084 + }else {
  3085 + var more_p=parseFloat(df_price-item.order_amount).toFixed(2);
  3086 + item.order_amount=0;
  3087 + item.user_money=parseFloat(item.user_money-more_p).toFixed(2);
  3088 + df_item.user_money=more_p;
  3089 + }
  3090 + }else{
  3091 + if(item.user_money>df_price){
  3092 + item.user_money=parseFloat(item.user_money-df_price).toFixed(2);
  3093 + df_item.user_money=df_price.toFixed(2);
  3094 + }else {
  3095 + var more_p=parseFloat(df_price-item.user_money).toFixed(2);
  3096 + item.user_money=0;
  3097 + item.order_amount=parseFloat(item.user_money-more_p).toFixed(2);
  3098 + df_item.order_amount=more_p;
  3099 +
  3100 + }
  3101 + }
  3102 +
  3103 + if (df_room_ids != "") df_item.room_ids = ut.sub_last(df_room_ids);
  3104 + df_item.order_goods=df_goods;
  3105 + pdata.push(df_item);
  3106 + }
  3107 + //如果只有代发商品的时候
  3108 + if(df_goods.length>0 && item.order_goods.length<=0){
  3109 + item.order_goods=df_goods;
  3110 + item.is_whsle=1;
  3111 + }
2919 3112 pdata.push(item);
2920 3113 }
2921 3114  
2922   -
2923 3115 }
2924 3116  
2925 3117 if (pdata.length == 0) return;
... ... @@ -2951,7 +3143,7 @@ Page({
2951 3143 }
2952 3144 var order_amount = 0;
2953 3145 pdata.forEach(function (em, ind) {
2954   - order_amount += em.order_amount;
  3146 + order_amount += parseFloat(em.order_amount);
2955 3147 })
2956 3148 //要进行判断,如果是用微信支付,就要跳转到支付界面
2957 3149 if (order_amount > 0) {
... ... @@ -3757,7 +3949,7 @@ Page({
3757 3949 for (var i in goodlist) {
3758 3950 var gd = goodlist[i];
3759 3951 //--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券--
3760   - if (gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act.is_xz_yh) || gd.is_xz_yh == 1) {
  3952 + 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 3953 continue;
3762 3954 }
3763 3955  
... ... @@ -3865,8 +4057,8 @@ Page({
3865 4057 arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0);
3866 4058 arr[ind].check_quan_ware_list = check_quan_ware_list;
3867 4059 arr[ind].check_quan_price_list = check_quan_price_list;
3868   - //是否关闭使用优惠券
3869   - if (th.data.is_close_quan != 1) {
  4060 + //-- 是否关闭使用优惠券,循环有找到商品 --
  4061 + if (th.data.is_close_quan != 1 && check_quan_ware_list) {
3870 4062 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
3871 4063 var url = "/api/weshop/couponList/getUseCouponList";
3872 4064 await app.request.promiseGet(url, {
... ... @@ -3904,6 +4096,9 @@ Page({
3904 4096 get_buy_now_quan: function () {
3905 4097 var quanlist = null, th = this, frozenQuan = null;
3906 4098 var good = this.data.bn_goods;
  4099 +
  4100 + //一件代发商品不使用优惠券
  4101 + if(good.whsle_id) return false;
3907 4102 if (good.prom_price) {
3908 4103 th.data.ckeck_quan_price = good.prom_price; //如果有优惠价,就用优惠价
3909 4104 } else if (good.is_offline) {
... ... @@ -4025,6 +4220,7 @@ Page({
4025 4220 arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
4026 4221 arr.gift_limit_num = get_data.limit_num;
4027 4222 arr.gift_storecount = get_data.gift_storecount;
  4223 + arr.whsle_id=get_data.goodsinfo.whsle_id;
4028 4224 }
4029 4225 arr.s_libao = get_data.libao;
4030 4226 arr.s_lb_num = get_data.lb_num;
... ... @@ -4659,6 +4855,11 @@ Page({
4659 4855 goods_color: gf_item.goodsinfo.goods_color,
4660 4856 };
4661 4857  
  4858 +
  4859 + //-- 如果是代发商品的时候 --
  4860 + if(gf_item.goodsinfo.whsle_id){
  4861 + newd.whsle_id=gf_item.goodsinfo.whsle_id;
  4862 + }
4662 4863 await getApp().request.promisePost("/api/weshop/cart/save", {
4663 4864 data: newd
4664 4865 }).then(res => {
... ... @@ -4714,6 +4915,11 @@ Page({
4714 4915 goods_spec: gf_item.goodsinfo.goods_spec,
4715 4916 goods_color: gf_item.goodsinfo.goods_color,
4716 4917 };
  4918 + //-- 如果是代发商品的时候 --
  4919 + if(gf_item.goodsinfo.whsle_id){
  4920 + newd.whsle_id=gf_item.goodsinfo.whsle_id;
  4921 + }
  4922 +
4717 4923 new_pk_list_goods.push(newd);
4718 4924 }
4719 4925 var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -407,9 +407,9 @@ Page({
407 407  
408 408  
409 409 //---------计算立即购买----------
410   - calculatePrice2: function () {
  410 + calculatePrice2:async function () {
411 411 var th = this, good = this.data.bn_goods;
412   - wx.showLoading({ title: "处理中.", })
  412 + wx.showLoading({ title: "处理中.", mask:true })
413 413 //-----------计算商品总价--------------
414 414 var allpice = good.shop_price * good.buynum;
415 415 var all_integral = good.integral * good.buynum;
... ... @@ -426,7 +426,7 @@ Page({
426 426 th.setData({ [c_txt]: cut_price, });
427 427 }
428 428  
429   - to.getwuliuprice(async function (rs) {
  429 + //to.getwuliuprice(async function (rs) {
430 430  
431 431 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
432 432 var out_of_weight = null; //超出多少重量
... ... @@ -453,6 +453,7 @@ Page({
453 453 let item = gd_arr_list[i];
454 454  
455 455 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1) ) {
  456 + if (goods_weight < 0) goods_weight = 0;
456 457 if (item['exp_sum_type'] == 2) {
457 458 goods_weight += item['weight'] * item['buynum'];
458 459 cut_good_weight += item['weight'] * item['buynum'];
... ... @@ -495,8 +496,38 @@ Page({
495 496 var code = "";
496 497 if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
497 498 //--------------开始计算物流------------------
498   - var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
499   - goods_piece, th.data.user_addr, back_data, rs);
  499 + var shipping_price=0;
  500 + // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  501 + // goods_piece, th.data.user_addr, back_data, rs);
  502 +
  503 + var w_data={
  504 + store_id:os.stoid, code:code,
  505 + o_shipping_price:o_shipping_price,
  506 + goods_weight:goods_weight,
  507 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  508 + user_addr_province:th.data.user_addr.province,
  509 + user_addr_city:th.data.user_addr.city,
  510 + user_addr_district:th.data.user_addr.district,
  511 + is_by_all:back_data && back_data.is_by_all?1:0,
  512 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  513 + }
  514 +
  515 + var is_ok=0;
  516 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  517 + if(res.data.code==0){
  518 + shipping_price=res.data.data; is_ok=1;
  519 + }
  520 + })
  521 + if(!is_ok){
  522 + wx.showToast({
  523 + title: "计算物流错误", icon: 'none',duration: 2000
  524 + })
  525 + th.setData({ show_submit:0 });
  526 + wx.hideLoading();
  527 + return false;
  528 + }
  529 +
  530 +
500 531 if (shipping_price <= 0) {
501 532 th.data.is_by[th.data.bn_pick] = 1; //已经是包邮了,就不要选择包邮券
502 533 }
... ... @@ -547,7 +578,7 @@ Page({
547 578  
548 579 wx.hideLoading();
549 580  
550   - });
  581 + //});
551 582  
552 583 },
553 584  
... ... @@ -666,6 +697,12 @@ Page({
666 697 goods.skinface_id=getApp().globalData.skinface_id;
667 698 }
668 699  
  700 + if(th.data.bn_goods.whsle_id){
  701 + item.is_whsle=1;
  702 + goods.is_whsle_goods=1;
  703 + }
  704 +
  705 +
669 706 //-- 把导购的信息填入--
670 707 if (gg.guide_id) {
671 708 goods.guide_id = gg.guide_id;
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -394,7 +394,15 @@ Page({
394 394 });
395 395 },
396 396 //---------计算立即购买----------
397   - calculatePrice2: function () {
  397 + calculatePrice2:async function () {
  398 +
  399 + this.setData({submit:1});
  400 +
  401 + wx.showLoading({
  402 + title: "处理中.",
  403 + mask:true
  404 + })
  405 +
398 406 var th = this, good = this.data.bn_goods;
399 407 //-----------计算商品总价--------------
400 408 var allpice = good.shop_price * good.buynum;
... ... @@ -402,9 +410,10 @@ Page({
402 410 var txt = "formData.all_price";
403 411 th.setData({ [txt]: allpice, });
404 412  
405   - to.getwuliuprice(async function (rs) {
  413 + //to.getwuliuprice(async function (rs) {
406 414 console.log('calculatePrice2222');
407   - console.log(rs);
  415 + //console.log(rs);
  416 +
408 417 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
409 418 var out_of_weight = null; //超出多少重量
410 419  
... ... @@ -430,7 +439,8 @@ Page({
430 439 let item = gd_arr_list[i];
431 440  
432 441 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
433   - if (item['exp_sum_type'] == 2) {
  442 + if (goods_weight < 0) goods_weight = 0;
  443 + if (item['exp_sum_type'] == 2) {
434 444 cut_good_weight += item['weight'] * item['buynum'];
435 445 goods_weight += item['weight'] * item['buynum'];
436 446 }
... ... @@ -473,8 +483,36 @@ Page({
473 483 var code = th.data.wu_arr[th.data.index].code;
474 484  
475 485 //--------------开始计算物流------------------
476   - var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
477   - goods_piece, th.data.user_addr, back_data, rs);
  486 + var shipping_price=0;
  487 + // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  488 + // goods_piece, th.data.user_addr, back_data, rs);
  489 +
  490 + var w_data={
  491 + store_id:os.stoid, code:code,
  492 + o_shipping_price:o_shipping_price,
  493 + goods_weight:goods_weight,
  494 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  495 + user_addr_province:th.data.user_addr.province,
  496 + user_addr_city:th.data.user_addr.city,
  497 + user_addr_district:th.data.user_addr.district,
  498 + is_by_all:back_data && back_data.is_by_all?1:0,
  499 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  500 + }
  501 +
  502 + var is_ok=0;
  503 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  504 + if(res.data.code==0){
  505 + shipping_price=res.data.data; is_ok=1;
  506 + }
  507 + })
  508 + if(!is_ok){
  509 + wx.showToast({
  510 + title: "计算物流错误", icon: 'none',duration: 2000
  511 + })
  512 + th.setData({ show_submit:0 });
  513 + wx.hideLoading();
  514 + return false;
  515 + }
478 516  
479 517 shipping_price = parseFloat(shipping_price).toFixed(2);
480 518 var wl_txt = "formData.shipping_price";
... ... @@ -497,17 +535,19 @@ Page({
497 535 //--------------如果使用余额---------------------
498 536 if (th.data.bn_use_money == 1 && th.data.yuer > 0) {
499 537 if (parseFloat(th.data.yuer) > total_m) {
500   - th.setData({ [txt]: total_m, [txt2]: 0 })
  538 + th.setData({ [txt]: total_m, [txt2]: 0,submit:0 })
501 539 } else {
502 540 order_m = parseFloat(order_m) - parseFloat(th.data.yuer);
503 541 order_m = order_m.toFixed(2);
504   - th.setData({ [txt]: th.data.yuer, [txt2]: order_m })
  542 + th.setData({ [txt]: th.data.yuer, [txt2]: order_m,submit:0 })
505 543 }
506 544 } else {
507   - th.setData({ [txt]: 0, [txt2]: order_m })
  545 + th.setData({ [txt]: 0, [txt2]: order_m,submit:0 })
508 546 }
509 547  
510   - });
  548 + wx.hideLoading();
  549 +
  550 + //});
511 551  
512 552 },
513 553 //--------------------提交订单-----------------------
... ... @@ -618,6 +658,12 @@ Page({
618 658 if(getApp().globalData.skinface_id){
619 659 goods.skinface_id=getApp().globalData.skinface_id;
620 660 }
  661 +
  662 + if(th.data.bn_goods.whsle_id){
  663 + item.is_whsle=1;
  664 + goods.is_whsle_goods=1;
  665 + }
  666 +
621 667 //--导购分享过来的id--
622 668 if (gg.guide_id) {
623 669 goods.guide_id = gg.guide_id;
... ...
pages/cart/cart2_pt/cart2_pt.wxml
... ... @@ -158,7 +158,7 @@
158 158 <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
159 159 <!-- <view class="co-red big"></view> -->
160 160 </view>
161   - <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  161 + <button disabled="{{submit}}" class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
162 162 </view>
163 163 </form>
164 164  
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -40,6 +40,7 @@ Page({
40 40 show_pay_type: 0,
41 41  
42 42 teamgroup: null,
  43 + submit:1, //默认按钮是灰色
43 44 },
44 45  
45 46 /**
... ... @@ -71,7 +72,7 @@ Page({
71 72 * 生命周期函数--监听页面显示
72 73 */
73 74 onShow: function () {
74   - getApp().check_can_share();
  75 + getApp().check_can_share();
75 76 var th = this;
76 77 if (th.data.isclose == 0) {
77 78 wx.navigateTo({
... ... @@ -96,7 +97,7 @@ Page({
96 97 /**
97 98 * 用户点击右上角分享
98 99 */
99   - onShareAppMessage: function () { getApp().globalData.no_clear=1 },
  100 + onShareAppMessage: function () { getApp().globalData.no_clear=1 },
100 101 //---------------获取物流---------------
101 102 get_wuliu(func) {
102 103 var th = this,
... ... @@ -296,7 +297,7 @@ Page({
296 297 } else {
297 298 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money;
298 299 allpice = allpice.toFixed(2);
299   - th.setData({ exp_price: 0, allpice: allpice })
  300 + th.setData({ exp_price: 0, allpice: allpice,submit:0 })
300 301 }
301 302 },
302 303  
... ... @@ -330,6 +331,8 @@ Page({
330 331  
331 332 //--计算物流的值--
332 333 if (type == 0) {
  334 +
  335 + th.setData({submit:0})
333 336 th.calculate_wuliu();
334 337 } else {
335 338 var allpice = parseFloat(th.data.order.order_amount)
... ... @@ -348,11 +351,19 @@ Page({
348 351 },
349 352 //--弹起支付框--
350 353 to_pay() {
  354 +
  355 +
  356 + //如果有再计算价格的过程中,不能提交订单
  357 + if(this.data.submit){ return false}
  358 +
351 359 //--物流支付时要有地址--
352 360 if (this.data.exp_type == 0 && this.data.user_addr == null) {
353 361 return getApp().my_warnning("请选择收货地址", 0, this);
354 362 }
355 363  
  364 +
  365 +
  366 +
356 367 this.setData({ show_pay_type: 1 });
357 368 },
358 369  
... ... @@ -473,9 +484,11 @@ Page({
473 484 },
474 485  
475 486 //----计算物流的钱----
476   - calculate_wuliu() {
  487 + async calculate_wuliu() {
  488 + //让按钮变灰色
  489 + this.setData({submit:1});
477 490 var to = getApp(), th = this;
478   - to.getwuliuprice(async function (rs) {
  491 + //to.getwuliuprice(async function (rs) {
479 492 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1, good = th.data.goods;
480 493 var out_of_weight = null; //超出多少重量
481 494  
... ... @@ -505,7 +518,8 @@ Page({
505 518 let item = gd_arr_list[i];
506 519  
507 520 if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
508   - if (item['exp_sum_type'] == 2) {
  521 + if (goods_weight < 0) goods_weight = 0;
  522 + if (item['exp_sum_type'] == 2) {
509 523 goods_weight += item['weight'] * item['buynum'];
510 524 cut_good_weight += item['weight'] * item['buynum'];
511 525 }
... ... @@ -547,21 +561,50 @@ Page({
547 561 var code = th.data.wu_arr[th.data.index].code;
548 562  
549 563 //--------------开始计算物流------------------
550   - var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
551   - goods_piece, th.data.user_addr, back_data, rs);
  564 + var shipping_price =0;
  565 + // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  566 + // goods_piece, th.data.user_addr, back_data, rs);
  567 +
  568 + var w_data={
  569 + store_id:os.stoid, code:code,
  570 + o_shipping_price:o_shipping_price,
  571 + goods_weight:goods_weight,
  572 + out_of_weight:out_of_weight,goods_piece:goods_piece,
  573 + user_addr_province:th.data.user_addr.province,
  574 + user_addr_city:th.data.user_addr.city,
  575 + user_addr_district:th.data.user_addr.district,
  576 + is_by_all:back_data && back_data.is_by_all?1:0,
  577 + no_free_goods:back_data && back_data.no_free_goods && back_data.no_free_goods.length>0?1:0,
  578 + }
  579 +
  580 + var is_ok=0;
  581 + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', {data:w_data,is_json:1}).then(res=>{
  582 + if(res.data.code==0){
  583 + shipping_price=res.data.data; is_ok=1;
  584 + }else{
  585 + wx.showToast({
  586 + title: "计算物流错误:"+res.data.msg, icon: 'none',duration: 2000
  587 + })
  588 + }
  589 + })
  590 + if(!is_ok){
  591 + th.setData({ submit:0 });
  592 + wx.hideLoading();
  593 + return false;
  594 + }
552 595  
553 596 var exp_price = parseFloat(shipping_price).toFixed(2);
554 597 allpice = parseFloat(exp_price) + parseFloat(allpice);
555 598 allpice = allpice.toFixed(2);
556 599  
557 600 exp_price = parseFloat(exp_price);
558   - th.setData({ exp_price: exp_price, allpice: allpice })
  601 + th.setData({ exp_price: exp_price, allpice: allpice,submit:0 })
559 602 } else {
560 603 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money;
561 604 allpice = allpice.toFixed(2);
562   - th.setData({ exp_price: 0, allpice: allpice })
  605 + th.setData({ exp_price: 0, allpice: allpice,submit:0})
563 606 }
564   - });
  607 + //});
565 608  
566 609 },
567 610  
... ...
pages/cart/cart_wk/cart_wk.wxml
... ... @@ -110,7 +110,7 @@
110 110 <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text>
111 111 </view> -->
112 112 <view class='zf_left'>支付合计:<text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text></view>
113   - <view class='zf_btn' bindtap="to_pay">支付尾款</view>
  113 + <view class="zf_btn {{submit?'gray':''}}" bindtap="to_pay">支付尾款</view>
114 114 </view>
115 115  
116 116 <!--支付的方式选择,0微信支付 1余额支付-->
... ...
pages/cart/cart_wk/cart_wk.wxss
... ... @@ -288,7 +288,11 @@ page {
288 288 color: #c4182e;
289 289 }
290 290  
291   -/*----------nyf新增,地址---------*/
  291 +.zf_btn.gray{
  292 + background-color:darkgrey;
  293 +}
  294 +
  295 + /*----------nyf新增,地址---------*/
292 296 .add_new{
293 297 box-sizing: border-box;
294 298 height: 92rpx;
... ...
pages/giftpack/buygiftpack/giftpackbuy.wxml
... ... @@ -21,7 +21,8 @@
21 21 <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a>
22 22 </view>
23 23 </view>
24   - <block wx:for="{{wareCard}}" wx:if="{{now > filter.gettimestamp(items.starTime) || (items.is_show && now > items.show_time)}}" wx:for-item="items" wx:for-index="index" wx:key="index">
  24 + <!--<block wx:for="{{wareCard}}" wx:if="{{now > filter.gettimestamp(items.starTime) || (items.is_show && now > items.show_time)}}" wx:for-item="items" wx:for-index="index" wx:key="index">-->
  25 + <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index">
25 26 <view class="content_box">
26 27 <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn=''">
27 28 <view class="content_box_img">
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -228,7 +228,7 @@ Page({
228 228 giftTitle: res.data.data.giftTitle,
229 229 default_color: res.data.data.bgcolor
230 230 })
231   -
  231 +
232 232 if(res.data.data.iswarelbtype==1) {
233 233 th.setData({iswarelbtype:1})
234 234 }
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -19,7 +19,7 @@
19 19 </block>
20 20 <block wx:else>
21 21 <text class="data-v-3a5b7e36" wx:if="{{isBuy==0 && iswarelbtype}}">{{"兑换结束时间:"+giftDate}}</text>
22   - <text class="data-v-3a5b7e36" wx:else>
  22 + <text class="data-v-3a5b7e36" wx:if="{{flag == 1}}">
23 23 {{"活动结束时间:"+giftDate}}
24 24 </text>
25 25 </block>
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -352,6 +352,10 @@ Page({
352 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 //-- 如果有房间号 --
... ... @@ -557,7 +561,7 @@ Page({
557 561 var that = this, th = this;
558 562 getApp().getConfig2(function (e) {
559 563 var sales_rules = e.sales_rules;
560   - if (sales_rules == 2 && [1,2,4,6,8,9].indexOf(th.data.prom_type)==-1 ) {
  564 + if (sales_rules == 2 && [1,2,4,6,8,9].indexOf(th.data.prom_type)==-1 && !th.data.sele_g.whsle_id ) {
561 565 getApp().waitfor2(that, "wait_for_user_store", "fir_goods", function () {
562 566 var lock = 0, plist = null;
563 567 var gd = that.data.fir_goods;
... ... @@ -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.fir_goods.whsle_id && ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 2) {
890 895 ee.check_is_youhui(ee.data.gid);
891 896 }
892 897  
... ... @@ -1390,6 +1395,13 @@ Page({
1390 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 1406 if (th.data.c_guide_id) {
1395 1407 newd['guide_id'] = th.data.c_guide_id;
... ... @@ -1664,7 +1676,7 @@ Page({
1664 1676 }
1665 1677  
1666 1678 //---如果是线下门店销售的时候---
1667   - if (th.data.sales_rules == 2) {
  1679 + if (th.data.sales_rules == 2 && !th.data.sele_g.whsle_id ) {
1668 1680 var pick = th.get_pick_from_list(th.data.sto_sele_id)
1669 1681 //---通过接口获取门店的线下库存信息--
1670 1682 getApp().request.get("/api/weshop/goods/getWareStorages", {
... ... @@ -1781,7 +1793,7 @@ Page({
1781 1793 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);
1782 1794 if ("add" == t.currentTarget.dataset.action) {
1783 1795  
1784   - if (th.data.prom_goods) {
  1796 + if (th.data.prom_goods && !th.data.sele_g.whsle_id) {
1785 1797 newd.prom_type = 3;
1786 1798 newd.prom_id = th.data.prom_goods[0].prom_id;
1787 1799 }
... ... @@ -2336,7 +2348,7 @@ Page({
2336 2348 check_is_prom_goods: function (callback) {
2337 2349 var th = this;
2338 2350 var usr = getApp().globalData.userInfo;
2339   - if (this.data.sele_g.prom_type != 0 && this.data.sele_g.prom_type != 3) {
  2351 + if (this.data.sele_g.prom_type != 0 && this.data.sele_g.prom_type != 3 && !this.data.sele_g.whsle_id) {
2340 2352 callback();
2341 2353 } else {
2342 2354 //-- 判断有没有优惠活动 --
... ... @@ -2847,10 +2859,10 @@ 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 && !that.data.sele_g.whsle_id ) {
2854 2866 var lock = 0, plist = null;
2855 2867 //先读取门店的lock,采用链式写法,少用await
2856 2868 getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
... ... @@ -3077,7 +3089,7 @@ Page({
3077 3089 th.setData({all_pick_list: e.data.data.pageData});
3078 3090  
3079 3091 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
3080   - if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) {
  3092 + if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && !th.data.sele_g.whsle_id && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) {
3081 3093 setTimeout(function () {
3082 3094 th.deal_pickup_dline(e);
3083 3095 }, 800)
... ... @@ -3619,7 +3631,7 @@ Page({
3619 3631 this.get_sku(o.stoid, this.data.data, gid);
3620 3632 this.check_has_flash();
3621 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 3635 return false;
3624 3636 }
3625 3637  
... ... @@ -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 4278 } else {
4267 4279  
4268 4280 if (th.data.is_normal) {
... ... @@ -5981,7 +5993,7 @@ Page({
5981 5993 var lock = 0;
5982 5994  
5983 5995 //---如果是活动的时候,同时不是普通购买---
5984   - if ((th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) && !th.data.is_normal) {
  5996 + if (th.data.sele_g.whsle_id || (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) && !th.data.is_normal) {
5985 5997 func();
5986 5998 return false;
5987 5999 }
... ... @@ -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 6655 closeSpecModal_inte: function () {
... ... @@ -6845,7 +6857,8 @@ Page({
6845 6857 });
6846 6858 this.get_sku(os.stoid, this.data.data, gid);
6847 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 6862 this.data.is_normal = 1;
6850 6863 },
6851 6864  
... ... @@ -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 6963 closeSpecModal_flash_normal: function () {
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -649,7 +649,7 @@
649 649 <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
650 650 (配送不匹配)
651 651 </view>
652   - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">
  652 + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0 && !sele_g.whsle_id}}">
653 653 (库存不足)
654 654 </view>
655 655 </block>
... ... @@ -1254,7 +1254,7 @@
1254 1254 <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
1255 1255 <block wx:else>
1256 1256 <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
1257   - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">
  1257 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0 &&!sele_g.whsle_id}}">
1258 1258 (库存不足)
1259 1259 </view>
1260 1260 </block>
... ... @@ -1326,7 +1326,7 @@
1326 1326 </block>
1327 1327 <block wx:else>
1328 1328 <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
1329   - <block wx:if="{{sales_rules==2 && prom_type==0}}">
  1329 + <block wx:if="{{sales_rules==2 && prom_type==0 && !sele_g.whsle_id}}">
1330 1330 <block wx:if="{{!def_pick_store.CanOutQty}}">
1331 1331 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1332 1332 库存不足
... ...
pages/goods/goodsList/goodsList.js
... ... @@ -41,6 +41,9 @@ Page({
41 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 49 var th=this;
... ...
pages/index/index/index.js
... ... @@ -173,6 +173,11 @@ Page({
173 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 18 <view class="top-bar">
19 19 <!-- 顶部关注公众号 -->
20 20 <view id="off_top" wx:if="{{is_gz_h5}}"><official-account></official-account></view>
21   -
22 21 <!-- 控制要不要显示顶部门店选择 -->
23 22 <block wx:if="{{is_topstore}}">
24 23 <store_select style="z-index: 999;"></store_select>
... ... @@ -45,17 +44,11 @@
45 44 </view>
46 45 </view>
47 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 53 <view class="rel title-img" wx:if="{{banner}}">
61 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 588  
596 589  
597 590  
  591 +
  592 +
... ...
pages/togoin/togoin.js
... ... @@ -11,6 +11,7 @@ Page({
11 11 store_logo:'',
12 12 first_leader:'', //-- 邀请人 --
13 13 config2:null,
  14 + sub:0
14 15 },
15 16 onLoad: function (options) {
16 17 if (wx.getUserProfile) {
... ... @@ -187,15 +188,7 @@ Page({
187 188 };
188 189 //--如果有邀请人的时候--
189 190 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   - })
  191 + dd.first_leader=th.data.first_leader;
199 192 }
200 193 //-- 导购会员ID --
201 194 if(getApp().globalData.guide_id){
... ... @@ -209,50 +202,77 @@ Page({
209 202  
210 203 console.log("-----会员注册的信息-------");
211 204 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 205  
246   - },
247   - failStatus: function (t) {
248   - return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
249   - },
250   - fail: function (t) {
251   - return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  206 +
  207 + var need_go=0;
  208 + //如果有需要完善的信息没有完善,就需要跳转
  209 + if(th.data.name_need_go){ need_go=1;}
  210 + if(th.data.birth_need_go){ need_go=1;}
  211 + if(th.data.idcard_need_go){ need_go=1;}
  212 + if(th.data.address_need_go){ need_go=1;}
  213 + if(th.data.pick_need_go){ need_go=1;}
  214 + if(th.data.sex_need_go){ need_go=1;}
  215 + if(th.data.introducer_need_go){ need_go=1;}
  216 +
  217 + if(need_go){
  218 +
  219 + var req_data={
  220 + sessionKey: sessionKey,
  221 + encryptedData: e.encryptedData,
  222 + iv: e.iv,
  223 + store_id: getApp().globalData.setting.stoid,
  224 + }
  225 + //-- 获取一下手机 --
  226 + getApp().request.promiseGet("/api/weshop/users/getmobile", {data:req_data}).then(res=>{
  227 + if(res.data.code==0){
  228 + dd.mobile=res.data.data;
  229 + getApp().globalData.zc_dd=dd;
  230 + wx.redirectTo({
  231 + url:"/packageA/pages/profile/profile?is_back=1"
  232 + })
  233 + }
  234 + })
  235 +
  236 + }else{
  237 +
  238 + this.setData({sub:1});
  239 + wx.showLoading({
  240 + title:'处理中.',
  241 + mask:true
  242 + })
  243 + this.zu_ce(dd); //调用注册的函数
252 244 }
253   - });
  245 +
254 246 },
255 247  
  248 + zu_ce:function (dd) {
  249 + var th=this;
  250 + app.request.get("/api/weshop/users/thirdLogin", {
  251 + data: dd,
  252 + success: function (e) {
  253 + if (e.data.code == 0) {
  254 + app.globalData.user_id = e.data.data.user_id;
  255 + } else {
  256 + return app.showWarning("授权登入失败!"+e.data.msg);
  257 + }
  258 + getApp().globalData.login_back=1;
  259 + wx.setStorageSync("userinfo",e.data.data);
  260 + wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(app.globalData.userInfo.head_pic);
  261 + wx.navigateBack({ delta: 1})
  262 +
  263 + },
  264 + failStatus: function (t) {
  265 + th.setData({sub:0});
  266 + return app.my_warnning("授权登入失败,请稍后再试!", 0, th);
  267 + },
  268 + fail: function (t) {
  269 + th.setData({sub:0});
  270 + return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  271 + }
  272 + });
  273 + },
  274 +
  275 +
256 276 bind_bnerr:function(e){
257 277 var _errImg = e.target.dataset.errorimg;
258 278 var _errObj = {};
... ...
pages/togoin/togoin.wxml
... ... @@ -68,7 +68,7 @@
68 68 </view>
69 69 <view class="flex btn_view">
70 70 <view bindtap="close_pop_back" style="height: 100%; line-height:normal;" class="txt-center f2 flex ali-c flex-center2 fs36 b_right">暂不授权</view>
71   - <button style="height: 100%;" class="g_mobile f2 flex ali-c flex-center2 fs36 txt-red" open-type="getPhoneNumber" bindgetphonenumber="getphone">立即授权</button>
  71 + <button disabled="{{sub}}" style="height: 100%;" class="g_mobile f2 flex ali-c flex-center2 fs36 txt-red" open-type="getPhoneNumber" bindgetphonenumber="getphone">立即授权</button>
72 72 </view>
73 73 </view>
74 74 </view>
... ...
pages/user/index/index.js
... ... @@ -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 97 this.init_user_tool()
80 98 },
81 99  
... ... @@ -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 527 show_tc: function () {
... ...
pages/user/order_detail/order_detail.js
... ... @@ -629,7 +629,7 @@ Page({
629 629 }
630 630  
631 631 //--如果是线下库存的时候--
632   - if(th.data.conf.sales_rules==2){
  632 + if(th.data.conf.sales_rules==2 && !gg.whsle_id){
633 633 var ob={};
634 634 await th.check_down_line_next(gg,good.goods_num,order.pickup_id,function(obj){
635 635 ob=obj;
... ... @@ -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 1201 var is_g_prom=0;
1202 1202 //因为有全场优惠活动,商品参加的活动还未开始
1203 1203 var url="/api/weshop/activitylist/getGoodActInfo";
... ... @@ -1239,7 +1239,7 @@ Page({
1239 1239  
1240 1240  
1241 1241 //判断是不是线下库存的购买, 是不是秒杀活动
1242   - if(th.data.sales_rules==2 && !prom){
  1242 + if(th.data.sales_rules==2 && !prom && !good.whsle_id){
1243 1243  
1244 1244 //-- 看一下购物车上有多少商品 --
1245 1245 var cart_num=0;
... ...
pages/user/order_detail/order_detail.wxml
... ... @@ -36,7 +36,7 @@
36 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 40 <view bindtap="checkReturnGoodsStatus" class="goods-num" data-oid="{{item.order_id}}"
41 41 data-recid="{{item.goods_id}}" wx:if="{{item.return_btn==1 && !order.is_bedistri}}">申请退款</view>
42 42 <view bindtap="gotoreturn" class="return-btn" data-oid="{{item.order_id}}"
... ...
pages/user/order_list/order_list.js
... ... @@ -881,7 +881,7 @@ Page({
881 881 }
882 882  
883 883 //--如果是线下库存的时候--
884   - if (th.data.conf.sales_rules == 2) {
  884 + if (th.data.conf.sales_rules == 2 && !gg.whsle_id) {
885 885 var ob = {};
886 886 await th.check_down_line_next(gg, good.goods_num, order.pickup_id, function (obj) {
887 887 ob = obj;
... ... @@ -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 1443 var is_g_prom=0;
1444 1444 //因为有全场优惠活动,商品参加的活动还未开始
1445 1445 var url="/api/weshop/activitylist/getGoodActInfo";
... ... @@ -1482,7 +1482,7 @@ Page({
1482 1482  
1483 1483  
1484 1484 //判断是不是线下库存的购买, 是不是秒杀活动
1485   - if(th.data.sales_rules==2 && !prom){
  1485 + if(th.data.sales_rules==2 && !prom && !good.whsle_id){
1486 1486  
1487 1487 //-- 看一下购物车上有多少商品 --
1488 1488 var cart_num=0;
... ...
pages/user/order_list/order_list.wxml
... ... @@ -150,7 +150,7 @@
150 150 </view>
151 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 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 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 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 88 console.log('ee',ee);
89 89 var sms_conf = ee.switch_list;
90 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 102 if (sms_conf.usercode_vailtime!=null && parseInt(sms_conf.usercode_vailtime)>0)
98 103 {
99 104 th.setData({ getusercode_vailtime: sms_conf.usercode_vailtime });
... ... @@ -101,7 +106,7 @@ Page({
101 106 if (sms_conf.user_label_set) {
102 107 th.query_checklabels();
103 108 }
104   - })
  109 + },1)
105 110 },
106 111 //查找会员选择的兴趣标签
107 112 query_checklabels: function() {
... ... @@ -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 825 }, !0);
829 826 },
830 827  
... ...
pages/user/userinfo/userinfo.wxml
... ... @@ -113,6 +113,12 @@
113 113 </block>
114 114 <view class="fs26">女</view>
115 115 </view>
  116 +
  117 + <block wx:if="{{!user.sex}}">
  118 + <text class="lb_txt" wx:if="{{reg_info.sex && reg_info.sex_state && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</text>
  119 + <text class="lb_txt" wx:if="{{reg_info.sex && reg_info.sex_state && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</text>
  120 + </block>
  121 +
116 122 </view>
117 123  
118 124 </view>
... ... @@ -140,7 +146,7 @@
140 146 <view class="Mleft">农历</view>
141 147 </view>
142 148 </view>
143   - <view class="user-txt-right">
  149 + <view class="user-txt-right flex ai_c">
144 150 <!-- 填充数据的时候要判断是否已经有出生日期,有值的话就不可修改 -->
145 151 <block wx:if="{{user.birthday==''||user.birthday==null}}">
146 152 <picker bindchange='bindChange' value="{{datet}}" mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31">
... ... @@ -150,7 +156,12 @@
150 156 <block wx:else>
151 157 <view>{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}</view>
152 158 </block>
153   -
  159 +
  160 + <block wx:if="{{!user.birthday}}">
  161 + <text class="lb_txt" wx:if="{{reg_info.birthday && reg_info.birthday_state && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</text>
  162 + <text class="lb_txt" wx:if="{{reg_info.birthday && reg_info.birthday_state && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</text>
  163 + </block>
  164 +
154 165 </view>
155 166 </view>
156 167 </view>
... ... @@ -158,18 +169,25 @@
158 169 <view class="Bbottom">
159 170 <view bindtap="editUserInfo1" class="user-name mt flex-vertical-between" data-type="nickname">
160 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_state && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</text>
  176 + <text class="lb_txt" wx:if="{{reg_info.name && reg_info.name_state && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</text>
  177 + </block>
  178 + </view>
162 179 </view>
163 180  
164 181 <view bindtap="editUserInfo1" class="user-name flex-vertical-between" data-type="nickname">
165 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_state && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</text>
  187 + <text class="lb_txt" wx:if="{{reg_info.idcard && reg_info.idcard_state && (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 191 </view>
174 192 <view data-url="/packageB/pages/user/Change_phone/Change_phone" bindtap="go_phone" class="user-name flex-vertical-between" data-type="mobile">
175 193 <view class="user-name-txt">更换手机</view>
... ... @@ -185,8 +203,14 @@
185 203 <view>{{user.address}}</view>
186 204 </block>
187 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_state && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</text>
  210 + <text class="lb_txt" wx:if="{{reg_info.address && reg_info.address_state && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</text>
  211 + </block>
  212 + </view>
  213 +
190 214 </view>
191 215  
192 216 <!-- 选择门店 -->
... ... @@ -194,7 +218,14 @@
194 218 <view class="user-name-txt">所属门店</view>
195 219 <view class="flex-center user-txt-right">
196 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_state && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</text>
  225 + <text class="lb_txt" wx:if="{{reg_info.pick && reg_info.pick_state && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</text>
  226 + </block>
  227 + </view>
  228 +
198 229 </view>
199 230 </view>
200 231  
... ... @@ -239,7 +270,6 @@
239 270 <navigator bindtap="goto-address" class="user-name mt flex-vertical-between" url="/pages/user/address_list/address_list">
240 271 <view class="user-name-txt">收货地址</view>
241 272 <view class="flex-center user-txt-right">
242   - <!-- <view class="flex">{{user.address_id}}</view> -->
243 273 <view class="angle">∟</view>
244 274 </view>
245 275 </navigator>
... ...
pages/user/userinfo/userinfo.wxss
... ... @@ -662,3 +662,7 @@ input {
662 662 height: 46rpx;
663 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 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 702 unserialize: unserialize,
681 703 _throttle:_throttle,
682 704 unserialize_o: unserialize_o,
... ...