审查视图

public/themes/simpleboot3/portal/salesmangoods/salesman_goods_add.html 30.2 KB
anyv authored
1 2 3 4 5 6 7 8
<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>学考无忧-添加商品</title>
anyv authored
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    <link rel="stylesheet" href="__TMPL__/public/assets/css//mui.min.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css//mui.picker.min.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css//reset.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css//log.css" />
    <style>
        .log_six_add_photos{
            padding: 0.15rem 0.2rem;
            display: flex;
            justify-content: space-around;
            align-items: center;
        }
        .log_six_photo_ones{
            width: 1.6rem;
            height: 1.6rem;
        }
        .log_six_add_imgs{
            width: 100%;
            height:1.5rem;
        }
        .log_six_add_titles{
            display: none;
        }
        .log_six_pictyre_imgs{
            width: 1.6rem;
            height: 1.6rem;
        }
        .log_six_pictyre_titles{
            display: none;
        }
1  
anyv authored
38
        .log_six_select_one span,.log_two_input_title span,.log_two_picture_title span{
anyv authored
39 40
            color: #F20000;
        }
1  
anyv authored
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
        .mui-poppicker-header,
        .mui-picker {
            background-color: white;
        }

        .mui-btn-blue,
        .mui-btn-primary,
        input[type=submit] {
            background-color: #FF7700;
            border: 0;
        }

        .mui-pciker-list li.highlight {
            color: #FF7700;
        }
        .mui-dtpicker-header,.mui-dtpicker-title h5{
            background-color: white;
        }
anyv authored
59
    </style>
anyv authored
60 61 62
</head>

<body>
anyv authored
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
<div class="tx_mask_tongyi">
    <div class="tx_maskCon_school">
        <div class="three_model_school">
            <div class="three_model_school_data" style="display: block;">
                <div class="three_model_school_name there_unActive">一年级</div>
                <div class="three_model_school_name">二年级</div>
                <div class="three_model_school_name">三年级</div>
                <div class="three_model_school_name">四年级</div>
                <div class="three_model_school_name">五年级</div>
                <div class="three_model_school_name">六年级</div>
                <div class="three_model_school_name">初一</div>
                <div class="three_model_school_name">初二</div>
                <div class="three_model_school_name">初三</div>
                <div class="three_model_school_name">高一</div>
                <div class="three_model_school_name">高二</div>
                <div class="three_model_school_name">高三</div>
4  
anyv authored
79 80 81 82
                <div class="three_model_school_name">小学</div>
                <div class="three_model_school_name">初中</div>
                <div class="three_model_school_name">高中</div>
                <div class="three_model_school_name">学龄前</div>
王晓刚 authored
83
                <div class="three_model_school_name">4-6年级</div>
4  
anyv authored
84
                <div class="three_model_school_name">3-6年级</div>
5  
anyv authored
85
                <div class="three_model_school_name">1-2年级</div>
anyv authored
86 87 88 89
            </div>
        </div>
    </div>
</div>
anyv authored
90 91 92 93 94 95 96 97 98 99 100
<div class="log_top_co">
    <!-- 顶部 -->
    <div class=" order_top log_top_co">
        <a href="javascript:history.back(-1)">
            <img src="__TMPL__/public/assets/images/left.png" alt="" />
        </a>
        <p>添加商品</p>
    </div>
</div>
<!-- 添加照片 -->
<div class="log_six_add_photo">
anyv authored
101
    <div class="log_six_photo_one">
4  
anyv authored
102
        <div class="log_six_add_img" onclick="img_file()">
anyv authored
103 104 105 106 107 108
            <img src="__TMPL__/public/assets/images/jiahao.png" id="show_img" alt="" />
        </div>
        <div class="log_six_add_title">
            添加照片
        </div>
        <div class="input_file">
4  
anyv authored
109
            <!--<input type="file" id="img1_file_img" name="avatar" />-->
anyv authored
110
        </div>
anyv authored
111
    </div>
anyv authored
112
    <div class="log_six_photo_one">
4  
anyv authored
113
        <div class="log_six_add_img" onclick="img_suolue()">
