import {
	request
} from '../config/http.js'
import env from "../config/config.js"

//获取菜单列表
export const getMenuListByOpen = (data) => request({
	url: '/open/columnArticle/getMenuListByOpen',
	method: 'POST',
	data: data
})

//获取文章列表
export const getArticleByOpen = (data) => request({
	url: '/open/columnArticle/getArticleByOpen',
	method: 'POST',
	data: data
})

//获取文章详情
export const getArticleDetailByOpen = (data) => request({
	url: '/open/columnArticle/getArticleDetailByOpen',
	method: 'POST',
	data: data
})

//轮播图列表
export const carouselList = (data) => request({
	url: '/open/carousel/list',
	method: 'POST',
	data: data
})

//收货地址 列表
export const deliveryAddressList = (data) => request({
	url: '/open/wechat/myCenter/deliveryAddressList',
	method: 'POST',
	data: data
})
//收货地址 新增
export const addDeliveryAddress = (data) => request({
	url: '/open/wechat/myCenter/addDeliveryAddress',
	method: 'POST',
	data: data
})
//收货地址 删除
export const delDeliveryAddressList = (id) => request({
	url: `/open/wechat/myCenter/delDeliveryAddressList/${id}`,
	method: 'POST'
})
//收货地址 修改
export const modifyDeliveryAddress = (data,id) => request({
	url: `/open/wechat/myCenter/modifyDeliveryAddress/${id}`,
	method: 'POST',
	data: data
})


//登录
export const login = (code) => request({
	url: `/open/wechat/login/${env.appid}/${code}`,
	method: 'POST'
})
//绑定手机号
export const bindphone = (code) => request({
	url: `/open/wechat/bind/${env.appid}/${code}`,
	method: 'POST'
})
//获取个人信息
export const myInfo = (code) => request({
	url: `/open/wechat/myCenter/myInfo`,
	method: 'POST'
})
//修改个人信息
export const modifyInfo = (data) => request({
	url: `/open/wechat/myCenter/modifyInfo`,
	method: 'POST',
	data: data
})


//模块一接口（推荐）
export const moduleByOne = (data) => request({
	url: '/open/homeSetting/moduleByOne',
	method: 'POST',
	data: data
})
//模块二接口（技术培训）
export const moduleByTwo = (data) => request({
	url: '/open/homeSetting/moduleByTwo',
	method: 'POST',
	data: data
})
//模块三接口（行业详情）
export const moduleByThree = (data) => request({
	url: '/open/homeSetting/moduleByThree',
	method: 'POST',
	data: data
})
//模块四接口（最新资讯）
export const moduleByFour = (data) => request({
	url: '/open/homeSetting/moduleByFour',
	method: 'POST',
	data: data
})
//模块五接口（视频资讯
export const moduleByFive = (data) => request({
	url: '/open/homeSetting/moduleByFive',
	method: 'POST',
	data: data
})
//模块六接口（商品分类）
export const moduleBySix = (data) => request({
	url: '/open/homeSetting/moduleBySix',
	method: 'POST',
	data: data
})
//模块七接口（互动天地）
export const moduleBySeven = (data) => request({
	url: '/open/homeSetting/moduleBySeven',
	method: 'POST',
	data: data
})



//产品列表
export const productPage = (data) => request({
	url: '/open/wechat/product/productPage',
	method: 'POST',
	data: data
})
//产品详情
export const productdetail = (id) => request({
	url: `/open/wechat/product/detail/${id}`,
	method: 'POST',
})
//规格型号及配方
export const productspecs = (id) => request({
	url: `/open/wechat/product/specs/${id}`,
	method: 'POST',
})
//收藏
export const productcollection = (id) => request({
	url: `/open/wechat/product/collection/${id}`,
	method: 'POST'
})
//取消收藏
export const cancelCollection = (id) => request({
	url: `/open/wechat/product/cancelCollection/${id}`,
	method: 'POST'
})
//发表评论
export const publishReviews = (data) => request({
	url: `/open/wechat/product/publishReviews`,
	method: 'POST',
	data: data
})
//评论列表
export const reviewsPage = (data) => request({
	url: `/open/wechat/product/reviewsPage`,
	method: 'POST',
	data: data
})
//产品类目
export const categoriesList = (data) => request({
	url: `/open/wechat/product/categoriesList`,
	method: 'POST',
	data: data
})




//加入购物车
export const addShoppingCart = (data) => request({
	url: `/open/wechat/order/addShoppingCart`,
	method: 'POST',
	data: data
})
//移除购物车
export const removeShoppingCart = (id) => request({
	url: `/open/wechat/order/removeShoppingCart/${id}`,
	method: 'POST',
	// data: data
})
//购物车列表
export const shoppingCartPage = (data) => request({
	url: `/open/wechat/order/shoppingCartPage`,
	method: 'POST',
	data: data
})
//计算购物车价格
export const calcShoppingCart = (data) => request({
	url: `/open/wechat/order/calcShoppingCart`,
	method: 'POST',
	data: data
})
//购物车下单
export const shoppingCartCreateOrder = (data) => request({
	url: `/open/wechat/order/shoppingCartCreateOrder`,
	method: 'POST',
	data: data
})
//确认订单
export const confirmOrder = (data,orderId) => request({
	url: `/open/wechat/order/confirmOrder/${orderId}`,
	method: 'POST',
	data: data
})
//立即支付
export const prePayOrder = (orderId) => request({
	url: `/open/wechat/order/prePay/${orderId}`,
	method: 'POST'
})
//确认订单页面中取消订单
export const cancelOrderByConfirm = (orderId) => request({
	url: `/open/wechat/order/cancelOrderByConfirm/${orderId}`,
	method: 'POST',
	// data: data
})
//订单详情
export const orderDetail = (orderId) => request({
	url: `/open/wechat/order/orderDetail/${orderId}`,
	method: 'POST',
	// data: data
})
//订单列表
export const orderPage = (data) => request({
	url: `/open/wechat/order/orderPage`,
	method: 'POST',
	data: data
})
//订单列表页 取消订单
export const cancelOrder = (orderId) => request({
	url: `/open/wechat/order/cancelOrder/${orderId}`,
	method: 'POST',
	// data: data
})
//订单列表页 再次购买
export const orderAgain = (orderId) => request({
	url: `/open/wechat/order/orderAgain/${orderId}`,
	method: 'POST',
	// data: data
})
//前端支付完成回调
export const payPaying = (orderId) => request({
	url: `/open/wechat/pay/paying/${orderId}`,
	method: 'POST',
	// data: data
})

