addinfo.html 44.4 KB
1 2 3 4 5 6 7 8 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 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 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 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 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 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
<include file="public/layout" />
<script src="__PUBLIC__/static/js/layer/laydate/laydate.js"></script>
<style>
    dd.opt table {
        width: 100%;
    }

    dd.opt tr {
        border: 1px solid #f4f4f4;
        padding: 8px;
    }

    dd.opt tr td {
        border: 1px solid #f4f4f4;
    }

    .btn {
        color: #999;
        cursor: pointer !important;
    }

    .opt table tr th {
        text-align: center;
        font-weight: 600;
        padding: 5px 0;
    }

    select {
        height: 31px;
    }

    .prom_info {
        border: 1px #ddd solid;
        max-width: 1000px;
    }

    .prom_info .prom_top {
        padding: 15px;
        font-size: 0;
        border-bottom: 1px #ddd solid;
    }
    .prom_info .prom_top:last-child {
        border-bottom: 0;
    }

    .prom_info .prom_top .dib_vm {
        display: inline-block;
        *display: inline;
        *zoom: 1;
        width: 0;
        height: 100%;
        vertical-align: middle;
    }

    .prom_info .prom_top .prom_center {
        display: inline-block;
        *display: inline;
        *zoom: 1;
        vertical-align: middle;
        font-size: 12px;
    }

    .prom_info .prom_top .prom_center1 {
        width: 20%;
        text-align: center;
    }

    .prom_info .prom_top .prom_center2 {
        width: 35%;
        text-align: center;
    }

    .prom_info .prom_top .prom_center3 {
        width: 40%;
        padding-left: 5%;
        position: relative;
    }

    .prom_info .prom_top .prom_center3 .close {
        position: absolute;
        right: -5px;
        top: 50%;
        margin-top:-10px;
        z-index: 10;
        font-size: 20px;
    }

    .prom_info .prom_top .prom_center3 li {
        padding: 8px 0;
    }

    .prom_info .prom_top .prom_center3 li .left_span {
        display: inline-block;
        *display: inline;
        *zoom: 1;
        width: 20%;
    }

    .prom_info .prom_top .prom_center3 li .left_span label input {
        margin: -2px 8px 0;
        vertical-align: middle;
    }

    .prom_info .prom_top .prom_center3 li .right_span {
        visibility: hidden;
        display: inline-block;
        *display: inline;
        *zoom: 1;
        width: 65%;
    }

    .prom_info .prom_top .prom_center3 li .right_span select.prom_input {
        width: 100px;
    }

    .prom_info .prom_top .prom_center3 li .right_span img {
        display: inline-block;
        *display: inline;
        *zoom: 1;
        vertical-align: middle;
        margin: -3px 8px 0;
    }

    .prom_input { width: 50px; margin: 0 5px;}
    .prom_center2 .prom_input { width: 100px; margin: 0 8px; }

    .radio1 {
        display: inline-block;
        *zoom: 1;
        *display: inline;
        vertical-align: middle;
        margin: -3px 5px 0;
        width: 19px;
        height: 19px;
        background-image: url("__PUBLIC__/static/images/prom_radio.png");
        background-repeat: no-repeat;
        background-position: center center;
    }

    .radio1.on {
        background-image: url("__PUBLIC__/static/images/prom_radio_on.png");
    }

    .prom_info .prom_bottom {
        padding: 10px 15px;
        border-top: 1px #ddd solid;
    }
    .prom_info_tit{
        border-bottom: 1px #ddd solid;
        padding: 5px 0;
        background-color: #F5F5F5;
    }
    .prom_info_tit span{
        display: inline-block;
        *zoom: 1;
        *display: inline;
        text-align: center;

    }
    .prom_info .prom_bottom .add {
        display: inline-block;
        *zoom: 1;
        *display: inline;
        font-size: 12px;
        line-height: 24px;
        color: #ff3c3c;
        background-color: #FFFFFF;
        height: 24px;
        padding: 2px 7px;
        border: solid 1px #ff3c3c;
        border-radius: 4px;
    }

    .prom_table {
        margin: 30px 0;
        text-align: center;

    }

    .prom_table td {
        padding: 6px 5px;
        max-height: 61px;
        line-height: 30px;
        overflow: hidden;
    }

    .ncap-form-default .input-txt.share, .ncap-form-all .input-txt.share{width:500px !important;}

