| | |
| | | </body> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" onclick="xadmin.open('添加权益','gradePotence-add.html',500,480)"><i class="layui-icon"></i>添加 |
| | | <button class="layui-btn" onclick="openAddViews()"><i class="layui-icon"></i>添加 |
| | | </button> |
| | | </div> |
| | | </script> |
| | |
| | | <div>{{layui.util.toDateString(d.updateTime, 'yyyy-MM-dd HH:mm:ss')}}</div> |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="switchTpl"> |
| | | <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="启用|停用" lay-filter="stateBox" {{ d.state== 1 ? 'checked': ''}} > |
| | | <script type="text/html" id="dateFomat1"> |
| | | <div>{{layui.util.toDateString(d.effectiveTime, 'yyyy-MM-dd HH:mm:ss')}}</div> |
| | | </script> |
| | | |
| | | |
| | | |
| | | <script> |
| | | layui.use('laydate', |
| | |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | var gradeId= GetQueryString("pid"); // 上级did |
| | | |
| | | //封装GetQueryString()方法来获取URL后面的value值 |
| | | function GetQueryString(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | if (r != null) |
| | | return decodeURI(r[2]); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | function openAddViews() { |
| | | xadmin.open('新增链接信息','gradePotence-add.html?pid='+ gradeId,500,480); |
| | | } |
| | | |
| | | |
| | | var app = null; |
| | | layui.use('table', function () { |
| | | //搜索表单的vue赋值 |
| | |
| | | cols: [ |
| | | [{type: 'checkbox', title: "ID"}, |
| | | {field: 'id', width: 80, sort: true, title: "ID"}, |
| | | {field: 'state', width: 80, title: "状态", templet: "#switchTpl"}, |
| | | {field: 'gradeId', edit: 'text', width: 150, title: "等级名称"}, |
| | | {field: 'name',edit: 'text', width: 120, sort: true, title: "等级图标"}, |
| | | {field: 'icon', edit: 'text', width: 150, title: "等级序号"}, |
| | | {field: 'rebatePercent', edit: 'text', width: 150, title: "返利比例"}, |
| | | {field: 'taolijinPercent',edit: 'text', width: 150, sort: true, title: "淘礼金比例"}, |
| | | {field: 'taolijinMaxNumber', edit: 'text', width: 150, title: "每日创建淘礼金的次数"}, |
| | | {field: 'taolijinMaxMoney', edit: 'text', width: 150, title: "每日创建淘礼金的最大金额"}, |
| | | {field: 'effectiveTime', sort: true, width: 150, title: "生效时间", templet:"#dateFomat1"}, |
| | | {field: 'updateTime', sort: true, width: 150, title: "修改时间", templet:"#dateFomat"}, |
| | | {fixed: 'right', width: 250, title: "操作", toolbar: '#barAction'}, |
| | | ] |
| | |
| | | }; |
| | | }); |
| | | |
| | | |
| | | //监听状态操作 |
| | | layui.form.on('switch(stateBox)', function(obj){ |
| | | var state = 0; |
| | | if (obj.elem.checked) { |
| | | state = 1; |
| | | } |
| | | var params = {id: this.value, state: state}; |
| | | app.update(this.value, params); |
| | | }); |
| | | |
| | | });</script> |
| | | </html> |