| | |
| | | TSite.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true}, |
| | | {title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '运营商名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'20%', |
| | | |
| | | }, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '运营商名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'20%',}, |
| | | {title: '管理员姓名', field: 'userName', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '管理员手机号', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | formatter: function (data,row) { |
| | | var btn = ""; |
| | | if(data==1) { |
| | | var str = '<button class="btn btn-outline btn-primary" onclick="TSite.bindOperator('+row.id+')" >去绑定</button>' |
| | | var str = '<button class="btn btn-outline btn-primary" onclick="TSite.Allocationratio('+row.id+')" >去绑定</button>' |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>'] |
| | | }else{ |
| | | var str = '<h3>已绑定</h3>' |
| | |
| | | return true; |
| | | } |
| | | }; |
| | | TSite.bindOperator = function (e) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: "认证", |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/operatorUser/proportion/' + e |
| | | }); |
| | | this.layerIndex = index; |
| | | /** |
| | | * 商户号认证 |
| | | */ |
| | | TSite.Allocationratio = function (e) { |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: "商户认证", |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/operatorUser' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | /** |
| | | * 商户号认证页面 |
| | | */ |
| | | TSite.auth = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: "商户认证", |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/operator/proportionAuth/' + TSite.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 商户号认证页面回显 |
| | | */ |
| | | TSite.auth1 = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: "商户认证详情", |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/operator/proportionAuth1/' + TSite.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 分账比例 |
| | | */ |
| | | TSite.proportion = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length >1 ){ |
| | | Feng.info("只能选择一个运营商商户设置分账比例!"); |
| | | }else { |
| | | if (this.check()) { |
| | | console.log("看看状态") |
| | | console.log(TSite.seItem.status) |
| | | if (TSite.seItem.status==1){ |
| | | Feng.error("当前运营商没有绑定商户号,请先绑定商户号!") |
| | | return; |
| | | } |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: "认证", |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/operator/proportion/' + TSite.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | } |
| | | }; |
| | | TSite.addSubmit = function(){ |
| | | var alipayType = $("input[name='alipayType']:checked").val(); |
| | | var wechatType = $("input[name='wechatType']:checked").val(); |
| | | var alipayNum = $("#alipayNum").val(); |
| | | var wechatNum = $("#wechatNum").val(); |
| | | var operatorId = $("#operatorId").val(); |
| | | if($("#alipayNum").val()=='' ){ |
| | | Feng.info("请输入支付宝商户号") |
| | | return; |
| | | } |
| | | if($("#wechatNum").val()=='' ){ |
| | | Feng.info("请输入微信商户号") |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/operator/auth", function(data){ |
| | | Feng.success("认证成功") |
| | | TSite.close(); |
| | | TSite.search(); |
| | | }); |
| | | ajax.set("alipayType",alipayType); |
| | | ajax.set("wechatType",wechatType); |
| | | ajax.set("alipayNum",alipayNum); |
| | | ajax.set("wechatNum",wechatNum); |
| | | ajax.set("operatorId",operatorId); |
| | | ajax.start(); |
| | | }; |
| | | TSite.addSubmit1 = function(){ |
| | | var alipayProportion = $("#alipayProportion").val(); |
| | | var wechatProportion = $("#wechatProportion").val(); |
| | | var operatorIdOne = $("#operatorIdOne").val(); |
| | | if($("#alipayNum").val()=='' ){ |
| | | Feng.info("请输入支付宝分账比例") |
| | | return; |
| | | } |
| | | if($("#wechatNum").val()=='' ){ |
| | | Feng.info("请输入微信分账比例") |
| | | return; |
| | | } |
| | | if (Number(alipayProportion)+Number(wechatProportion)!=100){ |
| | | Feng.info("总比例应该是100%,当前比例:"+Number(Number(alipayProportion)+Number(wechatProportion))); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/operator/proportion", function(data){ |
| | | Feng.success("分账比例设置成功") |
| | | window.parent.TSite.table.refresh(); |
| | | TSite.close(); |
| | | TSite.search(); |
| | | }); |
| | | ajax.set("alipayProportion",alipayProportion); |
| | | ajax.set("wechatProportion",wechatProportion); |
| | | ajax.set("operatorIdOne",operatorIdOne); |
| | | ajax.start(); |
| | | }; |
| | | /** |
| | | * 上架 |