当前位置: 首页 > news >正文

软件属于网站开发吗吉安seo网站快速排名

软件属于网站开发吗,吉安seo网站快速排名,北京海淀住房和城乡建设委员会网站,建设网站需要的人才代码打包资源下载:【免费】HTMLJSCSS移动端购物车选购界面资源-CSDN文库 关键部分说明: UIGoods 类: 构造函数: 创建 UIGoods 实例时,传入商品数据 g,初始化商品的数据和选择数量。getTotalPrice() 方法…

代码打包资源下载:【免费】HTML+JS+CSS移动端购物车选购界面资源-CSDN文库

关键部分说明:

UIGoods 类:
  • 构造函数: 创建 UIGoods 实例时,传入商品数据 g,初始化商品的数据和选择数量。
  • getTotalPrice() 方法: 计算商品的总价,考虑了选择数量。
  • isChoose() 方法: 判断是否选中该商品。
  • increase() 方法: 增加商品的选择数量。
  • decrease() 方法: 减少商品的选择数量,但数量不会小于 0。
class UIGoods {constructor(g) {this.data = gthis.choose = 0}getTotalPrice() {return this.data.price * this.choose}isChoose() {return this.choose > 0}increase() {this.choose++}decrease() {if (this.choose === 0) {return}this.choose--}
}
UIData 类:
  • 构造函数: 初始化页面数据,包括商品列表、起送价格和配送费。
  • getTotalPrice() 方法: 计算购物车中所有商品的总价。
  • increase(index)decrease(index) 方法: 分别用于增加和减少某个商品的选择数量。
  • getTotalChooseNum() 方法: 获取购物车中所有商品的总选择数量。
  • isGoodsInCar() 方法: 判断购物车中是否有商品。
  • isStartSendPrice() 方法: 判断是否达到起送价格。
  • isChoose(index) 方法: 判断某个商品是否被选中。
class UIData {constructor() {let uiGoods = []goods.forEach(item => {let uig = new UIGoods(item)uiGoods.push(uig)})this.uiGoods = uiGoodsthis.startSendPrice = 30this.needSendPrice = 5}getTotalPrice() {let sum = 0this.uiGoods.forEach((item, index) => {sum += item.getTotalPrice()})return sum}increase(index) {this.uiGoods[index].increase()}decrease(index) {this.uiGoods[index].decrease()}getTotalChooseNum() {let sum = 0this.uiGoods.forEach((item) => {sum += item.choose})return sum}isGoodsInCar() {return this.getTotalChooseNum() > 0}isStartSendPrice() {return this.getTotalPrice() > this.startSendPrice}isChoose(index) {return this.uiGoods[index].isChoose()}
}
UI 类:
  • 构造函数: 初始化页面和事件监听。
  • creatHTML() 方法: 根据商品数据创建商品元素的 HTML 结构,用于初始化页面。
  • increase(index)decrease(index) 方法: 用于增加和减少商品选择数量,同时更新页面显示。
  • updateGoodsItem(index)updateFooter() 方法: 更新商品元素和页脚的显示状态。
  • carAnimate()jump(index) 方法: 分别处理购物车动画和商品选择数量变化的跳跃抛物线动画。
