审查视图

public/themes/simpleboot3/portal/goodsdetails/goods_details.html 11.5 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/base.css">
</head>
1  
anyv authored
12 13 14 15 16 17 18 19 20 21
<style>
    .de_main4ParaCon p{
        width: 2.8rem;
        font-size: 0.28rem;
        cursor: pointer;
        margin-bottom: 0.08rem;
        color: rgba(102, 102, 102, 1);
        text-align: left;
    }
</style>
anyv authored
22 23 24 25
<body>
<div class="detail_box">
    <!-- 顶部 -->
    <div class="detail_top order_top">
anyv authored
26
        <a href="javascript:history.go(-1)">
anyv authored
27 28
            <img src="__TMPL__/public/assets/images/left2.png" alt="">
        </a>
anyv authored
29
        <p style="color:white">商品详情</p>
anyv authored
30 31 32 33 34
    </div>
    <!-- banner 顶部 -->
    <div class="de_top">
        <!-- 图片 -->
        <div class="de_topImg">
anyv authored
35
            <img src="{:cmf_get_image_url($data.show_img)}" alt="">
anyv authored
36 37 38 39 40
        </div>
        <!-- 文字 -->
        <div class="de_topTxt">
            <!-- 价格 -->
            <div class="de_topTxt1">
anyv authored
41 42
                <p class="de_topTxt1_1"><span>{$data.price0}</span>.{$data.price1}</p>
                <p class="de_topTxt1_2"><span>{$data.pricing0}</span>.{$data.pricing1}</p>
anyv authored
43 44
            </div>
            <!-- 名字 -->
anyv authored
45
            <div class="de_topTxt2 txt-cut">{$data.book_name}</div>
anyv authored
46 47
            <!-- 其他 -->
            <div class="de_topTxt3">
anyv authored
48 49 50
                <span>作者:{$data.author}</span>
                <span>适合年级:{$data.grade}</span>
                <span>销量:{$data.sales}</span>
anyv authored
51 52 53 54 55 56 57 58
            </div>
        </div>
    </div>
    <!-- 出版 -->
    <div class="de_main2">
        <ul class="de_main2_1">
            <li>
                <p class="de_main2Txt1">出版社</p>
anyv authored
59
                <span class="de_main2Txt2">{$data.press}</span>
anyv authored
60 61 62 63
                <img class="de_main2Img" src="__TMPL__/public/assets/images/29.png" alt="">
            </li>
            <li>
                <p class="de_main2Txt1">出版时间</p>
anyv authored
64
                <span class="de_main2Txt2">{$data.press_time}</span>
anyv authored
65 66 67 68 69 70
                <img class="de_main2Img" src="__TMPL__/public/assets/images/29.png" alt="">
            </li>
        </ul>
        <!-- 提示 -->
        <div class="de_main2_2">
            <ul>
anyv authored
71 72 73
                <volist name="data_label" id="vo">
                    <li>{$vo.name}</li>
                </volist>
anyv authored
74 75 76 77
            </ul>
        </div>
    </div>
    <!-- 相关推荐 -->
anyv authored
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
    <if condition="$is_recomm eq 1">
        <div class="de_main3">
            <div class="de_main3Tiele"><span>相关推荐</span></div>
            <ul class="de_main3_list">
                <volist name="data_recomm" id="vo">
                    <a href="{:url('Goodsdetails/Goods_details',array('goods_id'=>$vo.id))}">
                        <li>
                            <div class="de_main3Img">
                                <img src="{:cmf_get_image_url($vo.show_img)}" alt="">
                            </div>
                            <p class="one-txt-cut">{$vo.book_name}</p>
                        </li>
                    </a>
                </volist>
            </ul>
        </div>
    </if>
anyv authored
95 96
    <!-- 商品详情 -->
    <div class="de_main4">
anyv authored
97
        <div class="de_main3Tiele"><span>商品详情</span></div>
anyv authored
98 99 100 101 102
        <!-- 参数 -->
        <div class="de_main4Parameter">
            <h1>基本信息:</h1>
            <ul class="de_main4ParaCon">
                <li>
anyv authored
103 104
                    <p>书号:{$data.book_number}</p>
                    <p>开本:{$data.book_size}</p>
anyv authored
105 106
                </li>
                <li>
anyv authored
107 108
                    <p>纸张:{$data.paper}</p>
                    <p>印刷:{$data.printing}</p>
