; layui.define(['form'], function (e) { var s = layui.$, t = (layui.layer, layui.laytpl, layui.setter, layui.view, layui.admin), form = layui.form; form.on('submit(LAY-address-add)',function(data){ s.post('add.html',data.field,function(r){ layer.msg(r.msg,{time:1000,end:function(){ if (!r.code) { var qfsc = layui.data('qfsc'); var history_url = qfsc['history']; if (history_url != null) { window.location.replace(history_url) }else{ history.go(-1) } } }}) }) return false; }) form.on('submit(LAY-address-edit)',function(data){ s.post('edit.html',data.field,function(r){ layer.msg(r.msg,{time:1000,end:function(){ if (!r.code) { var qfsc = layui.data('qfsc'); var history_url = qfsc['history']; if (history_url != null) { window.location.replace(history_url) }else{ history.go(-1) } } }}) }) return false; }) var address = function(){ if (s('.city-picker').length > 0) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = '/static/plugins/city-picker/js/city-picker.min.js'; script.onload = script.onreadystatechange = function () { if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"){ script.onload = script.onreadystatechange = null; } }; head.appendChild(script); } } e('address',new address()); })