Showing
6 changed files
with
53 additions
and
12 deletions
1 | 'use strict'; | 1 | 'use strict'; |
2 | var $ = require('jquery'), | 2 | var $ = require('jquery'), |
3 | common = require('../common/common'); | 3 | common = require('../common/common'); |
4 | - | ||
5 | require('../util/custom.js'); | 4 | require('../util/custom.js'); |
5 | +/* | ||
6 | +* 获取业务数据 | ||
7 | +*/ | ||
8 | +window.NETSALEDATA=require('./partials/data.js'); | ||
9 | + | ||
10 | +console.log(window.NETSALEDATA); | ||
11 | + | ||
12 | +/*加载其他模块*/ | ||
13 | +require('./partials/xiaobian'); | ||
14 | + | ||
15 | + | ||
16 | + | ||
6 | 17 | ||
7 | -var e = new common.edit('#basicForm'); | ||
8 | -e.init(); | 18 | +// var e = new common.edit('#basicForm'); |
19 | +// e.init(); | ||
9 | 20 | ||
10 | -common.edit.ajaxfileupload('.goods-img', { | ||
11 | - action: '/ajax/upload', | ||
12 | - onComplete: function() { | 21 | +// common.edit.ajaxfileupload('.goods-img', { |
22 | +// action: '/ajax/upload', | ||
23 | +// onComplete: function() { | ||
13 | 24 | ||
14 | - } | ||
15 | -}) | ||
25 | +// } | ||
26 | +// }) |
client/js/goods/partials/data.js
0 → 100644
1 | +'use strict'; | ||
2 | +var $ = require('jquery'), | ||
3 | + common = require('../../common/common'); | ||
4 | + | ||
5 | +var ENUM=null; | ||
6 | +var param=location.href.match(/edit\/(\d+)/)[1]; | ||
7 | +common.util.__ajax({ | ||
8 | + url:'/goods/netsale/getdata', | ||
9 | + async:false, | ||
10 | + data:{ | ||
11 | + param:param | ||
12 | + } | ||
13 | +},function(res){ | ||
14 | + ENUM=res.data; | ||
15 | +},true); | ||
16 | + | ||
17 | +module.exports=ENUM; |
client/js/goods/partials/xiaobian.js
0 → 100644
1 | +console.log("小编SB "); |
@@ -29,7 +29,6 @@ var entry={index:[],libs:[]}; | @@ -29,7 +29,6 @@ var entry={index:[],libs:[]}; | ||
29 | entry.libs=commons; | 29 | entry.libs=commons; |
30 | 30 | ||
31 | 31 | ||
32 | - | ||
33 | var readfile=function(dir,callback){ | 32 | var readfile=function(dir,callback){ |
34 | var files = fs.readdirSync(dir); | 33 | var files = fs.readdirSync(dir); |
35 | files.forEach(function (file) { | 34 | files.forEach(function (file) { |
@@ -37,7 +36,7 @@ var readfile=function(dir,callback){ | @@ -37,7 +36,7 @@ var readfile=function(dir,callback){ | ||
37 | if (fs.statSync(filePath).isFile() && /.*\.js$/i.test(file)) { | 36 | if (fs.statSync(filePath).isFile() && /.*\.js$/i.test(file)) { |
38 | callback && callback(filePath); | 37 | callback && callback(filePath); |
39 | }else{ | 38 | }else{ |
40 | - if(file!="common"&&file!="util"){ | 39 | + if(file!="common"&&file!="util"&&file!="partials"){ |
41 | readfile(filePath,callback); | 40 | readfile(filePath,callback); |
42 | } | 41 | } |
43 | } | 42 | } |
@@ -166,11 +166,20 @@ exports.res = [ | @@ -166,11 +166,20 @@ exports.res = [ | ||
166 | route: '/goods/netsale/edit/:param', | 166 | route: '/goods/netsale/edit/:param', |
167 | method: 'GET', | 167 | method: 'GET', |
168 | view: 'pages/goods/netsale-edit', | 168 | view: 'pages/goods/netsale-edit', |
169 | - url: '/product/getNetSaleInfo', | 169 | + // url: '/product/getNetSaleInfo', |
170 | src: '/goods/netsale-edit', | 170 | src: '/goods/netsale-edit', |
171 | data: { | 171 | data: { |
172 | action: '' | 172 | action: '' |
173 | - }, | 173 | + |
174 | + }//, | ||
175 | + // params: [{ | ||
176 | + // name: 'param', | ||
177 | + // type: 'number' | ||
178 | + // }] | ||
179 | + },{ | ||
180 | + route: '/goods/netsale/getdata', | ||
181 | + method: 'POST', | ||
182 | + url: '/product/getNetSaleInfo', | ||
174 | params: [{ | 183 | params: [{ |
175 | name: 'param', | 184 | name: 'param', |
176 | type: 'number' | 185 | type: 'number' |
-
Please register or login to post a comment