Authored by 陶雨

Merge branch 'yohobuy_portal_dev_v4.6_20160601' of http://git.yoho.cn/fe/yohobuy…

…-portal-fe into yohobuy_portal_dev_v4.6_20160601
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 */ 3 */
4 'use strict'; 4 'use strict';
5 var $ = require('jquery'), 5 var $ = require('jquery'),
6 - common=require('../common/common'); 6 + common = require('../common/common');
7 new common.dropDown({el: "#filter-status"}); 7 new common.dropDown({el: "#filter-status"});
8 var couponId = location.href.substring(location.href.lastIndexOf("/") + 1); 8 var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
9 $("#filter-couponId").val(couponId); 9 $("#filter-couponId").val(couponId);
@@ -11,32 +11,37 @@ $("#filter-couponId").val(couponId); @@ -11,32 +11,37 @@ $("#filter-couponId").val(couponId);
11 11
12 var g = new common.grid({ 12 var g = new common.grid({
13 el: '#content-list', 13 el: '#content-list',
14 - hash:false,  
15 - async:false,  
16 - parms:function(){ 14 + hash: false,
  15 + async: false,
  16 + parms: function () {
17 return { 17 return {
18 couponId: couponId, 18 couponId: couponId,
19 isUse: common.util.__input("filter-status") 19 isUse: common.util.__input("filter-status")
20 }; 20 };
21 }, 21 },
22 - columns:[  
23 - {display:"ID", name:"id"},  
24 - {display:"优惠券号",name:"couponCode"},  
25 - {display: '是否发放',name:"isUse"}, 22 + columns: [
  23 + {display: "ID", name: "id"},
  24 + {display: "优惠券号", name: "couponCode"},
  25 + {display: '是否发放', name: "isUse"},
26 { 26 {
27 - display:"创建时间",name:"createTimeStr" 27 + display: "创建时间", name: "createTimeStr"
28 } 28 }
29 ] 29 ]
30 }); 30 });
31 g.init("/pCouponSn/queryCouponSnList"); 31 g.init("/pCouponSn/queryCouponSnList");
32 $("#count").html(g.total); 32 $("#count").html(g.total);
33 33
34 -$(document).on("click", "#filter-btn", function() { 34 +$(document).on("click", "#filter-btn", function () {
35 g.reload(1); 35 g.reload(1);
36 }); 36 });
37 37
38 //导出 38 //导出
39 -$(document).on('click', '#export-btn', function() {  
40 - var queryConf = JSON.stringify({couponId:couponId});  
41 - window.open("/ajax/down?queryConf=" + queryConf + "&type=pCouponSnsExport"); 39 +$(document).on('click', '#export-btn', function () {
  40 + var total = g.total;
  41 + if (total <= 0) {
  42 + common.util.__tip("当前0条数据,无需导出!", "warning")
  43 + } else {
  44 + var queryConf = JSON.stringify({couponId: couponId});
  45 + window.open("/ajax/down?queryConf=" + queryConf + "&type=pCouponSnsExport");
  46 + }
42 }); 47 });
@@ -4,13 +4,13 @@ @@ -4,13 +4,13 @@
4 4
5 'use strict'; 5 'use strict';
6 var $ = require('jquery'), 6 var $ = require('jquery'),
7 - common=require('../common/common'); 7 + common = require('../common/common');
8 8
9 var couponId = location.href.substring(location.href.lastIndexOf("/") + 1); 9 var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
10 10
11 //下拉框 11 //下拉框
12 new common.dropDown({el: '#filter-status'}); 12 new common.dropDown({el: '#filter-status'});
13 -var Bll={ 13 +var Bll = {
14 getTime: function (time) { 14 getTime: function (time) {
15 var t = new Date(time * 1000); 15 var t = new Date(time * 1000);
16 return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); 16 return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
@@ -20,33 +20,40 @@ var Bll={ @@ -20,33 +20,40 @@ var Bll={
20 //grid 20 //grid
21 var g = new common.grid({ 21 var g = new common.grid({
22 el: '#content-list', 22 el: '#content-list',
23 - hash:false,  
24 - async:false,  
25 - parms:function(){ 23 + hash: false,
  24 + async: false,
  25 + parms: function () {
26 return { 26 return {
27 couponId: couponId 27 couponId: couponId
28 //status:common.util.__input("filter-status") 28 //status:common.util.__input("filter-status")
29 }; 29 };
30 }, 30 },
31 - columns:[  
32 - {display:"单券号", name:"couponCode"},  
33 - {display:"用户ID",name:"uid"},  
34 - {display: '发放时间', render: function(item) {  
35 - return Bll.getTime(item.createTime);  
36 - }} 31 + columns: [
  32 + {display: "单券号", name: "couponCode"},
  33 + {display: "用户ID", name: "uid"},
  34 + {
  35 + display: '发放时间', render: function (item) {
  36 + return Bll.getTime(item.createTime);
  37 + }
  38 + }
37 ] 39 ]
38 }); 40 });
39 g.init("/couponLogs/queryUserCouponLogsList"); 41 g.init("/couponLogs/queryUserCouponLogsList");
40 $("#count").html(g.total); 42 $("#count").html(g.total);
41 43
42 -$(document).on("click", "#filter-btn", function() { 44 +$(document).on("click", "#filter-btn", function () {
43 g.reload(1); 45 g.reload(1);
44 }); 46 });
45 47
46 //导出 48 //导出
47 -$(document).on('click', '#export-btn', function() {  
48 - var queryConf = JSON.stringify({couponId:couponId});  
49 - window.open("/ajax/down?queryConf=" + queryConf + "&type=couponLogsExport"); 49 +$(document).on('click', '#export-btn', function () {
  50 + var total = g.total;
  51 + if (total <= 0) {
  52 + common.util.__tip("当前0条数据,无需导出!", "warning")
  53 + } else {
  54 + var queryConf = JSON.stringify({couponId: couponId});
  55 + window.open("/ajax/down?queryConf=" + queryConf + "&type=couponLogsExport");
  56 + }
50 }); 57 });
51 58
52 //输入限制 59 //输入限制
@@ -3,16 +3,16 @@ @@ -3,16 +3,16 @@
3 */ 3 */
4 'use strict'; 4 'use strict';
5 var $ = require('jquery'), 5 var $ = require('jquery'),
6 - common=require('../common/common'); 6 + common = require('../common/common');
7 new common.dropDown({el: "#filter-status"}); 7 new common.dropDown({el: "#filter-status"});
8 var couponId = location.href.substring(location.href.lastIndexOf("/") + 1); 8 var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
9 9
10 //grid 10 //grid
11 var g = new common.grid({ 11 var g = new common.grid({
12 el: '#content-list', 12 el: '#content-list',
13 - hash:false,  
14 - async:false,  
15 - parms:function(){ 13 + hash: false,
  14 + async: false,
  15 + parms: function () {
16 return { 16 return {
17 couponId: couponId, 17 couponId: couponId,
18 couponCode: common.util.__input("filter-couponCode"), 18 couponCode: common.util.__input("filter-couponCode"),
@@ -21,32 +21,39 @@ var g = new common.grid({ @@ -21,32 +21,39 @@ var g = new common.grid({
21 status: common.util.__input("filter-status") 21 status: common.util.__input("filter-status")
22 }; 22 };
23 }, 23 },
24 - columns:[  
25 - {display:"单券号", name:"couponCode"},  
26 - {display:"用户ID",name:"uid"},  
27 - {display:"订单号",name:"orderCode"},  
28 - {display: '是否使用', render: function(item) { 24 + columns: [
  25 + {display: "单券号", name: "couponCode"},
  26 + {display: "用户ID", name: "uid"},
  27 + {display: "订单号", name: "orderCode"},
  28 + {
  29 + display: '是否使用', render: function (item) {
29 var status = ""; 30 var status = "";
30 - if(item.status == 0) { 31 + if (item.status == 0) {
31 status = "未使用"; 32 status = "未使用";
32 - } else if(item.status == 1) { 33 + } else if (item.status == 1) {
33 status = "已使用"; 34 status = "已使用";
34 } 35 }
35 return '<p class="audit-time">' + status + '</p>'; 36 return '<p class="audit-time">' + status + '</p>';
36 - }} 37 + }
  38 + }
37 ] 39 ]
38 }); 40 });
39 g.init("/couponLogs/queryUserCouponLogsList"); 41 g.init("/couponLogs/queryUserCouponLogsList");
40 $("#count").html(g.total); 42 $("#count").html(g.total);
41 43
42 -$(document).on("click", "#filter-btn", function() { 44 +$(document).on("click", "#filter-btn", function () {
43 g.reload(1); 45 g.reload(1);
44 }); 46 });
45 47
46 //导出 48 //导出
47 -$(document).on('click', '#export-btn', function() {  
48 - var queryConf = JSON.stringify({couponId:couponId});  
49 - window.open("/ajax/down?queryConf=" + queryConf + "&type=useCouponLogsExport"); 49 +$(document).on('click', '#export-btn', function () {
  50 + var total = g.total;
  51 + if (total <= 0) {
  52 + common.util.__tip("当前0条数据,无需导出!", "warning")
  53 + } else {
  54 + var queryConf = JSON.stringify({couponId: couponId});
  55 + window.open("/ajax/down?queryConf=" + queryConf + "&type=useCouponLogsExport");
  56 + }
50 }); 57 });
51 58
52 //输入限制 59 //输入限制
@@ -10,16 +10,17 @@ var util = require('../util/common'); @@ -10,16 +10,17 @@ var util = require('../util/common');
10 */ 10 */
11 var config = { 11 var config = {
12 'development': { 12 'development': {
13 - yohoSearch: 'http://192.168.102.216:8080/yohosearch', 13 + yohoSearch: 'http://192.168.102.216:8080/yohosearch'
14 }, 14 },
15 'test': { 15 'test': {
16 - yohoSearch: 'http://10.66.100.4:8080/yohosearch', 16 + yohoSearch: 'http://192.168.102.224:8080/yohosearch/'//168联调
  17 + // yohoSearch: 'http://10.66.100.4:8080/yohosearch',
17 }, 18 },
18 'preview': { 19 'preview': {
19 - yohoSearch: 'http://192.168.102.216:8087/yohosearch', 20 + yohoSearch: 'http://192.168.102.216:8087/yohosearch'
20 }, 21 },
21 'production': { 22 'production': {
22 - yohoSearch: 'http://search.yohoops.org/yohosearch', 23 + yohoSearch: 'http://search.yohoops.org/yohosearch'
23 } 24 }
24 }; 25 };
25 26
@@ -29,8 +29,10 @@ @@ -29,8 +29,10 @@
29 <option value="N">未发放</option> 29 <option value="N">未发放</option>
30 </select> 30 </select>
31 </div> 31 </div>
32 - <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>  
33 - <a id="export-btn" href="" class="btn btn-info">导出</a> 32 + <div class="panel-col">
  33 + <input type="text" class="btn btn-info col-sm-5" id="filter-btn" value="筛选">
  34 + <input type="text" class="btn btn-info col-sm-5 col-sm-offset-1" id="export-btn" value="导出">
  35 + </div>
34 </div> 36 </div>
35 </div> 37 </div>
36 </div> 38 </div>
@@ -23,7 +23,9 @@ @@ -23,7 +23,9 @@
23 <div class="panel panel-default" style="margin-bottom:10px;"> 23 <div class="panel panel-default" style="margin-bottom:10px;">
24 <div class="panel-body"> 24 <div class="panel-body">
25 <div class="row"> 25 <div class="row">
26 - <a id="export-btn" href="" class="btn btn-info">导出</a> 26 + <div class="panel-col">
  27 + <input type="text" class="btn btn-info col-sm-5" id="export-btn" value="导出">
  28 + </div>
27 </div> 29 </div>
28 </div> 30 </div>
29 </div> 31 </div>
@@ -40,8 +40,10 @@ @@ -40,8 +40,10 @@
40 <option value="0">未使用</option> 40 <option value="0">未使用</option>
41 </select> 41 </select>
42 </div> 42 </div>
43 - <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>  
44 - <a id="export-btn" href="" class="btn btn-info">导出</a> 43 + <div class="panel-col">
  44 + <input type="text" class="btn btn-info col-sm-5" id="filter-btn" value="筛选">
  45 + <input type="text" class="btn btn-info col-sm-5 col-sm-offset-1" id="export-btn" value="导出">
  46 + </div>
45 </div> 47 </div>
46 </div> 48 </div>
47 </div> 49 </div>