✅P240_商城业务-购物车-页面环境搭建

gong_yz大约 1 分钟谷粒商城

点击我的购物车跳转到购物车列表页面

cfmall-product/src/main/resources/templates/index.html

<span><a href="http://cart.cfmall.com/cartList.html">我的购物车</a></span>

将商品详情页的立即预约修改为加入购物车

cfmall-product/src/main/resources/templates/item.html

<div class="box-btns-two">
   <button class="http://cart.cfmall.com/addToCart">加入购物车</button>
</div>

跳转至购物车列表页 ,跳转商品详情页先写死保证能跳转即可

cfmall-cart/src/main/resources/templates/success.html

<div class="bg_shop">
    <a class="btn-tobback"
       href="http://item.cfmall.com/94.html">查看商品详情</a>
    <a class="btn-addtocart" href="http://cart.cfmall.com/cartList.html"
       id="GotoShoppingCart"><b></b>去购物车结算</a>
</div>

跳转接口

cfmall-cart/src/main/java/com/gyz/cfmall/controller/CartController.java

    @RequestMapping("/addToCart")
    public String addToCart(){
        return "success";
    }