diff --git a/packageA/pages/profile/profile.js b/packageA/pages/profile/profile.js
index 6cee44d..1b90f26 100644
--- a/packageA/pages/profile/profile.js
+++ b/packageA/pages/profile/profile.js
@@ -23,6 +23,7 @@ var date = new Date(timestamp);
// barcode,
// qrcode
// } = require('../../../utils/index.js');
+var regeneratorRuntime = require('../../../utils/runtime.js');
Page({
data: {
@@ -576,114 +577,104 @@ Page({
self = this;
let url1 = '/api/weshop/storeconfig/get/';
- let url3 = '/api/weshop/users/getERPUser/';
+ let url3 = '/api/weshop/users/getErpvipidPickup';
url1 += r.stoid;
- var user=app.globalData.userInfo;
- if(!user) return false;
-
- //-- 赋予默认值 --
- if(user['idcard']) this.data.id=user['idcard'];
- if(user['vipname']) this.data.name=user['vipname'];
- if(user['address']) this.data.address=user['address'];
-
+
+ var uu=getApp().globalData.zc_dd;
+ if(uu){
+ this.setData({head_pic:uu.head_pic,nickname:uu.nickname})
+ }
+
app.request.get(url1, {
- success: function(res) {
- console.log('x-->', res.data.code, res.data.data.reg_type, res.data.data.reg_info);
+ success:async function(res) {
if(res.data.code == 0) {
let reg_type = res.data.data.reg_type;
let reg_info = res.data.data.reg_info;
if(reg_type) { //reg_type为1才显示积分信息
if(reg_info) {
- reg_info = JSON.parse(reg_info);
+ reg_info = JSON.parse(reg_info);
+ var user_id=0;
+
+ //-- 获取会员信息 -
+ await getApp().request.promiseGet("/api/weshop/users/page", {data:{
+ store_id:r.stoid,mobile:uu.mobile
+ }}).then(res=>{
+ if(ut.ajax_ok(res)){
+ user_id=res.data.data.pageData[0].user_id;
+ }
+ })
+
if(reg_info.reginfo_coupon){
//判断有没有领过券
- self.check_is_send_quan(reg_info.reginfo_coupon,user.user_id);
- }
+ self.check_is_send_quan(reg_info.reginfo_coupon,user_id);
+ }
+
+ if(reg_info.reginfo_lb_id){
+ //判断有没有领过礼包
+ self.check_is_send_libao(reg_info.reginfo_lb_id,user_id);
+ }
+
};
};
self.setData({
reg_type,
reg_info,
- user: app.globalData.userInfo,
});
- };
-
+ }
},
});
-
- //获取默认信息
- url3 += r.stoid + "/" +user.user_id;
- app.request.get(url3, {
- success: function(res) {
- if(res.data.code == 0) {
- console.log('url3', res.data.data.birthday);
- let data = res.data.data;
-
- if(data.birthday){
- data.birthday= ut.formar_no_full(data.birthday);
- }
-
- if(user['sex'] && !data.sex){
- data.sex=user['sex'];
- }
- if(user['birthday'] && !data.birthday){
- data.birthday= ut.formar_no_full(user['birthday']);
- }
-
- if(!data.pickup_name){
- data.pickup_name="";
- }
- if(!data.pickup_id){
- data.pickup_id=0;
- }
- //-- 获取门店 --
- if(user['pickup_id'] && !data.pickup_id){
- getApp().promiseGet("/api/weshop/pickup/get/"+r.stoid+"/"+user['pickup_id']).then(res=>{
- if(res.data.code==0 && res.data.data){
- data.pickup_name=res.data.data.pickup_name;
- data.pickup_id=res.data.data.pickup_id;
-
- self.setData({
- isGender: data.sex,
- isLunar: data.islunar,
- datet: data.birthday,
- stoname: data.pickup_name,
- sto_sele_id: data.pickup_id,
- });
- }
- else{
- self.setData({
- isGender: data.sex,
- isLunar: data.islunar,
- datet: data.birthday,
- stoname: data.pickup_name,
- sto_sele_id: data.pickup_id,
- });
- }
- if(!self.data.sto_sele_id){
- self.get_store_set();
- }
- })
- }else{
- self.setData({
- isGender: data.sex,
- isLunar: data.islunar,
- datet: data.birthday,
- stoname: data.pickup_name,
- sto_sele_id: data.pickup_id,
- });
- }
-
- if(!self.data.sto_sele_id){
- self.get_store_set();
- }
- };
- }
- });
-
- if(user){
- self.setData({user:user})
- }
+
+
+ //-- 获取线下会员的情况 --
+ var req_data={
+ stoid:r.stoid,
+ mobile:getApp().globalData.zc_dd.mobile
+ };
+ if(getApp().globalData.zc_dd.first_leade)
+ req_data.first_leader=getApp().globalData.zc_dd.first_leader
+
+ wx.showLoading();
+ getApp().request.promiseGet(url3, {data:req_data}).then(res=>{
+ if(res.data.code==0){
+ var back_data=res.data.data; back_data=JSON.parse(back_data);
+ var set_data={is_fx:0};
+ //-- 如果有包含会员的线下的信息 --
+ if(back_data && back_data.erpviplist){
+ //-- data.data就是门店的数据 --
+ if(back_data.data){
+ back_data.erpviplist.pickup_id=back_data.data.pickup_id;
+ if(!back_data.erpviplist.pick) set_data.is_fx=1;
+ set_data.stoname=back_data.data.pickup_name;
+ set_data.sto_sele_id=back_data.data.pickup_id;
+ }
+
+ //-- 推荐人姓名 --
+ if(back_data.erpviplist.fromuser) {
+ set_data.tjrname=back_data.erpviplist.fromuser;
+ back_data.erpviplist.fromuser_id=back_data.erpviplist.fromuser;
+ }
+ //性别
+ if(back_data.erpviplist.sex) set_data.isGender=back_data.erpviplist.sex;
+ //名称
+ if(back_data.erpviplist.vipname) set_data.name=back_data.erpviplist.vipname;
+ //身份证
+ if(back_data.erpviplist.idcard) set_data.id=back_data.erpviplist.idcard;
+ //地址
+ if(back_data.erpviplist.address) set_data.address=back_data.erpviplist.address;
+ //生日
+ if(back_data.erpviplist.birthday) {
+ set_data.datet=back_data.erpviplist.birthday;
+ set_data.isLunar=back_data.erpviplist.islunar;
+ }
+ set_data.user=back_data.erpviplist;
+ }
+ self.setData(set_data);
+ if(!self.data.sto_sele_id){
+ self.get_store_set();
+ }
+ }
+ wx.hideLoading();
+ })
var is_back=t.is_back;
if(is_back) this.data.is_back=1;
@@ -694,9 +685,7 @@ Page({
getApp().check_can_share();
- var e = this;
if (this.data.is_zy) return false;
- this.wait_for_store_config();
//如果有传值进行跳转的话
var choice_guide=null;
@@ -705,64 +694,108 @@ Page({
getApp().globalData.choice_guide=null;
}
- var req = t;
-
- a.getUserInfo(function(a) {
- var txt = util.formatTime(a.birthday, 'yyyy-M-d'),
- arr = txt.split(' ');
- a.birthday = arr[0];
- var txt2 = util.formatTime(a.reg_time, 'yyyy-M-d'),
- arr2 = txt.split(' ');
- a.reg_time = arr2[0];
- if (a.pickup_id != null) {
- req.get("/api/weshop/pickup/get/" + r.stoid + "/" + a.pickup_id, {
- success: function(da) {
- if(da.data.data){
- //设置门店
- e.setData({
- // stoname: da.data.data.pickup_name
- });
- }
-
- }
- })
- }
-
- }, !0);
},
check_is_send_quan:function(cid,uid){
var self=this;
let url2 = '/api/weshop/prom/coupon/get/';
- //看一下会员有没有领过注册的券
- getApp().promiseGet("/api/weshop/couponList/page",{
- data:{store_id:r.stoid,uid:uid,cid:cid}
- }).then(res=>{
- var is_ling=0;
- if(res.data.code==0 && res.data.data && res.data.data.total>0){
- is_ling=1;
- }
-
- //没有领过券,就显示
- if(!is_ling){
- //获取优惠券
- url2 += cid;
- app.request.get(url2, {
- success: function(r) {
- if(r.data.code == 0) {
- console.log('000res==>', r.data.data.name);
- self.setData({
- couponInfo: r.data.data.name,
- });
- };
- },
- });
- }
-
- })
+ //-- 如果没有会员信息的时候 --
+ if(!uid){
+ //获取优惠券
+ url2 += cid;
+ app.request.get(url2, {
+ success: function(r) {
+ if(r.data.code == 0) {
+ self.setData({
+ couponInfo: r.data.data.name,
+ });
+ };
+ },
+ });
+
+ }else{
+ //看一下会员有没有领过注册的券
+ getApp().promiseGet("/api/weshop/couponList/page",{
+ data:{store_id:r.stoid,uid:uid,cid:cid}
+ }).then(res=>{
+ var is_ling=0;
+ if(res.data.code==0 && res.data.data && res.data.data.total>0){
+ is_ling=1;
+ }
+
+ //没有领过券,就显示
+ if(!is_ling){
+ //获取优惠券
+ url2 += cid;
+ app.request.get(url2, {
+ success: function(r) {
+ if(r.data.code == 0) {
+ console.log('000res==>', r.data.data.name);
+ self.setData({
+ couponInfo: r.data.data.name,
+ });
+ };
+ },
+ });
+ }
+
+ })
+ }
+
+
+
},
+ //-- 有没有送过礼包 --
+ check_is_send_libao:function(lbid,uid){
+ var self=this;
+ let url2 = '/api/weshop/marketing/giftbag/get';
+ if(!uid){
+ //获取礼包
+ app.request.get(url2, {
+ data:{storeId:r.stoid,giftBagId:lbid},
+ success: function(r) {
+ if(r.data.code == 0) {
+ console.log('000res==>', r.data.data.name);
+ self.setData({
+ libao: r.data.data.lbTitle,
+ });
+ }
+ }
+ });
+
+ }else{
+ //看一下会员有没有领过注册的券
+ getApp().promiseGet("/api/weshop/marketing/gift/getgiveone",{
+ data:{store_id:r.stoid,user_id:uid,lbid:lbid,act_type:7}
+ }).then(res=>{
+ var is_ling=0;
+ if(res.data.code==0 && res.data.data && res.data.data.total>0){
+ is_ling=1;
+ }
+ //没有领过礼包,就显示
+ if(!is_ling){
+ //获取礼包
+ app.request.get(url2, {
+ data:{storeId:r.stoid,giftBagId:lbid},
+ success: function(r) {
+ if(r.data.code == 0) {
+ self.setData({
+ libao: r.data.data.lbTitle,
+ });
+ }
+ }
+ });
+ }
+
+ })
+ }
+
+ },
+
+
+
//------卡片的显示和关闭--------
show_tc: function() {
@@ -782,8 +815,6 @@ Page({
tc_hide: true,
});
},
-
-
//地址
address: function(e) {
@@ -854,39 +885,41 @@ Page({
datas.staffId=th.data.user.staffId;
}
- getApp().request.put("/api/weshop/users/updateUserInfo", {
- data: datas,
- success: function(res) {
- if (res.data.code == 0) {
- getApp().my_warnning("修改成功", 1, th);
-
- setTimeout(function () {
- if(th.data.is_back){
- wx.navigateBack({ delta: 1}) //返回上一页
- }else{
- getApp().goto("/pages/user/index/index");
- }
- },1000)
-
- } else {
- getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
- }
- }
- })
+ var post_data={ ...getApp().globalData.zc_dd, ...datas }
+ this.zu_ce(post_data);
},
+
+
+ zu_ce:function (dd) {
+ var th=this;
+ app.request.get("/api/weshop/users/thirdLogin", {
+ data: dd,
+ success: function (e) {
+ if (e.data.code == 0) {
+ app.globalData.user_id = e.data.data.user_id;
+ } else {
+ return app.showWarning("授权登入失败!"+e.data.msg);
+ }
+ getApp().globalData.login_back=1;
+ wx.setStorageSync("userinfo",e.data.data);
+ wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = s.getFullUrl(a.globalData.userInfo.head_pic);
+ wx.navigateBack({ delta: 1})
+
+ },
+ failStatus: function (t) {
+ return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
+ },
+ fail: function (t) {
+ return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
+ }
+ });
+ },
+
//选择地址
goto_address: function() {
// this.setData({ is_zy: 1 });
},
- //更换手机
- // go_phone: function(e) {
- // var url = e.currentTarget.dataset.url;
- // this.setData({
- // is_zy: 1
- // });
- // getApp().goto(url);
- // },
-
+
//--点击分享事件---
onShareAppMessage: function(t) {
getApp().globalData.no_clear=1
@@ -983,9 +1016,8 @@ Page({
this.setData({
datet: e.detail.value,
});
- };
-
- // console.log(this.data.datet, this.data.isCalendar);
+ }
+
},
// 生日判断
@@ -1074,7 +1106,6 @@ Page({
var data = {
store_id: r.stoid,
- user_id: app.globalData.user_id,
};
//-- 需要推荐人 --
@@ -1083,11 +1114,7 @@ Page({
if (tjrname == "" || tjrname == null) {
app.my_warnning("请输入推荐人", 0, this);
return false;
- };
- if(tjrname==user.mobile || tjrname==user.erpvipno ){
- app.my_warnning("推荐人不能是自己", 0, this);
- return false;
- }
+ };
data.tjrname=tjrname;
}
@@ -1119,7 +1146,7 @@ Page({
};
data.birthday=birthday;
- data.islunar=self.data.isLunar;
+ data.islunar=self.data.isLunar?1:0;
}
//-- 需要身份证 --
@@ -1155,97 +1182,19 @@ Page({
app.my_warnning("请您先阅读和勾选指定的内容", 0, this);
return false;
};
-
-
- console.log('data==>', data);
-
- app.request.put("/api/weshop/users/updateInfo", {
- data: data,
- success: function(res) {
- if (res.data.code == 0) {
- getApp().my_warnning("保存成功", 1, self);
- if(th.data.is_back){
- wx.navigateBack({ delta: 1}) //返回上一页
- }else{
- getApp().goto("/pages/user/index/index");
- }
- } else {
- getApp().my_warnning(res.data.msg, 0, self);
- };
- }
- })
+
+
+
+
+ var post_data={ ...getApp().globalData.zc_dd, ...data };
+
+ delete post_data.sessionKey;
+ delete post_data.encryptedData;
+ delete post_data.iv;
+
+ this.zu_ce(post_data);
- // } else {
- // app.my_warnning("请您先阅读和勾选指定的内容", 0, self);
- // };
- // var isstcsp = th.data.isstcsp; //是否启用消费密码
- // var phone = th.data.phone; //手机号码
- // if (phone == "" || phone == null) {
- // getApp().my_warnning("手机不能为空", 0, th);
- // return false;
- // }
- // var consumption = th.data.consumption; //消费密码
- // var isstcsp = th.data.isstcsp;
- // if (isstcsp == 1) {
-
- // if (consumption == null || consumption == "" || consumption == undefined) {
- // getApp().my_warnning("消费密码不能为空", 0, th);
- // return false;
- // }
- // if (consumption.length < 6) {
- // getApp().my_warnning("消费密码不能小于6位", 0, th);
- // return false;
- // }
- // }
- // var sex = th.data.isGender; //性别
-
- // if (sex != "1" && sex != "2") {
- // getApp().my_warnning("请选择性别", 0, th);
- // return false;
- // }
- // var vipname = th.data.user.vipname; //用户姓名
- // if (user_name == "" || user_name == null) {
- // getApp().my_warnning("请输入名字", 0, th);
- // return false;
- // }
- // var identity_card = th.data.identity_card; //身份证
-
- // if (identity_card!=null && identity_card!=undefined && identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) {
- // getApp().my_warnning("身份证号码错误", 0, th);
- // return false;
- // }
- // var address = th.data.address; //地址
- // var sto_sele_id = self.data.sto_sele_id;
- // var data = {
- // store_id: r.stoid,
- // user_id: app.globalData.user_id,
- // tjrname: self.data.referee, //推荐人
- // vipname: self.data.name, //名称
- // sex: self.data.isGender, //性别
- // birthday: self.data.datet,
- // islunar: self.data.isLunar,
- // idcard: self.data.id,
- // address: self.data.address,
- // pickup_id: sto_sele_id ,//自提门店 所属门店
- // };
-
- // console.log('data==>', data);
- //往上提交美导的ID
- // if(th.data.fir_guide_id!=th.data.user.staffId){
- // datas.staffId=th.data.user.staffId;
- // }
-
- // app.request.put("/api/weshop/users/updateInfo", {
- // data: data,
- // success: function(res) {
- // if (res.data.code == 0) {
- // getApp().my_warnning("保存成功", 1, self);
- // getApp().goto("/pages/user/index/index");
- // } else {
- // getApp().my_warnning("系统繁忙,请稍后再试", 0, self);
- // };
- // }
- // })
+
},
diff --git a/packageA/pages/profile/profile.wxml b/packageA/pages/profile/profile.wxml
index 45b7d0a..e60c1cd 100644
--- a/packageA/pages/profile/profile.wxml
+++ b/packageA/pages/profile/profile.wxml
@@ -7,13 +7,13 @@
-
+
- {{user.nickname}}
+ {{nickname}}
@@ -28,7 +28,9 @@
推荐人:
-
+
+
+
+{{reg_info.introducer}}积分
@@ -41,7 +43,7 @@
姓名:
- +{{reg_info.name}}积分
+ +{{reg_info.name}}积分
+{{reg_info.name}}成长值
@@ -68,8 +70,8 @@
女
-
-
+
+
+{{reg_info.sex}}积分
+{{reg_info.sex}}成长值
@@ -127,7 +129,7 @@
∟
-
+
+{{reg_info.pick}}积分
+{{reg_info.pick}}成长值
@@ -174,6 +176,7 @@
保存
保存成功即可获得一张{{couponInfo}}
+ 保存成功即可获得一个{{libao}}
diff --git a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
index 82fb3dc..dcd404f 100644
--- a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
+++ b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -2238,6 +2238,11 @@ Page({
goods.skinface_id=getApp().globalData.skinface_id;
}
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
//-- 把导购的信息填入--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
index 8febce7..958c92d 100644
--- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
+++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
@@ -783,6 +783,12 @@ Page({
if(getApp().globalData.skinface_id){
goods.skinface_id=getApp().globalData.skinface_id;
}
+
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
//--导购分享过来的id--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/packageC/pages/payForAnother/payForAnother.js b/packageC/pages/payForAnother/payForAnother.js
index 8f220da..f7deb93 100644
--- a/packageC/pages/payForAnother/payForAnother.js
+++ b/packageC/pages/payForAnother/payForAnother.js
@@ -2119,6 +2119,11 @@ Page({
'prom_id': th.data.bn_goods.prom_id, //促销活动id
};
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
//-- 把导购的信息填入--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js
index 82f4374..d513611 100644
--- a/packageC/pages/presell/cart/cart2.js
+++ b/packageC/pages/presell/cart/cart2.js
@@ -702,6 +702,7 @@ Page({
if (item['exp_sum_type'] == 2) {
cut_good_weight += item['weight'] * item['buynum'];
goods_weight += item['weight'] * item['buynum'];
+
}
if (back_data.weight_free > 0) {
out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
@@ -1054,6 +1055,11 @@ Page({
goods.skinface_id=getApp().globalData.skinface_id;
}
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
//-- 把导购的信息填入--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/packageC/pages/presell/cart/cart2_pre.js b/packageC/pages/presell/cart/cart2_pre.js
index 4a882e4..8772484 100644
--- a/packageC/pages/presell/cart/cart2_pre.js
+++ b/packageC/pages/presell/cart/cart2_pre.js
@@ -542,6 +542,11 @@ Page({
goods.skinface_id=getApp().globalData.skinface_id;
}
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
//--导购分享过来的id--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js
index d095dfc..fcd9bc3 100644
--- a/pages/cart/cart/cart.js
+++ b/pages/cart/cart/cart.js
@@ -612,8 +612,8 @@ Page({
}
}
-
- else if(item.prom_type == 0) {
+ //判断不是代发的商品
+ else if(item.prom_type == 0 && !item.whsle_id) {
//如果有优惠活动,要更新活动
await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => {
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index dd7dd02..28f8aba 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -451,8 +451,8 @@ Page({
//如果有购买活动
item1.promgoodsbuynum = promgoodsbuynum;
- //要把优惠活动加入,prom_goods_map中,赠品不要运算
- if (item1.prom_type == 3 && item1.is_gift != 1) {
+ //要把优惠活动加入,prom_goods_map中,赠品不要运算,代发商品不算优惠
+ if (item1.prom_type == 3 && item1.is_gift != 1 && !item1.whsle_id) {
// th.check_is_youhui(item1.goods_id, item1.pick_id);
await th.add_prom_goods_map(item1);
}
@@ -1187,6 +1187,8 @@ Page({
var o_price = 0, q_conditin = 0;
//--------循环计算总价-----------
for (var j = 0; j < ord_goods.length; j++) {
+
+ if(ord_goods[j].whsle_id) continue;
o_price += ord_goods[j].goods_price * ord_goods[j].goods_num;
}
@@ -1232,6 +1234,7 @@ Page({
item_map.gift_weight = get_data.goodsinfo.weight;
item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
+ item_map.whsle_id = get_data.goodsinfo.whsle_id;
}
item_map.s_libao = get_data.libao;
@@ -1491,12 +1494,16 @@ Page({
//调用函数计算每件商品的单价
await th.calc_per(c_arr);
+
//调用函数计算每件组合购商品的单价,
await zh_calc.calc_zh_split_price(c_arr, th);
+
//调用函数计算每件阶梯促销商品的单价,
await ladder_calc.calc_split_price(c_arr, th);
//调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品
+
await th.get_cart_quan(c_arr);
+
//---循环购物车---
for (var i in c_arr) {
//因为搭配购买也是再这里计算,搭配购的is_b_now==1
@@ -1555,9 +1562,15 @@ Page({
})
}
+
+ var whsle_goods_price=0;
//--------循环计算总价-----------
for (var j = 0; j < item.length; j++) {
+ if(item.whsle_id>0){
+ whsle_goods_price+=item.goods_price*item.goods_num;
+ }
+
var is_no_zh = 0;
if (item[j].prom_type != 7 && item[j].prom_type != 10) is_no_zh = 1;
@@ -1729,6 +1742,8 @@ Page({
//--------循环计算总价-----------
for (var j = 0; j < item.length; j++) {
+ //如果是一件代发商品,不计算运费
+ if(item[j].whsle_id) continue;
//如果商品本身是包邮了
if(item[j].is_free_shipping == 1) continue;
//如果是优惠活动是包邮,就不用计算包邮的费用了
@@ -1812,6 +1827,10 @@ Page({
o_condition = o_price_no_zh - quan_price;
}
+ if(whsle_goods_price>0){
+ o_condition=o_condition-whsle_goods_price;
+ }
+
var order_m = 0;
//---判断是不是有订单优惠---
await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
@@ -2019,7 +2038,8 @@ Page({
quan_no = th.data.using_quan[bn_pick].coupon_no;
if (quan_no) {
- if (th.data.using_quan[bn_pick].isby != 1) {
+ //如果是一件代发就不要找商品
+ if (th.data.using_quan[bn_pick].isby != 1 && !good.whsle_id) {
//---获取优惠券优惠---
await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", {
data: {
@@ -2043,7 +2063,7 @@ Page({
}
//-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
- if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past != 1) {
+ if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_past != 1) {
//看是不是有调用过包邮券
if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) {
var condition = allpice - cut_price - quan_price;
@@ -2129,8 +2149,13 @@ Page({
var cut_good_weight = 0;
for (let i in gd_arr_list) {
let item = gd_arr_list[i];
-
+
+ if(good.is_free_shipping==1) continue;
+ //-- 代发商品不算运费 --
+ if(good.whsle_id) continue;
+
if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
+
if (item['exp_sum_type'] == 2) {
goods_weight += item['weight'] * item['buynum'];
cut_good_weight += item['weight'] * item['buynum'];
@@ -2211,6 +2236,10 @@ Page({
}
//--看一下有没有订单优惠--
var o_condition = parseFloat(order_m);
+ if(th.data.bn_goods.whsle_id>0){
+ o_condition=0;
+ }
+
if (o_condition > 0) {
th.check_is_order_prom(o_condition, function () {
var order_prom_amount = 0;
@@ -2522,6 +2551,7 @@ Page({
})
}
+
var goods = {
'goods_id': gg.goods_id,
'goods_name': gg.goods_name,
@@ -2535,6 +2565,11 @@ Page({
'prom_id': th.data.bn_goods.prom_id, //促销活动id
};
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
if (getApp().globalData.skinface_id) {
goods.skinface_id = getApp().globalData.skinface_id;
}
@@ -2564,7 +2599,7 @@ Page({
if (gg.is_pd_normal) goods.is_pd_normal = 1;
//如果不立即购买或者秒杀,如果是线下库存购买的时候
- if (goods.prom_type != 1 && goods.prom_type != 6 && th.data.sales_rules == 2) {
+ if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 && th.data.sales_rules == 2) {
var isok = 1;
await th.check_store_num(goods.goods_id, th.data.bn_pick, gg.goods_num, function (res) {
isok = res;
@@ -2681,7 +2716,7 @@ Page({
}
var order_prom_list_cart = th.data.order_prom_list_cart;;
- console.log('xxxxxxxxxxxxxxxx', order_prom_list_cart)
+
//--组装推送数据--
for (var i = 0; i < order_prom_list_cart.length; i++) {
var t_item = order_prom_list_cart[i];
@@ -2806,6 +2841,11 @@ Page({
await th.split_set_goods_quanprice(you_item, t_item);
}
}
+
+ //代发商品的集合
+ var df_goods=[];
+ var df_price=0;
+ var df_room_ids="";
//-------------让商品添加到商品列表--------------------
for (var k = 0; k < t_item.goods.length; k++) {
var g_item = t_item.goods[k];
@@ -2900,26 +2940,77 @@ Page({
}
})
}
- //如果房间号不为空的时候
- if (g_item.room_id) {
- goods.room_id = g_item.room_id;
- room_ids += g_item.room_id + ",";
- }
//如果有阶梯促销
if (g_item.ladder_list_id) {
goods.ladder_list_id = g_item.ladder_list_id;
}
- item.order_goods.push(goods);
+ //-- 如果有代发商品,就要开始拆单 --
+ if(g_item.whsle_id){
+ df_price+= parseFloat(g_item.goods_num*g_item.goods_price);
+ goods.is_whsle_goods=1;
+ df_goods.push(goods);
+ df_room_ids+= g_item.room_id + ",";
+ }else{
+ item.order_goods.push(goods);
+ //如果房间号不为空的时候
+ if (g_item.room_id) {
+ goods.room_id = g_item.room_id;
+ room_ids += g_item.room_id + ",";
+ }
+ }
}
//如果房间号不为空的时候
if (room_ids != "") item.room_ids = ut.sub_last(room_ids);
+
+
+ //处理代发商品的拆分
+ if(df_goods.length>0){
+ var df_item=JSON.parse(JSON.stringify(item));
+ item.goods_price= parseFloat(item.goods_price-df_price).toFixed(2);
+ item.total_amount= parseFloat(item.total_amount-df_price).toFixed(2);
+
+ df_item.is_whsle=1;
+ df_item.is_discount_amount=0;
+ df_item.goods_price=df_price;
+ df_item.total_amount=df_price;
+ df_item.shipping_price=0; //没有运费
+ if(df_item.order_prom_list) df_item.order_prom_list={};
+
+ //看一下是用余额比较多,还是用钱比较多
+ if(item.order_amount>item.user_money){
+ if(item.order_amount>df_price){
+ item.order_amount=parseFloat(item.order_amount-df_price).toFixed(2);
+ df_item.order_amount=df_price.toFixed(2);
+ }else {
+ var more_p=parseFloat(df_price-item.order_amount).toFixed(2);
+ item.order_amount=0;
+ item.user_money=parseFloat(item.user_money-more_p).toFixed(2);
+ df_item.user_money=more_p;
+ }
+ }else{
+ if(item.user_money>df_price){
+ item.user_money=parseFloat(item.user_money-df_price).toFixed(2);
+ df_item.user_money=df_price.toFixed(2);
+ }else {
+ var more_p=parseFloat(df_price-item.user_money).toFixed(2);
+ item.user_money=0;
+ item.order_amount=parseFloat(item.user_money-more_p).toFixed(2);
+ df_item.order_amount=more_p;
+
+ }
+ }
+
+ if (df_room_ids != "") df_item.room_ids = ut.sub_last(df_room_ids);
+ df_item.order_goods=df_goods;
+ pdata.push(df_item);
+ }
+
pdata.push(item);
}
-
}
if (pdata.length == 0) return;
@@ -2951,7 +3042,7 @@ Page({
}
var order_amount = 0;
pdata.forEach(function (em, ind) {
- order_amount += em.order_amount;
+ order_amount += parseFloat(em.order_amount);
})
//要进行判断,如果是用微信支付,就要跳转到支付界面
if (order_amount > 0) {
@@ -3757,7 +3848,7 @@ Page({
for (var i in goodlist) {
var gd = goodlist[i];
//--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券--
- if (gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act.is_xz_yh) || gd.is_xz_yh == 1) {
+ 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) {
continue;
}
@@ -3865,8 +3956,8 @@ Page({
arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0);
arr[ind].check_quan_ware_list = check_quan_ware_list;
arr[ind].check_quan_price_list = check_quan_price_list;
- //是否关闭使用优惠券
- if (th.data.is_close_quan != 1) {
+ //-- 是否关闭使用优惠券,循环有找到商品 --
+ if (th.data.is_close_quan != 1 && check_quan_ware_list) {
//--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
var url = "/api/weshop/couponList/getUseCouponList";
await app.request.promiseGet(url, {
@@ -3904,6 +3995,9 @@ Page({
get_buy_now_quan: function () {
var quanlist = null, th = this, frozenQuan = null;
var good = this.data.bn_goods;
+
+ //一件代发商品不使用优惠券
+ if(good.whsle_id) return false;
if (good.prom_price) {
th.data.ckeck_quan_price = good.prom_price; //如果有优惠价,就用优惠价
} else if (good.is_offline) {
@@ -4025,6 +4119,7 @@ Page({
arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
arr.gift_limit_num = get_data.limit_num;
arr.gift_storecount = get_data.gift_storecount;
+ arr.whsle_id=get_data.goodsinfo.whsle_id;
}
arr.s_libao = get_data.libao;
arr.s_lb_num = get_data.lb_num;
@@ -4659,6 +4754,11 @@ Page({
goods_color: gf_item.goodsinfo.goods_color,
};
+
+ //-- 如果是代发商品的时候 --
+ if(gf_item.goodsinfo.whsle_id){
+ newd.whsle_id=gf_item.goodsinfo.whsle_id;
+ }
await getApp().request.promisePost("/api/weshop/cart/save", {
data: newd
}).then(res => {
@@ -4714,6 +4814,11 @@ Page({
goods_spec: gf_item.goodsinfo.goods_spec,
goods_color: gf_item.goodsinfo.goods_color,
};
+ //-- 如果是代发商品的时候 --
+ if(gf_item.goodsinfo.whsle_id){
+ newd.whsle_id=gf_item.goodsinfo.whsle_id;
+ }
+
new_pk_list_goods.push(newd);
}
var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
diff --git a/pages/cart/cart2_inte/cart2_inte.js b/pages/cart/cart2_inte/cart2_inte.js
index c62df2c..f9dcd6f 100644
--- a/pages/cart/cart2_inte/cart2_inte.js
+++ b/pages/cart/cart2_inte/cart2_inte.js
@@ -666,6 +666,12 @@ Page({
goods.skinface_id=getApp().globalData.skinface_id;
}
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
+
//-- 把导购的信息填入--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js
index 99b57cb..96ae1d4 100644
--- a/pages/cart/cart2_pt/cart2_pt.js
+++ b/pages/cart/cart2_pt/cart2_pt.js
@@ -618,6 +618,12 @@ Page({
if(getApp().globalData.skinface_id){
goods.skinface_id=getApp().globalData.skinface_id;
}
+
+ if(th.data.bn_goods.whsle_id){
+ item.is_whsle=1;
+ goods.is_whsle_goods=1;
+ }
+
//--导购分享过来的id--
if (gg.guide_id) {
goods.guide_id = gg.guide_id;
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 753ba52..61e9932 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -352,6 +352,10 @@ Page({
getApp().globalData.guide_id = res.data.data.id;
}
})
+
+ if(!getApp().globalData.user_id){
+ ut.new_user_go(os.stoid,first_leader);
+ }
}
//-- 如果有房间号 --
@@ -886,7 +890,8 @@ Page({
}
- if (ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 2) {
+ //一件代发商品不去计算优惠
+ if (!ee.data.whsle_id && ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 2) {
ee.check_is_youhui(ee.data.gid);
}
@@ -1390,6 +1395,13 @@ Page({
prom_type: th.data.sele_g.prom_type,
};
+
+ //-- 代发商品不参加优惠 --
+ if(th.data.sele_g.whsle_id && newd.prom_type==3){
+ newd.prom_type=0;
+ newd.prom_id=0;
+ }
+
//---是不是从收藏夹出来的---
if (th.data.c_guide_id) {
newd['guide_id'] = th.data.c_guide_id;
@@ -2847,7 +2859,7 @@ Page({
});
- that.check_is_youhui(gid, that.data.is_normal);
+ if(!item.whsle_id) that.check_is_youhui(gid, that.data.is_normal);
//默认门店要拿下门店库存
if (that.data.sales_rules == 2 && that.data.def_pick_store) {
@@ -3619,7 +3631,7 @@ Page({
this.get_sku(o.stoid, this.data.data, gid);
this.check_has_flash();
this.data.is_normal = 1;
- this.check_is_youhui(gid, 1);
+ if(!this.data.data.whsle_id) this.check_is_youhui(gid, 1);
return false;
}
@@ -4262,7 +4274,7 @@ Page({
});
});
}
- th.check_is_youhui(th.data.gid, 1);
+ if(!th.data.sele_g.whsle_id) th.check_is_youhui(th.data.gid, 1);
} else {
if (th.data.is_normal) {
@@ -6637,7 +6649,7 @@ Page({
});
});
}
- this.check_is_youhui(th.data.gid, 1);
+ if(!th.data.sele_g.whsle_id) this.check_is_youhui(th.data.gid, 1);
},
closeSpecModal_inte: function () {
@@ -6845,7 +6857,8 @@ Page({
});
this.get_sku(os.stoid, this.data.data, gid);
this.get_sto();
- this.check_is_youhui(gid, 1);
+ if(!this.data.data.whsle_id)
+ this.check_is_youhui(gid, 1);
this.data.is_normal = 1;
},
@@ -6944,7 +6957,7 @@ Page({
});
});
}
- this.check_is_youhui(th.data.gid, 1);
+ if(!this.data.data.whsle_id) this.check_is_youhui(th.data.gid, 1);
},
closeSpecModal_flash_normal: function () {
diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js
index 4c10c0b..0135340 100644
--- a/pages/goods/goodsList/goodsList.js
+++ b/pages/goods/goodsList/goodsList.js
@@ -41,6 +41,9 @@ Page({
getApp().globalData.guide_id=res.data.data.id;
}
})
+ if(!getApp().globalData.user_id){
+ ut.new_user_go(oo.stoid,first_leader);
+ }
}
var th=this;
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index dac0d27..eb378ac 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -173,6 +173,11 @@ Page({
getApp().globalData.guide_id = res.data.data.id;
}
})
+
+ if(!getApp().globalData.user_id){
+ ut.new_user_go(os.stoid,first_leader);
+ }
+
}
// 判断是否有红包活动
diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml
index d57483c..9220eef 100644
--- a/pages/index/index/index.wxml
+++ b/pages/index/index/index.wxml
@@ -18,7 +18,6 @@
-
@@ -45,17 +44,11 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -595,3 +588,5 @@
+
+
diff --git a/pages/togoin/togoin.js b/pages/togoin/togoin.js
index bc99d99..7fa1335 100644
--- a/pages/togoin/togoin.js
+++ b/pages/togoin/togoin.js
@@ -187,15 +187,7 @@ Page({
};
//--如果有邀请人的时候--
if(th.data.first_leader){
- //判断一下分享人是不是分享商
- await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+th.data.first_leader,{}).then(res=>{
- if(res.data.code==0){
- var user= res.data.data;
- if(user.is_distribut==1){
- dd.first_leader=th.data.first_leader;
- }
- }
- })
+ dd.first_leader=th.data.first_leader;
}
//-- 导购会员ID --
if(getApp().globalData.guide_id){
@@ -209,50 +201,70 @@ Page({
console.log("-----会员注册的信息-------");
console.log(dd);
- app.request.get("/api/weshop/users/thirdLogin", {
- data: dd,
- success: function (e) {
-
- if (e.data.code == 0) {
- app.globalData.user_id = e.data.data.user_id;
- } else {
- return app.showWarning("授权登入失败!"+e.data.msg);
- }
-
-
- var need_go=0;
- var t_user=e.data.data;
-
-
- getApp().globalData.login_back=1;
- wx.setStorageSync("userinfo",e.data.data);
- wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);
-
- //如果有需要完善的信息没有完善,就需要跳转
- if(!t_user['vipname'] && th.data.name_need_go){ need_go=1;}
- if(!t_user['birthday'] && th.data.birth_need_go){ need_go=1;}
- if(!t_user['idcard'] && th.data.idcard_need_go){ need_go=1;}
- if(!t_user['address'] && th.data.address_need_go){ need_go=1;}
- if(!t_user['pickup_id'] && th.data.pick_need_go){ need_go=1;}
- if(!t_user['sex'] && th.data.sex_need_go){ need_go=1;}
- if(!t_user['fromuser_id'] && th.data.introducer_need_go){ need_go=1;}
-
- if(need_go){
- getApp().goto("/packageA/pages/profile/profile");
- }else{
- wx.navigateBack({ delta: 1})
- }
- },
- failStatus: function (t) {
- return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
- },
- fail: function (t) {
- return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
+
+ var need_go=0;
+ //如果有需要完善的信息没有完善,就需要跳转
+ if(th.data.name_need_go){ need_go=1;}
+ if(th.data.birth_need_go){ need_go=1;}
+ if(th.data.idcard_need_go){ need_go=1;}
+ if(th.data.address_need_go){ need_go=1;}
+ if(th.data.pick_need_go){ need_go=1;}
+ if(th.data.sex_need_go){ need_go=1;}
+ if(th.data.introducer_need_go){ need_go=1;}
+
+ if(need_go){
+
+ var req_data={
+ sessionKey: sessionKey,
+ encryptedData: e.encryptedData,
+ iv: e.iv,
+ store_id: getApp().globalData.setting.stoid,
+ }
+ //-- 获取一下手机 --
+ getApp().request.promiseGet("/api/weshop/users/getmobile", {data:req_data}).then(res=>{
+ if(res.data.code==0){
+ dd.mobile=res.data.data;
+ getApp().globalData.zc_dd=dd;
+ wx.redirectTo({
+ url:"/packageA/pages/profile/profile?is_back=1"
+ })
+ }
+ })
+
+
+ }else{
+ this.zu_ce(dd); //调用注册的函数
}
- });
+
},
+ zu_ce:function (dd) {
+ var th=this;
+ app.request.get("/api/weshop/users/thirdLogin", {
+ data: dd,
+ success: function (e) {
+ if (e.data.code == 0) {
+ app.globalData.user_id = e.data.data.user_id;
+ } else {
+ return app.showWarning("授权登入失败!"+e.data.msg);
+ }
+ getApp().globalData.login_back=1;
+ wx.setStorageSync("userinfo",e.data.data);
+ wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(app.globalData.userInfo.head_pic);
+ wx.navigateBack({ delta: 1})
+
+ },
+ failStatus: function (t) {
+ return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
+ },
+ fail: function (t) {
+ return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
+ }
+ });
+ },
+
+
bind_bnerr:function(e){
var _errImg = e.target.dataset.errorimg;
var _errObj = {};
diff --git a/pages/user/index/index.js b/pages/user/index/index.js
index 167e168..a5a80e3 100644
--- a/pages/user/index/index.js
+++ b/pages/user/index/index.js
@@ -75,7 +75,25 @@ Page({
}
}
})
- app.getUserFir();
+
+ var first_leader = options.first_leader;
+ if(first_leader){
+ //-- user_id代过来免登录 --
+ getApp().globalData.first_leader = first_leader;
+ //调用接口判断是不是会员
+ getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
+ if (res.data.code == 0) {
+ getApp().globalData.guide_id = res.data.data.id;
+ }
+ })
+
+ if(!getApp().globalData.user_id){
+ ut.new_user_go(os.stoid,first_leader);
+ }
+
+ }else{
+ app.getUserFir();
+ }
this.init_user_tool()
},
@@ -484,7 +502,26 @@ Page({
/**
* 用户点击右上角分享
*/
- onShareAppMessage: function () { getApp().globalData.no_clear = 1; },
+ onShareAppMessage: function () {
+ getApp().globalData.no_clear = 1;
+ var url = "/pages/user/index/index";
+
+ if (userInfo) {
+ url += "?first_leader=" + getApp().globalData.user_id;
+ }
+ var title = "会员中心"
+ //分享
+ if (getApp().globalData.config && getApp().globalData.config.store_name) {
+ title = getApp().globalData.config.store_name;
+ } else if (getApp().globalData.setting.appName) {
+ title = getApp().globalData.setting.appName;
+ }
+
+ var ob = {
+ title: title,path: url,
+ };
+ return ob;
+ },
//------卡片的显示和关闭--------
show_tc: function () {
diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js
index 1c1ac5f..9d71b60 100644
--- a/pages/user/order_detail/order_detail.js
+++ b/pages/user/order_detail/order_detail.js
@@ -1197,7 +1197,7 @@ Page({
}
//如果有优惠促销的时候,要看下商品的优惠活动有没有过期
- if(g_item.prom_type==3 || good.prom_type==3){
+ if((g_item.prom_type==3 || good.prom_type==3) && good.whsle_id<=0){
var is_g_prom=0;
//因为有全场优惠活动,商品参加的活动还未开始
var url="/api/weshop/activitylist/getGoodActInfo";
diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml
index 9a97f62..4fd3535 100644
--- a/pages/user/order_detail/order_detail.wxml
+++ b/pages/user/order_detail/order_detail.wxml
@@ -36,7 +36,7 @@
×{{item.goods_num}}
-
+
申请退款
-
+
申请退款
退款中
重新退款
diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js
index 2606abf..1034f50 100644
--- a/pages/user/userinfo/userinfo.js
+++ b/pages/user/userinfo/userinfo.js
@@ -88,12 +88,17 @@ Page({
console.log('ee',ee);
var sms_conf = ee.switch_list;
sms_conf = JSON.parse(sms_conf);
- th.setData({
- rank_switch:sms_conf.rank_switch,
- is_lable_set: sms_conf.user_label_set, //是不是会员标签设置
- guide_title:sms_conf.guide_consultant, //系统参数 导购标题
- guide_change_time:sms_conf.guide_change_time, //每月能修改几次
- })
+ let reg_type = ee.reg_type;
+ let reg_info = ee.reg_info;
+ var con_f={
+ rank_switch:sms_conf.rank_switch,
+ is_lable_set: sms_conf.user_label_set, //是不是会员标签设置
+ guide_title:sms_conf.guide_consultant, //系统参数 导购标题
+ guide_change_time:sms_conf.guide_change_time, //每月能修改几次
+ }
+ if(reg_type) con_f.reg_info= JSON.parse(reg_info);
+ th.setData(con_f)
+
if (sms_conf.usercode_vailtime!=null && parseInt(sms_conf.usercode_vailtime)>0)
{
th.setData({ getusercode_vailtime: sms_conf.usercode_vailtime });
@@ -101,7 +106,7 @@ Page({
if (sms_conf.user_label_set) {
th.query_checklabels();
}
- })
+ },1)
},
//查找会员选择的兴趣标签
query_checklabels: function() {
@@ -816,15 +821,7 @@ Page({
}
})
}
- // var phone = "";
- // phone+=a.mobile.substr(0, 3)+"****";
- // phone += a.mobile.substr(7, 12);
-
-
- // e.setData({
- // isGender:e.data.user.sex
- // })
}, !0);
},
diff --git a/pages/user/userinfo/userinfo.wxml b/pages/user/userinfo/userinfo.wxml
index 2e82d7b..0d4998b 100644
--- a/pages/user/userinfo/userinfo.wxml
+++ b/pages/user/userinfo/userinfo.wxml
@@ -113,6 +113,12 @@
女
+
+
+ +{{reg_info.sex}}积分
+ +{{reg_info.sex}}成长值
+
+
@@ -140,7 +146,7 @@
农历
-
+
@@ -150,7 +156,12 @@
{{datet==""? user.birthday==""?"":filters.replace_time2(user.birthday):datet}}
-
+
+
+ +{{reg_info.birthday}}积分
+ +{{reg_info.birthday}}成长值
+
+
@@ -158,18 +169,25 @@
姓名
-
+
+
+
+ +{{reg_info.name}}积分
+ +{{reg_info.name}}成长值
+
+
身份证
+
+
+
+ +{{reg_info.idcard}}积分
+ +{{reg_info.idcard}}成长值
+
+
-
-
-
-
更换手机
@@ -185,8 +203,14 @@
{{user.address}}
-->
-
-
+
+
+
+ +{{reg_info.address}}积分
+ +{{reg_info.address}}成长值
+
+
+
@@ -194,7 +218,14 @@
所属门店
{{stoname}}
- ∟
+
+ ∟
+
+ +{{reg_info.pick}}积分
+ +{{reg_info.pick}}成长值
+
+
+
@@ -239,7 +270,6 @@
收货地址
-
∟
diff --git a/pages/user/userinfo/userinfo.wxss b/pages/user/userinfo/userinfo.wxss
index efaf211..8d60f47 100644
--- a/pages/user/userinfo/userinfo.wxss
+++ b/pages/user/userinfo/userinfo.wxss
@@ -662,3 +662,7 @@ input {
height: 46rpx;
line-height: 46rpx;
}
+
+.lb_txt{
+ color: red; font-size: 24rpx;
+}
diff --git a/utils/util.js b/utils/util.js
index 6dc7f0a..39c9180 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -677,6 +677,28 @@ module.exports = {
url: r + o
});
},
+
+ //分享注册,跳转到授权
+ new_user_go:function (stoid,first_leader) {
+ getApp().request.get("/api/weshop/users/get/" + stoid + "/" + first_leader,{
+ success: function(e) {
+ if (e.data.code == 0 && e.data.data ) {
+ // 提示框
+ wx.showModal({
+ title: '注册邀请',
+ content: e.data.data.vipname+'邀请你成为会员?',
+ success: function (res) {
+ if (res.confirm) {
+ getApp().goto("/pages/togoin/togoin");
+ }
+ }
+ })
+ }
+ }
+ })
+ },
+
+
unserialize: unserialize,
_throttle:_throttle,
unserialize_o: unserialize_o,