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 = {
|
2020-07-31 10:14:46 +08:00
|
|
|
|
// 获取标签
|
2020-07-16 10:02:57 +08:00
|
|
|
|
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
|
|
|
|
},
|
2020-07-31 10:14:46 +08:00
|
|
|
|
// 创建标签
|
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
|
|
|
|
},
|
|
|
|
|
// 获取订单列表
|
2020-07-30 19:49:12 +08:00
|
|
|
|
getorderlist({type,page}){
|
|
|
|
|
return vm.$u.get("/Order/orderList",{type,page})
|
2020-07-29 15:21:40 +08:00
|
|
|
|
},
|
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})
|
|
|
|
|
},
|
2020-07-30 10:12:27 +08:00
|
|
|
|
// 删除文章
|
|
|
|
|
delarticle({article_id}){
|
|
|
|
|
return vm.$u.post("/article/articleDelete",{article_id})
|
|
|
|
|
},
|
2020-07-30 09:41:08 +08:00
|
|
|
|
// 骑手列表
|
|
|
|
|
takeawayerlist(){
|
|
|
|
|
return vm.$u.get("/Order/getTakeawayerList")
|
2020-07-29 20:35:33 +08:00
|
|
|
|
},
|
2020-07-30 19:49:12 +08:00
|
|
|
|
// 投诉列表
|
|
|
|
|
reportlist(){
|
|
|
|
|
return vm.$u.post("/takeawayer/complaintTKList")
|
|
|
|
|
},
|
|
|
|
|
// 投诉详情
|
|
|
|
|
reportdetail({id}){
|
|
|
|
|
return vm.$u.post("/takeawayer/complaintInfo",{id})
|
|
|
|
|
},
|
|
|
|
|
// 可以投诉的订单
|
|
|
|
|
canreportorder(){
|
|
|
|
|
return vm.$u.post("/Takeawayer/tryOrderSnList")
|
|
|
|
|
},
|
|
|
|
|
// 投诉骑手
|
|
|
|
|
|
|
|
|
|
reportorder({order_id,takeawayer_id,order_list,content}){
|
|
|
|
|
return vm.$u.post("/takeawayer/complaintTakeawayer",{order_id,takeawayer_id,order_list,content})
|
|
|
|
|
},
|
|
|
|
|
// 文章详情
|
|
|
|
|
getdetail({article_id}){
|
|
|
|
|
return vm.$u.post("/article/articleInfo",{article_id})
|
|
|
|
|
},
|
|
|
|
|
// 回复评论
|
2020-08-06 14:40:11 +08:00
|
|
|
|
reply({article_id,pid,content,reply_id}){
|
|
|
|
|
return vm.$u.post("/article/articleAddComment",{article_id,pid,content,reply_id})
|
2020-07-30 19:49:12 +08:00
|
|
|
|
},
|
|
|
|
|
// 达人是否可以直播
|
|
|
|
|
canlive(){
|
|
|
|
|
return vm.$u.post("/Streaming/expt_live")
|
|
|
|
|
},
|
|
|
|
|
// 可选择直播商品列表
|
|
|
|
|
canselectgood(){
|
|
|
|
|
return vm.$u.post("/article/getStoreGoodsList")
|
|
|
|
|
},
|
2020-08-05 17:42:06 +08:00
|
|
|
|
// 发布图文
|
|
|
|
|
publishphoto({article_title,article_content,article_pic,file_id,goods_id_arr,label_arr}){
|
|
|
|
|
return vm.$u.post("/article/publishImage",{article_title,article_content,article_pic,file_id,goods_id_arr,label_arr})
|
|
|
|
|
},
|
|
|
|
|
// 发布视频
|
|
|
|
|
publishvideo({article_title,article_content,article_pic,video_path,goods_id_arr,label_arr}){
|
|
|
|
|
return vm.$u.post("/article/publishVideo",{article_title,article_content,article_pic,video_path,goods_id_arr,label_arr})
|
|
|
|
|
},
|
|
|
|
|
// 订单详情
|
|
|
|
|
orderdetail({order_id}){
|
|
|
|
|
return vm.$u.post("/Order/orderInfo",{order_id})
|
|
|
|
|
},
|
|
|
|
|
// 试穿订单详情
|
|
|
|
|
testorderdetail({goods_try_id}){
|
|
|
|
|
return vm.$u.post("/order/goodsTryOrderInfo",{goods_try_id})
|
|
|
|
|
},
|
|
|
|
|
// 绑定物流订单
|
|
|
|
|
bindpushid({order_id,shipping_code,shipping_express_id}){
|
|
|
|
|
return vm.$u.post("/order/send",{order_id,shipping_code,shipping_express_id})
|
|
|
|
|
},
|
|
|
|
|
// 绑定骑手
|
|
|
|
|
bindcarer({order_id,takeawayer_id}){
|
|
|
|
|
return vm.$u.post("/order/orderRider",{order_id,takeawayer_id})
|
|
|
|
|
},
|
|
|
|
|
// 发货物流公司
|
|
|
|
|
pushcompany(){
|
|
|
|
|
return vm.$u.post("/order/getExpress")
|
|
|
|
|
},
|
|
|
|
|
// 退款退货
|
|
|
|
|
refund({refund_id,seller_state,seller_message}){
|
|
|
|
|
return vm.$u.post("/order/editRefund",{refund_id,seller_state,seller_message})
|
|
|
|
|
},
|
2020-08-05 20:03:53 +08:00
|
|
|
|
// 试穿
|
|
|
|
|
agreetest({goods_try_id,type,takeawayer_id}){
|
|
|
|
|
return vm.$u.post("/order/goodsTryAgree",{goods_try_id,type,takeawayer_id})
|
2020-08-28 14:51:35 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
messageList({page = 1}){
|
|
|
|
|
return vm.$u.post("/message/messageList",{page})
|
|
|
|
|
},
|
|
|
|
|
isread(){
|
|
|
|
|
return vm.$u.post("/message/isread")
|
|
|
|
|
},
|
|
|
|
|
messageInfo(){
|
|
|
|
|
return vm.$u.post("/message/messageInfo")
|
2020-08-05 20:03:53 +08:00
|
|
|
|
}
|
2020-08-05 17:42:06 +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
|
|
|
|
}
|