/**
|
* 用户详情对话框(可用于添加和修改对话框)
|
*/
|
var TaskInfo = {
|
userInfoData: {},
|
layerIndex: -1,
|
exposureCrowd: $('#exposureCrowd').val()
|
};
|
|
var editor = null;
|
|
/**
|
* 关闭此对话框
|
*/
|
TaskInfo.close = function () {
|
parent.layer.close(window.parent.Task.layerIndex);
|
};
|
|
|
|
TaskInfo.setConfig = function () {
|
let taskType = $('#taskType').val();
|
let type = null;
|
if(taskType == 1){
|
type = $('#cqrw #type').val();
|
}
|
if(taskType == 2){
|
type = $('#bdsrw #type').val();
|
}
|
|
let str = '';
|
let size = '';
|
const array = ('' == $('#taskConfig').val() ? [] : JSON.parse($('#taskConfig').val()));
|
if(taskType == 1 && type == 2){
|
size = ['620px', '530px'];
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">时间周期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="text" class="layui-input" id="dateTime1" value="' + (array.length > 0 ? array[0] + ' - ' + array[1] : '') + '">' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">星期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="week" multiple data-live-search="true" data-style="btn-info" title="请选择">\n' +
|
' <option value="1" ' + (array.length > 0 && array[2] == '1' ? 'selected' : '') + '>星期一</option>\n' +
|
' <option value="2" ' + (array.length > 0 && array[2] == '2' ? 'selected' : '') + '>星期二</option>\n' +
|
' <option value="3" ' + (array.length > 0 && array[2] == '3' ? 'selected' : '') + '>星期三</option>\n' +
|
' <option value="4" ' + (array.length > 0 && array[2] == '4' ? 'selected' : '') + '>星期四</option>\n' +
|
' <option value="5" ' + (array.length > 0 && array[2] == '5' ? 'selected' : '') + '>星期五</option>\n' +
|
' <option value="6" ' + (array.length > 0 && array[2] == '6' ? 'selected' : '') + '>星期六</option>\n' +
|
' <option value="7" ' + (array.length > 0 && array[2] == '7' ? 'selected' : '') + '>星期七</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">加油次数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="times" class="form-control" value="' + (array.length > 0 ? array[3] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">加油金额>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="price" class="form-control" value="' + (array.length > 0 ? array[4] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">油品类型</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="oilType" multiple data-live-search="true" data-style="btn-info" title="请选择">\n' +
|
' <option value="-10" ' + (array.length > 0 && array[5] == '-10' ? 'selected' : '') + '>-10#柴油</option>\n' +
|
' <option value="0" ' + (array.length > 0 && array[5] == '0' ? 'selected' : '') + '>0#柴油</option>\n' +
|
' <option value="92" ' + (array.length > 0 && array[5] == '92' ? 'selected' : '') + '>92#汽油</option>\n' +
|
' <option value="95" ' + (array.length > 0 && array[5] == '95' ? 'selected' : '') + '>95#汽油</option>\n' +
|
' <option value="98" ' + (array.length > 0 && array[5] == '98' ? 'selected' : '') + '>98#汽油</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">是否使用一键加油</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="cheer">\n' +
|
' <option value="" ' + (array.length > 0 && array[6] == '' ? 'selected' : '') + '>请选择</option>\n' +
|
' <option value="0" ' + (array.length > 0 && array[6] == '0' ? 'selected' : '') + '>否</option>\n' +
|
' <option value="1" ' + (array.length > 0 && array[6] == '1' ? 'selected' : '') + '>是</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">加油升数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="liters" class="form-control" value="' + (array.length >= 7 ? array[7] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>'
|
}
|
if(taskType == 1 && type == 3){
|
size = ['620px', '500px'];
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">时间周期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="text" class="layui-input" id="dateTime1" value="' + (array.length > 0 ? array[0] + ' - ' + array[1] : '') + '">' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">星期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="week" multiple data-live-search="true" data-style="btn-info" title="请选择">\n' +
|
' <option value="1" ' + (array.length > 0 && array[2] == '1' ? 'selected' : '') + '>星期一</option>\n' +
|
' <option value="2" ' + (array.length > 0 && array[2] == '2' ? 'selected' : '') + '>星期二</option>\n' +
|
' <option value="3" ' + (array.length > 0 && array[2] == '3' ? 'selected' : '') + '>星期三</option>\n' +
|
' <option value="4" ' + (array.length > 0 && array[2] == '4' ? 'selected' : '') + '>星期四</option>\n' +
|
' <option value="5" ' + (array.length > 0 && array[2] == '5' ? 'selected' : '') + '>星期五</option>\n' +
|
' <option value="6" ' + (array.length > 0 && array[2] == '6' ? 'selected' : '') + '>星期六</option>\n' +
|
' <option value="7" ' + (array.length > 0 && array[2] == '7' ? 'selected' : '') + '>星期七</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">购买次数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="times" class="form-control" value="' + (array.length > 0 ? array[3] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">购买金额>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="price" class="form-control" value="' + (array.length > 0 ? array[4] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">购买非油品商品</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input id="goods" class="form-control" placeholder="商品ID,多个用英文分号分隔" value="' + (array.length > 0 ? array[5] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>' +
|
' </div>'
|
}
|
if(taskType == 1 && type == 4){
|
size = ['620px', '500px'];
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">时间周期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="text" class="layui-input" id="dateTime1" value="' + (array.length > 0 ? array[0] + ' - ' + array[1] : '') + '">' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">星期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="week" multiple data-live-search="true" data-style="btn-info" title="请选择">\n' +
|
' <option value="1" ' + (array.length > 0 && array[2] == '1' ? 'selected' : '') + '>星期一</option>\n' +
|
' <option value="2" ' + (array.length > 0 && array[2] == '2' ? 'selected' : '') + '>星期二</option>\n' +
|
' <option value="3" ' + (array.length > 0 && array[2] == '3' ? 'selected' : '') + '>星期三</option>\n' +
|
' <option value="4" ' + (array.length > 0 && array[2] == '4' ? 'selected' : '') + '>星期四</option>\n' +
|
' <option value="5" ' + (array.length > 0 && array[2] == '5' ? 'selected' : '') + '>星期五</option>\n' +
|
' <option value="6" ' + (array.length > 0 && array[2] == '6' ? 'selected' : '') + '>星期六</option>\n' +
|
' <option value="7" ' + (array.length > 0 && array[2] == '7' ? 'selected' : '') + '>星期七</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">兑换订单数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="times" class="form-control" value="' + (array.length > 0 ? array[3] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">消耗积分数量>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="price" class="form-control" value="' + (array.length > 0 ? array[4] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">兑换商品</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input id="goods" class="form-control" placeholder="商品ID,多个用英文分号分隔" value="' + (array.length > 0 ? array[5] : '') + '"/>\n' +
|
' </div>\n' +
|
' </div>' +
|
' </div>'
|
}
|
if(taskType == 2 && type == 5){
|
size = ['550px', '350px'];
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">跳转类型</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="jumpType">\n' +
|
' <option value="8" ' + (array.length > 0 && array[0] == '8' ? 'selected' : '') + '>积分商城</option>\n' +
|
' <option value="9" ' + (array.length > 0 && array[0] == '9' ? 'selected' : '') + '>我的优惠券列表</option>\n' +
|
' <option value="11" ' + (array.length > 0 && array[0] == '11' ? 'selected' : '') + '>外部H5</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="link1" ' + (array.length > 0 && array[0] == '11' ? '' : 'hidden') + ' style="height: 50px;">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">链接路径</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="address" value="' + (array.length > 0 ? array[1] : '') + '">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="dataCode" ' + (array.length == 0 || (array.length > 0 && array[0] == '8') ? '' : 'hidden') + ' style="height: 50px;">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">商品编码</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="objecCode" value="' + (array.length > 0 ? array[2] : '') + '">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">浏览时间>=</label>\n' +
|
' <div class="col-sm-7">\n' +
|
' <input type="number" min="0" id="duration" class="form-control" value="' + (array.length > 0 ? array[3] : '') + '"/>\n' +
|
' </div>\n' +
|
' <label class="col-sm-1 control-label">秒</label>\n' +
|
' </div>\n' +
|
' </div>'
|
}
|
if(taskType == 2 && type == 6){
|
size = ['700px', '400px'];
|
var ajax = new $ax(Feng.ctxPath + "/coupon/queryAll", function (data) {
|
if(data.code == 200){
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">券包</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="coupon" multiple data-live-search="true" data-style="btn-info" title="请选择">';
|
let arr = data.data;
|
for(const i in arr){
|
str += '<option value="' + arr[i].id + '" ' + (array.length > 0 && array[0] == arr[i].id ? 'selected' : '') + '>' + arr[i].name + '</option>';
|
}
|
str += ' </select>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>'
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("获取失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({});
|
ajax.start();
|
|
}
|
if(taskType == 2 && type == 7){
|
size = ['700px', '400px'];
|
var ajax = new $ax(Feng.ctxPath + "/pointActivity/queryAll", function (data) {
|
if(data.code == 200){
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">报名集点活动</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="pointActivity" multiple data-live-search="true" data-style="btn-info" title="请选择">';
|
let arr = data.data;
|
for(const i in arr){
|
str += '<option value="' + arr[i].id + '" ' + (array.length > 0 && array[0] == arr[i].id ? 'selected' : '') + '>' + arr[i].name + '</option>';
|
}
|
str += ' </select>\n' +
|
' </div>\n' +
|
' </div>\n';
|
|
var ajax = new $ax(Feng.ctxPath + "/salesPromotion/queryAll", function (data) {
|
if(data.code == 200){
|
str +=
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">访问促销活动</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="selectpicker show-tick form-control" id="salesPromotion" multiple data-live-search="true" data-style="btn-info" title="请选择">\n';
|
let arr = data.data;
|
for(const i in arr){
|
str += '<option value="' + arr[i].id + '" ' + (array.length > 0 && array[1] == arr[i].id ? 'selected' : '') + '>' + arr[i].name + '</option>';
|
}
|
str += ' </select>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>'
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("获取失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({});
|
ajax.start();
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("获取失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({});
|
ajax.start();
|
}
|
if(taskType == 2 && type == 8){
|
size = ['500px', '270px'];
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-1 control-label">近</label>\n' +
|
' <div class="col-sm-3">\n' +
|
' <input type="number" min="0" id="day" class="form-control" value="' + (array.length > 0 ? array[0] : '') + '"/>\n' +
|
' </div>\n' +
|
' <label class="col-sm-2 control-label">天 >=</label>\n' +
|
' <div class="col-sm-4">\n' +
|
' <input type="number" min="0" id="times" class="form-control" value="' + (array.length > 0 ? array[1] : '') + '"/>\n' +
|
' </div>\n' +
|
' <label class="col-sm-1 control-label">次</label>\n' +
|
' </div>\n' +
|
' </div>'
|
}
|
if(taskType == 2 && type == 9){
|
size = ['550px', '350px'];
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">跳转类型</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="jumpType">\n' +
|
' <option value="1" ' + (array.length > 0 && array[0] == '1' ? 'selected' : '') + '>签到</option>\n' +
|
' <option value="2" ' + (array.length > 0 && array[0] == '2' ? 'selected' : '') + '>会员权益</option>\n' +
|
' <option value="3" ' + (array.length > 0 && array[0] == '3' ? 'selected' : '') + '>任务中心</option>\n' +
|
' <option value="16" ' + (array.length > 0 && array[0] == '16' ? 'selected' : '') + '>我的优惠券</option>\n' +
|
' <option value="17" ' + (array.length > 0 && array[0] == '17' ? 'selected' : '') + '>我的任务</option>\n' +
|
' <option value="18" ' + (array.length > 0 && array[0] == '18' ? 'selected' : '') + '>我的订单</option>\n' +
|
' <option value="5" ' + (array.length > 0 && array[0] == '5' ? 'selected' : '') + '>券包</option>\n' +
|
' <option value="6" ' + (array.length > 0 && array[0] == '6' ? 'selected' : '') + '>促销活动</option>\n' +
|
' <option value="7" ' + (array.length > 0 && array[0] == '7' ? 'selected' : '') + '>集点活动</option>\n' +
|
' <option value="10" ' + (array.length > 0 && array[0] == '10' ? 'selected' : '') + '>加油站首页</option>\n' +
|
' <option value="12" ' + (array.length > 0 && array[0] == '12' ? 'selected' : '') + '>外部小程序</option>\n' +
|
' <option value="13" ' + (array.length > 0 && array[0] == '13' ? 'selected' : '') + '>一键加油</option>\n' +
|
' <option value="14" ' + (array.length > 0 && array[0] == '14' ? 'selected' : '') + '>开发票</option>\n' +
|
' <option value="15" ' + (array.length > 0 && array[0] == '15' ? 'selected' : '') + '>领券活动</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="link1" ' + (array.length > 0 && array[0] == '12' ? '' : 'hidden') + ' style="height: 50px;">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">链接路径</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="address" value="' + (array.length > 0 ? array[1] : '') + '">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="dataCode" ' + (array.length > 0 && (array[0] == '5' || array[0] == '6' || array[0] == '7' || array[0] == '15') ? '' : 'hidden') + ' style="height: 50px;">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">' + (array.length > 0 && ( array[0] == '6' || array[0] == '7') ? '<span style="color: red">*</span>' : '') + '数据ID</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="objecCode" value="' + (array.length > 0 ? array[2] : '') + '">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="appidDiv" ' + (array.length > 0 && array[0] == '12' ? '' : 'hidden') + ' style="height: 50px;">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">APPID</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="appid" value="' + (array.length > 0 ? array[3] : '') + '">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div id="durationDiv" class="form-group" ' + (array.length == 0 || (array[0] != '10' && array[0] != '12' && array[0] != '13' && array[0] != '14') ? 'hidden' : '') + ' style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">浏览次数>=</label>\n' +
|
' <div class="col-sm-7">\n' +
|
' <input type="number" min="0" id="duration" class="form-control" value="' + (array.length > 0 ? array[4] : '') + '"/>\n' +
|
' </div>\n' +
|
' <label class="col-sm-1 control-label">次</label>\n' +
|
' </div>\n' +
|
' </div>'
|
}
|
|
layer.open({
|
type: 1
|
,title: '设置条件'
|
,area: size
|
,offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
|
,id: 'layerDemo' //防止重复弹出
|
,content: '<div style="padding: 20px">' + str + '</div>'
|
,btn: ['确定', '取消']
|
,btnAlign: 'c' //按钮居中
|
,shade: 0.5 //不显示遮罩
|
,yes: function(){
|
if(taskType == 1 && type == 2){
|
const dateTime1 = $('#dateTime1').val();
|
const week = $('#week').val();
|
const times = $('#times').val();
|
const price = $('#price').val();
|
const oilType = $('#oilType').val();
|
const cheer = $('#cheer').val();
|
const liters = $('#liters').val();
|
if('' == dateTime1 || null == dateTime1){
|
Feng.error("时间周期不能为空");
|
return false;
|
}
|
if('' == times && '' == price && '' == cheer && '' == liters){
|
Feng.error("请填写正确配置");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([dateTime1.split(' - ')[0], dateTime1.split(' - ')[1], (null == week ? "" : week), times, price, (null == oilType ? "" : oilType), cheer,liters]));
|
}
|
if(taskType == 1 && type == 3){
|
const dateTime1 = $('#dateTime1').val();
|
const week = $('#week').val();
|
const times = $('#times').val();
|
const price = $('#price').val();
|
const goods = $('#goods').val();
|
if('' == dateTime1 || null == dateTime1){
|
Feng.error("时间周期不能为空");
|
return false;
|
}
|
if('' == times && '' == price && '' == goods){
|
Feng.error("请填写正确配置");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([dateTime1.split(' - ')[0], dateTime1.split(' - ')[1], (null == week ? "" : week), times, price, goods]));
|
}
|
if(taskType == 1 && type == 4){
|
const dateTime1 = $('#dateTime1').val();
|
const week = $('#week').val();
|
const times = $('#times').val();
|
const price = $('#price').val();
|
const goods = $('#goods').val();
|
if('' == dateTime1 || null == dateTime1){
|
Feng.error("时间周期不能为空");
|
return false;
|
}
|
if('' == times && '' == price && '' == goods){
|
Feng.error("请填写正确配置");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([dateTime1.split(' - ')[0], dateTime1.split(' - ')[1], (null == week ? "" : week), times, price, goods]));
|
}
|
if(taskType == 2 && type == 5){
|
let jumpType = $('#jumpType').val();
|
const address = $('#address').val();
|
let objecCode = $('#objecCode').val();
|
const duration = $('#duration').val();
|
if(jumpType == 11 && (null == address || '' == address)){
|
Feng.error("链接路径不能为空");
|
return false;
|
}
|
if(null == duration || '' == duration){
|
Feng.error("浏览时间不能为空");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([jumpType, address, objecCode, duration]));
|
}
|
if(taskType == 2 && type == 6){
|
const coupon = $('#coupon').val();
|
if(coupon.length == 0){
|
Feng.error("请选择券包")
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify(coupon));
|
}
|
if(taskType == 2 && type == 7){
|
const pointActivity = $('#pointActivity').val();
|
const salesPromotion = $('#salesPromotion').val();
|
if((null != pointActivity && pointActivity.length == 0) || (null != salesPromotion && salesPromotion.length == 0)){
|
Feng.error("请填写正确配置");
|
return false;
|
}
|
if(null == pointActivity && null == salesPromotion){
|
Feng.error("请填写正确配置");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([pointActivity, salesPromotion]));
|
}
|
if(taskType == 2 && type == 8){
|
const day = $('#day').val();
|
const times = $('#times').val();
|
if(null == day || '' == day){
|
Feng.error("浏览天数不能为空");
|
return false;
|
}
|
if(null == times || '' == times){
|
Feng.error("浏览次数不能为空");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([day, times]));
|
}
|
if(taskType == 2 && type == 9){
|
let jumpType = $('#jumpType').val();
|
const address = $('#address').val();
|
let objecCode = $('#objecCode').val();
|
let appid = $('#appid').val();
|
const duration = $('#duration').val();
|
if((jumpType == 6 || jumpType == 7) && (null == objecCode || '' == objecCode)){
|
Feng.error("数据ID不能为空");
|
return false;
|
}
|
if(jumpType == 12 && (null == address || '' == address)){
|
Feng.error("链接路径不能为空");
|
return false;
|
}
|
if(jumpType == 12 && (null == appid || '' == appid)){
|
Feng.error("APPID不能为空");
|
return false;
|
}
|
if((jumpType == 10 || jumpType == 12 || jumpType == 13 || jumpType == 14) && (null == duration || '' == duration)){
|
Feng.error("浏览次数不能为空");
|
return false;
|
}
|
$('#taskConfig').val(JSON.stringify([jumpType, address, objecCode, appid, duration]));
|
}
|
layer.closeAll();
|
},
|
});
|
$('.selectpicker').selectpicker();
|
if(taskType == 1 && type == 2){
|
$('#week').selectpicker('val', array[2]);
|
$('#week').selectpicker('refresh');
|
$('#oilType').selectpicker('val', array[5]);
|
$('#oilType').selectpicker('refresh');
|
}
|
if(taskType == 1 && type == 3){
|
$('#week').selectpicker('val', array[2]);
|
$('#week').selectpicker('refresh');
|
}
|
if(taskType == 1 && type == 4){
|
$('#week').selectpicker('val', array[2]);
|
$('#week').selectpicker('refresh');
|
}
|
if(taskType == 2 && type == 6){
|
$('#coupon').selectpicker('val', array[0]);
|
$('#coupon').selectpicker('refresh');
|
}
|
if(taskType == 2 && type == 7){
|
$('#pointActivity').selectpicker('val', array[0]);
|
$('#pointActivity').selectpicker('refresh');
|
$('#salesPromotion').selectpicker('val', array[1]);
|
$('#salesPromotion').selectpicker('refresh');
|
}
|
layui.use('laydate', function() {
|
var laydate = layui.laydate;
|
laydate.render({
|
elem: '#dateTime1'
|
, type: 'datetime'
|
, range: true
|
});
|
});
|
|
$('#jumpType').on('change', function () {
|
const v = $(this).val();
|
if(v == 0 || v == 1 || v == 2 || v == 3 || v == 4 || v == 9){
|
$('#link1').hide();
|
$('#appidDiv').hide();
|
$('#dataCode').hide();
|
$('#durationDiv').hide();
|
$('#durationDiv input').val('');
|
$('#link1 #address').val('');
|
$('#dataCode input').val('');
|
$('#appidDiv input').val('');
|
}
|
if(v == 5 || v == 6 || v == 7 || v==15 ){
|
$('#link1').hide();
|
$('#appidDiv').hide();
|
$('#dataCode').show();
|
$('#durationDiv').hide();
|
$('#durationDiv input').val('');
|
$('#link1 #address').val('');
|
$('#appidDiv input').val('');
|
if(v == 6 || v == 7){
|
$('#dataCode').find('label').empty().append('<span style="color: red">*</span>数据ID');
|
}else {
|
$('#dataCode').find('label').text('数据ID');
|
}
|
}
|
|
if(v == 10 || v == 13 || v == 14){
|
$('#link1').hide();
|
$('#appidDiv').hide();
|
$('#dataCode').hide();
|
$('#durationDiv').show();
|
$('#link1 #address').val('');
|
$('#dataCode input').val('');
|
$('#appidDiv input').val('');
|
}
|
if(v == 11){
|
$('#link1').show();
|
$('#appidDiv').hide();
|
$('#dataCode').hide();
|
$('#durationDiv').hide();
|
$('#durationDiv input').val('');
|
$('#appidDiv input').val('');
|
$('#dataCode input').val('');
|
}
|
if(v == 12){
|
$('#link1').show();
|
$('#appidDiv').show();
|
$('#dataCode').hide();
|
$('#durationDiv').show();
|
$('#dataCode input').val('');
|
}
|
if(v == 8){
|
$('#link1').hide();
|
$('#appidDiv').hide();
|
$('#dataCode').show();
|
$('#durationDiv').hide();
|
$('#durationDiv input').val('');
|
$('#link1 #address').val('');
|
$('#appidDiv input').val('');
|
$('#dataCode').find('label').text('商品编码');
|
}
|
})
|
};
|
|
|
|
/**
|
* 提交添加任务
|
*/
|
TaskInfo.addSubmit = function () {
|
const name = $('#name').val();
|
const explain = $('#explain').val();
|
const icon = $('#icon').val();
|
const taskType = $('#taskType').val();
|
const type = taskType == 1 ? $('#cqrw #type').val() : $('#bdsrw #type').val();
|
const dateTime = $('#dateTime').val();
|
const bonusPoints = $('#bonusPoints').val();
|
const sort = $('#sort').val();
|
const taskConfig = $('#taskConfig').val();
|
|
const frequency = $('#frequency').val();
|
const zhouSelectpicker = $('#zhouSelectpicker').find("select").val();
|
const yueSelectpicker = $('#yueSelectpicker').find("select").val();
|
var frequencyTime="";
|
if(frequency==1){//周
|
frequencyTime=zhouSelectpicker==null?[]:zhouSelectpicker;
|
}else {
|
frequencyTime=yueSelectpicker==null?[]:yueSelectpicker;
|
}
|
var pointTime = [];
|
$(".pointTime").each(function(){
|
pointTime.push($(this).val());
|
});
|
|
if(null == name || '' == name){
|
Feng.error("任务名称不能为空");
|
return
|
}
|
if(null == explain || '' == explain){
|
Feng.error("任务说明不能为空");
|
return
|
}
|
if(null == icon || '' == icon){
|
Feng.error("任务图标不能为空");
|
return
|
}
|
if(null == taskConfig || '' == taskConfig){
|
Feng.error("任务设置不能为空");
|
return
|
}
|
if(null == dateTime || '' == dateTime){
|
Feng.error("任务有效期不能为空");
|
return
|
}
|
if(null == bonusPoints || '' == bonusPoints){
|
Feng.error("任务赠送积分不能为空");
|
return
|
}
|
if(null == sort || '' == sort){
|
Feng.error("排序不能为空");
|
return
|
}
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/task/addTask", function (data) {
|
if(data.code == 200){
|
layer.closeAll('loading'); //关闭loading
|
Feng.success("添加成功!");
|
window.parent.Task.table.refresh();
|
TaskInfo.close();
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({
|
name: name,
|
explain: explain,
|
icon: icon,
|
taskType: taskType,
|
type: type,
|
startTime: dateTime.split(' - ')[0],
|
endTime: dateTime.split(' - ')[1],
|
bonusPoints: bonusPoints,
|
sort: sort,
|
taskConfig: taskConfig,
|
frequency: frequency,
|
frequencyTime: JSON.stringify(frequencyTime),
|
pointTime: JSON.stringify(pointTime),
|
exposureCrowd: TaskInfo.exposureCrowd
|
});
|
ajax.start();
|
};
|
|
/**
|
* 提交修改
|
*/
|
TaskInfo.editSubmit = function () {
|
layer.load(); //上传loading
|
const name = $('#name').val();
|
const explain = $('#explain').val();
|
const icon = $('#icon').val();
|
const taskType = $('#taskType').val();
|
const type = taskType == 1 ? $('#cqrw #type').val() : $('#bdsrw #type').val();
|
const dateTime = $('#dateTime').val();
|
const bonusPoints = $('#bonusPoints').val();
|
const sort = $('#sort').val();
|
const taskConfig = $('#taskConfig').val();
|
|
const frequency = $('#frequency').val();
|
const zhouSelectpicker = $('#zhouSelectpicker').find("select").val();
|
const yueSelectpicker = $('#yueSelectpicker').find("select").val();
|
var frequencyTime="";
|
if(frequency==1){//周
|
frequencyTime=zhouSelectpicker==null?[]:zhouSelectpicker;
|
}else {
|
frequencyTime=yueSelectpicker==null?[]:yueSelectpicker;
|
}
|
var pointTime = [];
|
$(".pointTime").each(function(){
|
pointTime.push($(this).val());
|
});
|
if(null == name || '' == name){
|
Feng.error("任务名称不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
if(null == explain || '' == explain){
|
Feng.error("任务说明不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
if(null == icon || '' == icon){
|
Feng.error("任务图标不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
if(null == taskConfig || '' == taskConfig){
|
Feng.error("任务设置不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
if(null == dateTime || '' == dateTime){
|
Feng.error("任务有效期不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
if(null == bonusPoints || '' == bonusPoints){
|
Feng.error("任务赠送积分不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
if(null == sort || '' == sort){
|
Feng.error("排序不能为空");
|
layer.closeAll('loading');
|
return
|
}
|
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/task/editTask", function (data) {
|
layer.closeAll('loading'); //关闭loading
|
if(data.code == 200){
|
Feng.success("编辑成功!");
|
window.parent.Task.table.refresh();
|
TaskInfo.close();
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("编辑失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({
|
id: $('#id').val(),
|
name: name,
|
explain: explain,
|
icon: icon,
|
taskType: taskType,
|
type: type,
|
startTime: dateTime.split(' - ')[0],
|
endTime: dateTime.split(' - ')[1],
|
bonusPoints: bonusPoints,
|
sort: sort,
|
taskConfig: taskConfig,
|
frequency: frequency,
|
frequencyTime: JSON.stringify(frequencyTime),
|
pointTime: JSON.stringify(pointTime),
|
exposureCrowd: TaskInfo.exposureCrowd
|
});
|
ajax.start();
|
};
|
|
TaskInfo.showExposureCrowd = function(){
|
var index = layer.open({
|
type: 2,
|
title: '用户标签设置',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/exposureCrowd/showExposureCrowd?objectType=5&id=' + $('#id').val() + "&page=TaskInfo"
|
});
|
this.layerIndex = index;
|
}
|
|
|
//投放时间点添加
|
TaskInfo.addPointTime = function(){
|
var pointTimeDiv='<div class="form-group">\n' +
|
' <label class="col-sm-3 control-label"></label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control pointTime">\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <i class="fa fa-minus-square" onclick="TaskInfo.subtractPointTime(this)" style="font-size:24px"></i>\n' +
|
' </div>\n' +
|
' </div>';
|
$(".pointTime").last().parent().parent().after(pointTimeDiv);
|
//初始化时间选择器
|
$('.pointTime').each(function (e, i) {
|
layui.use('laydate', function() {
|
var laydate = layui.laydate;
|
laydate.render({
|
// 绑定元素
|
elem: i,
|
// 类型:时间
|
type: 'time',
|
range:true,
|
// 格式:时分秒
|
format: 'HH:mm:ss',
|
|
});
|
});
|
});
|
}
|
|
//投放时间点删除
|
TaskInfo.subtractPointTime = function(e){
|
$(e).parent().parent().remove();
|
}
|
|
$(function () {
|
// 初始化头像上传
|
var avatarUp = new $WebUpload("icon");
|
avatarUp.setUploadBarId("progressBar");
|
avatarUp.init();
|
|
$('#taskType').on('change', function () {
|
const v = $(this).val();
|
if(v == 1){
|
$('#cqrw').show();
|
$('#bdsrw').hide();
|
$('#frequencyDiv').hide();
|
if($('#cqrw #type').val() == 1){
|
$('#cqrw #config').hide();
|
$('#cqrw #gzhdz').show();
|
}else{
|
$('#cqrw #config').show();
|
$('#cqrw #gzhdz').hide();
|
}
|
}
|
if(v == 2){
|
$("#bdsrw #config").show();
|
$('#cqrw').hide();
|
$('#bdsrw').show();
|
$('#frequencyDiv').show();
|
}
|
$('#cqrw #link').val('');
|
$('#taskConfig').val('');
|
})
|
|
$('#cqrw #type').on('change', function () {
|
const v = $(this).val();
|
if(v == 1){
|
$('#gzhdz').show();
|
$("#cqrw #config").hide();
|
}else{
|
$('#gzhdz').hide();
|
$("#cqrw #config").show();
|
}
|
$('#cqrw #link').val('');
|
$('#taskConfig').val('');
|
})
|
$('#bdsrw #type').on('change', function () {
|
$('#cqrw #link').val('');
|
$('#taskConfig').val('');
|
})
|
|
$('#gzhdz #link').on('blur', function () {
|
$('#taskConfig').val(JSON.stringify([$(this).val()]));
|
})
|
|
if($('#taskType').val() == 1 && $('#cqrw #type').val() == 1){
|
var v = $('#taskConfig').val();
|
if(v != ''){
|
$('#gzhdz #link').val(JSON.parse(v)[0]);
|
}
|
}
|
//编辑页加载数据
|
if(typeof $('#code').val() != "undefined"){
|
let taskType = $('#taskType').val();
|
let type = null;
|
if(taskType == 1){
|
type = $('#cqrw #type').val();
|
}
|
if(taskType == 2){
|
type = $('#bdsrw #type').val();
|
}
|
|
let str = '';
|
let arr = JSON.parse($('#taskConfig').val());
|
if(taskType == 1 && type == 1){
|
$('#link').val(arr[0]);
|
}
|
}
|
|
|
//详情页面加载数据
|
if(typeof $('#code').val() != "undefined"){
|
let taskType = $('#taskType').val();
|
let type = null;
|
if(taskType == 1){
|
type = $('#cqrw #type').val();
|
}
|
if(taskType == 2){
|
type = $('#bdsrw #type').val();
|
}
|
|
let str = '';
|
let arr = '' == $('#taskConfig').val() ? [] : JSON.parse($('#taskConfig').val());
|
if(taskType == 1 && type == 1){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">跳转链接</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input id="link" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n'
|
|
$('#content').html(str);
|
$('#link').val(arr[0]);
|
}
|
if(taskType == 1 && type == 2){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">时间周期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="text" class="layui-input" id="dateTime1" readonly>' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">星期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="week" disabled>\n' +
|
' <option value="">请选择</option>\n' +
|
' <option value="1">星期一</option>\n' +
|
' <option value="2">星期二</option>\n' +
|
' <option value="3">星期三</option>\n' +
|
' <option value="4">星期四</option>\n' +
|
' <option value="5">星期五</option>\n' +
|
' <option value="6">星期六</option>\n' +
|
' <option value="7">星期七</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">加油次数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="times" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">加油金额>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="price" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">油品类型</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="oilType" disabled>\n' +
|
' <option value="">请选择</option>\n' +
|
' <option value="-10">-10#柴油</option>\n' +
|
' <option value="0">0#柴油</option>\n' +
|
' <option value="92">92#汽油</option>\n' +
|
' <option value="95">95#汽油</option>\n' +
|
' <option value="98">98#汽油</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">是否使用一键加油</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="cheer" disabled>\n' +
|
' <option value="">请选择</option>\n' +
|
' <option value="0">否</option>\n' +
|
' <option value="1">是</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>'+
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">加油升数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="liters" class="form-control" value="" disabled/>\n' +
|
' </div>\n' +
|
' </div>\n' ;
|
|
$('#content').html(str);
|
$('#dateTime1').val(arr[0] + ' - ' + arr[1]);
|
$('#week').val(arr[2]);
|
$('#times').val(arr[3]);
|
$('#price').val(arr[4]);
|
$('#oilType').val(arr[5]);
|
$('#cheer').val(arr[6]);
|
$('#liters').val(arr[7]);
|
}
|
if(taskType == 1 && type == 3){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">时间周期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="text" class="layui-input" id="dateTime1" readonly>' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">星期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="week" disabled>\n' +
|
' <option value="">请选择</option>\n' +
|
' <option value="1">星期一</option>\n' +
|
' <option value="2">星期二</option>\n' +
|
' <option value="3">星期三</option>\n' +
|
' <option value="4">星期四</option>\n' +
|
' <option value="5">星期五</option>\n' +
|
' <option value="6">星期六</option>\n' +
|
' <option value="7">星期七</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">购买次数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="times" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">购买金额>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="price" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">购买非油品商品</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input id="goods" class="form-control" placeholder="商品ID,多个用英文分号分隔" readonly/>\n' +
|
' </div>\n' +
|
' </div>'
|
|
$('#content').html(str);
|
$('#dateTime1').val(arr[0] + ' - ' + arr[1]);
|
$('#week').val(arr[2]);
|
$('#times').val(arr[3]);
|
$('#price').val(arr[4]);
|
$('#goods').val(arr[5]);
|
}
|
if(taskType == 1 && type == 4){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">时间周期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="text" class="layui-input" id="dateTime1" readonly>' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">星期</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="week" disabled>\n' +
|
' <option value="">请选择</option>\n' +
|
' <option value="1">星期一</option>\n' +
|
' <option value="2">星期二</option>\n' +
|
' <option value="3">星期三</option>\n' +
|
' <option value="4">星期四</option>\n' +
|
' <option value="5">星期五</option>\n' +
|
' <option value="6">星期六</option>\n' +
|
' <option value="7">星期七</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">兑换订单数>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="times" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">消耗积分数量>=</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input type="number" min="0" id="price" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">兑换商品</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input id="goods" class="form-control" placeholder="商品ID,多个用英文分号分隔" readonly/>\n' +
|
' </div>\n' +
|
' </div>'
|
|
$('#content').html(str);
|
$('#dateTime1').val(arr[0] + ' - ' + arr[1]);
|
$('#week').val(arr[2]);
|
$('#times').val(arr[3]);
|
$('#price').val(arr[4]);
|
$('#goods').val(arr[5]);
|
}
|
|
|
if(taskType == 2 && type == 5){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">跳转类型</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="jumpType" disabled>\n' +
|
' <option value="8">积分商城</option>\n' +
|
' <option value="9">我的优惠券列表</option>\n' +
|
' <option value="11">外部H5</option>\n' +
|
' </select>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="link1">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">链接路径</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="address" value="" readonly>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div id="dataCode" style="height: 50px;">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">商品编码</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <input class="form-control" id="objecCode" value="" readonly>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">浏览时间>=</label>\n' +
|
' <div class="col-sm-7">\n' +
|
' <input type="number" min="0" id="duration" class="form-control" value="" readonly>\n' +
|
' </div>\n' +
|
' <label class="col-sm-1 control-label">秒</label>\n' +
|
' </div>\n';
|
|
$('#content').html(str);
|
$('#jumpType').val(arr[0]);
|
if(arr[0] == 8){
|
$('#link1').hide();
|
$('#objecCode').val(arr[2]);
|
}
|
if(arr[0] == 9){
|
$('#link1').hide();
|
$('#dataCode').hide();
|
}
|
if(arr[0] == 11){
|
$('#dataCode').hide();
|
$('#address').val(arr[1]);
|
}
|
$('#duration').val(arr[3]);
|
}
|
if(taskType == 2 && type == 6){
|
var ajax = new $ax(Feng.ctxPath + "/coupon/queryAll", function (data) {
|
if(data.code == 200){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">券包</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="coupon" disabled>\n'+
|
' <option value="0">请选择券包</option>\n';
|
let array = data.data;
|
for(const i in array){
|
str += '<option value="' + array[i].id + '">' + array[i].name + '</option>';
|
}
|
str += ' </select>\n' +
|
' </div>\n' +
|
' </div>\n'
|
|
$('#content').html(str);
|
$('#coupon').val(arr[0])
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("获取失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({});
|
ajax.start();
|
|
}
|
if(taskType == 2 && type == 7){
|
var ajax = new $ax(Feng.ctxPath + "/pointActivity/queryAll", function (data) {
|
if(data.code == 200){
|
str = '<div class="row">\n' +
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">报名集点活动</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="pointActivity" disabled>\n'+
|
' <option value="0">请选择集点活动</option>\n' ;
|
let array = data.data;
|
for(const i in array){
|
str += '<option value="' + array[i].id + '">' + array[i].name + '</option>';
|
}
|
str += ' </select>\n' +
|
' </div>\n' +
|
' </div>\n';
|
|
var ajax = new $ax(Feng.ctxPath + "/salesPromotion/queryAll", function (data) {
|
if(data.code == 200){
|
str +=
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">访问促销活动</label>\n' +
|
' <div class="col-sm-8">\n' +
|
' <select class="form-control" id="salesPromotion" disabled>\n'+
|
' <option value="0">请选择促销活动</option>\n' ;
|
let array = data.data;
|
for(const i in array){
|
str += '<option value="' + array[i].id + '">' + array[i].name + '</option>';
|
}
|
str += ' </select>\n' +
|
' </div>\n' +
|
' </div>\n'
|
|
$('#content').html(str);
|
$('#pointActivity').val(arr[0]);
|
$('#salesPromotion').val(arr[1]);
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("获取失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({});
|
ajax.start();
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("获取失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({});
|
ajax.start();
|
}
|
if(taskType == 2 && type == 8){
|
str =
|
' <div class="form-group" style="height: 50px;">\n' +
|
' <label class="col-sm-3 control-label">近</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input type="number" min="0" id="day" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' <label class="col-sm-1 control-label">天 >=</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input type="number" min="0" id="times" class="form-control" readonly/>\n' +
|
' </div>\n' +
|
' <label class="col-sm-1 control-label">次</label>\n' +
|
' </div>\n'
|
$('#content').html(str);
|
$('#day').val(arr[0]);
|
$('#times').val(arr[1]);
|
}
|
|
}
|
|
//投放频率切换
|
$('#frequency').on('change', function () {
|
var frequencyVal = $(this).val();
|
$(".selectpicker").selectpicker('val',"");
|
if(frequencyVal==2){
|
$("#zhouSelectpicker").hide();
|
$("#yueSelectpicker").show();
|
$("#nullSelectpicker").hide();
|
}else if(frequencyVal==1){
|
$("#zhouSelectpicker").show();
|
$("#yueSelectpicker").hide();
|
$("#nullSelectpicker").hide();
|
}else{
|
$("#zhouSelectpicker").hide();
|
$("#yueSelectpicker").hide();
|
$("#nullSelectpicker").show();
|
}
|
})
|
//编辑回显投放频率类型
|
var frequencyInput = $('#frequencyInput').val();
|
if(frequencyInput==2){
|
$("#zhouSelectpicker").hide();
|
$("#yueSelectpicker").show();
|
$("#nullSelectpicker").hide();
|
}else if(frequencyInput==1){
|
$("#zhouSelectpicker").show();
|
$("#yueSelectpicker").hide();
|
$("#nullSelectpicker").hide();
|
}else{
|
$("#zhouSelectpicker").hide();
|
$("#yueSelectpicker").hide();
|
$("#nullSelectpicker").show();
|
}
|
//编辑回显投放频率时间
|
var obj = eval('(' + $("#frequencyTimeInput").val() + ')');
|
$(".selectpicker").selectpicker('val',obj );
|
//时间周期回显
|
var taskType = $("#taskType").val();
|
if(taskType==2){
|
$("#frequencyDiv").show();
|
}
|
});
|