anyv authored
114 115 116 117 118 119
            <img src="__TMPL__/public/assets/images/jiahao.png" id="thumbnail" alt="" />
        </div>
        <div class="log_six_add_title">
            添加缩略图
        </div>
        <div class="input_file">
4  
anyv authored
120
            <!--<input type="file" id="img_file_suolue" name="avatar" />-->
anyv authored
121
        </div>
anyv authored
122
    </div>
anyv authored
123
anyv authored
124 125 126 127 128 129 130
</div>
<div class="log_six_wire"></div>
<!-- 输入框 -->
<div class="log_six_input">
    <div class="log_two_input">
        <div class="log_two_input_one ">
            <div class="log_two_input_title">
anyv authored
131
                <span>*</span>书名
anyv authored
132 133
            </div>
            <div class="log_two_input_contant">
anyv authored
134
                <input type="text" placeholder="请输入书籍名称" name="book_name" />
anyv authored
135 136 137 138
            </div>
        </div>
        <div class="log_two_input_one ">
            <div class="log_two_input_title">
anyv authored
139
                <span>*</span>佣金
anyv authored
140 141
            </div>
            <div class="log_two_input_contant">
王晓刚 authored
142
                <input type="number" placeholder="请输入下级推广佣金" name="money" onkeyup="value=value.replace(/[^\d\.]/g,'')"/>
anyv authored
143 144 145 146
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
anyv authored
147
                <span>*</span>售价
anyv authored
148 149
            </div>
            <div class="log_two_input_contant">
王晓刚 authored
150
                <input type="number" placeholder="输入售价" name="price" onkeyup="value=value.replace(/[^\d\.]/g,'')"/>
anyv authored
151 152
            </div>
        </div>
4  
anyv authored
153
anyv authored
154 155 156 157 158
        <div class="log_six_input_one">
            <div class="log_two_input_title" style="margin-top: 0.09rem;">
                商品说明
            </div>
            <div class="log_six_input_contant">
anyv authored
159
                <textarea cols="20" rows="3" placeholder="请输入商品说明" id="instr"></textarea>
anyv authored
160 161 162 163
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
1  
anyv authored
164 165 166 167 168 169 170 171
                <span>*</span>咨询电话
            </div>
            <div class="log_two_input_contant">
                <input type="text" placeholder="请输入咨询电话" name="zixun_phone" />
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
anyv authored
172 173 174
                书号
            </div>
            <div class="log_two_input_contant">
anyv authored
175 176 177
                <input type="text" placeholder="请输入书号" name="book_number" />
            </div>
        </div>
4  
anyv authored
178
        <!--<div class="log_two_input_one">
anyv authored
179 180 181 182 183 184
            <div class="log_two_input_title">
                纸张
            </div>
            <div class="log_two_input_contant">
                <input type="text" placeholder="请输入纸张" name="paper" />
            </div>
4  
anyv authored
185
        </div>-->
anyv authored
186 187
        <div class="log_two_input_one">
            <div class="log_two_input_title">
7  
anyv authored
188
                装订
anyv authored
189 190
            </div>
            <div class="log_two_input_contant">
1  
anyv authored
191
                <input type="text" placeholder="请输入装订类型" name="binding" />
anyv authored
192 193 194 195
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
anyv authored
196
                <span>*</span>开本
anyv authored
197 198 199 200 201 202 203 204 205 206
            </div>
            <div class="log_two_input_contant">
                <input type="text" placeholder="请输入开本" name="book_size" />
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
                印刷
            </div>
            <div class="log_two_input_contant">
1  
anyv authored
207
                <input type="text" placeholder="请输入印刷颜色" name="printing" />
anyv authored
208 209 210 211 212 213 214
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
                作者
            </div>
            <div class="log_two_input_contant">
anyv authored
215
                <input type="text" placeholder="请输入作者名称" name="author" />
anyv authored
216 217 218 219 220 221 222
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
                出版社
            </div>
            <div class="log_two_input_contant">
anyv authored
223
                <input type="text" placeholder="请输入出版社名称" name="press" />
anyv authored
224 225 226 227 228 229 230
            </div>
        </div>
        <div class="log_two_input_one">
            <div class="log_two_input_title">
                出版时间
            </div>
            <div class="log_two_input_contant">
