审查视图

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


    /**
6  
anyv authored
149 150 151 152
     * 点击上移
     */
    function move_up(id){
        $.post("{:url('Salesmangoods/goods_move_up')}",{goods_id:id},function(data){
5  
anyv authored
153 154
        });
    }
6  
anyv authored
155
5  
anyv authored
156 157 158 159 160 161 162 163 164 165
    /**
     *点击删除
     */
    function goods_del(id){
        $.post("{:url('Salesmangoods/goods_del')}",{goods_id:id},function(data){
            if(data){
                $('.del'+id).remove();
            }else{
                alert('删除失败!');
            }
6  
anyv authored
166 167
        });
    }
anyv authored
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

    /**
     *费用
     */
    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
203 204
</script>
<script>
anyv authored
205
    $(document).on('click', '.log_five_list_right', function() {
anyv authored
206 207 208 209 210 211 212 213 214
        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
215
        $up.click(function() {
anyv authored
216 217 218 219 220 221
            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
222
            if(index == 0) {
anyv authored
223
                alert("已经在最顶端了,不能上移了");
anyv authored
224
                $('.log_five_shanxian').css('display', 'none');
anyv authored
225 226 227 228 229
                return false;
            }

            $(this).closest(".com").html(txt1);
            prev.closest(".com").html(txt);
anyv authored
230 231
            $('.log_five_shanxian').css('display', 'none');
anyv authored
232 233 234 235 236
        })

    });

    // 编辑
anyv authored
237
    $(".log_five_handle_pay").click(function() {
anyv authored
238 239 240 241
        $(".tx_mask").css({
            display: "block"
        });
    });
anyv authored
242
anyv authored
243 244 245 246 247 248 249 250 251
    $(".tx_maskOk").click(function() {
        $(".tx_mask").css({
            display: "none"
        });
    });
</script>
</body>

</html>