<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<?php 
Define('PM_CALL',true);
include dirname(__FILE__).('/../admin_global.func.php');
include dirname(__FILE__).('/../../config/mysql.func.php');
include dirname(__FILE__).('/../../config/Conn.php');
//判断是否登录
if(isset($_COOKIE['Aname'])){
//获取数据
include dirname(__FILE__).('/../function/admin_cookie.inc.php');
  

//转转平台商品采集2017-12-29版本
if($_GET['action']=='caiji'){

  //判断是否转转商品地址
  if ((strstr($_POST['cajiURL'], "zhuanzhuan.58.com"))) {
    if(!(strstr($_POST['cajiURL'], "shtml"))){
      _alert_back('必须是转转网的完整并且有效的URL地址');
    }
    //开始采集
    function preg_substr($start, $end, $str) // 正则截取函数        
    {        
        $temp = preg_split($start, $str);        
        $content = preg_split($end, $temp[1]);        
        return $content[0];        
    }     
    function str_substr($start, $end, $str) // 字符串截取函数        
    {        
        $temp = explode($start, $str, 2);        
        $content = explode($end, $temp[1], 2);        
        return $content[0];       
    }     
        
    $str = iconv("UTF-8","UTF-8",  file_get_contents($_POST['cajiURL']));      
    //商品TITLE标签长标题
    $maxtitle = str_substr("<title>", "</title>", $str);
    //echo ('标题: ' . str_substr("<title>", "</title>", $str)); // 通过字符串提取标
    //商品描述
    $description = str_substr('<meta name="description" content="', '"/>', $str);
    //echo ('描述: ' . str_substr('<meta name="description" content="', '"/>', $str)); // 通过字符串提取标
    //商品标题
    $title = str_substr('<h1 class="info_titile">', '</h1>', $str);
    //echo ('商品标题: ' . preg_substr("/作者：/", "/<\//", $str)); // 通过正则提取作者   
    //echo ('商品标题: ' . str_substr('<h1 class="info_titile">', '</h1>', $str)); // 通过正则提取作者
    //商品价格
    $price = preg_substr("/现价：<i>/", "/<\//", $str);
    //echo ('商品价格: ' . preg_substr("/现价：<i>/", "/<\//", $str));
    //所在区域
    $region = preg_substr("/区域：<i>/", "/<\//", $str);
    //echo ('区域: ' . preg_substr("/区域：<i>/", "/<\//", $str)); // 通过正则提取作
    //用户名
    $user_name = str_substr('<p class="personal_name">', '</p>', $str);
    //echo ('用户名: ' . str_substr('<p class="personal_name">', '</p>', $str)); // 通过字符串提取标题
    //用户头像
    $user_portrait = str_substr('<span class="baby_face_img">
              <img src="', '" alt="">', $str);
    //echo ('头像: ' . str_substr('<span class="baby_face_img">
              //<img src="', '" alt="">', $str)); //内容当然不可以少
    //浏览量
    $hits = preg_substr("/<span class=\"look_time\">/", "/次浏览<\/span>/", $str);
    //echo ('点击率: ' . preg_substr("/<span class=\"look_time\">/", "/次浏览<\/span>/", $str)); // 通过正则提取作
    //商品描述
    $goods_desc = str_substr('<span class="icon_png sanjiao"></span>', '</div>', $str);
    //echo ('商品描述: ' . str_substr('<div class="baby_kuang clearfix">', '</div>', $str)); // 通过正则提取作

    //echo ('商品图片: ' . preg_substr("/<img src='/", "/'/", $str)); // 通过正则提取作
    //$img = array(preg_substr("/<img src='/", "/'/", $str));
    //var_dump($img);

    //获取所有商品图片
    $conn=file_get_contents($_POST['cajiURL']);//获取页面内容
    $pattern="/<img src=\'(.*)\' alt=\"(.*)\">/iUs";//正则
    $arr = array();
    preg_match_all($pattern, $conn, $arr);//匹配内容到arr数组
    //print_r($arr);die;
    $goods_img1 = $arr[1][0];
    $goods_img2 = $arr[1][1];
    $goods_img3 = $arr[1][2];
    $goods_img4 = $arr[1][3];
    $goods_img5 = $arr[1][4];
    //echo ('商品缩略图: ' . preg_substr("/<img id=\"img1\" rel='/", "/'/", $str)); // 通过正则提取作
    //echo ('想买人数: ' . preg_substr("/<span class=\"want_person\">/", "/人想买<\/span>/", $str));
    //交易数量
    $tran_num = str_substr('<span class="numdeal">', '</span>', $str);
    //echo ('交易数量: ' . str_substr('<span class="numdeal">', '</span>
    //', $str));





  }else{
    _alert_back('必须是转转网的完整并且有效的URL地址');
  }




}




}else{
   _location('非法操作！','/admin.php');  
}
?>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>新增商品</title>

</head>
<body>
 <style type="text/css">
	a{cursor:pointer;}
	body{background: #fff none repeat scroll 0 0; color: #333; font: 12px/1.5 "Microsoft YaHei","Helvetica Neue",Helvetica,STHeiTi,sans-serif; background-position: left top; background-repeat: repeat; background-attachment: scroll;}
	.clearfix:after{visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0}
	*:first-child+html .clearfix{zoom:1}
	ul,li{list-style: none;padding:0;margin:0}
	.avatar_uplpad_btn {
		background:  url("images/avatar_uplpad_btn.png") no-repeat scroll 0 0;
		display: inline-block;
		height: 30px;
		width: 82px;
		float:left;
	}
	.loading_bar{background: #f2f2f5 none repeat scroll 0 0;border-radius: 6px;display: inline-block;font-size: 0;height: 10px;overflow: hidden;text-align: left;width: 250px;}
	.loading_bar em{background: #fa7d3c none repeat scroll 0 0;display: inline-block;height: 10px;vertical-align: top;}
</style>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" charset="utf-8" src="UEditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="UEditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="UEditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="UEditor/plupload/plupload.full.min.js"></script>
<article class="page-container">


	<form class="form form-horizontal" action="?Admin=GoodsCommand10&action=add" method="post">
   
        <input name="goods_oid" type="hidden" value="<?php echo $zhuanzhuanNUM1_1; ?>">
        <input name="test_desc" type="hidden" value="">
        <input name="stock" type="hidden" value="0">
        <input name="user_grade" type="hidden" value="1">
        <input name="test_desc2" type="hidden" value="">
        <input name="in_class_id" type="hidden" value="10">
        <input name="in_admin_id" type="hidden" value="<?php echo $_AID; ?>">
    	<input name="imUrl" type="hidden" value="">
        
         <div class="row cl" style='display:none'>
          <label class="form-label col-xs-4 col-sm-2">新旧选择：</label>
          <div class="formControls col-xs-8 col-sm-2"> <span class="select-box">
            <select name="oldnew" class="select">
              <option value="1">全新</option>
              <option value="2" selected="selected">二手</option>
            </select>
            </span> </div>
        </div>
        
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*
			</span>
		    商品标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="<?php echo $title;?>" name="title" placeholder="标题字数限制200字以内" required/>
			</div>
		</div>

    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">所在地区：</label>
      <div class="formControls col-xs-8 col-sm-3">
        <input type="text" class="input-text" value="<?php echo $region; ?>" name="region" placeholder="所在地区，如：浙江 杭州">
      </div>
    </div>

        
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">商品价格：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="<?php echo $price; ?>" placeholder="价格" name="price" required/>
            </div>
        </div>


        <div class="row cl" style='display:none'>
            <label class="form-label col-xs-4 col-sm-2">运费：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="0" placeholder="运费" name="freight" required/>
            </div>
        </div>

        <div class="row cl" style='display:none'>
            <label class="form-label col-xs-4 col-sm-2">浏览量：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="<?php if($hits){echo $hits;}else{echo 0;}?>" placeholder="浏览量" name="hits" required/>
            </div>
        </div>

        <div class="row cl" style='display:none'>
            <label class="form-label col-xs-4 col-sm-2">容量：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="" placeholder="容量如：32G" name="att_capacity"/>
            </div>
        </div>

        <div class="row cl" style='display:none'>
            <label class="form-label col-xs-4 col-sm-2">机身颜色：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="" placeholder="如：银白色" name="att_color"/>
            </div>
        </div>

        <div class="row cl" style='display:none'>
            <label class="form-label col-xs-4 col-sm-2">购买渠道：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="" placeholder="如：国货" name="att_channel"/>
            </div>
        </div>
		
        <div class="row cl" style='display:none'>
            <label class="form-label col-xs-4 col-sm-2">验机费用：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" class="input-text" value="" placeholder="" name="yanjifeiyong"/>
            </div>
        </div>
		
		<div class="row cl" style='display:none'>
          <label class="form-label col-xs-4 col-sm-2">商品价减验机费：</label>
          <div class="formControls col-xs-8 col-sm-2"> <span class="select-box">
            <select name="jianyanji" class="select">
              <option value="1">是</option>
              <option value="2" selected="selected">否</option>
            </select>
            </span> </div>
        </div>
		
		<div class="row cl" style='display:none'>
          <label class="form-label col-xs-4 col-sm-2">删验机信息：</label>
          <div class="formControls col-xs-8 col-sm-2"> 
		  <span class="select-box">
            <select name="qcyanji" class="select">
              <option value="1">是</option>
              <option value="2" selected="selected">否</option>
            </select>
            </span></div>删除模版中的所有验机信息，方便发布不走验机类商品
        </div>

	<div class="row cl" style='display:none'>
    	<label class="form-label col-xs-4 col-sm-2">商品图片1：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
            <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn4"></a>
            <div id="avatar_pic4" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="<?php if($goods_img1){echo $goods_img1;}else{echo "images/noimg.jpg";}?>" style="width:100px;height:68px;"/><?php if($goods_img1){?><input type="hidden"  name="goods_img1" value="<?php echo $goods_img1; ?>"/><?php }?>
            </div>
            <div id="avatar_pic44" style="width:100%;margin:30px 0 0"></div>
            <div id="loading_bar4" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent4" style="width: 27%;"></em></span>
                <span id="percentnum4">27%</span>
            </div>
        </div>
        <label class="form-label col-xs-4 col-sm-2">商品图片2：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
          <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn5"></a>
  <div id="avatar_pic5" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="<?php if($goods_img2){echo $goods_img2;}else{echo "images/noimg.jpg";}?>" style="width:100px;height:68px;"/><?php if($goods_img2){?><input type="hidden"  name="goods_img2" value="<?php echo $goods_img2; ?>"/><?php }?>
            </div>
          <div id="avatar_pic55" style="width:100%;margin:30px 0 0"></div>
      <div id="loading_bar5" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent5" style="width: 27%;"></em></span>
                <span id="percentnum5">27%</span>
            </div>
        </div>
        <label class="form-label col-xs-4 col-sm-2">商品图片3：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
          <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn6"></a>
  <div id="avatar_pic6" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="<?php if($goods_img3){echo $goods_img3;}else{echo "images/noimg.jpg";}?>" style="width:100px;height:68px;"/><?php if($goods_img3){?><input type="hidden"  name="goods_img3" value="<?php echo $goods_img3; ?>"/><?php }?>
            </div>
          <div id="avatar_pic66" style="width:100%;margin:30px 0 0"></div>
      <div id="loading_bar6" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent6" style="width: 27%;"></em></span>
                <span id="percentnum6">27%</span>
            </div>
        </div>
        <label class="form-label col-xs-4 col-sm-2">商品图片4：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
          <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn7"></a>
  <div id="avatar_pic7" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="<?php if($goods_img4){echo $goods_img4;}else{echo "images/noimg.jpg";}?>" style="width:100px;height:68px;"/><?php if($goods_img4){?><input type="hidden"  name="goods_img4" value="<?php echo $goods_img4; ?>"/><?php }?>
            </div>
          <div id="avatar_pic77" style="width:100%;margin:30px 0 0"></div>
      <div id="loading_bar7" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent7" style="width: 27%;"></em></span>
                <span id="percentnum7">27%</span>
            </div>
        </div>
        <label class="form-label col-xs-4 col-sm-2">商品图片5：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
          <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn8"></a>
  <div id="avatar_pic8" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="<?php if($goods_img5){echo $goods_img5;}else{echo "images/noimg.jpg";}?>" style="width:100px;height:68px;"/><?php if($goods_img5){?><input type="hidden"  name="goods_img5" value="<?php echo $goods_img5; ?>"/><?php }?>
            </div>
          <div id="avatar_pic88" style="width:100%;margin:30px 0 0"></div>
      <div id="loading_bar8" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent8" style="width: 27%;"></em></span>
                <span id="percentnum8">27%</span>
            </div>
        </div>
    </div>


    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">商品描述：</label>
      <div class="formControls col-xs-8 col-sm-9"> 
            <textarea name="goods_desc" id="editor" style="width:100%;height:100px;"><?php echo $goods_desc; ?></textarea>
      </div>
    </div>

    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">在售宝贝：</label>
      <div class="formControls col-xs-8 col-sm-3">
        <input type="text" class="input-text" value="1" name="doods_num" placeholder="在售宝贝">
      </div>
    </div>

    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">交易数量：</label>
      <div class="formControls col-xs-8 col-sm-3">
        <input type="text" class="input-text" value="<?php if($tran_num){echo $tran_num;}else{echo 0;}?>" name="tran_num" placeholder="交易数量">
      </div>
    </div>


    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">回复率：</label>
      <div class="formControls col-xs-8 col-sm-3">
        <input type="text" class="input-text" value="100" name="recovery_rate" placeholder="回复率">
      </div>
    </div>


    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">用户名称：</label>
      <div class="formControls col-xs-8 col-sm-3">
        <input type="text" class="input-text" value="<?php echo $user_name; ?>" name="user_name" placeholder="用户名称">
      </div>
    </div>
    
    
 	<div class="row cl" style='display:none'>
    	<label class="form-label col-xs-4 col-sm-2">用户头像：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
            <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn1"></a>
            <div id="avatar_pic1" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="<?php if($user_portrait){echo $user_portrait;}else{echo "images/noimg.jpg";}?>" style="width:100px;height:68px;"/><?php if($user_portrait){?><input type="hidden"  name="user_portrait" value="<?php echo $user_portrait; ?>"/><?php }?>
            </div>
            <div id="avatar_pic11" style="width:100%;margin:30px 0 0"></div>
            <div id="loading_bar1" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent1" style="width: 27%;"></em></span>
                <span id="percentnum1">27%</span>
            </div>
        </div>
    </div>

    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">性别：</label>
      <div class="formControls col-xs-8 col-sm-2"> <span class="select-box">
        <select name="user_gender" class="select">
          <option value="2">男</option>
          <option value="1">女</option>
        </select>
        </span> </div>
    </div>

	<div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">支付方式：</label>
      <div class="formControls col-xs-8 col-sm-2"> <span class="select-box">
        <select name="pay_fangshi" class="select">
          <option value="2">普通支付</option>
          <option value="1">Q币接口</option>
          <option value="4">图片二维码</option>
        </select>
        </span> </div>
    </div>
	
	<div class="row cl" style='display:none'>
    	<label class="form-label col-xs-4 col-sm-2">二维码：</label>
        <div class="avatar_area" style="margin:0px 0 0;text-align: center;">
          <a href="javascript:void(0);"class="avatar_uplpad_btn" id="avatar_uplpad_btn2"></a>
  <div id="avatar_pic2" style="width:100%;margin:10px 0 0; float:left;">
                    <img alt="" src="images/noimg.jpg" style="width:100px;height:68px;"/>
            </div>
          <div id="avatar_pic22" style="width:100%;margin:30px 0 0"></div>
      <div id="loading_bar2" style="display:none;float:left;">
                <p id="updesc">图片上传中...</p>
                <span class="loading_bar"><em id="percent2" style="width: 27%;"></em></span>
                <span id="percentnum2">27%</span>
            </div>
        </div>
    </div>
    
    <div class="row cl" style='display:none'>
      <label class="form-label col-xs-4 col-sm-2">支付地址：</label>
      <div class="formControls col-xs-8 col-sm-6">
        <input type="text" class="input-text" value="" name="zhifubaoURL" placeholder="支付地址">
      </div>
    </div>
		
        
        <div class="row cl">
          <label class="form-label col-xs-4 col-sm-2">上架状态：</label>
          <div class="formControls col-xs-8 col-sm-2"> <span class="select-box">
            <select name="is_shelves" class="select">
              <option value="1" <?php if (!(strcmp($_GoodsID['is_shelves'], 1))) {echo "selected=\"selected\"";} ?>>立即上架</option>
              <option value="0" <?php if (!(strcmp($_GoodsID['is_shelves'], 0))) {echo "selected=\"selected\"";} ?>>放入仓库</option>
            </select>
            </span> </div>
        </div>
        
     
        
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i> 保存并提交</button>
				<button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>


	</form>
</article>

<!--_footer 作为公共模版分离出去-->

<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer /作为公共模版分离出去-->

        <script type="text/javascript">
			//用户肖像
            var uploader_avatar1 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn1'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic1").hide();
                        $("#loading_bar1").show();
                        uploader_avatar1.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent1").css({"width": percent + "%"});
                        $("#percentnum1").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic1").html("<img  src='" + data.pic + "' width=100 height=100/>");
						 $("#avatar_pic11").html("<input type='hidden'  name='user_portrait' value='" + data.pic + "'/>");
                        $("#loading_bar1").hide();
                        $("#avatar_pic1").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar1").hide();
                    }
                }
            });
            uploader_avatar1.init();
		//	微信二维码
 		 var uploader_avatar2 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn2'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic2").hide();
                        $("#loading_bar2").show();
                        uploader_avatar2.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent2").css({"width": percent + "%"});
                        $("#percentnum2").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic2").html("<img  src='" + data.pic + "' width=150 height=150/>");
						$("#avatar_pic22").html("<input type='hidden'  name='weixin_img' value='" + data.pic + "'/>");
                        $("#loading_bar2").hide();
                        $("#avatar_pic2").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar2").hide();
                    }
                }
            });
            uploader_avatar2.init();
		//	支付宝二维码
 		 var uploader_avatar3 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn3'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic3").hide();
                        $("#loading_bar3").show();
                        uploader_avatar3.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent3").css({"width": percent + "%"});
                        $("#percentnum3").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic3").html("<img  src='" + data.pic + "' width=150 height=150/>");
						$("#avatar_pic33").html("<input type='hidden'  name='zhifubao_img' value='" + data.pic + "'/>");
                        $("#loading_bar3").hide();
                        $("#avatar_pic3").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar3").hide();
                    }
                }
            });
            uploader_avatar3.init();
		//	goods_img1
 		 var uploader_avatar4 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn4'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic4").hide();
                        $("#loading_bar4").show();
                        uploader_avatar4.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent4").css({"width": percent + "%"});
                        $("#percentnum4").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic4").html("<img  src='" + data.pic + "' width=100 height=100/>");
						$("#avatar_pic44").html("<input type='hidden'  name='goods_img1' value='" + data.pic + "'/>");
                        $("#loading_bar4").hide();
                        $("#avatar_pic4").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar4").hide();
                    }
                }
            });
			uploader_avatar4.init();
		//	goods_img2
 		 var uploader_avatar5 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn5'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic5").hide();
                        $("#loading_bar5").show();
                        uploader_avatar5.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent5").css({"width": percent + "%"});
                        $("#percentnum5").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic5").html("<img  src='" + data.pic + "' width=100 height=100/>");
						$("#avatar_pic55").html("<input type='hidden'  name='goods_img2' value='" + data.pic + "'/>");
                        $("#loading_bar5").hide();
                        $("#avatar_pic5").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar5").hide();
                    }
                }
            });
            uploader_avatar5.init();
		//	goods_img3
 		 var uploader_avatar6 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn6'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic6").hide();
                        $("#loading_bar6").show();
                        uploader_avatar6.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent6").css({"width": percent + "%"});
                        $("#percentnum6").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic6").html("<img  src='" + data.pic + "' width=100 height=100/>");
						$("#avatar_pic66").html("<input type='hidden'  name='goods_img3' value='" + data.pic + "'/>");
                        $("#loading_bar6").hide();
                        $("#avatar_pic6").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar6").hide();
                    }
                }
            });
            uploader_avatar6.init();
		//	goods_img4
 		 var uploader_avatar7 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn7'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic7").hide();
                        $("#loading_bar7").show();
                        uploader_avatar7.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent7").css({"width": percent + "%"});
                        $("#percentnum7").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic7").html("<img  src='" + data.pic + "' width=100 height=100/>");
						$("#avatar_pic77").html("<input type='hidden'  name='goods_img4' value='" + data.pic + "'/>");
                        $("#loading_bar7").hide();
                        $("#avatar_pic7").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar7").hide();
                    }
                }
            });
            uploader_avatar7.init();
		//	goods_img5
 		 var uploader_avatar8 = new plupload.Uploader({//创建实例的构造方法
                runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
                browse_button: ['avatar_uplpad_btn8'], // 上传按钮
                url: "pluploadajax.php", //远程上传地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif,jpeg"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        $("#avatar_pic8").hide();
                        $("#loading_bar8").show();
                        uploader_avatar8.start();
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条

                        var percent = file.percent;
                        $("#percent8").css({"width": percent + "%"});
                        $("#percentnum8").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                        var data = eval("(" + info.response + ")");//解析返回的json数据
                        $("#avatar_pic8").html("<img  src='" + data.pic + "' width=100 height=100/>");
						$("#avatar_pic88").html("<input type='hidden'  name='goods_img5' value='" + data.pic + "'/>");
                        $("#loading_bar8").hide();
                        $("#avatar_pic8").show();
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                        $("#loading_bar8").hide();
                    }
                }
            });
            uploader_avatar8.init();
        </script>
</body>
</html>