5  
anyv authored
231
                <input type="text" placeholder="请输入出版时间" name="press_time" />
anyv authored
232 233
            </div>
        </div>
anyv authored
234 235 236 237 238 239 240 241
        <div class="log_two_input_one">
            <div class="log_two_input_title">
                定价
            </div>
            <div class="log_two_input_contant">
                <input type="text" placeholder="输入定价" name="pricing" />
            </div>
        </div>
anyv authored
242 243 244 245 246 247
    </div>
</div>
<div class="log_six_wire"></div>
<!-- 套装 -->
<div class="log_six_select">
    <div class="log_six_select_contant">
anyv authored
248 249
        <div class="log_two_input_one">
            <div class="log_two_input_title">
anyv authored
250
                <span>*</span>套装
anyv authored
251
            </div>
anyv authored
252
            <div class="log_two_input_contant">
1  
anyv authored
253
                <input type="text" placeholder="请输入每套本数" name="suit" />
anyv authored
254 255
            </div>
        </div>
anyv authored
256
        <div class="log_six_select_top log_six_select_nianji">
anyv authored
257
            <div class="log_six_select_left">
anyv authored
258
                <div class="log_six_select_one" >
anyv authored
259
                    <span>*</span>适合年级
anyv authored
260
                </div>
anyv authored
261
                <div class="log_six_select_two log_six_nianji_contant" id="grade" >
anyv authored
262 263 264 265 266 267 268 269 270 271 272 273
                    请选择
                </div>
            </div>
            <div class="log_six_select_three">
                <img src="__TMPL__/public/assets/images/29.png" alt="" />
            </div>
        </div>
    </div>
</div>
<div class="log_six_wire"></div>
<div class="log_two_picture">
    <div class="log_two_picture_title">
1  
anyv authored
274
        <span>*</span>商品详情
anyv authored
275 276 277 278
    </div>
    <div class="log_six_file_picture">
        <div class="log_six_picture">
            <div class="log_six_picture_one">
4  
anyv authored
279
                <div class="log_six_pictyre_img" onclick="openCamera2()">
anyv authored
280
                    <img src="__TMPL__/public/assets/images/jiahao.png" alt="" id="img0" />
anyv authored
281 282 283 284 285
                </div>
                <div class="log_six_pictyre_title">
                    添加图片
                </div>
                <div class="input_files">
4  
anyv authored
286
                    <!--<input type="file" id="img0_file" name="avatar" />-->
anyv authored
287 288 289 290 291
                </div>
            </div>
        </div>
        <div class="log_six_picture">
            <div class="log_six_picture_one">
4  
anyv authored
292
                <div class="log_six_pictyre_img" onclick="openCamera1()">
anyv authored
293
                    <img src="__TMPL__/public/assets/images/jiahao.png" alt="" id="img1" />
anyv authored
294 295 296 297 298
                </div>
                <div class="log_six_pictyre_title">
                    添加图片
                </div>
                <div class="input_files">
4  
anyv authored
299
                    <!--<input type="file" id="img1_file" name="avatar" />-->
anyv authored
300 301 302 303 304
                </div>
            </div>
        </div>
        <div class="log_six_picture">
            <div class="log_six_picture_one">
4  
anyv authored
305
                <div class="log_six_pictyre_img" id="openCamera">
4  
anyv authored
306
                    <img src="__TMPL__/public/assets/images/jiahao.png" id="img2" alt=""  />
4  
anyv authored
307
                </div><!--id="img2"-->
anyv authored
308 309 310 311
                <div class="log_six_pictyre_title">
                    添加图片
                </div>
                <div class="input_files">
4  
anyv authored
312
                    <!--<input type="file" id="openCamera" name="avatar" />-->
anyv authored
313 314 315
                </div>
            </div>
        </div>
7  
anyv authored
316
    </div><!--id="img2_file"-->
4  
anyv authored
317
</div>
4  
anyv authored
318
anyv authored
319
<!-- 保存 -->
anyv authored
320
<div class="log_two_bottom_btn" onclick="Sure_add()">
anyv authored
321 322 323 324 325 326
    确定添加
