中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

app網(wǎng)站開發(fā)書籍下載企業(yè)網(wǎng)絡(luò)營銷策略分析案例

app網(wǎng)站開發(fā)書籍下載,企業(yè)網(wǎng)絡(luò)營銷策略分析案例,威海做網(wǎng)站推廣的企業(yè),企業(yè)管理知識代碼打包資源下載:【免費(fèi)】HTMLJSCSS移動端購物車選購界面資源-CSDN文庫 關(guān)鍵部分說明: UIGoods 類: 構(gòu)造函數(shù): 創(chuàng)建 UIGoods 實(shí)例時(shí),傳入商品數(shù)據(jù) g,初始化商品的數(shù)據(jù)和選擇數(shù)量。getTotalPrice() 方法…

代碼打包資源下載:【免費(fèi)】HTML+JS+CSS移動端購物車選購界面資源-CSDN文庫

關(guān)鍵部分說明:

UIGoods 類:
  • 構(gòu)造函數(shù): 創(chuàng)建 UIGoods 實(shí)例時(shí),傳入商品數(shù)據(jù) g,初始化商品的數(shù)據(jù)和選擇數(shù)量。
  • getTotalPrice() 方法: 計(jì)算商品的總價(jià),考慮了選擇數(shù)量。
  • isChoose() 方法: 判斷是否選中該商品。
  • increase() 方法: 增加商品的選擇數(shù)量。
  • decrease() 方法: 減少商品的選擇數(shù)量,但數(shù)量不會小于 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 類:
  • 構(gòu)造函數(shù): 初始化頁面數(shù)據(jù),包括商品列表、起送價(jià)格和配送費(fèi)。
  • getTotalPrice() 方法: 計(jì)算購物車中所有商品的總價(jià)。
  • increase(index)decrease(index) 方法: 分別用于增加和減少某個(gè)商品的選擇數(shù)量。
  • getTotalChooseNum() 方法: 獲取購物車中所有商品的總選擇數(shù)量。
  • isGoodsInCar() 方法: 判斷購物車中是否有商品。
  • isStartSendPrice() 方法: 判斷是否達(dá)到起送價(jià)格。
  • isChoose(index) 方法: 判斷某個(gè)商品是否被選中。
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 類:
  • 構(gòu)造函數(shù): 初始化頁面和事件監(jiān)聽。
  • creatHTML() 方法: 根據(jù)商品數(shù)據(jù)創(chuàng)建商品元素的 HTML 結(jié)構(gòu),用于初始化頁面。
  • increase(index)decrease(index) 方法: 用于增加和減少商品選擇數(shù)量,同時(shí)更新頁面顯示。
  • updateGoodsItem(index)updateFooter() 方法: 更新商品元素和頁腳的顯示狀態(tài)。
  • carAnimate()jump(index) 方法: 分別處理購物車動畫和商品選擇數(shù)量變化的跳躍拋物線動畫。
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結(jié)構(gòu)... --></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) {// 更新商品元素的顯示狀態(tài)// ...省略具體實(shí)現(xiàn)...}updateFooter() {// 更新頁腳的顯示狀態(tài)// ...省略具體實(shí)現(xiàn)...}carAnimate() {this.doms.car.classList.add('animate')}jump(index) {// 商品選擇數(shù)量變化的跳躍拋物線動畫// ...省略具體實(shí)現(xiàn)...}
}

注意:

文章說明:該功能是根據(jù)“渡一前端”視頻敲出來的,并不屬于原創(chuàng),但是轉(zhuǎn)載或是翻譯的連接我找不到了,所以使用的原創(chuàng)標(biāo)簽,特此說明一下。

http://www.risenshineclean.com/news/54396.html

相關(guān)文章:

  • gateface能用來做網(wǎng)站嗎google登錄入口
  • 西安網(wǎng)站建設(shè)云李百度知道合伙人官網(wǎng)登錄入口
  • 美工網(wǎng)站做兼職企業(yè)網(wǎng)絡(luò)推廣網(wǎng)站
  • 網(wǎng)站更改機(jī)房備案個(gè)人網(wǎng)站制作
  • 福建企業(yè)網(wǎng)站開發(fā)純手工seo公司
  • 貴陽雙龍區(qū)建設(shè)局網(wǎng)站谷歌搜索引擎香港免費(fèi)入口
  • 政府采購網(wǎng)上商城網(wǎng)站成都專門做網(wǎng)站的公司
  • 廈門網(wǎng)站建設(shè)哪家公司好實(shí)時(shí)熱榜
  • 網(wǎng)站跳轉(zhuǎn)怎么辦瀏覽器下載安裝2023版本
  • 網(wǎng)站優(yōu)化網(wǎng)絡(luò)推廣seo班級優(yōu)化大師的利和弊
  • 做機(jī)械設(shè)備網(wǎng)站成都網(wǎng)站建設(shè)軟件
  • 學(xué)校網(wǎng)站建設(shè)經(jīng)驗(yàn)介紹什么是網(wǎng)絡(luò)營銷策劃
  • 攜程特牌 的同時(shí)做別的網(wǎng)站自己如何制作一個(gè)網(wǎng)站
  • 做展柜平時(shí)在哪里網(wǎng)站推廣全國十大教育機(jī)構(gòu)
  • 珠寶網(wǎng)站建設(shè)平臺分析報(bào)告網(wǎng)站構(gòu)建的基本流程
  • 連鎖酒店網(wǎng)站建設(shè)網(wǎng)站優(yōu)化推廣方案
  • 網(wǎng)站開發(fā)工具安全性能怎樣制作一個(gè)網(wǎng)站
  • 網(wǎng)站開發(fā)技術(shù)有廣州疫情最新數(shù)據(jù)
  • 做模具的網(wǎng)站sem競價(jià)推廣怎么做
  • 客戶網(wǎng)站回訪長春百度快速優(yōu)化
  • 網(wǎng)站開發(fā)用c語言嗎網(wǎng)站網(wǎng)絡(luò)營銷公司
  • 為什么 要建設(shè)網(wǎng)站掃一掃識別圖片
  • 網(wǎng)站制作策劃書最新域名8xgmvxyz
  • 長春專業(yè)做網(wǎng)站公司排名手機(jī)優(yōu)化大師官方版
  • 網(wǎng)站通欄南京seo網(wǎng)站管理
  • 基于jsp網(wǎng)站開發(fā)與實(shí)現(xiàn)和生活app下載安裝最新版
  • 好用的免費(fèi)建站網(wǎng)站百度網(wǎng)絡(luò)營銷中心
  • 在靜安正規(guī)的設(shè)計(jì)公司網(wǎng)站個(gè)人博客登錄入口
  • 卡通網(wǎng)站建設(shè)濟(jì)南頭條新聞熱點(diǎn)
  • 正規(guī)的培訓(xùn)行業(yè)網(wǎng)站開發(fā)seo關(guān)鍵詞如何布局