审查视图

public/themes/simpleboot3/portal/salesmangoods/salesman_goods.html 8.4 KB
anyv authored
1 2 3 4 5 6 7 8 9 10 11
<!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>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
</head>
5  
anyv authored
12 13 14 15 16 17
<style>
    .log_five_list_center{
        width: 3.4rem;
        padding-top: 0.04rem;
    }
</style>
anyv authored
18 19 20 21 22 23 24 25 26
<body>
<!-- 弹窗 -->
<div class="tx_mask">
    <div class="tx_maskCon">
        <div class="tx_maskCon2">
            <div class="log_three_model">
                <div class="log_three_model_one" style="padding-bottom: 0.2rem;">
                    <div class="log_three_model_left">价钱</div>
                    <div class="log_three_model_right">
anyv authored
27
                        <input style="width: 2rem;" type="text" placeholder="请输入价钱" value="" id="price" />
anyv authored
28
                    </div>
anyv authored
29
                    <input type="hidden" name="" id="goods_id" value="">
anyv authored
30 31 32 33
                </div>
                <div class="log_three_model_one" style="padding-bottom: 0.2rem;">
                    <div class="log_three_model_left">佣金</div>
                    <div class="log_three_model_right">
anyv authored
34
                        <input style="width: 2rem;" type="text" placeholder="请输入佣金" value="" id="money" />
anyv authored
35 36 37 38
                    </div>
                </div>
            </div>
            <!-- 确定 -->
1  
anyv authored
39
            <div class="tx_maskOk" onclick="moneyedit()" style="cursor: pointer;">确定</div>
anyv authored
40 41 42 43 44 45
        </div>
    </div>
</div>
<div class="log_top_co">
    <!-- 顶部 -->
    <div class=" order_top log_top_co">
5  
anyv authored
46
        <a href="javascript:history.back(-1)">
anyv authored
47 48 49 50 51 52
            <img src="__TMPL__/public/assets/images/left.png" alt="" />
        </a>
        <p>商品管理</p>
    </div>
</div>
<div class="dom">
5  
anyv authored
53
    <volist name="data_goods" id="vo">
5  
anyv authored
54
        <div class="com del{$vo.id}">
anyv authored
55
            <!-- 商品列表 -->
2  
anyv authored
56
            <div class="log_five_list" style="cursor: pointer">
anyv authored
57
                <div class="log_five_list_left">
5  
anyv authored
58
                    <img src="{:cmf_get_image_url($vo.show_img)}" alt="" style="width: 100%;height: 100%;"/>
anyv authored
59
                </div>
anyv authored
60
                <div class="log_five_list_center">
5  
anyv authored
61
                    <div class="log_five_list_center_one txt-cut" style="-webkit-line-clamp: 2; ">
5  
anyv authored
62
                        {$vo.book_name}
anyv authored
63
                    </div>
anyv authored
64
                    <div class="log_four_zong_shu" style="margin-top: 0.16rem">
5  
anyv authored
65
                        <span></span>{$vo.price0}.<span>{$vo.price1}</span>
anyv authored
66
                    </div>
anyv authored
67
                    <div class="log_five_list_center_three">
5  
anyv authored
68
                        销量:{$vo.sales}
anyv authored
69 70
                    </div>
                </div>
2  
anyv authored
71
                <div class="log_five_list_right" style="cursor: pointer">
anyv authored
72
                    <img src="__TMPL__/public/assets/images/shenglve.png" alt="" />
anyv authored
73 74
                </div>
            </div>
anyv authored
75 76 77 78 79 80 81
            <!-- 操作 -->
            <div class="log_five_shanxian">
                <div class="log_five_handle">
                    <div class="log_five_handle_one">
                        <div class="log_five_handle_img">
                            <img src="__TMPL__/public/assets/images/87.png" alt="" />
                        </div>
1  
anyv authored
82
                        <div class="log_five_handle_word log_five_handle_add" onclick="goods_edit({$vo.id})" style="cursor: pointer;">
anyv authored
83 84 85
                            编辑
                        </div>
                    </div>
5  
anyv authored
86
                    <div class="log_five_handle_one" >
anyv authored
87 88 89
                        <div class="log_five_handle_img">
                            <img src="__TMPL__/public/assets/images/86.png" alt="" />
                        </div>
1  
anyv authored
90
                        <div class="log_five_handle_word log_five_handle_del" onclick="goods_del({$vo.id})" style="cursor: pointer;">
anyv authored
91 92 93
                            删除
                        </div>
                    </div>
6  
anyv authored
94
                    <div class="log_five_handle_one" >
anyv authored
95 96 97
                        <div class="log_five_handle_img">
                            <img src="__TMPL__/public/assets/images/85.png" alt="" />
                        </div>
