313392073 5 rokov pred
rodič
commit
71253018b3
1 zmenil súbory, kde vykonal 73 pridanie a 16 odobranie
  1. 73 16
      page/user/billcb.html

+ 73 - 16
page/user/billcb.html

@@ -246,6 +246,18 @@
                             <div class="layui-inline">
                                 <input class="layui-input" name="restauthorname" id="restauthorname" autocomplete="off">
                             </div>
+                            <!-- 购买文章 -->
+                            <span class="allbuy" id="allbuy" style="display: none;">
+                                <span class="searchname">文章类型:</span>
+                                <div class="layui-form layui-inline">
+                                    <select name="buyarticle" lay-filter="buyarticle" id="buyarticle">
+                                        <option value="0">请选择文章类型</option>
+                                        <option value="1">免费文章</option>
+                                        <option value="2">购买文章</option>
+                                        <option value="3">保障贴</option>
+                                    </select>
+                                </div>
+                            </span>
                             <!-- ds -->
                             <span id="allds" style="display: none">
                                 <span class="searchname">打赏类型:</span>
@@ -421,12 +433,26 @@
             var element = layui.element,
                 table = layui.table,
                 form = layui.form
+                form.on('select(buyarticle)', function(data){
+                    $("#restcztype").val(0)
+                    form.render('select');
+                    var tips = "<option value='0'>请先选择彩种</option>" 
+                    $("#restzb").html(tips)
+                    form.render('select');
+                })
                 form.on('select(restcztype)', function(data){
                     var obj = ''
                     var parentid = data.value
                     var typed = $('input[name="type"]:checked').val() //币种类型
+                    var buyarticle = $("#buyarticle").val()
                     if(typed == 2) {
-                        reloadForm(cstype)
+                        if(buyarticle == 0){
+                            layer.msg("请选择文章类型", {icon: 5});
+                        }else if(buyarticle == 3) {
+                            reloadForm(dstype)
+                        }else{
+                            reloadForm(cstype)
+                        }
                     }
                     if(typed == 3) {
                         reloadForm(dstype)
@@ -458,6 +484,7 @@
                         $("#restcztype").val(0);
                         $("#allds").hide()
                         $("#target").hide()
+                        $("#allbuy").hide()
                         tableRender(cols1)
                     }
                     if(data.value == 2) {
@@ -465,6 +492,7 @@
                         $("#restzb").html(tips);
                         form.render("select");
                         $("#allds").hide()
+                        $("#allbuy").show()
                         $("#target").show()
                         tableRender(cols2)
                     }
@@ -472,6 +500,7 @@
                         $("#restcztype").val(0);
                         $("#restzb").html(tips);
                         form.render("select");
+                        $("#allbuy").hide()
                         $("#allds").show()
                         $("#target").show()
                         tableRender(cols3)
@@ -519,11 +548,46 @@
                     { field: 'qi', title: '期数' },
                     // { field: 'articleid', title: '文章编码' },
                     { field: 'articlename', title: '文章名称' },
-                    // { field: 'authorid', title: '作者编码' },
+                    { field: 'type_article', title: '文章类型', templet: function (res) {
+                            var str = '';
+                            switch (res['type_article']) {
+                                case 1:
+                                    str = '免费文章';
+                                    break;
+                                case 2:
+                                    str = '购买文章'
+                                    break;
+                                case 3:
+                                    str = '保障贴'
+                                    break;
+                            }
+                            return str
+                        }
+                    },
+                    {
+                        field: 'type_zb', title: '指标类型', templet: function (res) {
+                            if(res.type_article == 3) {
+                                var str = ''
+                                dstype.forEach((item,index) => {
+                                    if(item.parentid == res['type_cz']) {
+                                        str = dstype[index].datas[res['type_zb']]
+                                    }
+                                })
+                                return str;
+                            }else{
+                                var str = ''
+                                cstype.forEach((item,index) => {
+                                    if(item.parentid == res['type_cz']) {
+                                        str = cstype[index].datas[res['type_zb']]
+                                    }
+                                })
+                                return str;
+                            }
+                        }
+                    },
                     { field: 'authorname', title: '作者名称' },
                     { field: 'money', title: '金额' },
-                    {
-                        field: 'type_cz', title: '彩种类型', templet: function (res) {
+                    { field: 'type_cz', title: '彩种类型', templet: function (res) {
                             var str = '';
                             switch (res['type_cz']) {
                                 case 1:
@@ -542,17 +606,6 @@
                             return str
                         }
                     },
-                    {
-                        field: 'type_zb', title: '指标类型', templet: function (res) {
-                            var str = ''
-                            cstype.forEach((item,index) => {
-                                if(item.parentid == res['type_cz']) {
-                                    str = cstype[index].datas[res['type_zb']]
-                                }
-                            })
-                            return str;
-                        }
-                    },
                     {
                         field: 'createtime', title: '创建时间', templet: function (res) {
                             return formatDate(res.createtime)
@@ -717,6 +770,9 @@
                 var type = $.trim($('#resttype').val()); //打赏类型
                 var type_article = $.trim($('#restarticle').val()); //文章类型
                 var type_zb = $.trim($('#restzb').val()); //文章类型
+
+                var type_article = $.trim($("#buyarticle").val())
+
                 if(userid == '' && qi == '' && authorname == '' && type_cz == 0) {
                     layer.msg("请输入查询条件", {icon: 5});
                     return false
@@ -730,7 +786,8 @@
                 }
                 if(typed == 2) {
                     Object.assign(obj,{
-                        type_zb:type_zb
+                        type_zb:type_zb,
+                        type_article:type_article
                     })
                 } 
                 if(typed == 3) {