</div>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/mui.min.js"></script>
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
anyv authored
327
<script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script>
anyv authored
328
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
anyv authored
329
<script src="__TMPL__/public/assets/js/uploadfile.js"></script>
anyv authored
330 331
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
1  
anyv authored
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
    var schoolpicker = new mui.PopPicker();
    (function($, doc) {
        $.init();
        $.ready(function() {
            schoolpicker.setData([{
                text: '一年级'
            },{
                text: '二年级'
            },{
                text: '三年级'
            },{
                text: '四年级'
            },{
                text: '五年级'
            },{
                text: '六年级'
anyv authored
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
            },{
                text: '初一'
            },{
                text: '初二'
            },{
                text: '初三'
            },{
                text: '高一'
            },{
                text: '高二'
            },{
                text: '高三'
            },{
                text: '小学'
            },{
                text: '初中'
            },{
                text: '高中'
            },{
                text: '学龄前'
            },{
王晓刚 authored
369 370
                text: '4-6年级'
            },{
anyv authored
371 372 373
                text: '3-6年级'
            },{
                text: '1-2年级'
1  
anyv authored
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
            },]);
        });
    })(mui, document);
    $(".log_six_select_nianji").click(function() {
        schoolpicker.show(function(e) {
            school_name = e[0].value;
            school_names = e[0].text;
            $(".log_six_nianji_contant").text(e[0].text);
            $('.log_six_nianji_contant').css('color', '#333333');

        });

    })
</script>
<script>
anyv authored
389
7  
anyv authored
390 391
    $('#openCamera').click(function(){
5  
anyv authored
392
        wx.config({$jssdk});
5  
anyv authored
393
        wx.chooseImage({
anyv authored
394
            count: 1, // 默认9
2  
anyv authored
395
            sizeType: ['original'], // 指定是原图还是压缩图,默认都有
anyv authored
396 397 398
            sourceType: ['album', 'camera'], // 指定来源是相册还是相机,默认都有
            success: function (res) {
                var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
4  
anyv authored
399
anyv authored
400 401 402 403 404 405 406 407
                wx.uploadImage({
                    localId: localIds.toString(), // 需要上传的图片的ID,由chooseImage接口获得
                    isShowProgressTips: 1, // 进度提示
                    success: function (res) {
                        var mediaId = res.serverId; // 返回图片的服务器端ID,即mediaId
                        //将获取到的 mediaId 传入后台 方法savePicture
                        $.post("{:url('Salesmangoods/savePicture')}",{"mediaId":mediaId},function(res){
                            //填写你自己的业务逻辑
4  
anyv authored
408
                            res = JSON.parse(res);
anyv authored
409
                            $('#img2').attr("src",res.filename);
4  
anyv authored
410 411
                            $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                            $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
anyv authored
412
                        });
anyv authored
413 414 415 416 417 418 419 420 421 422 423

                    },
                    fail: function (res) {
                        alertModal('图片上传失败,请重试');
                    }
                });
            }
        });

    });
4  
anyv authored
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
    function openCamera1(){
        wx.config({$jssdk});
        wx.chooseImage({
            count: 1, // 默认9
            sizeType: ['original'], // 指定是原图还是压缩图,默认都有
            sourceType: ['album', 'camera'], // 指定来源是相册还是相机,默认都有
            success: function (res) {
                var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片

                wx.uploadImage({
                    localId: localIds.toString(), // 需要上传的图片的ID,由chooseImage接口获得
                    isShowProgressTips: 1, // 进度提示
                    success: function (res) {
                        var mediaId = res.serverId; // 返回图片的服务器端ID,即mediaId
                        //将获取到的 mediaId 传入后台 方法savePicture
                        $.post("{:url('Salesmangoods/savePicture')}",{"mediaId":mediaId},function(res){
                            //填写你自己的业务逻辑
                            res = JSON.parse(res);
                            $('#img1').attr("src",res.filename);
                            $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                            $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
                        });

                    },
                    fail: function (res) {
                        alertModal('图片上传失败,请重试');
                    }
                });
            }
        });
    }

    function openCamera2(){
        wx.config({$jssdk});
        wx.chooseImage({
            count: 1, // 默认9
            sizeType: ['original'], // 指定是原图还是压缩图,默认都有
            sourceType: ['album', 'camera'], // 指定来源是相册还是相机,默认都有
            success: function (res) {
                var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片

                wx.uploadImage({
                    localId: localIds.toString(), // 需要上传的图片的ID,由chooseImage接口获得
                    isShowProgressTips: 1, // 进度提示
                    success: function (res) {
                        var mediaId = res.serverId; // 返回图片的服务器端ID,即mediaId
                        //将获取到的 mediaId 传入后台 方法savePicture
                        $.post("{:url('Salesmangoods/savePicture')}",{"mediaId":mediaId},function(res){
                            //填写你自己的业务逻辑
                            res = JSON.parse(res);
                            $('#img0').attr("src",res.filename);
                            $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                            $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
                        });

                    },
                    fail: function (res) {
                        alertModal('图片上传失败,请重试');
                    }
                });
            }
        });

    }
