mall-laonong/jsFile/public-api.js

19 lines
522 B
JavaScript
Raw Normal View History

2022-07-31 02:14:22 +00:00
import requst from './requst.js';
import store from '@/store/index.js'
// 查询轮播位置
export function slidePosition(data) {
return requst.get("/api/common/slide-positions");
}
// 查询购物车信息
export function getCartInfo(){
2022-08-04 05:38:20 +00:00
return requst.post('/api/index/indexGetShoppingCartInformation').then(res=>{
2022-07-31 02:14:22 +00:00
if(res.code==0){
2022-08-04 05:38:20 +00:00
console.log(res,'首页购物车信息')
let cartObj = res.data;
2022-07-31 02:14:22 +00:00
store.commit('setNum', cartObj.count)
2022-08-04 05:38:20 +00:00
store.commit('setPrice', cartObj.price)
2022-07-31 02:14:22 +00:00
}
})
}