goods.basegoods.Info.js
3.77 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
webpackJsonp([35],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/**
* Created by wangqianjun on 16/3/9.
* 商品详情
*/
var $ = __webpack_require__(1),
common = __webpack_require__(2);
/*获取基础商品数据*/
var goodsInfo=window.ViewModel || {};
goodsInfo = goodsInfo.data || {};
goodsInfo.attribute={"1":"普通商品","2":"赠品","3":"虚拟商品","4":"组合商品"}[""+goodsInfo.attribute];
goodsInfo.ageLevel=common.config.__ageLevel(goodsInfo.ageLevel|| '');//goodsInfo.ageLevel.replace("1","成人").replace("2","大童").replace("3","小童");
goodsInfo.gender={"1":"男","2":"女","3":"通用"}[""+goodsInfo.gender];
goodsInfo.grade={"0":"否","1":"是"}[""+goodsInfo.grade];
goodsInfo.goodsSeason={"0":"四季","1":"春","2":"夏","3":"秋","4":"冬","5":"春夏","6":"秋冬"}[""+goodsInfo.goodsSeason];
goodsInfo.isPromotionalGifts={"N":"否","Y":"是"}[""+goodsInfo.isPromotionalGifts];
goodsInfo.isLimited={"N":"否","Y":"是"}[""+goodsInfo.isLimited];
goodsInfo.isLimitbuy={"N":"否","Y":"是"}[""+goodsInfo.isLimitbuy];
goodsInfo.appType={"0":"有货平台","1":"有货,BLK平台"}[""+goodsInfo.appType];
goodsInfo.isAdvance={"N":"否","Y":"是"}[""+goodsInfo.isAdvance];
goodsInfo.classic={"0":"否","1":"是"}[""+goodsInfo.classic];
goodsInfo.sellType={"1":"经销","2":"代销", "3" : "JIT", "4" : "专营店代销入库", "5" : "专营店代销不入库", '10': '经销保税'}[""+goodsInfo.sellType];
goodsInfo.isBonded = goodsInfo.isBonded === 'Y';
var goodList = goodsInfo.baseGoodList;
$.each(goodList, function(index, item) {
var goodsSizeList = item.goodsSizeList;
var newGoodSizeList = [];
$.each(goodsSizeList, function(index, _item) {
var balanceTime = _item.balanceTime;
if(balanceTime && balanceTime != 0) {
_item.balanceTime = new Date(balanceTime * 1000).toLocaleString();
} else {
_item.balanceTime = '';
}
_item.storageBondedBo = _item.storageBondedBo || {};
newGoodSizeList.push(_item);
});
item.goodsSizeList = newGoodSizeList;
});
var param=[goodsInfo.productSkn]
var a=common.util.__template2($("#template").html(), goodsInfo);
$(".contentpanel").html(a);
// 通过
var BllPass={
toast:function(content,fn){
common.dialog.confirm("温馨提示",content,function(){
common.util.__ajax({
url:'/base/goods/pass',
data:fn()
},function(){
// location.reload();
setTimeout(function(){
location.reload();
},2000);
});
});
}
}
// 驳回
var BllReject={
toast:function(content,fn){
common.dialog.confirm("温馨提示",content,function(){
common.util.__ajax({
url:'/base/goods/reject',
data:fn()
},function(){
setTimeout(function(){
location.reload();
},2000);
});
});
}
}
//单个通过
$(document).on("click",".apply-success",function(){
var data=function(){
return {
productSknList:JSON.stringify([param[0]]),
};
}
BllPass.toast("你确定审核通过吗?",data);
return false;
});
//单个驳回
$(document).on("click",".apply-back",function(){
var data=function(){
var reason = $('#bohui').val();
if (reason === '' || $.trim(reason) === '') {
return "请填写驳回原因";
}
return {
productSknList:JSON.stringify([param[0]]),
rejectReason:reason
};
}
BllReject.toast($("#bohuiuuu").html(),data);
return false;
});
/***/ }
]);