4  
anyv authored
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
    function img_file(){

        wx.config({$jssdk});
        wx.chooseImage({
            count: 1, // 默认9
            sizeType: ['original'], // 指定是原图还是压缩图,默认都有
            sourceType: ['album', 'camera'], // 指定来源是相册还是相机,默认都有
            success: function (res) {
                var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片

                wx.uploadImage({
                    localId: localIds.toString(), // 需要上传的图片的ID,由chooseImage接口获得
                    isShowProgressTips: 1, // 进度提示
                    success: function (res) {
                        var mediaId = res.serverId; // 返回图片的服务器端ID,即mediaId
                        //将获取到的 mediaId 传入后台 方法savePicture
                        $.post("{:url('Salesmangoods/savePicture')}",{"mediaId":mediaId},function(res){
                            //填写你自己的业务逻辑
                            res = JSON.parse(res);
                            $('#show_img').attr("src",res.filename);
                            $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                            $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
                        });

                    },
                    fail: function (res) {
                        alertModal('图片上传失败,请重试');
                    }
                });
            }
        });

    }

    function img_suolue(){

        wx.config({$jssdk});
        wx.chooseImage({
            count: 1, // 默认9
            sizeType: ['original'], // 指定是原图还是压缩图,默认都有
            sourceType: ['album', 'camera'], // 指定来源是相册还是相机,默认都有
            success: function (res) {
                var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片

                wx.uploadImage({
                    localId: localIds.toString(), // 需要上传的图片的ID,由chooseImage接口获得
                    isShowProgressTips: 1, // 进度提示
                    success: function (res) {
                        var mediaId = res.serverId; // 返回图片的服务器端ID,即mediaId
                        //将获取到的 mediaId 传入后台 方法savePicture
                        $.post("{:url('Salesmangoods/savePicture')}",{"mediaId":mediaId},function(res){
                            //填写你自己的业务逻辑
                            res = JSON.parse(res);
                            $('#thumbnail').attr("src",res.filename);
                            $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                            $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
                        });

                    },
                    fail: function (res) {
                        alertModal('图片上传失败,请重试');
                    }
                });
            }
        });

    }
anyv authored
557 558 559 560 561

