luban-mall/jsFile/public-api.js

26 lines
647 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import requst from './requst.js';
import store from '@/store/index.js'
// 查询轮播位置
export function slidePosition(data) {
return requst.get("/api/common/slide-positions");
}
// 查询购物车数量
export function getCartNum(){
return requst.get('/api/order/shopping-cart-count').then(res=>{
if(res.code==0){
store.commit('setNum', res.data.count)
}
})
}
// 查询用户信息缓存商户id
export function userInfoEv(){
return requst.get('/api/user/info').then(res=>{
if(res.code==0){
uni.setStorageSync('business_id',res.data.business_id);
uni.setStorageSync('business_code',res.data.business_code);
}
})
}