实战:京东购物车静态界面实现,html前端技术开发

0.3mg*10片

${res.children[1].children[0].textContent}

-

1

+

${res.children[1].children[0].textContent}

<span οnclick=“delete_shop($(this))”>删除

移入关注

`

if ($shop_li.length !== 0) {

$shop_li.append(insertHtml)

} else {

insertHtml = `

  • 京东自营

    ${insertHtml}

    `

    console.log(insertHtml);

    $(“#shops_ul”).append(insertHtml)

    }

    }

    /----------头部样式----------/

    header {

    width: 100%;

    height: 25px;

    line-height: 25px;

    background: #e3e4e5;

    border-bottom: solid 1px #ddd;

    }

    header .header_nav {

    /background-color: red;/

    height: 100%;

    font-size: 8px;

    color: #999999;

    position: relative;

    }

    header ul {

    display: flex;

    }

    header ul.left {

    position: absolute;

    left: 0;

    }

    header ul.right {

    position: absolute;

    right: 0;

    }

    header ul li {

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 8px;

    }

    header ul li.home {

    cursor: pointer;

    }

    header ul li.home:hover {

    color: red;

    }

    header .down {

    margin-left: 5px;

    font-size: 14px;

    border-right: 1px solid #ccc;

    margin-right: 5px;

    }

    header .down_none {

    border-right: none

    }

    header .right_span {

    cursor: pointer;

    }

    header .right_span:hover {

    color: red;

    }

    /----------主体样式----------/

    article .article_top {

    height: 90px;

    /background-color: red;/

    display: flex;

    align-items: center;

    position: relative;

    }

    article .logo {

    display: block;

    margin-top: 2px;

    width: 134px;

    height: 42px;

    background: url(//misc.360buyimg.com/jdf/1.0.0/unit/global-header/5.0.0/i/jdlogo-201708-@1x.png) no-repeat 0 0;

    background-size: 134px 42px;

    text-indent: -20000px;

    }

    article .search {

    background: #c91623;

    height: 24px;

    overflow: hidden;

    position: absolute;

    right: 0;

    display: flex;

    align-items: center;

    }

    article .search .itxt {

    border: 1px solid #c91623;

    height: 22px;

    line-height: 18px;

    width: 260px;

    outline: none

    }

    article .search .button {

    display: inline-block;

    vertical-align: top;

    width: 48px;

    height: 24px;

    background: #c91623;

    text-align: center;

    color: #fff;

    font-weight: 700;

    font-size: 12px;</

  • 8
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vue.js前端开发实战6.4购物车案例是一个实际应用Vue.js框架来开发一个购物车功能的案例。购物车功能是电商网站中非常常见的功能,通过此案例能够学习到如何使用Vue.js进行页面渲染、数据绑定和事件处理等前端开发技术。 在这个案例中,我们会通过Vue.js实现以下功能: 1. 商品列表展示:通过Vue.js的模板语法,我们可以根据后端返回的数据动态渲染商品列表,展示商品的名称、价格、图片等信息。 2. 商品添加和删除:通过点击“添加到购物车”按钮,我们可以将商品添加到购物车中。同时,我们也可以通过点击购物车中的“删除”按钮,将已选择的商品从购物车中移除。 3. 数量和价格计算:根据购物车中的商品数量,我们可以实时计算出选中商品的总数量和总价格,并展示在页面上。 4. 购物车状态同步:通过Vue.js的双向数据绑定,我们可以实现购物车中商品数量的实时变化,无需刷新页面即可同步。 5. 商品勾选与取消:我们可以通过点击商品前面的勾选框来选择/取消选择商品。选择的商品会被计入总数量和总价格的计算,取消选择的商品会不计入计算。 通过这个案例,我们可以运用Vue.js框架中的数据绑定、计算属性、事件处理等特性,快速开发一个实际的购物车功能。这个案例对于学习Vue.js的前端开发人员来说,是一个很好的实践项目,可以提升对Vue.js的理解和熟练度。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值