</script>
<script>
    /**
     *确定添加
anyv authored
562 563 564
     */
    function Sure_add(){
        show_img = $('#show_img')[0].src;
4  
anyv authored
565
4  
anyv authored
566
     if(show_img == "http://xkeasy.w.bronet.cn/themes/simpleboot3/public/assets/images/jiahao.png"){
anyv authored
567 568
            show_img = '';
        }
anyv authored
569
        thumbnail = $('#thumbnail')[0].src;
4  
anyv authored
570
        if(thumbnail == "http://xkeasy.w.bronet.cn/themes/simpleboot3/public/assets/images/jiahao.png"){
anyv authored
571 572
            thumbnail = '';
        }
anyv authored
573 574 575 576 577 578 579 580 581 582 583 584 585
        book_name = $("input[name='book_name']").val();
        money = $("input[name='money']").val();
        price = $("input[name='price']").val();
        pricing = $("input[name='pricing']").val();
        instr = $('#instr').val();
        book_number = $("input[name='book_number']").val();
        paper = $("input[name='paper']").val();
        book_size = $("input[name='book_size']").val();
        binding = $("input[name='binding']").val();
        author = $("input[name='author']").val();
        press = $("input[name='press']").val();
        press_time = $("input[name='press_time']").val();
        suit = $("input[name='suit']").val();
4  
anyv authored
586
        printing = $("input[name='printing']").val();
5  
anyv authored
587
        zixun_phone = $("input[name='zixun_phone']").val();
anyv authored
588
        grade = $("#grade").text();
anyv authored
589
anyv authored
590
        img0 = $('#img0')[0].src;
4  
anyv authored
591
        if(img0 == "http://xkeasy.w.bronet.cn/themes/simpleboot3/public/assets/images/jiahao.png"){
anyv authored
592 593
            img0 = '';
        }
anyv authored
594
        img1 = $('#img1')[0].src;
4  
anyv authored
595
        if(img1 == "http://xkeasy.w.bronet.cn/themes/simpleboot3/public/assets/images/jiahao.png"){
anyv authored
596 597
            img1 = '';
        }
anyv authored
598
        img2 = $('#img2')[0].src;
4  
anyv authored
599
        if(img2 == "http://xkeasy.w.bronet.cn/themes/simpleboot3/public/assets/images/jiahao.png"){
anyv authored
600 601
            img2 = '';
        }
5  
anyv authored
602 603
        if(book_name!=""&&money!=""&&price!=""&&book_size!=""&&suit!=""&&grade!=""&&(img0!=""||img1!=""||img2!="")&&zixun_phone!=""){
            $.post("{:url('Salesmangoods/Salesman_goods_add')}",{show_img:show_img,thumbnail:thumbnail,book_name:book_name,money:money,price:price,pricing:pricing,instr:instr,book_number:book_number,paper:paper,book_size:book_size,binding:binding,author:author,press:press,press_time:press_time,suit:suit,grade:grade,img0:img0,img1:img1,img2:img2,printing:printing,zixun_phone:zixun_phone},function(data){
anyv authored
604 605 606 607
                if(data == 3){
                    alert('添加失败,业务员书籍不能超过8本');
                }else if(data == 2){
                    alert('佣金不能大于售价');
4  
anyv authored
608
                }else{
anyv authored
609 610 611 612 613
                    if(data){
                        window.location.href = "{:url('salesmangoods/salesman_goods')}";
                    }else{
                        alert('添加失败');
                    }
anyv authored
614
                }
anyv authored
615 616 617 618 619
            });
        }else{
            alert("必填项不能为空")
        }
anyv authored
620 621 622 623 624 625 626
    }


</script>
<script>

    //选择年级
1  
anyv authored
627 628 629 630 631 632 633 634 635 636
//    $(".log_six_select_nianji").click(function(){
//        $(".tx_mask_tongyi").css({
//            display: "block"
//        });
//    })
//    $(".tx_mask_tongyi .three_model_school_name").click(function(){
//        var index = $(this).index();
//        $('.log_six_nianji_contant').text($(this).text()).css("color", "#333");
//        $(".tx_mask_tongyi").hide();
//    })
anyv authored
637
    //取消弹窗
1  
anyv authored
638 639 640 641 642 643
//    $(document).mouseup(function(e) {
//        var _con = $('.tx_maskCon_school');
//        if(!_con.is(e.target) && _con.has(e.target).length === 0) {
//            $('.tx_mask_tongyi').hide()
//        }
//    })
anyv authored
644 645
    //上传图片
