demingshangjia/common/http.api.js
2020-08-05 20:03:53 +08:00

146 lines
4.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 此处第二个参数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")
},
login({member_name,member_password}){
return vm.$u.get("/Login/expertLogin",{member_name,member_password})
},
// 创建标签
createLivesp({spec_name}){
return vm.$u.post("Streaming/createLivesp",{spec_name})
},
getStoreGoodsList(){
return vm.$u.post("article/getStoreGoodsList")
},
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})
},
liveStreamList(){
return vm.$u.post("Streaming/liveStreamList")
},
// 获取订单列表
getorderlist({type,page}){
return vm.$u.get("/Order/orderList",{type,page})
},
// 获取试穿订单列表
getshiftlist(){
return vm.$u.get("/order/goodsTryOrderList")
},
// 获取轮播图列表
getswiper(){
return vm.$u.get("/Order/orderList")
},
// 商家登陆
shoplogin({member_name,member_password}){
return vm.$u.get("/Login/storeLogin",{member_name,member_password})
},
// 获取个人信息
getshopinfo(){
return vm.$u.post("/member/memberInfo")
},
// 获取粉丝列表
myfanlist(){
return vm.$u.post("/member/myFansList")
},
// 修改个人信息
changeinfo({nickname,avatar,signature}){
return vm.$u.post("/Member/changeMemberInfo",{nickname,avatar,signature})
},
// 获取内容列表
articlelist({type,page}){
return vm.$u.post("/Article/articleList",{type,page})
},
// 删除文章
delarticle({article_id}){
return vm.$u.post("/article/articleDelete",{article_id})
},
// 骑手列表
takeawayerlist(){
return vm.$u.get("/Order/getTakeawayerList")
},
// 投诉列表
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})
},
// 回复评论
reply({article_id,pid,content}){
return vm.$u.post("/article/articleAddComment",{article_id,pid,content})
},
// 达人是否可以直播
canlive(){
return vm.$u.post("/Streaming/expt_live")
},
// 可选择直播商品列表
canselectgood(){
return vm.$u.post("/article/getStoreGoodsList")
},
// 发布图文
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})
},
// 试穿
agreetest({goods_try_id,type,takeawayer_id}){
return vm.$u.post("/order/goodsTryAgree",{goods_try_id,type,takeawayer_id})
}
}
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = api;
}
export default {
install
}