diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index ea70ed7..22713ee 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -39,6 +39,7 @@ Page({ def_serviceman: null, //分享人的营业员 fir_leader: 0, //分享人的ID staffNo_arr: [], //多个营业员 + focus:false, is_select: false, //是否选择营业员过 }, swiperChange: function (e) { @@ -286,17 +287,16 @@ Page({ //选择营业员 select_serviceman(e) { let StaffNo = e.currentTarget.dataset.staffno; - // let {req_data,req} = this.data; - // if (StaffNo || StaffNo !== "") { - // req_data.staffNo = StaffNo; - // req.serviceman = StaffNo; - // }; - + let {req_data,req} = this.data; + if (StaffNo || StaffNo !== "") { + req_data.staffNo = StaffNo; + req.serviceman = StaffNo; + }; this.setData({ is_select: 1, staffNo_arr:[], - inp_serviceman:StaffNo, }) + this.check_serviceman(req_data,req) }, //--绑定邀请码的输入-- b_input: function (e) { @@ -317,6 +317,7 @@ Page({ }, //--立即购买卡-- buy_card: async function () { + console.log(11111); var th = this; var is_card = 0; //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- @@ -359,6 +360,9 @@ Page({ if (th.data.is_salesman) { if (!th.data.inp_serviceman) { getApp().my_warnning("请输入营业员", 0, th); + th.setData({ + focus:true + }) return false; } req.serviceman = th.data.inp_serviceman @@ -379,35 +383,37 @@ Page({ req_data, req, }) - getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { - data: req_data, - success: function (res) { - if (res.data.code == 0) { - if(res.data.data.length > 1 && !th.data.is_select){ - th.setData({ - staffNo_arr:res.data.data - }) - }else{ - t_pay.pay(req, th.success, function () { - getApp().my_warnning("支付失败", 0, th); - th.setData({ - is_select:0, - }) - }); - } - } else { - getApp().my_warnning(res.data.msg, 0, th); - th.setData({ - is_select:0, - }) - } - } - }) + th.check_serviceman(req_data,req) + // getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { + // data: req_data, + // success: function (res) { + // if (res.data.code == 0) { + // if(res.data.data.length > 1 && !th.data.is_select){ + // th.setData({ + // staffNo_arr:res.data.data + // }) + // }else{ + // t_pay.pay(req, th.success, function () { + // getApp().my_warnning("支付失败", 0, th); + // th.setData({ + // is_select:0, + // }) + // }); + // } + // } else { + // getApp().my_warnning(res.data.msg, 0, th); + // th.setData({ + // is_select:0, + // }) + // } + // } + // }) } else { t_pay.pay(req, th.success, function () { getApp().my_warnning("支付失败", 0, th); th.setData({ is_select:0, + focus:true, }) }); } @@ -424,30 +430,35 @@ Page({ staffNo_arr: [], }); }, - // check_serviceman(data,req) { - // let th = this; - // getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { - // data, - // success: function (res) { - // if (res.data.code == 0) { - // if (res.data.data.length > 1 && !th.data.is_select) { - // th.setData({ - // staffNo_arr: res.data.data - // }) - // }else{ - // t_pay.pay(req, th.success, function () { - // getApp().my_warnning("支付失败", 0, th); - // }); - // } - // } else { - // getApp().my_warnning(res.data.msg, 0, th); - // } - // th.setData({ - // is_select:0, - // }) - // } - // }) - // }, + check_serviceman(data,req) { + let th = this; + getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { + data, + success: function (res) { + if (res.data.code == 0) { + if (res.data.data.length > 1 && !th.data.is_select) { + th.setData({ + staffNo_arr: res.data.data + }) + }else{ + t_pay.pay(req, th.success, function () { + getApp().my_warnning("支付失败", 0, th); + th.setData({ + is_select:0, + focus:true, + }) + }); + } + } else { + getApp().my_warnning(res.data.msg, 0, th); + th.setData({ + is_select:0, + focus:true, + }) + } + } + }) + }, //返回会员中心 back_user: function () { setTimeout(function () { @@ -476,7 +487,6 @@ Page({ url: u_url }) } - }, diff --git a/pages/user/plus/plus.wxml b/pages/user/plus/plus.wxml index 6751083..b51ed39 100644 --- a/pages/user/plus/plus.wxml +++ b/pages/user/plus/plus.wxml @@ -134,14 +134,14 @@ - + - + @@ -169,13 +169,13 @@ X - 编号 - 姓名 + 编号 + 姓名 - {{item.StaffNo}} - {{item.StaffName}} + {{item.StaffNo}} + {{item.StaffName}} diff --git a/pages/user/plus/plus.wxss b/pages/user/plus/plus.wxss index 0e95971..e6912d3 100644 --- a/pages/user/plus/plus.wxss +++ b/pages/user/plus/plus.wxss @@ -48,11 +48,16 @@ page { display: flex; border-bottom: 1rpx solid #f7f7f7; justify-content: space-around; + } .weui-active{ opacity: 0.9; background: #f7f7f7; } +.w50 { + width: 50%; + text-align: center; +} .Opening_bk image { position: absolute; z-index: 2;