anyv authored
109 110
                </li>
                <li>
anyv authored
111 112
                    <p>装订:{$data.binding}</p>
                    <p>套装:{$data.suit}</p>
anyv authored
113 114 115 116 117
                </li>
            </ul>
        </div>
        <!-- 图片 -->
        <div class="de_main4Img">
anyv authored
118 119 120
            <volist name="det_img" id="vo">
                <img src="{:cmf_get_image_url($vo)}" alt="">
            </volist>
anyv authored
121 122 123 124
        </div>
    </div>
    <!-- 精彩推荐 -->
    <div class="de_main5">
anyv authored
125 126
        <div class="de_main5Tit">商品说明</div>
        <div class="de_main5Con">{$data.instr}</div>
anyv authored
127 128 129 130
    </div>

    <!-- 底部 -->
    <div class="de_footer">
anyv authored
131
        <if condition="$is_collect eq 1">
2  
anyv authored
132
            <div class="de_footerLeft" >
anyv authored
133 134
                <div class="de_footerLeftLi collection" style="margin-top: 0.1rem" >
                    <div class="de_footerLeftImg" onclick="goods_collection({$data.id})">
anyv authored
135 136 137
                        <img src="__TMPL__/public/assets/images/26.png" alt="" id="imgsss">
                    </div>
                    <p id="shoucang">收藏</p>
anyv authored
138
                </div>
anyv authored
139 140 141
            </div>
            <else/>
            <div class="de_footerLeft">
anyv authored
142
                <div class="de_footerLeftLi collection">
5  
anyv authored
143
                    <div class="de_footerLeftImg" onclick="cancel_goods_collection({$data.id})">
anyv authored
144 145 146 147 148 149 150 151 152 153 154 155
                        <img src="__TMPL__/public/assets/images/xin (1).png" alt="">
                    </div>
                    <p>已收藏</p>
                </div>
            </div>
        </if>
        <div class="de_footerLeft">
            <div class="de_footerLeftLi" onclick="go_to_car()">
                <div class="de_footerLeftImg" style="width: 0.45rem;height: 0.45rem;">
                    <img src="__TMPL__/public/assets/images/17.png" alt="">
                </div>
                <p>购物车</p>
anyv authored
156 157 158
            </div>
        </div>
        <div class="de_footerRight">
5  
anyv authored
159
            <div class="de_footerRight1" onclick="add_cart({$data.id})">加入购物车</div>
anyv authored
160
            <div class="de_footerRight2" onclick="buy_now({$data.id})">立即购买</div>
anyv authored
161 162 163 164
        </div>
    </div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
4  
anyv authored
165
<script src="__TMPL__/public/assets/js/jquery.js"></script>
anyv authored
166
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
1  
anyv authored
167 168 169 170 171
<script>
    wx.config({$jssdk});
    wx.ready(function () {
        wx.onMenuShareAppMessage({
            title: '学考无忧',
anyv authored
172
            desc: "{$data.book_name}",
1  
anyv authored
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
            link: '{$url}',
            imgUrl: "{:cmf_get_image_url($data.show_img)}", // 分享图标
            type: 'link', // 分享类型,music、video或link,不填默认为link
            dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
            success: function (res) {

                alert('分享成功');

                //分享成功返回信息
            },
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        });
        wx.onMenuShareTimeline({
            title: '学考无忧',
5  
anyv authored
189
            desc: "{$data.book_name}",
1  
anyv authored
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
            link: '{$url}',
            imgUrl: "{:cmf_get_image_url($data.show_img)}", // 分享图标
            type: 'link', // 分享类型,music、video或link,不填默认为link
            dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
            success: function (res) {

                alert('分享成功');
                //分享成功返回信息
            },
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        });
    });
