import {
	route,
	route_timeout,
	newroute
} from '../api/homeApi.js'
import {
	_query,
	_queryPage,
	_queryList,
	_getters,
	_dispatch
} from './BaseService'
const service = {
	setGoodsCateList: (goodsCateList = []) => _dispatch('setGoodsCateList', goodsCateList),			// 保存分类信息到store中
	getGoodsCateList: () => _getters('goodsCateList', []),											// 获取store中的分类信息
	setCate: (cate = {}) => _dispatch('setCate', cate),												// 作品绘制成功
	getCate: () => _getters('cate', {}),																// 作品绘制成功
	setSnapshot: (snapshot = {}) => _dispatch('setSnapshot', snapshot),	 //diy操作步骤图						
	getSnapshot: () => _getters('snapshot', []),
	setStock: (stock = []) => _dispatch('setStock', stock),	 //diy操作步骤图
	getStock: () => _getters('stock', []),
	// Ad.list 获取广告
	// Account.newOrder 个人最新消费记录
	//  Machine.shopList  获取附件店铺
	// User.recommendUser 推荐设计师
	// Works.category 作品分类
	// Material.category 贴图分类
	queryList: (user = {}) => _queryList({api: route, params: user, callBack: (data = {}) => {
	}}),
	// 作品 Works.list// 我的作品 Works.mylist// 作品详情 Works.detail 作品分类 Works.category
	WorksList: (user = {}) => _queryList({api: route, params: user, callBack: (data = {}) => {
	}}),
	cheshi: (user = {}) => _queryList({api: route_timeout, params: user, callBack: (data = {}) => {
	}}),
	// 贴头 Material.list// 我的贴头 Material.mylist// 贴头详情 Material.detail 贴头分类 Material.category 
	// 更新状态 Material.updateStatus  off:下架，on：上架， publish:发布，del：删除
	MaterialList: (user = {}) => _queryList({api: route, params: user, callBack: (data = {}) => {
	}}),
	newqueryList: (user = {}) => _queryList({api: newroute, params: user, callBack: (data = {}) => {
		
	}}),
}
export default service

/**
 * url:/lite/index
 * 
 * 获取附件店铺
 * query：{s: 'Machine.shopList',longitude: ,latitude: ,distance:}
 * 个人最新消费记录
 * query：{s: 'Account.newOrder'}
 * 获取首页广告
 * query：{s: 'Ad.list',ad_position_key: 'clothes-mall'}
 * 释放锁定库存
 * query：{s: 'Order.newLockAttrStock',machine_id:,goods_id:null, dict_id:null,old_sn:null,onlyClear:1}
 * 锁定库存
 * query：{s: 'Order.newLockAttrStock',machine_id:,goods_id:,dict_id:,old_sn:}
 * 设备详情
 * query：{s: 'machine.detail'，machine_id: }
 * 设备轮播图
 * query：{s: 'Ad.list',ad_position_key: 'index_top',machine_id:}
 * 保存作品
 * query：{s: 'Works.save',components: components,works_id: ,goods_id: ,template: ,template_price: ,template_user_id: ,user_id: ,platform: 3,shape_image: ,shape_id:,shape_price:,machine_id:,background_color:,}
 * 获取商品库存信息
 * {s: 'machine.getProductAttribute',goods_id: options.goods_id}
 * 创建订单
 * query：{s: 'Order.create',type: this.key,machine_id: ,goods_id: ,works_id: ,channel_no: ,dict_id: ,goods_size: ,works_num: ,shop_id: ,sn: ,coupon_id: ,user_address: }
 * 作品详情
 * query：{s: 'Works.detail'，id: }
 * 贴图详情
 * query：{s: 'Material.detail'，id: }
 * 获取产品详情数据
 * query：{s: 'Product.detail',id: }
 * 形状图分类
 * query：{s: 'Material.getShapeCategory','machine_id': null }
 * 贴图分类
 * query：{s: 'Material.category','machine_id': null}
 * 查询货到库存
 * query：{s: 'Product.getMachineProduct',machine_id:}
 * 字体列表
 * query:{s: 'Material.fontFamilyList'}
 * 形状图列表
 * query: {s: 'Material.getShapeList',page: 1,per_page: 50,shape_category_id: null,goods_category_id:null,total: 0,machine_id: null,}
 * 贴图列表
 * query:{s: 'Material.list',page: 1,per_page: 50,is_revise: 1,is_edit: 1,total: 0,is_new: null,is_hot: null ,machine_id: null, }
 * 获取设备打印排队列表
 * query:{s:'Machine.wait',machine_id:null,}
 * 获取通知提醒配置
 * {s:'Qrcode.getSubscribeTemplate'}
 * 获取库存与优惠券信息
 * {s: 'Machine.getMachineStock',machine_id:,key: }
 * 订单页面-获取可以下单的设备列表
 * {s: 'Machine.shopList',longitude: ,latitude: ,status:[1,2],distance:,goods_id:}
 * 订单详情
 * {s: 'Order.detail',id: null}
 * 查询订单状态
 * {s:'Order.orderStatus',order_id:}
 * 查询订单排队情况
 * {s:'Order.orderRanking',order_id:,machine_id:}
*/