<style> .whole{ width: 490px; margin: 0 auto; padding-top: 45px; } .icon_p{ text-align: center; } .Import_name{ text-align: center; font-size: 20px; font-weight: bold; } .import_tip{ font-size: 16px; color: #999; } .whole p{ margin-bottom: 1em; } .btn_p{ text-align: center; } .upload-demo{ display: inline-block; color: #fff; background-color: #1890ff; border-color: #1890ff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045); height: 32px; padding: 0 15px; font-size: 14px; border-radius: 2px; } .upload-demo:hover{ color: #fff; background-color: #40a9ff; border-color: #40a9ff; } .downFile{ display: inline-block; color: #1890ff !important; border: 1px solid #1890ff; margin-left: 30px; height: 32px; padding: 0 15px; font-size: 14px !important; border-radius: 2px; line-height: 30px !important; } </style> <div class="whole"> <div class="icon_p"> <img src="{$site.path}templates/{$site.theme}/static/img/import_icon.png" class="import_icon" /> </div> <p class="Import_name">Excel批量导入会员信息</p> <p class="import_tip">第一步:下载Excel会员信息模板</p> <p class="import_tip">第二步:使用模板整理信息模板,点击"上传Excel"完成会员信息导入</p> <div class="btn_p"> <input type="hidden" name="jyhlSystemImg" value=""/> <input class="upload-demo" type="button" id="fileh" value="上传Excel" onclick="selectSystemImg(this)"> <input type="file" name="excel" value="导入会员" id="file" style="display: none;" onchange="selectSystemFile(this)"/> <a class="downFile" href="/upload/downexcel/圣水陵园导入会员模板.xlsx">下载模板</a> </div> </div> <script> function selectSystemFile(_this) { var formData = new FormData(); formData.append("file",$(_this)[0].files[0]); $.ajax({ url:"{U(array('m'=>'member','c'=>'member','a'=>'upload'))}&t=file", type:'post', data: formData, contentType: false, processData: false, success:function(response){ response= JSON.parse(response); console.log('11111'); console.log(response.message); $.ajax({ url:"{U(array('m'=>'member','c'=>'member','a'=>'import'))}", type:'post', data: { file:response.message }, success:function(response){ if(response.success==true){ msg.success(response.message); }else{ msg.success(response.newmessage); window.location.href=response.message; } } }) } }) } function selectSystemImg(_this) { $(_this).next().click(); } </script>
发表评论 取消回复