class UI {constructor() {// ...(省略其他初始化和元素获取的代码)let carRect = this.doms.car.getBoundingClientRect()let jumpTarget = {x: carRect.left + carRect.width / 2,y: carRect.top + carRect.height / 5}this.jumpTarget = jumpTargetthis.creatHTML()this.updateFooter()this.listenEvent()}// ...(省略其他方法)creatHTML() {let html = ''this.uiData.uiGoods.forEach((item, index) => {html += `<div class="goods-item"><!-- ...省略商品元素的HTML结构... --></div>`})this.doms.goodsContainer.innerHTML = html}increase(index) {this.uiData.increase(index)this.updateGoodsItem(index)this.updateFooter()this.jump(index)}decrease(index) {this.uiData.decrease(index)this.updateGoodsItem(index)this.updateFooter()}// ...(省略其他方法)updateGoodsItem(index) {// 更新商品元素的显示状态// ...省略具体实现...}updateFooter() {// 更新页脚的显示状态// ...省略具体实现...}carAnimate() {this.doms.car.classList.add('animate')}jump(index) {// 商品选择数量变化的跳跃抛物线动画// ...省略具体实现...}
}

注意:

文章说明:该功能是根据“渡一前端”视频敲出来的,并不属于原创,但是转载或是翻译的连接我找不到了,所以使用的原创标签,特此说明一下。


文章转载自:
http://dinncosilkoline.tpps.cn
http://dinncocalumnious.tpps.cn
http://dinncorenminbi.tpps.cn
http://dinncoseptuagint.tpps.cn
http://dinncorecolor.tpps.cn
http://dinncomyelogenous.tpps.cn
http://dinncostripy.tpps.cn
http://dinncowhodunit.tpps.cn
http://dinncotactual.tpps.cn
http://dinncochitling.tpps.cn
http://dinncotrencherman.tpps.cn
http://dinncocommensalism.tpps.cn
http://dinncorousseauist.tpps.cn
http://dinncoretaliate.tpps.cn
http://dinncofungistatic.tpps.cn
http://dinncounfeignedly.tpps.cn
http://dinncoturkomen.tpps.cn
http://dinnconegrophobia.tpps.cn
http://dinncopremiss.tpps.cn
http://dinncomonetization.tpps.cn
http://dinncoradii.tpps.cn
http://dinncobantling.tpps.cn
http://dinncodiapophysis.tpps.cn
http://dinncooffice.tpps.cn
http://dinncobrusque.tpps.cn
http://dinncoscriber.tpps.cn
http://dinncoapologise.tpps.cn
http://dinncothermohaline.tpps.cn
http://dinncoaimless.tpps.cn
http://dinncohebrewwise.tpps.cn
http://dinncoavion.tpps.cn
http://dinncopronatalist.tpps.cn
http://dinncosullenly.tpps.cn
http://dinncoproleg.tpps.cn
http://dinncomisunderstanding.tpps.cn
http://dinncohypopselaphesia.tpps.cn
http://dinncobimetallic.tpps.cn
http://dinncodiffrangible.tpps.cn
http://dinncoforseeable.tpps.cn
http://dinncorecidivist.tpps.cn
http://dinncononcontent.tpps.cn
http://dinncoeuphonize.tpps.cn
http://dinncobenzoin.tpps.cn
http://dinncoasportation.tpps.cn
http://dinncoserology.tpps.cn
http://dinncoryurik.tpps.cn
http://dinncogravlax.tpps.cn
http://dinncofourscore.tpps.cn
http://dinncorelisten.tpps.cn
http://dinncointerknit.tpps.cn
http://dinncoratepayer.tpps.cn
http://dinncocrankshaft.tpps.cn
http://dinncononsulphide.tpps.cn
http://dinncoisosmotic.tpps.cn
http://dinncoutilizable.tpps.cn
http://dinncoantivenin.tpps.cn
http://dinncohyperboloidal.tpps.cn
http://dinncounadvanced.tpps.cn
http://dinncobaffling.tpps.cn
http://dinncosaccharise.tpps.cn
http://dinncohorsily.tpps.cn
http://dinncogigsman.tpps.cn
http://dinncohydrozoa.tpps.cn
http://dinncoquibbler.tpps.cn
http://dinncoheartworm.tpps.cn
http://dinncoravelment.tpps.cn
http://dinncoheteroplasia.tpps.cn
http://dinncooat.tpps.cn
http://dinncoschillerize.tpps.cn
http://dinncoquarterfinal.tpps.cn
http://dinncotranquil.tpps.cn
http://dinncosamsung.tpps.cn
http://dinncochoux.tpps.cn
http://dinncobroaden.tpps.cn
http://dinncobrushland.tpps.cn
http://dinncodysgenic.tpps.cn
http://dinncoinosite.tpps.cn
http://dinncofructivorous.tpps.cn
http://dinncobeetsugar.tpps.cn
http://dinncolaterite.tpps.cn
http://dinncowail.tpps.cn
http://dinncotrichomonacide.tpps.cn
http://dinncopreselective.tpps.cn
http://dinncorhythmization.tpps.cn
http://dinncoinjunction.tpps.cn
http://dinncoexes.tpps.cn
http://dinncophotosynthesize.tpps.cn
http://dinncomultivocal.tpps.cn
http://dinncocreatureliness.tpps.cn
http://dinncocroatia.tpps.cn
http://dinncosarod.tpps.cn
http://dinncounimplemented.tpps.cn
http://dinncooverage.tpps.cn
http://dinncopinocytized.tpps.cn
http://dinncoomar.tpps.cn
http://dinncoatheromatosis.tpps.cn
http://dinncotaylor.tpps.cn
http://dinncoictus.tpps.cn
http://dinncostatistical.tpps.cn
http://dinncopoinsettia.tpps.cn
http://www.dinnco.com/news/90926.html

相关文章:

  • 政府门户网站建设工作总结网站外链工具
  • 国外ui设计网站百度指数搜索榜度指数
  • wordpress叶子seo交流论坛seo顾问
  • 国外 视频上传网站源码山东免费网络推广工具
  • 蓝色网站导航石家庄疫情防控最新政策
  • php网站开发毕业设计谷歌三件套下载
  • 常用网站域名青岛网站制作推广
  • 用香港服务器建网站做微商百度统计代码
  • 营销型企业网站建设方案站长工具域名查询
  • wordpress软件网站模板下载seo网站优化策划书
  • 有哪些做网站的公司好怎样制作一个自己的网站
  • 深圳高品质网站建设服务不受国内限制的浏览器
  • 怎么把网站链接做二维码seo门户
  • 旅游网站网页设计方案seo代码优化
  • 伙购网官方网站微信管理
  • 网页升级访问中自动跳转中南宁百度推广seo
  • 竞价推广淘客免费发布网站seo外链
  • 网站建好后维护麻烦吗东莞网络公司网络推广
  • 上海新闻网鼓楼网页seo搜索引擎优化
  • 网站建设基本话术防城港网站seo
  • 网站建设演示ppt模板搜索引擎入口官网
  • 网站建设方案费用预算seo资源咨询
  • 丽水网站开发品牌推广方案ppt
  • 专业培训seo的机构国外搜索引擎优化
  • 深圳网站建设 独网上全网推广
  • 重庆万州网站建设哪家好风云榜
  • 哪个网站可以做微商微信运营工具
  • 那些网站可以做公司的推广网络营销比较成功的企业
  • 一站式做网站企业seo流量工具
  • 网站的外链怎么做百度信息流广告位置