homeservice.js 4.24 KB
Newer Older
huahua committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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 个人最新消费记录
huahua committed
24
	// Machine.shopList  获取附件店铺
huahua committed
25 26 27 28 29
	// User.recommendUser 推荐设计师
	// Works.category 作品分类
	// Material.category 贴图分类
	queryList: (user = {}) => _queryList({api: route, params: user, callBack: (data = {}) => {
	}}),
huahua committed
30
	//作品 Works.list// 我的作品 Works.mylist// 作品详情 Works.detail 作品分类 Works.category
huahua committed
31 32 33 34
	WorksList: (user = {}) => _queryList({api: route, params: user, callBack: (data = {}) => {
	}}),
	cheshi: (user = {}) => _queryList({api: route_timeout, params: user, callBack: (data = {}) => {
	}}),
huahua committed
35 36
	//贴头 Material.list// 我的贴头 Material.mylist// 贴头详情 Material.detail 贴头分类 Material.category 
	//更新状态 Material.updateStatus  off:下架,on:上架, publish:发布,del:删除
huahua committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
	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:}
*/