goods.basegoods.Info.js
1.69 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
webpackJsonp([5],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Created by wangqianjun on 16/3/9.
* 商品详情
*/
var $ = __webpack_require__(1),
common = __webpack_require__(2);
/*获取基础商品数据*/
var data=ViewModel;
data.data.attribute={"1":"普通商品","2":"赠品","3":"虚拟商品"}[""+data.data.attribute];
data.data.ageLevel=common.config.__ageLevel(data.data.ageLevel);
data.data.gender={"1":"男","2":"女","3":"通用"}[""+data.data.gender];
data.data.grade={"0":"否","1":"是"}[""+data.data.grade];
data.data.goodsSeason={"0":"四季","1":"春","2":"夏","3":"秋","4":"冬","5":"春夏","6":"秋冬"}[""+data.data.goodsSeason];
data.data.isPromotionalGifts={"N":"否","Y":"是"}[""+data.data.isPromotionalGifts];
data.data.isLimited={"N":"否","Y":"是"}[""+data.data.isLimited];
data.data.isLimitbuy={"N":"否","Y":"是"}[""+data.data.isLimitbuy];
data.data.isAdvance={"N":"否","Y":"是"}[""+data.data.isAdvance];
data.data.classic={"0":"否","1":"是"}[""+data.data.classic];
data.data.sellType={"0":"","1":"经销","2":"代销","3":"JIT"}[""+data.data.sellType];
var goodList = data.data.baseGoodList;
$.each(goodList, function(index, item) {
var goodsSizeList = item.goodsSizeList;
var newGoodSizeList = [];
$.each(goodsSizeList, function(index, _item) {
var balanceTime = _item.balanceTime;
if(balanceTime) {
_item.balanceTime = new Date(balanceTime * 1000).toLocaleString();
}
newGoodSizeList.push(_item);
});
item.goodsSizeList = newGoodSizeList;
});
var a=common.util.__template2($("#template").html(), data.data);
$(".contentpanel").html(a);
/***/ }
]);