</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>添加拼单活动</h3>
            </div>
        </div>
    </div>
    <!-- 操作说明 -->
    <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%; min-height: 30px;min-width: 100px;">
        <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span title="收起提示" id="explanationZoom" style="display: block;"></span>
        </div>
        <ul>
            <li>
                <p>1、拼团成功后,才可对订单进行操作申请退款及发货,若拼团失败系统会自动原路退回支付的金额</p>
                <p>2、会员团获得的佣金需要团里的各个订单都为确认收货的状态后才会转入到团长的余额</p>
                <p>3、阶梯团支付定金的人数需达到第1阶梯设置的人数才为拼团成功,开团时长结束后根据支付的人数获取相应的价格到订单里进行支付尾款,支付后商家方可发货,24小时内未支付尾款的,订金由商家决定退或不退。</p>
            </li>
        </ul>
    </div>
    <form class="form-horizontal" id="handleposition" method="post">
        <input type="hidden" id="goods_id" name="goods_id" value="{$info.goods_id}">
        <input type="hidden" name="id" value="{$info.id}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>活动名称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="title" id="title"  maxlength="200"
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           value="{$info.title}" style="width: 400px;">  &nbsp;&nbsp;&nbsp; 排序:  <input type="text" name="ordid" id="ordid"
                                                                                                    onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                                                                                    value="{$info.ordid}" onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                                                                                                    onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="width: 80px;">
                    <span class="err cr"></span>
                    <p class="notic">请填写活动名称,最大200字</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <em>*</em><label>是否启用</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="goods_category1" class="cb-enable <if condition="$info.is_show eq 1">selected</if>">开启</label>
                        <label for="goods_category0" class="cb-disable <if condition="$info.is_show eq 0">selected</if>">关闭</label>
                        <input id="goods_category1" name="is_show" value="1" onkeydown="strkeydown(event, this, 'submitbtn')" type="radio" <if condition="$info.is_show eq 1"> checked="checked"</if>>
                        <input id="goods_category0" name="is_show" value="0" onkeydown="strkeydown(event, this, 'submitbtn')"  type="radio" <if condition="$info.is_show eq 0"> checked="checked"</if>>
                    </div>
                </dd>
            </dl>



            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>推荐理由</label>
                </dt>
                <dd class="opt">
                    <textarea class="txtBox" name="tj_reason" style="width: 400px; height: 60px;">{$info.tj_reason}</textarea>
                    <span class="err cr"></span>

                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>预热时间</label>
                </dt>
                <dd class="opt">
                    <input type="text" id="show_time" name="show_time"
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           <if condition="$is_start">readonly disabled="disabled"</if>
                           value="{$info.show_time}"  class="input-txt">
                    <span class="err cr"></span>
                    <p class="notic">日期为空,默认提前24小时预热  </p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>活动时间</label>
                </dt>
                <dd class="opt">
                    <input type="text" id="start_time" name="start_time"
                           <if condition="$is_start">readonly disabled="disabled"</if>
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           value="{$info.start_time}"  class="input-txt">  至   <input type="text" id="end_time" name="end_time"
                                                                                      onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                                                                      <if condition="$is_start">readonly disabled="disabled"</if>
                                                                                      value="{$info.end_time}" class="input-txt">
                    <span class="err cr"></span>

                </dd>
            </dl>

            <dl class="row">
                <dt class="tit"><em>*</em>团类型</dt>
                <dd class="opt">

                    <if condition="$Think.request.id">
                        <if condition="$info[kttype] eq 1">商家团</if>
                        <if condition="$info[kttype] eq 2">会员团</if>
                        <if condition="$info[kttype] eq 3">阶梯团</if>
                        <input  type="hidden" name="kttype" value="{$info[kttype]}" />

                    <else/>
                        <input id="kttype1" type="radio" name="kttype" value="1" onclick="kttype_con(1)"
                        <if condition="$info[kttype] eq 1"> checked </if>><label for="kttype1">商家团</label>
                        <input id="kttype2" type="radio" name="kttype" value="2" onclick="kttype_con(2)"
                        <if condition="$info[kttype] eq 2"> checked </if>><label for="kttype2">会员团</label>
                        <input id="kttype3" type="radio" name="kttype" value="3" onclick="kttype_con(3)"
                        <if condition="$info[kttype] eq 3"> checked </if>><label for="kttype3">阶梯团</label>
                    </if>
                </dd>
            </dl>


            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>活动规则</label>
                </dt>
                <dd class="opt">
                    <textarea id="text_gui_ze" class="txtBox" name="remark" style="width: 400px; height: 120px;">{$info.remark|default="1)用户选择好所要参团的商品,进入开团页面,支付完成参团成功\n2)参团成功后,请在商家指定的时间内把拼团分享页面分享给好友或朋友圈\n3)在商家指定的时间内满足拼团人数则拼团成功\n4)例:成团人数5人,在商家指定的时间只有3人参与拼团则拼团失败,系统会自动原路返还支付的金额,若同时有8人参与拼团,则系统会自动判断5人为一团,成团后即可发货,其他3人会自动生成一团,待满5人后才可成团"}</textarea>
                    <span class="err cr"></span>

                </dd>
            </dl>


            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>选择参团商品</label>
                </dt>
                <dd class="opt">
                    <if condition="$is_start">
                        {$info.goods_name}
                    <else/>
                        <input type="text" readonly  id="goods_name"
                               onkeydown="strkeydown(event, this, 'sumbitbtn')"
                               name="goods_name" value="{$info.goods_name}" class="input-txt">
                        <span class="err cr"></span>
                        <p class="notic">
                            <a onclick="selectGoods()" class="ncap-btn"><i class="fa fa-search"></i>选择商品</a>
                        </p>
                    </if>
                </dd>
            </dl>


            <!--参团价格和人数-->
            <dl class="row teamprice" style="<if condition='$info.kttype eq 3'>display:none</if>">
                <dt class="tit normol_tit">
                    <label><em>*</em>参团价格</label>
                </dt>
                <dd class="opt">
                    <input type="text" id="price" name="price" value="{$info.price}"
                           onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           <if condition="$is_start">readonly disabled="disabled"</if>
                           onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" style="width: 80px;"> 元
                    &nbsp;&nbsp;
                    &nbsp;&nbsp;&nbsp;成团人数:  <input type="text" id="ct_num" name="ct_num" value="{$info.ct_num}"
                                                    onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                                    onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                                                    onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
                                                    <if condition="$is_start">readonly disabled="disabled"</if>
                                                    style="width: 80px;">人&nbsp;
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>总库存量</label>
                </dt>
                <dd class="opt"><input type="text" name="goods_num" id="goods_num"
                                                     onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                                     value="{$info.goods_num}" onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                                                     onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
                                                     <if condition="$is_start">readonly disabled="disabled"</if>
                                                     style="width: 80px;">件
                    &nbsp;&nbsp;&nbsp;参团起购数:  <input type="text" id="minbuynum" name="minbuynum" value="{$info.minbuynum|default=1}"
                                                     onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                                     onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                                                     onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
                                                     <if condition="$is_start">readonly disabled="disabled"</if>
                                                     style="width: 80px;">件
                    &nbsp;&nbsp;&nbsp;限购数量:  <input type="text" id="buy_limit" name="buy_limit" value="{$info.buy_limit|default=1}"
                                                    onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                                    onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                                                    onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
                                                     <if condition="$is_start">readonly disabled="disabled"</if>
                                                    style="width: 80px;">件
                </dd>
            </dl>

            <dl class="row dn" id="typeshow2">
                <dt class="tit">团长优惠</dt>
                <dd class="opt">
                    <input id="tz_yhjgtype1" type="radio"
                    <if condition="$is_start">readonly disabled="disabled"</if>
                    name="tz_yhjgtype" value="1" onclick="yhjg_con(1)"
                    <if condition="$info[tz_yhjgtype] eq 1"> checked </if>><label for="tz_yhjgtype1">无优惠</label>

                    <input id="tz_yhjgtype2" type="radio"
                    <if condition="$is_start">readonly disabled="disabled"</if>
                    name="tz_yhjgtype" value="2" onclick="yhjg_con(2)"
                    <if condition="$info[tz_yhjgtype] eq 2"> checked </if>><label for="tz_yhjgtype2">免单</label>

                    <input id="tz_yhjgtype3" type="radio"
                    <if condition="$is_start">readonly disabled="disabled"</if>
                    name="tz_yhjgtype" value="3" onclick="yhjg_con(3)"
                    <if condition="$info[tz_yhjgtype] eq 3"> checked </if>><label for="tz_yhjgtype3">佣金</label>

                   <span  id="divyyhjg" <if condition='$info[tz_yhjgtype] neq 3'>style="display:none"</if>> <input type="text" id="tz_yyhjg" name="tz_yyhjg" value="{$info.tz_yyhjg}"
                           onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           onkeyup="this.value=this.value.replace(/[^\d.]/g,'')"
                                                <if condition="$is_start">readonly disabled="disabled"</if>
                                                style="width: 80px;"> 元</span>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>单团开团时长</label>
                </dt>
                <dd class="opt">

             <input type="text" name="kt_time" id="dt_time"
                                             onkeydown="strkeydown(event, this, 'sumbitbtn')"
                                             value="{$info.kt_time|default=24}" onpaste="this.value=this.value.replace(/[^\d]/g,'')"
                                             onkeyup="this.value=this.value.replace(/[^\d]/g,'')"
                    <if condition="$is_start">readonly disabled="disabled"</if>
                    style="width: 80px;">小时
                </dd>
            </dl>
            <dl class="row dn" id="typeshow3">
                <dt class="tit">
                    <label><em>*</em>定金</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="yf_price" id="yf_price"
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           value="{$info.yf_price}" onpaste="this.value=this.value.replace(/[^\d.]/g,'')"
                           onkeyup="this.value=this.value.replace(/[^\d.]/g,'')"
                    <if condition="$is_start">readonly disabled="disabled"</if>
                           style="width: 80px;">元
                </dd>
            </dl>
            <dl class="row dn" id="typeshow3_1">
                <dt class="tit">
                    <label><em>*</em>阶梯设置</label>
                </dt>
                <dd class="opt">
                    <div class="prom_info">
                        <div class="prom_info_tit"><span style="width: 20%">层级</span><span style="width: 20%">小于等于</span><span style="width: 40%;padding-left: 5%">拼团价</span></div>
                        <empty name="list">
                            <div class="prom_top" id="tab0">

                                <div class="prom_center prom_center1">
                                    1
                                </div>
                                <div class="prom_center prom_center2">
                                    <input class="prom_input first" type="text" name="data[0][rynum]" value=""
                                            onkeyup="check_num(this,0)"
                                    <if condition="$is_start">readonly disabled="disabled"</if>
                                           autocomplete="off">人

                                </div>
                                <div class="prom_center prom_center3">


                                             <input class="prom_input" name="data[0][price]" type="text" value="0" autocomplete="off"
                                    <if condition="$is_start">readonly disabled="disabled"</if>
                                                    onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">元


                                </div>
                                <div class="clear"></div>
                            </div>


                            <else/>
                            <volist name="list" id="vo" key="k">
                                <div class="prom_top" id="tab{$k-1}">
                                    <div class="prom_center prom_center1">{$k}</div>
                                    <div class="prom_center prom_center2 ">
                                        <input class="prom_input first"
                                              <if condition="$is_start">readonly disabled="disabled"</if>
                                               type="text" value="{$vo.rynum}"
                                                autocomplete="off" name="data[{$k-1}][rynum]"
                                               onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')">人

                                    </div>
                                    <div class="prom_center prom_center3">
                                        <empty name="tpl">
                                            <if condition="$k neq 1">
                                                <if condition="$is_start">
                                                <else/>
                                                    <div class="close fa fa-trash-o" onclick="tab_del(this)"></div>
                                                </if>


                                            </if>
                                        </empty>

                                        <input class="prom_input" name="data[{$k-1}][price]" type="text"
                                               <if condition="$is_start">readonly disabled="disabled"</if>
                                               autocomplete="off"
                                               onkeyup="this.value = this.value.replace(/^(\d+)\.(\d{3})/,'')" value="{$vo.price}">元


                                    </div>
                                    <div class="clear"></div>
                                </div>
                            </volist>
                        </empty>

                        <if condition="$is_start">
                        <else/>
                            <div class="add_div_set"></div>
                            <empty name="tpl">
                                    <div class="prom_bottom <if condition="count($list) eq 5">dn</if>">
                                        <a href="javascript:void(0);" onclick="add_tab()">
                                            <div class="add" title="新增阶梯">
                                                <span><i class="fa fa-plus"></i>新增阶梯</span>
                                            </div>
                                        </a>
                                        <span>(最多可设置五个层级,每级阶人数不重复)</span>
                                    </div>
                            </empty>

                        </if>
                    </div>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>分享标题:</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="share_title" id="share_title"  maxlength="200"
                           onkeydown="strkeydown(event, this, 'sumbitbtn')"
                           value="{$info.share_title}" class="input-txt">  &nbsp;&nbsp;&nbsp;
                    <span class="err cr"></span>
                    <p class="notic">请填写分享标题</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>分享描述</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="input-txt share" name="share_remark" id="share_remark" value="{$info.share_remark}"></input>
                    <span class="err cr"></span>
                    <p class="notic">请填写分享描述</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>分享图片</label>
                </dt>
                <dd class="opt">
                    <div class="ncsc-goods-default-pic">
                        <div class="goodspic-uplaod">
                            <div style="">
                                <img id="img_url2" style="width: 240px; border:#eee solid 1px"
                                     src="{:getImg($info.share_imgurl,'__PUBLIC__/images/default_goods_image_240.gif')}"
                                     onmouseover="layer.tips('<img src='+this.src+'>',this, {tips: [1, '#fff']});"
                                     onmouseout="layer.closeAll();">
                            </div>
                            <input type="hidden" id="share_imgurl" name="share_imgurl" class="type-file-text"
                                   value="{$info.share_imgurl}">
                            <p class="hint">请上传图片格式文件,<Font color="red">大小建议为:300*300像素。</Font></p>
                            <if condition="$tpl neq show">
                                <div class="handle">
                                    <div class="ncsc-upload-btn">
                                        <a onClick="GetUploadify_new(1,'share_imgurl','team','{$erpid}','teamlist','id','share_imgurl','{$info.id}','img_call_back')">
                                            <p><i class="icon-upload-alt"></i>图片上传</p>
                                        </a>
                                    </div>
                                </div>
                            </if>

                        </div>
                    </div>

                </dd>
            </dl>



            <dl class="row dn">
                <dt class="tit">
                    <label for="is_autowx"><em>*</em>是否自动推送</label>
                </dt>
                <dd class="opt">
                    <div class="onoff" id="is_autowx">
                        <label for="is_autowx1" class="cb-enable <if condition="$info[is_autowx] eq 1">selected</if>">是</label>
                        <label for="is_autowx1" class="cb-disable <if condition="$info[is_autowx] eq 0">selected</if>">否</label>
                        <input id="is_autowx1" name="is_autowx" value="1"
                               onkeydown="strkeydown(event, this, 'submitbtn')"
                               type="radio" <if condition="$info[is_autowx] eq 1"> checked="checked"</if>>
                        <input id="is_autowx0" name="is_autowx" value="0"
                               onkeydown="strkeydown(event, this, 'submitbtn')"
                               type="radio" <if condition="$info[is_autowx] eq 0"> checked="checked"</if>>
                    </div>
                    <p class="notic">启用后在活动前一天及结束前一天会自动通过微信推送消息给会员</p>
                </dd>
            </dl>

            <neq name="info.is_end" value="1">
              <div class="bot"><a id="sumbitbtn" onclick="adsubmit()" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
            </neq>
        </div>
        <input type="hidden" id="actno" name="actno" value="{$info['actno']}">
    </form>
    <input type="hidden" id="storecount" value="{$storecount}">
    <input type="hidden" id="goods_price" value="{$info['goods_price']}">
    <input type="hidden" id="qclurl" value="{$qclurl}">

