demingshangjia/common/http.api.js
2020-09-16 19:01:33 +08:00

175 lines
5.9 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,reply_id}){
return vm.$u.post("/article/articleAddComment",{article_id,pid,content,reply_id})
},
// 达人是否可以直播
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({store_deliver_type,order_id,shipping_code,shipping_express_id}){
return vm.$u.post("/order/send",{store_deliver_type,order_id,shipping_code,shipping_express_id})
},
// 绑定骑手
bindcarer({store_deliver_type,order_id,takeawayer_id}){
return vm.$u.post("/order/send",{store_deliver_type,order_id,takeawayer_id})
},
// 自提
bindmention({store_deliver_type,shipping_express_id,deliver_explain,order_id,sendimg}) {
return vm.$u.post("/order/send",{store_deliver_type,shipping_express_id,deliver_explain,order_id,sendimg})
},
// 发货物流公司
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})
},
// 物流
getcarinfo({order_id}) {
return vm.$u.post("/Order/orderLogistics",{order_id})
},
messageList({page = 1}){
return vm.$u.post("/message/messageList",{page})
},
isread(){
return vm.$u.post("/message/isread")
},
messageInfo({id}){
return vm.$u.post("/message/messageInfo",{id})
},
// 达人验证码
getCode({member_mobile,smslog_type=2}) {
return vm.$u.post("/Sms/sendSmsCode",{member_mobile,smslog_type})
},
// 达人登录
starLogin({member_mobile,sms_code}) {
return vm.$u.post("/Login/platformExpertPhoneLogin",{member_mobile,sms_code})
},
//上传直播间人数
//https://mall.dmygkeji.com/storeapi/Streaming/changeLiveRealtimeNumber?live_id=1&realtime_number=10
changeLiveRealtimeNumber({id,number}){
return vm.$u.post("Streaming/changeLiveRealtimeNumber",{live_id:id,realtime_number:number})
}
}
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = api;
}
export default {
install
}