|  |  |  | 
|---|
|  |  |  | <select name="gainType" class="gain-type" lay-filter="gain-type-select"> | 
|---|
|  |  |  | <option value="1">会员日</option> | 
|---|
|  |  |  | <option value="2">会员生日</option> | 
|---|
|  |  |  | <option value="3">其他</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 重新绑定图片上传 | 
|---|
|  |  |  | bindUpload(i+1); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | listenerLinkContent(); | 
|---|
|  |  |  | listenerGoodsSelect(); | 
|---|
|  |  |  | listenerCouponSelect(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | $(".linkContent").each(function(index, elem) { | 
|---|
|  |  |  | var dataIndex = $(this).attr('data-index'); | 
|---|
|  |  |  | var $this = $(this); | 
|---|
|  |  |  | $(this).off('blur') | 
|---|
|  |  |  | $(this).on('blur', function() { | 
|---|
|  |  |  | var data = $this.val(); | 
|---|
|  |  |  | hasData[dataIndex - 1].content = data; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $(".goodsSelect").each(function(index, elem) { | 
|---|
|  |  |  | var dataIndex = $(this).attr('data-index'); | 
|---|
|  |  |  | $(this).off('click') | 
|---|
|  |  |  | $(this).on('click', function() { | 
|---|
|  |  |  | febs.modal.open('选择商品', 'modules/vip/config/goodsSelect/' + dataIndex, { | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | 
|---|
|  |  |  | function listenerCouponSelect() { | 
|---|
|  |  |  | $(".couponSelect").each(function(index, elem) { | 
|---|
|  |  |  | var dataIndex = $(this).attr('data-index'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $(this).off('click') | 
|---|
|  |  |  | $(this).on('click', function() { | 
|---|
|  |  |  | febs.modal.open('选择优惠券', 'modules/vip/config/couponSelect/' + dataIndex, { | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var data = {}; | 
|---|
|  |  |  | data.linkType = linkTypeVal; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (isClickVal == 1) { | 
|---|
|  |  |  | data.linkType = linkTypeVal; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | data.isClick = isClickVal; | 
|---|
|  |  |  | addTableDate(data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | form.on('submit(vipBenefits-add-form-submit)', function (data) { | 
|---|
|  |  |  | data.field.details = tableBenefitsItemsData; | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | 'url':ctx + 'admin/vip/benefits/addBenefits', | 
|---|
|  |  |  | 'url':ctx + 'admin/vip/benefits/addOrEditBenefits', | 
|---|
|  |  |  | 'type':'post', | 
|---|
|  |  |  | 'dataType':'json', | 
|---|
|  |  |  | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 | 
|---|
|  |  |  | 
|---|
|  |  |  | if(data.code==200){ | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | febs.alert.success(data.message); | 
|---|
|  |  |  | $('#febs-act').find('#reset').click(); | 
|---|
|  |  |  | $('#febs-vip-benefits').find('#reset').click(); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | febs.alert.warn(data.message); | 
|---|
|  |  |  | } | 
|---|