2020-07-16 10:02:57 +08:00
|
|
|
|
|
|
|
|
|
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
|
|
|
|
|
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
|
|
|
|
|
const install = (Vue, vm) => {
|
|
|
|
|
// 此处没有使用传入的params参数
|
|
|
|
|
let api = {
|
|
|
|
|
getLiveSpec(){
|
|
|
|
|
return vm.$u.get("Streaming/getLiveSpec")
|
2020-07-16 11:20:59 +08:00
|
|
|
|
},
|
|
|
|
|
login({member_name,member_password}){
|
2020-07-29 15:21:40 +08:00
|
|
|
|
return vm.$u.get("/Login/expertLogin",{member_name,member_password})
|
2020-07-16 11:20:59 +08:00
|
|
|
|
},
|
|
|
|
|
createLivesp({spec_name}){
|
|
|
|
|
return vm.$u.post("Streaming/createLivesp",{spec_name})
|
2020-07-21 15:00:39 +08:00
|
|
|
|
},
|
|
|
|
|
getStoreGoodsList(){
|
|
|
|
|
return vm.$u.post("article/getStoreGoodsList")
|
2020-07-21 19:50:26 +08:00
|
|
|
|
},
|
|
|
|
|
createChatRoom({chat_name,live_desc,spec,goods_id,cover_img}){
|
|
|
|
|
return vm.$u.post("Streaming/createChatRoom",{chat_name,live_desc,spec,goods_id,cover_img})
|
2020-07-25 08:57:32 +08:00
|
|
|
|
},
|
|
|
|
|
liveStreamList(){
|
|
|
|
|
return vm.$u.post("Streaming/liveStreamList")
|
2020-07-29 15:21:40 +08:00
|
|
|
|
},
|
|
|
|
|
// 获取订单列表
|
|
|
|
|
getorderlist(){
|
|
|
|
|
return vm.$u.get("/Order/orderList")
|
|
|
|
|
},
|
2020-07-30 09:41:08 +08:00
|
|
|
|
// 获取试穿订单列表
|
|
|
|
|
getshiftlist(){
|
|
|
|
|
return vm.$u.get("/order/goodsTryOrderList")
|
|
|
|
|
},
|
2020-07-29 15:21:40 +08:00
|
|
|
|
// 获取轮播图列表
|
|
|
|
|
getswiper(){
|
|
|
|
|
return vm.$u.get("/Order/orderList")
|
|
|
|
|
},
|
|
|
|
|
// 商家登陆
|
2020-07-30 09:41:08 +08:00
|
|
|
|
shoplogin({member_name,member_password}){
|
|
|
|
|
return vm.$u.get("/Login/storeLogin",{member_name,member_password})
|
2020-07-29 15:21:40 +08:00
|
|
|
|
},
|
2020-07-29 20:35:33 +08:00
|
|
|
|
// 获取个人信息
|
2020-07-30 09:41:08 +08:00
|
|
|
|
getshopinfo(){
|
|
|
|
|
return vm.$u.post("/member/memberInfo")
|
2020-07-29 20:35:33 +08:00
|
|
|
|
},
|
|
|
|
|
// 获取粉丝列表
|
2020-07-30 09:41:08 +08:00
|
|
|
|
myfanlist(){
|
|
|
|
|
return vm.$u.post("/member/myFansList")
|
2020-07-29 20:35:33 +08:00
|
|
|
|
},
|
|
|
|
|
// 修改个人信息
|
2020-07-30 09:41:08 +08:00
|
|
|
|
changeinfo({nickname,avatar,signature}){
|
|
|
|
|
return vm.$u.post("/Member/changeMemberInfo",{nickname,avatar,signature})
|
2020-07-29 20:35:33 +08:00
|
|
|
|
},
|
|
|
|
|
// 获取内容列表
|
2020-07-30 09:41:08 +08:00
|
|
|
|
articlelist({type,page}){
|
|
|
|
|
return vm.$u.post("/Article/articleList",{type,page})
|
|
|
|
|
},
|
|
|
|
|
// 骑手列表
|
|
|
|
|
takeawayerlist(){
|
|
|
|
|
return vm.$u.get("/Order/getTakeawayerList")
|
2020-07-29 20:35:33 +08:00
|
|
|
|
},
|
2020-07-16 10:02:57 +08:00
|
|
|
|
}
|
|
|
|
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
|
|
|
|
vm.$u.api = api;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
install
|
2020-07-16 09:47:53 +08:00
|
|
|
|
}
|