4  
anyv authored
646
   /* $(function() {
anyv authored
647 648
        $("#img1_file_img").change(function() {
            var img_size = $(this).get(0).files[0].size;
anyv authored
649
            if(img_size > 1024000) {
anyv authored
650
                alert("上传图片过大,请上传小于1M的图片");
anyv authored
651 652
            } else {
                $.ajaxFileUpload({
anyv authored
653
                    url: '/portal/Personalcenter/image_one_up', //用于文件上传的服务器端请求地址
anyv authored
654
                    secureuri: false, //是否需要安全协议,一般设置为false
anyv authored
655
                    fileElementId: 'img1_file_img', //文件上传域的ID
anyv authored
656 657
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function(data) { //服务器成功响应处理函数
anyv authored
658 659 660 661 662 663
                        $('#show_img').attr("src","/uploads/"+data.data);
                        $(".log_six_add_photo").addClass("log_six_add_photos");
                        $(".log_six_photo_one").addClass("log_six_photo_ones");
                        $(".log_six_add_img").addClass("log_six_add_imgs");
                        $(".log_six_add_title").addClass("log_six_add_titles");
anyv authored
664 665 666 667
                    }
                });
            }
        });
anyv authored
668 669
        $("#img_file_suolue").change(function() {
            var img_size = $(this).get(0).files[0].size;
anyv authored
670
            if(img_size > 1024000) {
anyv authored
671
                alert("上传图片过大,请上传小于1M的图片");
anyv authored
672 673
            } else {
                $.ajaxFileUpload({
anyv authored
674
                    url: '/portal/Personalcenter/image_one_up', //用于文件上传的服务器端请求地址
anyv authored
675
                    secureuri: false, //是否需要安全协议,一般设置为false
anyv authored
676
                    fileElementId: 'img_file_suolue', //文件上传域的ID
anyv authored
677 678
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function(data) { //服务器成功响应处理函数
anyv authored
679 680 681 682
                        $('#thumbnail').attr("src","/uploads/"+data.data);
                        $(".log_two_pi_one").addClass("log_two_pi_ones");
                        $(".log_two_pi_one_p").addClass("log_two_pi_one_ps");
                        $(".log_two_pi_one_icon").addClass("log_two_pi_one_icons");
anyv authored
683 684 685 686
                    }
                });
            }
        });
anyv authored
687 688 689

        $("#img0_file").change(function() {
            var img_size = $(this).get(0).files[0].size;
anyv authored
690
            if(img_size > 1024000) {
anyv authored
691
                alert("上传图片过大,请上传小于1M的图片");
anyv authored
692 693
            } else {
                $.ajaxFileUpload({
anyv authored
694
                    url: '/portal/Personalcenter/image_one_up', //用于文件上传的服务器端请求地址
anyv authored
695
                    secureuri: false, //是否需要安全协议,一般设置为false
anyv authored
696
                    fileElementId: 'img0_file', //文件上传域的ID
anyv authored
697 698
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function(data) { //服务器成功响应处理函数
anyv authored
699 700 701 702
                        $('#img0').attr("src","/uploads/"+data.data);
                        $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                        $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
anyv authored
703 704 705 706
                    }
                });
            }
        });
anyv authored
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745

        $("#img1_file").change(function() {
            var img_size = $(this).get(0).files[0].size;
            if(img_size > 1024000) {
                alert("上传图片过大,请上传小于1M的图片");
            } else {
                $.ajaxFileUpload({
                    url: '/portal/Personalcenter/image_one_up', //用于文件上传的服务器端请求地址
                    secureuri: false, //是否需要安全协议,一般设置为false
                    fileElementId: 'img1_file', //文件上传域的ID
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function(data) { //服务器成功响应处理函数
                        $('#img1').attr("src","/uploads/"+data.data);
                        $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                        $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
                    }
                });
            }
        });

        $("#img2_file").change(function() {
            var img_size = $(this).get(0).files[0].size;
            if(img_size > 1024000) {
                alert("上传图片过大,请上传小于1M的图片");
            } else {
                $.ajaxFileUpload({
                    url: '/portal/Personalcenter/image_one_up', //用于文件上传的服务器端请求地址
                    secureuri: false, //是否需要安全协议,一般设置为false
                    fileElementId: 'img2_file', //文件上传域的ID
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function(data) { //服务器成功响应处理函数
                        $('#img2').attr("src","/uploads/"+data.data);
                        $(".log_six_pictyre_img").addClass("log_six_pictyre_imgs");
                        $(".log_six_pictyre_title").addClass("log_six_pictyre_titles");
                    }
                });
            }
        });
4  
anyv authored
746
    });*/
anyv authored
747 748 749 750
</script>
</body>

</html>