From 21277159ce29a84feec54fb4221bb491b5bd66bf Mon Sep 17 00:00:00 2001
From: anyv <anyu@bronet.cn>
Date: Tue, 4 Jun 2019 19:33:29 +0800
Subject: [PATCH] 5

---
 public/themes/simpleboot3/portal/shopcart/shop_cart.html | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/public/themes/simpleboot3/portal/shopcart/shop_cart.html b/public/themes/simpleboot3/portal/shopcart/shop_cart.html
index a825c0c..fe0ab8b 100644
--- a/public/themes/simpleboot3/portal/shopcart/shop_cart.html
+++ b/public/themes/simpleboot3/portal/shopcart/shop_cart.html
@@ -23,9 +23,8 @@
     <ul class="order_newsUl sp_cartUl" style="margin-bottom:2.1rem">
         <volist name="goods_data" id="vo">
             <li>
-                <div class="sh_cartround">
+                <div class="sh_cartround" data-id="{$vo.id}">
                     <img src="__TMPL__/public/assets/images/39_0.png" alt="" />
-                    <input type="hidden" name="" class="sh_add" value="{$vo.id}">
                 </div>
                 <div class="order_newsImg">
                     <img src="{:cmf_get_image_url($vo.thumbnail)}" alt="" />
@@ -117,7 +116,7 @@
      *删除
      */
     function datadel(){
-        $ids = $('.add').val();
+        $ids = $('.add').data('id');
         console.log($ids);
     }
 
@@ -184,11 +183,11 @@
             $(this).on("click", function() {
                 if ($(this).attr("src") == "__TMPL__/public/assets/images/39_0.png") {
                     $(this).attr("src", "__TMPL__/public/assets/images/39.png");
-                    $(this).next('input').addClass('add');
+                    $(this).parent().addClass('add');
                     calcTotal();
                 } else {
                     $(this).attr("src", "__TMPL__/public/assets/images/39_0.png");
-                    $(this).next('input').removeClass('add');
+                    $(this).parent().removeClass('add');
                     calcTotal();
                 }
             });
@@ -199,7 +198,7 @@
             if ($(this).attr("src") == "__TMPL__/public/assets/images/39_1.png") {
                 $(this).attr("src", "__TMPL__/public/assets/images/39.png");
                 $(".sh_cartround img").attr("src", "__TMPL__/public/assets/images/39.png");
-                $('.sh_add').addClass('add');
+                $(this).addClass('add');
                 calcTotal2();
             } else {
                 $(this).attr("src", "__TMPL__/public/assets/images/39_1.png");
--
libgit2 0.24.0