model.js
2.48 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
'use strict';
var $ = require('jquery'),
common = require('../../../../common/common');
new common.dropDown({
el: '#select—model',
ajax: 'queryModelListForSelect',
hash: true
});
new common.dropDown({
el: '#select—size',
ajax: 'queryProdSizeListForSel',
hash: true,
params:function(){
return{productSkn:NETSALEDATA.baseProductInfo.baseProduct.productSkn}
}
});
var modelCardTable = new common.grid({
el: "#model-card",
hash: false,
columns: [{
display: '模特',
name: 'modelName'
}, {
display: '尺码',
name: 'size'
}, {
display: '模特卡',
render: function(item) {
return '<img src="' + item.modelImg + '"/>';
}
}]
});
modelCardTable.init(NETSALEDATA.modelcardList);
$(document).on('click', '#btn-model-add', function () {
modelCardTable.init(NETSALEDATA.modelcardList);
var productSkn = NETSALEDATA.baseProductInfo.baseProduct.productSkn;
var modelCardId = $("#select—model").val();
var size = $("#select—size").val();
if(modelCardId==-1){
common.util.__tip("模特姓名不能为空");
return false;
}
if(size==-1){
common.util.__tip("商品尺寸不能为空");
return false;
}
common.util.__ajax({
url: '/goods/product/addproductModelCard',
data: {
productSkn:productSkn,
modelCardId:modelCardId,
size:size
}
}, function (res) {
if(res.code==200){
modelCardTable.init(res.data);
}
setTimeout(function () {
history.go(-1);
}, 1000);
});
});
var modelTryTable = new common.grid({
el: "#model-try",
hash: false,
columns: [{
display: '',
type: 'checkbox',
checked:true
}, {
display: '模特',
name: 'modelName'
}, {
display: '身高/体重',
render: function(item) {
return item.height + 'cm/' + item.weight + 'kg';
}
}, {
display: '三围',
name: 'vitalStatistics',
render: function(item) {
return item.vitalStatistics + 'cm';
}
}, {
display: '试穿尺码',
render: function(item) {
return item.fitModelBo.fit_size;
}
}, {
display: '试穿描述',
render: function(item) {
return item.fitModelBo.feel;
}
}, {
display: '备注',
render: function(item) {
return item.fitModelBo.fit_remark;
}
}]
});
modelTryTable.init(NETSALEDATA.modelTryList);
// $(".wqt_checkbox").attr("checked",'checked');
$(".wqt_checkbox").each(function(){
this.checked="checked";
});
setTimeout(function(){$(".wqt_all").attr("checked",'checked');},2000)