...
|
...
|
@@ -3,8 +3,8 @@ |
|
|
*/
|
|
|
|
|
|
'use strict';
|
|
|
var $ = require('jquery'),
|
|
|
common = require('../../../common/common');
|
|
|
var $ = require('jquery'), common = require('../../../common/common');
|
|
|
var artTemplate = common.artTemplate;
|
|
|
/**
|
|
|
* 全局变量
|
|
|
* couponTypes 优惠券类型
|
...
|
...
|
@@ -18,12 +18,14 @@ var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"]; |
|
|
// var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"];
|
|
|
var customTypes={1:"新客户",2:"银卡会员", 3:"金卡会员", 4:"白金卡会员", 5:"普通用户(不含新客)",9:"学生"};
|
|
|
var shopPriceLimitsTable={1:"成交价低于吊牌价三折",2:"限量商品"};
|
|
|
var thirdTypeEnum={1:"微信", 2:"支付宝", 3: "微薄"};
|
|
|
|
|
|
var ENUM = {
|
|
|
status: {0: '待审核', 1: '审核通过', 2: '驳回', '-1': '过期', 3: '作废'},//全部
|
|
|
tips: {"0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "all": 0}
|
|
|
};
|
|
|
var columnname = "all";
|
|
|
|
|
|
/**
|
|
|
* 初始化下拉框
|
|
|
*/
|
...
|
...
|
@@ -121,6 +123,9 @@ var g = new common.grid({ |
|
|
arr.push("<p>优惠结果:" + item.couponAmount + "</p>");
|
|
|
arr.push("<p>数量:" + item.couponNum + "</p>");
|
|
|
arr.push("<p>部门:" + item.departmentName + "</p>");
|
|
|
if (item.couponsUseRuleVo && item.couponsUseRuleVo.thirdType) {
|
|
|
arr.push("<p>第三方(" + thirdTypeEnum[item.couponsUseRuleVo.thirdType] + "): " + item.couponsUseRuleVo.thirdId+ "</p>");
|
|
|
}
|
|
|
return arr.join('');
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -236,6 +241,8 @@ var Bll = { |
|
|
btns.push(buttons[array[i]])
|
|
|
}
|
|
|
|
|
|
// 绑定第三方 id
|
|
|
btns.push('<a class="btn btn-warning btn-xs operation-third" data-coupon-id="' + id + '" data-index="' + index + '">绑定三方</a>');
|
|
|
// 增加查看操作记录按钮
|
|
|
btns.push('<a class="btn btn-primary btn-xs operation-records" data-coupon-id="' + id + '">操作记录</a>');
|
|
|
return btns;
|
...
|
...
|
@@ -359,6 +366,47 @@ $(document).on('click', '.coupon-info', function () { |
|
|
|
|
|
Bll.toastInfo(item1, '优惠券详情');
|
|
|
});
|
|
|
// 绑定第三方
|
|
|
$(document).on('click', '.operation-third', function() {
|
|
|
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
var obj = {};
|
|
|
if (item.couponsUseRuleVo && item.couponsUseRuleVo.thirdType) {
|
|
|
obj = item.couponsUseRuleVo;
|
|
|
}
|
|
|
obj["couponId"] = item.id;
|
|
|
|
|
|
var e = new common.edit("#baseform");
|
|
|
|
|
|
var url = "/coupon/updateCouponsUseRule";
|
|
|
|
|
|
var dialog = common.dialog.confirm("绑定第三方 ID", artTemplate("third-template", obj), function() {
|
|
|
|
|
|
e.submit(url, function (option) {
|
|
|
|
|
|
console.log(option.data);
|
|
|
|
|
|
option.success=function() {
|
|
|
dialog.close();
|
|
|
g.reload();
|
|
|
};
|
|
|
option.error=function(){};
|
|
|
});
|
|
|
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
// e.on("validate", function() {
|
|
|
// var thirdId = $("#baseform").find("#thirdId").val();
|
|
|
// if ($.trim(thirdId).length == 0) {
|
|
|
// return "请输入第三方 ID";
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
e.init();
|
|
|
|
|
|
new common.dropDown({ el: "#thirdType" });
|
|
|
});
|
|
|
|
|
|
// 查看操作记录
|
|
|
$(document).on('click', '.operation-records', function() {
|
...
|
...
|
|