2022-05-27 09:43:21 +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 themeEv(){
|
|
|
|
return requst.get('/api/index/mini-program-setting').then(res=>{
|
|
|
|
if(res.code==0){
|
|
|
|
let list = [];
|
2022-05-27 11:59:47 +00:00
|
|
|
if(res.data.footBar.length){//底部导航
|
2022-05-27 09:43:21 +00:00
|
|
|
res.data.footBar.forEach(item=>{
|
|
|
|
let obj = {
|
|
|
|
iconPath: item.icon,
|
|
|
|
selectedIconPath: item.icon,
|
|
|
|
title:item.name
|
|
|
|
}
|
|
|
|
list.push(obj);
|
|
|
|
})
|
|
|
|
store.commit('updateState', {list})
|
|
|
|
}
|
2022-05-27 11:59:47 +00:00
|
|
|
let geList = [];
|
|
|
|
if(res.data.recommend.length){//底部导航
|
|
|
|
res.data.recommend.forEach((item,index)=>{
|
|
|
|
let obj = {
|
|
|
|
url:item.link,
|
|
|
|
iconsrc:item.icon,
|
|
|
|
iconWidth:[48,56,64,48,56,58,48,44,54,52][index],
|
|
|
|
iconHeight:[50,54,46,48,58,52,54,56,50,52][index],
|
|
|
|
title:item.name
|
|
|
|
}
|
|
|
|
geList.push(obj);
|
|
|
|
})
|
|
|
|
store.commit('setGe', {geList})
|
|
|
|
}
|
2022-05-27 09:43:21 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 查询购物车数量
|
|
|
|
export function getCartNum(){
|
|
|
|
return requst.get('/api/order/shopping-cart-count').then(res=>{
|
|
|
|
if(res.code==0){
|
2022-05-27 11:59:47 +00:00
|
|
|
store.commit('setNum', res.data.count)
|
2022-05-27 09:43:21 +00:00
|
|
|
}
|
|
|
|
})
|
2022-05-25 09:55:44 +00:00
|
|
|
}
|