</script>
5  
anyv authored
205 206
<script>
    /**
anyv authored
207 208 209
     * 点击跳转购物车页面
     */
    function go_to_car(){
5  
anyv authored
210 211 212 213 214
        goods_id = "{$data.id}";
        $.post("{:url('Goodsdetails/is_salesmang_goods')}",{goods_id:goods_id},function(data){
            if(data){
                window.location.href = "{:url('Shopcart/shop_cart')}";
            }else{
4  
anyv authored
215 216
                alert('不在此区域销售');
                window.location.href = "{:url('Index/index')}";
5  
anyv authored
217 218 219
            }
        });
anyv authored
220 221 222
    }

    /**
anyv authored
223 224 225 226
     * 点击立即购买
     */
    function buy_now(id){
        price = {$price};
5  
anyv authored
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
        goods_id = "{$data.id}";
        $.post("{:url('Goodsdetails/is_salesmang_goods')}",{goods_id:goods_id},function(data){
            if(data){
                $.post("{:url('Goodsdetails/goodsdetails_go_pay')}",{id:id,myprice:price},function(data){
                    obj = JSON.parse(data);
                    if(obj.type == 20){
                        alert('业务员不能购买');
                    }if(obj.type == 3){
                        alert('业务员商品和平台商品不能同时购买!');
                    }else if(obj.type == 1){
                        window.location.href = "{:url('Orderpage/order_page')}?indet_id="+obj.indet_id;
                    }else if(obj.type == 2){
                        window.location.href = "{:url('Orderpage/order_salesman_ty')}?indet_id="+obj.indet_id;
                    }
                });
            }else{
4  
anyv authored
243 244
                alert('不在此区域销售');
                window.location.href = "{:url('Index/index')}";
5  
anyv authored
245 246 247
            }
        });
anyv authored
248 249 250 251 252
    }



    /**
5  
anyv authored
253 254 255
     *点击收藏
     */
    function goods_collection(id){
5  
anyv authored
256 257 258 259 260 261 262 263 264

        goods_id = "{$data.id}";
        $.post("{:url('Goodsdetails/is_salesmang_goods')}",{goods_id:goods_id},function(data){
            if(data){
                $.post("{:url('Goodsdetails/goods_collection')}",{goods_id:id},function(data){
                    if(data == 3){
                        alert('已收藏');
                    }else{
                        if(data){
anyv authored
265
                            /*$("#imgsss").attr("src","__TMPL__/public/assets/images/xin (1).png");
5  
anyv authored
266
                            $('#shoucang').text('已收藏');
anyv authored
267 268 269
                            alert('收藏成功');*/
                            $('.collection').html("<div class='de_footerLeftImg' onclick='cancel_goods_collection("+id+")'><img src='__TMPL__/public/assets/images/xin (1).png' ></div><p>已收藏</p>");
5  
anyv authored
270 271 272 273 274 275
                        }else{
                            alert('收藏失败');
                        }
                    }

                });
anyv authored
276
            }else{
4  
anyv authored
277 278
                alert('不在此区域销售');
                window.location.href = "{:url('Index/index')}";
anyv authored
279 280
            }
        });
5  
anyv authored
281
anyv authored
282
    }
5  
anyv authored
283
anyv authored
284 285 286 287 288 289 290
    /**
     *点击取消收藏
     */
    function cancel_goods_collection(id){

        $.post("{:url('Goodsdetails/cancel_goods_collection')}",{goods_id:id},function(data){
            if(data){
anyv authored
291
                $('.collection').html("<div class='de_footerLeftImg' onclick='goods_collection("+id+")'><img src='__TMPL__/public/assets/images/26.png'  id='imgsss'></div><p id='shoucang'>收藏</p>");
anyv authored
292 293 294 295
            }else{
                alert('取消收藏失败');
            }
        });
5  
anyv authored
296
5  
anyv authored
297
    }
1  
anyv authored
298
anyv authored
299 300 301 302 303 304





1  
anyv authored
305 306 307
    /**
     *点击加入购物车
     */
5  
anyv authored
308
    function add_cart(id){
5  
anyv authored
309 310 311 312 313 314 315 316 317 318 319 320 321 322

        goods_id = "{$data.id}";
        $.post("{:url('Goodsdetails/is_salesmang_goods')}",{goods_id:goods_id},function(data){
            if(data){
                $.post("{:url('Shopcart/add_cart')}",{goods_id:id},function(data){
                    if(data == 2){
                        alert('已添加购物车');
                    }else if(data == 3){
                        alert('添加失败');
                    }else if(data == 1){
                        alert('添加成功');
                    }
                });
            }else{
4  
anyv authored
323 324
                alert('不在此区域销售');
                window.location.href = "{:url('Index/index')}";
5  
anyv authored
325 326
            }
        });
5  
anyv authored
327
1  
anyv authored
328
    }
5  
anyv authored
329
</script>
anyv authored
330 331 332
</body>

</html>