1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- $(function(){
- var ApiHOST = "http://api.say365.xin/ss-admin";
- $(".handle_btn_save").click(function(){
- var load = layer.load();
- var imglist = [];
- var paperno = $("h3").attr("data-paperno");
- var paperid = $("h3").attr("data-paperid");
- $(".cut_imgview").each(function(index){
- var cutimg = {};
- var id = $(this).attr("data-id");
- console.log(id);
- if(id==undefined){
- id = 0;
- }
- cutimg.id = id;
- cutimg.imgtype = $(this).attr("data-image-type");
- cutimg.point = $(this).attr("data-point");
- cutimg.page = parseInt($(this).attr("data-page"))-1;
- if($(this).find(".subqueinput").length){
- cutimg.squeno = $(this).find(".subqueinput").val();
- }else{
- cutimg.squeno = 0;
- }
- cutimg.queno = $(this).parents(".cut_img_box_li").find(".quenoinput").val();
- imglist.push(cutimg);
- });
- console.log(imglist);
- //保存切片
- var url = ApiHOST+"/ss-admin/savestdpieces/";
- var params = {
- paper_id:paperid,
- paper_no:paperno,
- cut_paper_imgs_info:imglist,
- };
- $.ajax({
- type:"post",
- url:url,
- data:JSON.stringify(params),
- //dataType:'json',
- success:function(data){
- console.log(data);
- if(data.code==1){
- layer.alert("保存成功",{
- icon:1
- });
- window.location.reload();
- }
- layer.close(load);
- }
- });
- });
- });
|