</div>
<script type="text/javascript">

    var selectgoodnum=0;
    $(document).ready(function(){
        $('#start_time').layDate();
        $('#end_time').layDate();
        $('#show_time').layDate();


        var getkttype={$info["kttype"]};
        kttype_con(getkttype);

    })
    function adsubmit(){

        layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
        if($('#title').val() ==''){
		    $('#title').parent().find("span").text("标题不能为空");
            layer.msg('标题不能为空',{icon:2,time:1000});
			 $('#title').focus();
			return;
        }

        if($('#goods_name').val() ==''){
            $('#goods_name').parent().find("span").text("商品不能为空");
            $('#goods_name').focus();
            layer.msg('商品不能为空',{icon:2,time:1000});return;
        }


        if($('#goods_num').val() ==''){
            $('#goods_num').parent().find("span").text("总库存量数量不能为空");
            $('#goods_num').focus();
            layer.msg('参加拼团数量不能为空',{icon:2,time:1000});return;
        }

        if(parseFloat($('#goods_num').val())<=0){
            $('#goods_num').parent().find("span").text("总库存量数量必须大于0");
            $('#goods_num').focus();
            layer.msg('参加拼团数量必须大于0',{icon:2,time:1000});return;
        }


        selectgoodnum=parseInt($("#storecount").val());
        //alert(selectgoodnum+":"+$('#goods_num').val());
        if(parseFloat($('#goods_num').val())>selectgoodnum){
            $('#goods_num').parent().find("span").text("总库存量不能大于商品的库存数量!");
            $('#goods_num').focus();
            layer.msg('总库存量数量大于商品库存数量',{icon:2,time:1000});return;
        }

        var g_price=parseFloat($('#goods_price').val());
        var type=$("input[name='kttype']:checked").val();
        if(type==null){type="{$info.kttype}";}
        if(type!="3") {

            if($('#price').val() ==''){
                $('#price').parent().find("span").text("参团价格不能为空");
                $('#price').focus();
                layer.msg('参团价格不能为空',{icon:2,time:1000});return;
            }

            if(parseFloat($('#price').val())<=0){
                $('#price').parent().find("span").text("参团价格必须大于0");
                $('#price').focus();
                layer.msg('参团价格必须大于0',{icon:2,time:1000});return;
            }

            if(parseFloat($('#price').val())>g_price){
                $('#price').parent().find("span").text("参团价格不得高于手店价");
                $('#price').focus();
                layer.msg('参团价格不得高于手店价',{icon:2,time:1000});return;
            }

            if ($('#ct_num').val() == '') {
                $('#ct_num').focus();
                layer.msg('成团人数不能为空', {icon: 2, time: 1000});
                return;
            }
            if (parseFloat($('#ct_num').val()) <= 0) {
                $('#ct_num').focus();
                layer.msg('成团人数必须大于0', {icon: 2, time: 1000});
                return;
            }
        }else{

            if($('#yf_price').val()=="" ){
                $('#yf_price').parent().find("span").text("定金必须大于0");
                $('#yf_price').focus();
                layer.msg('定金必须大于0',{icon:2,time:1000});return;
            }

            if(parseFloat($('#yf_price').val())<=0){
                $('#yf_price').parent().find("span").text("定金必须大于0");
                $('#yf_price').focus();
                layer.msg('定金必须大于0',{icon:2,time:1000});return;
            }
            if(parseFloat($('#yf_price').val())>g_price){
                $('#yf_price').parent().find("span").text("yf_price不得高于手店价");
                $('#yf_price').focus();
                layer.msg('yf_price不得高于手店价',{icon:2,time:1000});return;
            }


            var yf_price=parseFloat($('#yf_price').val());

            var isok=1; var text="";
            //阶梯团要确保里面是数字要填写
            $(".prom_top").each(function () {
                 //级数
                 var lev=parseInt($(this).find('.prom_center1').text());

                 var vl=$(this).find('.prom_center2').find('input').val();
                 if(vl==''){
                     text="阶梯数量不能为空";
                     isok=0; return false;
                 }
                 vl=parseFloat(vl)
                 if(vl<=0)
                 {
                    text="阶梯数量不能为0";
                    isok=0; return false;
                 }

                 var  vl2=$(this).find('.prom_center3').find('input').val()
                 if(vl2==''){
                    text="阶梯价格不能为空";
                    isok=0; return false;
                 }
                 vl2=parseFloat(vl2);
                 if(vl2<=0){
                    text="阶梯价格要大于0";
                    isok=0; return false;
                 }

                 if(vl2>g_price){
                     text="阶梯价格不能大于手店价";
                     isok=0; return false;
                 }
                 if(vl2<=yf_price){
                    text="阶梯价格不能小于定金";
                    isok=0; return false;
                 }

                 //当级数大于1时,要计算级数之间的关系
                 if(lev>1){
                     lev=lev-2;
                     var tabname="#tab"+lev;
                     var vl_l=parseFloat($(tabname).find('.prom_center2').find('input').val());
                     var vl2_l=parseFloat($(tabname).find('.prom_center3').find('input').val());
                     if(vl<=vl_l){
                         text="阶梯数量必须大于前一级";
                         isok=0; return false;
                     }
                     if(vl2>=vl2_l){
                         text="阶梯价格必须小于前一级";
                         isok=0; return false;
                     }
                 }

            });
            if(isok==0){
                layer.msg(text,{icon:2,time:1000});
                return;
            }
        }


        if($('#minbuynum').val() ==''){
            $('#minbuynum').parent().find("span").text("参团起购不能为空");
            $('#minbuynum').focus();
            layer.msg('参团起购不能为空',{icon:2,time:1000});return;
        }

        if(parseFloat($('#minbuynum').val())<=0){
            $('#minbuynum').parent().find("span").text("参团起购数必须大于0");
            $('#minbuynum').focus();
            layer.msg('参团起购数必须大于0',{icon:2,time:1000});return;
        }

        if(parseFloat($('#minbuynum').val())>parseFloat($('#goods_num').val())){
            $('#minbuynum').parent().find("span").text("参团起购数要低于总库存数量");
            $('#minbuynum').focus();
            layer.msg('参团起购数要低于总库存数量',{icon:2,time:1000});
            return;
        }

        if($('#buy_limit').val() ==''){
		    $('#buy_limit').parent().find("span").text("限购数量不能为空");
			$('#buy_limit').focus();
            layer.msg('限购数量不能为空',{icon:2,time:1000});return;
        }

        if(parseFloat($('#buy_limit').val())<=0){
            $('#buy_limit').parent().find("span").text("限购数量必须大于0");
            $('#buy_limit').focus();
            layer.msg('限购数量必须大于0',{icon:2,time:1000});return;
        }

        if(parseFloat($('#buy_limit').val())<parseFloat($('#minbuynum').val())){
            $('#buy_limit').parent().find("span").text("限购数量不能小于起购数");
            $('#buy_limit').focus();
            layer.msg('限购数量不能小于起购数',{icon:2,time:1000});return;
        }

        var yudate = new Date($('#show_time').val().replace(/-/g,"/"));
        var startdate = new Date($('#start_time').val().replace(/-/g,"/"));
        var enddate = new Date($('#end_time').val().replace(/-/g,"/"));

        if(startdate<=yudate)
        {
            $('#start_time').parent().find("span").text("开始时间必须大于预热时间");
            layer.msg('开始时间必须大于预热时间',{icon:2,time:1000});return;
        }

        if(enddate <= startdate)
        {
            $('#end_time').parent().find("span").text("结束时间必须大于开始时间");
            layer.msg('结束时间必须大于开始时间',{icon:2,time:1000});return;
        }

        var share_title=$('#share_title').val();
        if(share_title==""){
            $('#share_title').parent().find("span").text("请填写分享标题");
            $('#share_title').focus();
            layer.msg('请填写分享标题',{icon:2,time:1000});return;
        }

        share_title=$('#share_remark').val();
        if(share_title==""){
            $('#share_remark').parent().find("span").text("请填写分享描述");
            $('#share_remark').focus();
            layer.msg('请填写分享描述',{icon:2,time:1000});return;
        }

        share_title=$('#share_imgurl').val();
        if(share_title==""){
            $('#share_imgurl').parent().find("span").text("请选择分享图片");
            $('#share_imgurl').focus();
            layer.msg('请选择分享图片',{icon:2,time:1000});return;
        }

        $("input[type='text']").removeAttr('disabled');
        $('#handleposition').submit();
    }
    function selectGoods(){
        var url = "{:U('team/search_goods',array('tpl'=>'select_goods'))}";
        layer.open({
            type: 2,
            title: '选择商品',
            shadeClose: true,
            shade: 0.2,
            area: ['96%', '80%'],
            content: url,
        });
    }
    //    上传图片回调
    function img_call_back(fileurl_tmp) {
        var getqclurl = $("#qclurl").val();
        $("#share_imgurl").val(fileurl_tmp);
        $("#img_url2").attr('src', getqclurl + fileurl_tmp);
    }

    function call_back(goods_id,goods_name,store_count,price){
        $('#goods_id').val(goods_id);
        $('#goods_name').val(goods_name);
        $('#share_title').val(goods_name);
        $('#storecount').val(store_count);
        $('#price').val(price);
        $('#goods_price').val(price);
        $('#goods_num').val(store_count);

        var ty=$('input[name="kttype"]:checked').val();
        if(ty!="3") {
            $("#price").focus();
        }else{
            $("#goods_num").focus();
        }

        layer.closeAll('iframe');
    }


    function  yhjg_con(type) {
        switch (type)
        {
            case 1:
                $("#divyyhjg").hide();
                $("#tz_yyhjg").val("0");
                break;
            case 2:
                $("#divyyhjg").hide();
                $("#tz_yyhjg").val($("#price").val());
                break;
            case 3:
                $("#divyyhjg").show();
                $("#tz_yyhjg").val("");
                break;
        }
    }


    function  kttype_con(type) {
        var id="{$Think.request.id}";
        switch (type)
        {
            case 1:
                $("#typeshow2").hide();
                $("#typeshow3").hide();
                $("#typeshow3_1").hide();
                $('.teamprice').show();

                if(id=="") {

                    var text = "1)用户选择好所要参团的商品,进入开团页面,支付完成参团成功\n2)参团成功后,请在商家指定的时间内把拼团分享页面分享给好友或朋友圈\n3)在商家指定的时间内满足拼团人数则拼团成功\n4)例:成团人数5人,在商家指定的时间只有3人参与拼团则拼团失败,系统会自动原路返还支付的金额,若同时有8人参与拼团,则系统会自动判断5人为一团,成团后即可发货,其他3人会自动生成一团,待满5人后才可成团";

                    $("#text_gui_ze").val(text);
                }

                break;
            case 2:
                $("#typeshow2").show();
                $("#typeshow3").hide();
                $("#typeshow3_1").hide();
                $('.teamprice').show();

                if(id=="") {

                    var text = "1)用户选择好所要拼团的商品,进入开团页面,支付完成开团成功\n2)开团成功后,请在商家指定的时间内把拼团分享页面分享给好友或朋友圈\n3)若商家有设置免单或分佣,当该团成团且团里的成员都确认收货后,团长可获得相应的免单或分佣金额;\n4)分佣金额会转入余额,可在线上购物时抵用或进行提现。\n5)例:商品价格50元,佣金为5元,要3个人成团,若设置免单则团长可获得50元的奖励,若设置分佣则团长可获得5元,团长开团按50元进行支付后分享好友参团,成团后团里的3人都进行确认收货后,团长即可获得相应奖励。";
                    $("#text_gui_ze").val(text);
                }

                break;
            case 3:
                $("#typeshow3").show();
                $("#typeshow3_1").show();
                $("#typeshow2").hide();
                $('.teamprice').hide();

                if(id=="") {
                    var text = "1)用户选择好所要拼团的商品,进入开团页面,支付定金开团成功\n2)开团成功后,请在商家指定的时间内把拼团分享页面分享给好友或朋友圈\n3)商家指定的时间过后,根据参团的人数判断是否成团,若成团则获取相应的阶梯价格,买家需在24小时之内支付尾款\n4)例:2个人1阶梯(10元),4个人1阶梯(8元),商家指定的成团时间过后若只有1人参与则拼团失败,系统自退订金,若有3个人参与,则以10元的价格出售,如果有1人不支付尾款,商家有权退或不退定金。";

                    $("#text_gui_ze").val(text);
                }

                break;
        }
    }
    //    活动卡删除事件
    function tab_del(obj) {
        if ($(obj).prev().val() > 0) {
            $.ajax({
                url: "{:U('Presale/tab_del')}",
                type: 'POST',
                data: {id: $(obj).prev().val()},
                dataType: 'json',
                beforeSend: function () {
                    load = layer.load(2);
                },
                success: function () {
                    layer.close(load);
                    layer.msg('删除成功',{icon:1,time: 1000});
                }
            });
        }
        $('.prom_bottom').show();
        $(obj).parent().parent().remove();
    }


    //    活动卡添加
    function add_tab() {
        for (var i = 0; i < 5; i++) {
            if (!document.getElementById("tab" + i)) {
                $('#tab' + (i - 1) + '').after('<div class="prom_top" id="tab' + i + '"><div class="prom_center prom_center1">' + (i + 1) + '</div>' +
                    '<div class="prom_center prom_center2"><input class="prom_input first" type="text" name="data[' + i + '][rynum]" value="0" autocomplete="off" onkeyup="check_num(this,0)">人 </div> <div class="prom_center prom_center3">' +
                    '<div class="close fa fa-trash-o" onclick="tab_del(this)"></div><span class="right_span"><input class="prom_input" name="data[' + i + '][price]" type="text" value="0" autocomplete="off" onkeyup="this.value=this.value.replace(/^(\\d+)\.(\\d{3})/,\'\')">元<span class="cr dn">请输入正确的值</span></span>' +
               
                    '</div><div class="clear"></div></div>');
                break;
            }
        }
        if (document.getElementById("tab4")) {
            $('.prom_bottom').hide();
        }
        add_tab_type('.select_syn:first');
    }


</script>
</body>
</html>