基本信息
源码名称:Vue.js框架
源码大小:42.36M
文件格式:.rar
开发语言:js
更新时间:2020-09-07
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 10 元×
微信扫码支付:10 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
Vue.js框架
【实例截图
//地址数据
getters:{
totleCount(state){
let count=0
state.carPanelData.forEach(
goods=>{
count =goods.count
})
return count
},
totlePrice(state)
{
let price=0
state.carPanelData.forEach(
goods=>{
price =goods.count*goods.price
})
return price
},
//全选
allChecked(state){
let allchecked=true
state.carPanelData.forEach(
goods=>{
if(!goods.check)
{
allchecked=false
return
}
})
return allchecked
},
//计算总金额
checkedPrice(state)
{
let price=0
state.carPanelData.forEach(
goods=>{
if(goods.check)
{
price = goods.price*goods.count
}
})
return price
},
//计算数量
checkedCount(state)
{
let count=0
state.carPanelData.forEach(
goods=>{
if(goods.check)
{
count =goods.count
}
})
return count
},
//当前加入的商品
checkGoods(state){
let checkGoods=[]
state.carPanelData.forEach(
goods=>{
if(goods.check)
{
checkGoods.push(goods)
}
})
return checkGoods
}
},
mutations:{
addCarpanelData(state,data)
{
let bOff=true
state.carPanelData.forEach(goods=>{
if(goods.sku_id === data.info.sku_id){
goods.count =data.count
if(goods.count>goods.limit_num){
goods.count -=data.count
state.maxOff=true
bOff=false
return
}
// bOff=false
state.carShow=true
state.ball.show=true
state.ball.img=data.info.ali_image
state.ball.el=event.path[0]
}
})
if(bOff){
state.carShow=true
let goodsData = data.info
Vue.set(goodsData,'count',data.count)
Vue.set(goodsData,'check',true)
state.carPanelData.push(goodsData)
state.ball.show=true
state.ball.img=data.info.ali_image
state.ball.el=event.path[0]
}
}, //关闭提示
closePrompt(state){
state.maxOff=false
},
//删除购物车内容
delCarpanelData(state,id){
state.carPanelData.forEach((goods,index)=>{
if(goods.sku_id===id){
state.carPanelData.splice(index,1)
return
}
})
},
Vue.js框架
【实例截图
//地址数据
getters:{
totleCount(state){
let count=0
state.carPanelData.forEach(
goods=>{
count =goods.count
})
return count
},
totlePrice(state)
{
let price=0
state.carPanelData.forEach(
goods=>{
price =goods.count*goods.price
})
return price
},
//全选
allChecked(state){
let allchecked=true
state.carPanelData.forEach(
goods=>{
if(!goods.check)
{
allchecked=false
return
}
})
return allchecked
},
//计算总金额
checkedPrice(state)
{
let price=0
state.carPanelData.forEach(
goods=>{
if(goods.check)
{
price = goods.price*goods.count
}
})
return price
},
//计算数量
checkedCount(state)
{
let count=0
state.carPanelData.forEach(
goods=>{
if(goods.check)
{
count =goods.count
}
})
return count
},
//当前加入的商品
checkGoods(state){
let checkGoods=[]
state.carPanelData.forEach(
goods=>{
if(goods.check)
{
checkGoods.push(goods)
}
})
return checkGoods
}
},
mutations:{
addCarpanelData(state,data)
{
let bOff=true
state.carPanelData.forEach(goods=>{
if(goods.sku_id === data.info.sku_id){
goods.count =data.count
if(goods.count>goods.limit_num){
goods.count -=data.count
state.maxOff=true
bOff=false
return
}
// bOff=false
state.carShow=true
state.ball.show=true
state.ball.img=data.info.ali_image
state.ball.el=event.path[0]
}
})
if(bOff){
state.carShow=true
let goodsData = data.info
Vue.set(goodsData,'count',data.count)
Vue.set(goodsData,'check',true)
state.carPanelData.push(goodsData)
state.ball.show=true
state.ball.img=data.info.ali_image
state.ball.el=event.path[0]
}
}, //关闭提示
closePrompt(state){
state.maxOff=false
},
//删除购物车内容
delCarpanelData(state,id){
state.carPanelData.forEach((goods,index)=>{
if(goods.sku_id===id){
state.carPanelData.splice(index,1)
return
}
})
},