...
|
...
|
@@ -7,8 +7,8 @@ webpackJsonp([71],[ |
|
|
*/
|
|
|
|
|
|
'use strict';
|
|
|
var $ = __webpack_require__(1),
|
|
|
common = __webpack_require__(2);
|
|
|
var $ = __webpack_require__(1), common = __webpack_require__(2);
|
|
|
var artTemplate = common.artTemplate;
|
|
|
/**
|
|
|
* 全局变量
|
|
|
* couponTypes 优惠券类型
|
...
|
...
|
@@ -22,12 +22,14 @@ webpackJsonp([71],[ |
|
|
// 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";
|
|
|
|
|
|
/**
|
|
|
* 初始化下拉框
|
|
|
*/
|
...
|
...
|
@@ -125,6 +127,9 @@ webpackJsonp([71],[ |
|
|
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('');
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -240,6 +245,8 @@ webpackJsonp([71],[ |
|
|
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;
|
...
|
...
|
@@ -363,6 +370,47 @@ webpackJsonp([71],[ |
|
|
|
|
|
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() {
|
...
|
...
|
|