Advertisement
VladislavNechepaev

Untitled

Sep 8th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. max-height: 600px;
  2. overflow-y: auto;
  3.  
  4. //===============================================
  5.  
  6. const currentHoursGlobal = today.getHours()
  7. const currentMinutesGlobal = today.getMinutes()
  8.  
  9. //-----
  10.  
  11. if (weekdayGlobal === 6 || weekdayGlobal === 0 || (weekdayGlobal === 5 && currentHoursGlobal >= 19 && currentMinutesGlobal >= 30) || values.access_week === "Current week" || !officeMeido[values.office]) {
  12.  
  13. //===============================================
  14.  
  15. function buildMenuItem(item){
  16.   const wrapper = document.createElement("div")
  17.   wrapper.className += "meido-item"
  18.   const itemTitle = document.createElement("div")
  19.   itemTitle.innerHTML = item.product_title
  20.   itemTitle.className += "meido-item-title"
  21.   const descWrapper = document.createElement("div")
  22.   descWrapper.className += "meido-desc-wrapper"
  23.   const itemPic = document.createElement("img")
  24.   itemPic.src = item.photo_url
  25.   itemPic.className += "meido-pic"
  26.   const innerWrapper = document.createElement("div")
  27.   const itemDesc = document.createElement("div")
  28.   itemDesc.innerHTML = item.product_description
  29.   itemDesc.className += "meido-desc-text"
  30.   const itemInfo = document.createElement("div")
  31.   itemInfo.innerHTML = item.weight + " gr.    " + item.cal
  32.   itemInfo.className += "meido-item-bzhu"
  33.   const itemBzhu = document.createElement("div")
  34.   itemBzhu.innerHTML = item.bzhu
  35.   itemBzhu.className += "meido-item-bzhu"
  36.   descWrapper.appendChild(itemPic)
  37.   innerWrapper.appendChild(itemDesc)
  38.   innerWrapper.appendChild(itemInfo)
  39.   innerWrapper.appendChild(itemBzhu)
  40.   descWrapper.appendChild(innerWrapper)
  41.   const price = document.createElement("span")
  42.   //price.innerHTML = `<i>Цена: ${item.product_price} грн.</i>`
  43.   price.innerHTML = "Цена: "+item.product_price+" грн."
  44.   price.className += "meido-price"
  45.   const add = document.createElement("button")
  46.   add.innerHTML = "Buy"
  47.   add.className += "meido-add-button"
  48.   add.onclick = null
  49.   add.onclick = function(e){
  50.     e.preventDefault()
  51.     meidoCart.addMeidoItem(item.id)
  52.   }
  53.   wrapper.appendChild(itemTitle)
  54.   wrapper.appendChild(descWrapper)
  55.   wrapper.appendChild(add)
  56.   wrapper.appendChild(price)
  57.   return wrapper
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement