mui.plusReady(function() { window.addEventListener('reload', function(e) { //执行刷新 location.reload(); }); var authType = localStorage.getItem('authType') var supermarket = '', commercial = '', shangdu = ''; var scinfo = '', ssinfo = '', sdinfo = ''; var shopName = ''; var scshopId = '', ssshopId = "", sdshopId = ''; var scid = '', ssid = '', sdid = ''; $('.nc').hide(); $('.ic').hide(); // 获取商超商厦申请记录 // //console.log(authType); JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { applyLevel: 2 }, function(data) { //shangchang // console.log(data) if ("undefined" != typeof(data.data)) { scshopId = data.data.shopId; scid = data.data.id; if (0 == data.data.status) { scinfo = "待审核" } if (1 == data.data.status) { scinfo = "已通过" } if (2 == data.data.status) { scinfo = "已拒绝" } }else{ JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { applyLevel: 2, status:1 }, function(data) { //shangchang // console.log(data) if ("undefined" != typeof(data.data)) { scshopId = data.data.shopId; scid = data.data.id; if (0 == data.data.status) { scinfo = "待审核" } if (1 == data.data.status) { scinfo = "已通过" } if (2 == data.data.status) { scinfo = "已拒绝" } } }) } }) JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { applyLevel: 3 }, function(data) { //xiaodian // console.log(data) if ("undefined" != typeof(data.data)) { if (0 == data.data.status) { ssinfo = "待审核" } if (1 == data.data.status) { ssinfo = "已通过" } if (2 == data.data.status) { ssinfo = "已拒绝" } ssid = data.data.id; ssshopId = data.data.shopId; // ssinfo=data.data.status; }else{ JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { applyLevel: 3, status:1 }, function(data) { //xiaodian // console.log(data) if ("undefined" != typeof(data.data)) { if (0 == data.data.status) { ssinfo = "待审核" } if (1 == data.data.status) { ssinfo = "已通过" } if (2 == data.data.status) { ssinfo = "已拒绝" } ssid = data.data.id; ssshopId = data.data.shopId; // ssinfo=data.data.status; } }) } }) JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { applyLevel: 4 }, function(data) { //shangchangkefu // console.log(data) if ("undefined" != typeof(data.data)) { if (0 == data.data.status) { sdinfo = "待审核" } if (1 == data.data.status) { sdinfo = "已通过" } if (2 == data.data.status) { sdinfo = "已拒绝" } sdid = data.data.id; sdshopId = data.data.shopId; // sdinfo = data.data.status; // shangdu = '' }else{ JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { applyLevel: 4, status:1 }, function(data) { //shangchangkefu // console.log(data) if ("undefined" != typeof(data.data)) { if (0 == data.data.status) { sdinfo = "待审核" } if (1 == data.data.status) { sdinfo = "已通过" } if (2 == data.data.status) { sdinfo = "已拒绝" } sdid = data.data.id; sdshopId = data.data.shopId; // sdinfo = data.data.status; // shangdu = '' } }) } }) JZL.ajax(qlgUrl('app/shops/userShopList'), {}, function(data) { if (1 == data.status) { var data = data.data; var html = ''; var info = "", infotext; $.each(data, function() { if (this.status == 0) { info = "待审核", infotext = "编辑" } else if (this.status == 1) { info = "已通过"; infotext = "进入店铺" } else if (this.status == 2) { info = "已拒绝"; infotext = "编辑" } html = '

' + this.shopName + '

' + info + '

商超

' + scinfo + '

商厦

' + ssinfo + '

商都

' + sdinfo + '

' + infotext + '

删除

'; // html = '
' + // this.shopName + // '

' + // info + // '

' + // infotext + // '

删除

'; // $('.con').append(html); }) }else{ mui.alert(data.msg) } }) setTimeout(function() { $.each($(".list"), function() { var shop_id = $(this).attr("data-id"); if (shop_id == scshopId) { $(this).find($('.listcenter .supermaket')).show() // $(this).find($('.listcenter .supermaket .namecom')).html('商超') // $(this).find($('.listcenter .shopname .scinfo')).show() $(this).find($('.listcenter .shopname .scinfo')).html(scinfo) } if (shop_id == ssshopId) { $(this).find($('.listcenter .commercial')).show() // $(this).find($('.listcenter .commercial .namecom')).html('商厦') // $(this).find($('.listcenter .shopname .ssinfo')).show() $(this).find($('.listcenter .shopname .ssinfo')).html(ssinfo) } if (shop_id == sdshopId) { $(this).find($('.listcenter .shangdu')).show() // $(this).find($('.listcenter .shangdu .namecom')).html('商都') // $(this).find($('.listcenter .shopname .sdinfo')).show() $(this).find($('.listcenter .shopname .sdinfo')).html(sdinfo) } }) }, 1000) // 申请店铺 $('.add1').on('tap', function() { JZL.openWindow('applicationopen.html', 'applicationopen.html'); }) //编辑店铺 var shopId = ''; mui('.con').on('tap', '.bj', function() { shopId = $(this).parents().parents().parents().attr("data-id"); var status = $(this).parents().parents().parents().attr("data-info"); if (1 == status) { JZL.openWindow('myshop.html', shopId, { 'shopId': shopId }); // JZL.openWindow('storeout.html', shopId); } else { JZL.openWindow('applicationopen.html', shopId, { 'status': status, 'shopId': shopId }); // JZL.openWindow('myshop.html', shopId); } }) mui('.con').on('tap', '.supermaket', function() { if (scinfo != "已通过") { JZL.openWindow('supermarket.html', 'supermarket.html', { scid: scid }) } }) mui('.con').on('tap', '.commercial', function() { if (ssinfo != "已通过") { JZL.openWindow('commercial.html', 'commercial.html', { ssid: ssid }) } }) mui('.con').on('tap', '.shangdu', function() { if (sdinfo != "已通过") { JZL.openWindow('shangdu.html', 'shangdu.html', { sdid: sdid }) } }) //删除店铺 mui('.con').on('tap', '.del', function() { shopId = $(this).parents().parents().parents().attr("data-id"); if (confirm('确认删除?')) { var lxy_div = '

请输入操作密码

'; $('body').append(lxy_div); $('.lxy_zz').on('tap', function(e) { e.preventDefault(); e.stopPropagation() }) mui('.lxy_zz_btn').on('tap', '.cancle', function() { $('#home_zhezhao').remove(); return; }) mui('.lxy_zz_btn').on('tap', '.sure', function() { var payPwd = $('.payword').val(); if (payPwd == '') { mui.alert("请输入密码") } JZL.ajax(qlgUrl('app/shops/delShop'), { shopId: shopId, payPwd: payPwd }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; // var data = toJson(data, 1); console.log(data); if (data.status == 1) { $('#home_zhezhao').remove(); mui.toast(data.msg) location.reload() }else{ mui.alert(data.msg) } }) }) } }) })