//退款申请
export const refundApply = (orderId) => request({
	url: `/open/wechat/pay/refundApply/${orderId}`,
	method: 'POST',
	// data: data
})




//主题详情
export const topicDetail = (data,topicId) => request({
	url: `/open/topic/detail/${topicId}`,
	method: 'POST',
	data: data
})
//回复列表
export const replyPage = (data) => request({
	url: `/open/topic/replyPage`,
	method: 'POST',
	data: data
})
//回复主题/楼层
export const topicReply = (data,topicId) => request({
	url: `/open/topic/reply/${topicId}`,
	method: 'POST',
	data: data
})


//收藏列表
export const collectionList = (data) => request({
	url: `/open/wechat/product/collectionList`,
	method: 'POST',
	data: data
})
//浏览记录
export const browsingHistoryPage = (data) => request({
	url: `/open/wechat/product/browsingHistoryPage`,
	method: 'POST',
	data: data
})
//意见反馈
export const feedback = (data) => request({
	url: `/open/wechat/myCenter/feedback`,
	method: 'POST',
	data: data
})


//互动天地列表
export const contentPage = (data,sortType) => request({
	url: `/open/topic/contentPage/${sortType}`,
	method: 'POST',
	data: data
})

//互动天地我参与的条数
export const joinCountByMe = (data) => request({
	url: `/open/topic/joinCountByMe`,
	method: 'POST',
	data: data
})


//公告列表
export const notifiesPage = (data) => request({
	url: `/open/wechat/common/notifiesPage`,
	method: 'POST',
	data: data
})
//公告详情
export const notifiesDetails = (id) => request({
	url: `/open/wechat/common/notifies/${id}`,
	method: 'POST'
})


//所在城市
export const getAreaList = (data) => request({
	url: `/open/vendor/getAreaList`,
	method: 'GET',
	data: data
})
//获取主营类目列表
export const getCategoryList = (id) => request({
	url: `/open/vendor/getCategoryList`,
	method: 'GET'
})
//供应商入驻
export const settledVendor = (data) => request({
	url: `/open/vendor/settledVendor`,
	method: 'POST',
	data: data
})
//我的供应商信息
export const myVendor = (data) => request({
	url: `/open/vendor/myVendor`,
	method: 'POST',
	data: data
})
//可申报商品
export const supplierList = (data) => request({
	url: `/open/vendor/supplierList`,
	method: 'POST',
	data: data
})

//我的申报记录
export const myDeclareSupplier = (data) => request({
	url: `/open/vendor/myDeclareSupplier`,
	method: 'POST',
	data: data
})
//采购单申报
export const declareSupplier = (data) => request({
	url: `/open/vendor/declareSupplier`,
	method: 'POST',
	data: data
})

//采购单列表-按供应商
export const vendorListOfDeclare = (data) => request({
	url: `/open/vendor/vendorListOfDeclare`,
	method: 'POST',
	data: data
})
//采购单列表-按产品
export const supplierListOfProduct = (data) => request({
	url: `/open/vendor/supplierListOfProduct`,
	method: 'POST',
	data: data
})
//供应商商品列表
export const vendorDeclareList = (vendorId) => request({
	url: `/open/vendor/vendorDeclareList/${vendorId}`,
	method: 'POST'
})







// 互动问答

//主题列表
export const getContentPage = (data,sortType) => request({
	url: `/open/topicQa/contentPage/${sortType}`,
	method: 'POST',
	data: data
})
//创建提问
export const createQuestion = (data) => request({
	url: `/open/topicQa/createQuestion`,
	method: 'POST',
	data: data
})
//主题详情及楼层回复
export const topicQaDetail = (data,topicId)=> request({
	url: `/open/topicQa/detail/${topicId}`,
	method: 'POST',
	data: data
})
//回复列表
export const QareplyPage = (data) => request({
	url: `/open/topicQa/replyPage`,
	method: 'POST',
	data: data
})
//回复主题/楼层
export const Qareplybyid = (data,topicId) => request({
	url: `/open/topicQa/reply/${topicId}`,
	method: 'POST',
	data: data
})
//点赞 （再次点击取消点赞）
export const Qalike = (replyId) => request({
	url: `/open/topicQa/like/${replyId}`,
	method: 'POST',
})
//关注问题（次点击取消关注）
export const Qacollect = (topicId) => request({
	url: `/open/topicQa/collect/${topicId}`,
	method: 'POST',
})