1  
anyv authored
98
                        <div class="log_five_handle_word log_five_handle_up" onclick="move_up({$vo.id})" style="cursor: pointer;">
anyv authored
99 100 101 102 103 104 105
                            上移
                        </div>
                    </div>
                    <div class="log_five_handle_one">
                        <div class="log_five_handle_img">
                            <img src="__TMPL__/public/assets/images/84.png" alt="" />
                        </div>
1  
anyv authored
106
                        <div class="log_five_handle_word log_five_handle_pay" onclick="cost({$vo.id})" style="cursor: pointer;">
anyv authored
107 108
                            费用
                        </div>
anyv authored
109 110 111 112
                    </div>
                </div>
            </div>
        </div>
anyv authored
113
    </volist>
anyv authored
114 115
</div>
<div class="log_seven_btn log_seven_btn9">
anyv authored
116
    <a href="{:url('Salesmangoods/Salesman_goods_add')}">
anyv authored
117 118 119 120
        <div class="log_seven_btn_contant">
            新增商品
        </div>
    </a>
anyv authored
121 122 123 124
</div>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script>
6  
anyv authored
125
    /**
anyv authored
126 127 128 129 130 131 132 133
     * 点击编辑
     */
     function goods_edit(id) {
        window.location.href = "{:url('Salesmangoods/Salesman_goods_edit')}?goods_id="+id;
    }


    /**
6  
anyv authored
134 135 136 137
     * 点击上移
     */
    function move_up(id){
        $.post("{:url('Salesmangoods/goods_move_up')}",{goods_id:id},function(data){
5  
anyv authored
138 139
        });
    }
6  
anyv authored
140
5  
anyv authored
141 142 143 144 145 146 147 148 149 150
    /**
     *点击删除
     */
    function goods_del(id){
        $.post("{:url('Salesmangoods/goods_del')}",{goods_id:id},function(data){
            if(data){
                $('.del'+id).remove();
            }else{
                alert('删除失败!');
            }
6  
anyv authored
151 152
        });
    }
anyv authored
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

    /**
     *费用
     */
    function cost(id){
        $.post("{:url('Salesmangoods/goods_cost')}",{goods_id:id},function(data){
            arr = JSON.parse(data);
            $('#price').val(arr.price);
            $('#money').val(arr.money);
            $('#goods_id').val(arr.id);
        });
    }

    /**
     *费用编辑
     */
    function moneyedit(){
        price = $('#price').val();
        money = $('#money').val();
        goods_id = $('#goods_id').val();
        if(price == ''){
            alert('不能为空');
        }else if(money == ''){
            alert('不能为空');
        }else{
            $.post("{:url('Salesmangoods/moneyedit')}",{price:price,money:money,goods_id:goods_id},function(data){
                if(data){
                }else{
                    alert('保存失败');
                }
            });
        }

    }
6  
anyv authored
188 189
</script>
<script>
anyv authored
190
    $(document).on('click', '.log_five_list_right', function() {
anyv authored
191 192 193 194 195 196 197 198 199
        if($(this).find("img").attr("src") == "__TMPL__/public/assets/images/shenglve.png") {
            $(this).find("img").attr("src", "__TMPL__/public/assets/images/83.png");
            $(this).parents('.com').find('.log_five_shanxian').slideToggle();
        } else {
            $(this).find("img").attr("src", "__TMPL__/public/assets/images/shenglve.png");
            $(this).parents('.com').find('.log_five_shanxian').slideToggle();
        }

        var $up = $(this).parent('.log_five_list').parent(".com").children('.log_five_shanxian').find('.log_five_handle_up');
anyv authored
200
        $up.click(function() {
anyv authored
201 202 203 204 205 206
            console.log(123)
            var index = $(this).closest(".com").index();
            var txt = $(this).closest(".com").html();
            var txt1 = $(this).closest(".com").prev().html();
            var prev = $(this).closest(".com").prev();
            console.log(txt);
anyv authored
207
            if(index == 0) {
anyv authored
208
                alert("已经在最顶端了,不能上移了");
anyv authored
209
                $('.log_five_shanxian').css('display', 'none');
anyv authored
210 211 212 213 214
                return false;
            }

            $(this).closest(".com").html(txt1);
            prev.closest(".com").html(txt);
anyv authored
215 216
            $('.log_five_shanxian').css('display', 'none');
anyv authored
217 218 219 220 221
        })

    });

    // 编辑
anyv authored
222
    $(".log_five_handle_pay").click(function() {
anyv authored
223 224 225 226
        $(".tx_mask").css({
            display: "block"
        });
    });
anyv authored
227
anyv authored
228 229 230 231 232 233 234 235 236
    $(".tx_maskOk").click(function() {
        $(".tx_mask").css({
            display: "none"
        });
    });
</script>
</body>

</html>