sale.js
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
/*
* @Author: Targaryen
* @Date: 2016-05-19 10:20:08
* @Last Modified by: Targaryen
* @Last Modified time: 2016-05-19 17:27:36
*/
'use strict';
const library = '../../../library';
const API = require(`${library}/api`).API;
const sign = require(`${library}/sign`);
const api = new API();
/**
* 处理 sale 首页原始数据
* @param {Object} origin [原始数据]
* @return {Object} [结果]
*/
const handleSaleData = (origin) => {
var dest = {};
dest = origin;
return dest;
};
/**
* 处理商品列表数据
* @param {[type]} origin [description]
* @return {[type]} [description]
*/
const handleSaleGoodsListData = (origin) => {
var dest = {};
dest = origin;
return dest;
};
/**
* 获取首页数据
* @return {[type]} [description]
*/
exports.getSaleDate = () => {
return api.get('', sign.apiSign({
method: 'app.activity.get',
sort: 2,
plateform: 2
})).then(result => {
return handleSaleData(result);
});
};
/**
* 获取商品列表数据
* @return {[type]} [description]
*/
exports.getSaleGoodsListData = () => {
return api.get('', sign.apiSign({
method: 'app.search.sales',
limit: 20,
order: 's_t_desc',
page: 1,
productSize: '384x511',
yh_channel: 1
})).then(result => {
return handleSaleGoodsListData(result);
});
};