记得上下班打卡 | git大法好,push需谨慎

Commit 0155f233 authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/hjc_now' into hjc_now

parents 66a8f10a 5c031219
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
display: none; display: none;
} }
.scope_application {
display: flex;
}
.scope_application .input-group-btn {
top: 33px;
}
#test1 { #test1 {
display: none; display: none;
} }
...@@ -88,45 +94,16 @@ ...@@ -88,45 +94,16 @@
height: 30px; height: 30px;
width: 200px; width: 200px;
} }
.search_ipt ul,.search_ipt li{ .search_ipt, .search_ipt2 {
width: 200px !important;
display: inline-block;
}
/* .search_ipt ul,.search_ipt li{
padding: 0; padding: 0;
margin: 0; margin: 0;
font-style: normal; font-style: normal;
list-style: none; list-style: none;
} } */
.search_ipt ul {
display: none;
position: absolute;
left: 0;
top: 26px;
padding: 5px 0;
z-index: 899;
min-width: 200px;
border: 1px solid #eee;
max-height: 300px;
overflow-y: auto;
background-color: #fff;
border-radius: 2px;
box-sizing: border-box;
box-shadow: 1px 1px 4px rgb(0 0 0 / 8%);
}
.search_ipt li {
background-color: #fff;
cursor: pointer;
padding-left: 10px!important;
color: #999;
padding: 0 10px;
line-height: 36px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.search_ipt li:hover {
background: #F6F6F6;
}
.search_ipt .layui-input {
width: 200px;
}
#test1 { #test1 {
display: none; display: none;
} }
...@@ -168,11 +145,25 @@ ...@@ -168,11 +145,25 @@
</div> </div>
<div class="scope_application" id="scope_application"> <div class="scope_application" id="scope_application">
<span class="labelName">适用范围:</span> <span class="labelName">适用范围:</span>
<div class="search_ipt" style="position: relative;display: inline;"> <div class="input-group search_ipt" style="margin-right: 12px;">
<input id="searchIpt" data-id="" type="text" class="form-control" placeholder="全部">
<div class="input-group-btn">
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
<div class="input-group search_ipt2" style="margin-right: 12px;">
<input id="searchIpt2" data-id="" type="text" class="form-control" placeholder="全部商品">
<div class="input-group-btn">
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
<!-- <div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部"> <input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul> <ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul>
</div> </div> -->
<select name="bindType" id="selectTwo" placeholder="请选择场次"> <select name="bindType" id="selectTwo" placeholder="请选择场次" style="margin-right: 12px;">
<option value="">所有</option> <option value="">所有</option>
</select> </select>
<select name="bindType" id="selectThree" placeholder="请选择票种"> <select name="bindType" id="selectThree" placeholder="请选择票种">
...@@ -264,6 +255,8 @@ ...@@ -264,6 +255,8 @@
let selectThreeName = ''; // 选中演出三级的名称 let selectThreeName = ''; // 选中演出三级的名称
let sendTimeType = ''; let sendTimeType = '';
let playMethod = '1'; // 叠加/限制 let playMethod = '1'; // 叠加/限制
let goodsId = '';
$("#scope_application").hide();
function search() { function search() {
let data = { let data = {
status: '(3,6,8,9)', status: '(3,6,8,9)',
...@@ -287,6 +280,70 @@ ...@@ -287,6 +280,70 @@
} }
}) })
}; };
function common (num) {
console.log(num, '?????')
let url = '';
let idField = '';
let keyField = '';
let effectiveFields = '';
let domData = '';
if (!num) {
url = ctx+'compilations/goodsList';
idField = 'spuId';
keyField = 'name';
effectiveFields = ['name'];
domData = $("#searchIpt2");
} else {
url = ctx+'kylin/base/performance/status?status=(3,6,8,9)&title=';
idField = 'performancesId';
keyField = 'title';
effectiveFields = ['title'];
domData = $("#searchIpt");
}
domData.bsSuggest('init', {
idField, // data.value 的第几个数据,作为input输入框的内容
keyField, // data.value 的第几个数据,作为input输入框的内容
allowNoKeyword: false, //是否允许无关键字时请求数据
showBtn:false,
multiWord: true, //以分隔符号分割的多关键字支持
hideOnSelect: true,
getDataMethod: "url", //获取数据的方式,总是从 URL 获取
effectiveFields,
url,
/*如果从 url 获取数据,并且需要跨域,则该参数必须设置*/
processData: function (json) { // url 获取数据时,对数据的处理,作为 getData 的回调函数
console.log(json, '?????')
let data = {
value: []
};
if (num) {
searchData = [...json.value];
let obj = {};
searchData.reduce((cur,next) => {
if (!obj[next.performancesId]) {
obj[next.performancesId] = true
data.value.push(next)
}
},[]) //设置cur默认类型为数组,并且初始值为空的数组
return data
} else {
data.value = json.data;
return data;
}
}
}).on('onDataRequestSuccess', function (e, result) {
}).on('onSetSelectValue', function (e, selectedData,selectedRawData ) { // 当前行的所有值都能拿到
if (num) {
selectOne(selectedData.id, selectedData.key)
} else {
console.log(selectedData, '????')
goodsId = selectedData.spuId
}
}).on('onUnsetSelectValue', function (e) {
});;
$("#searchIpt").bsSuggest.init
}
function getMallList() { function getMallList() {
let data = { let data = {
name: searchVal name: searchVal
...@@ -303,15 +360,9 @@ ...@@ -303,15 +360,9 @@
$('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'); $('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>');
} }
}) })
// $.ajax({
// type:'get',
// url:phpMallUrl + '/admin/goodListForQuick',
// success:function(e){
// }
// });
}; };
function selectOne(id,name) { function selectOne(id,name) {
$("#searchIpt").val(name); console.log(id)
showId = id; showId = id;
if (typeOne == 2) { if (typeOne == 2) {
return return
...@@ -335,31 +386,6 @@ ...@@ -335,31 +386,6 @@
$('#selectTwo').empty().append(str); $('#selectTwo').empty().append(str);
$('#selectThree').empty(); $('#selectThree').empty();
}; };
$("#searchIpt").blur(function(){
if (typeOne == 2) {
getMallList()
} else {
search()
}
$('#dataList').show()
});
// $("#searchIpt").blur(function(){
// setTimeout(() => {
// $('#dataList').hide()
// }, 500);
// });
function selectGoods(){
$('#dataList').hide()
}
$("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val()
// search()
if (typeOne == 2) {
getMallList()
} else {
search()
}
});
$('#selectTwo').change(function(e){ $('#selectTwo').change(function(e){
selectTwoId = $(this).val(); selectTwoId = $(this).val();
...@@ -380,46 +406,39 @@ ...@@ -380,46 +406,39 @@
$("input[name=typeOne]").change(function(e){ $("input[name=typeOne]").change(function(e){
typeOne = e.target.value; typeOne = e.target.value;
if (typeOne == 1) { if (typeOne == 1) {
$('#scope_application').show();
$(".search_ipt").show();
$(".search_ipt2").hide();
$("#searchIpt").val(''); $("#searchIpt").val('');
$("#searchIpt").attr('placeholder', '全部'); $('#selectTwo').show().val('').empty();
} $('#selectThree').show().val('').empty();
if (typeOne != 0) { common (1)
showId = ''; // 选中演出id } else if (typeOne == 2) {
showId = '';
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
$('#scope_application').show(); $('#scope_application').show();
$(".search_ipt").hide();
$(".search_ipt2").show();
$("#searchIpt2").val('');
$('#selectTwo').hide();
$('#selectThree').hide();
common (0)
} else { } else {
$('#searchIpt').val('');
$('#selectTwo').empty();
$('#selectThree').empty('');
$('#scope_application').hide(); $('#scope_application').hide();
}
if (typeOne == 2 || typeOne == 3) {
showId = ''; showId = '';
$('#selectTwo').val(''); selectTwoId = ''; // 选中演出下级的ID
$('#selectThree').val(''); selectThreeId = ''; // 选中演出三级的ID
$(".search_ipt").hide();
$(".search_ipt2").hide();
$('#selectTwo').hide(); $('#selectTwo').hide();
$('#selectThree').hide(); $('#selectThree').hide();
$('#searchIpt').val('');
$('#selectTwo').empty();
$('#selectThree').empty();
$('#dataList').empty();
if (typeOne == 2) {
$("#searchIpt").val('');
$("#searchIpt").attr('placeholder', '全部商品');
}
} else {
$('#selectTwo').show();
$('#selectThree').show();
$('#selectTwo').empty();
$('#selectThree').empty();
$('#dataList').empty();
}
if (typeOne == 3) {
$('.playMethod').show()
} else {
$('.playMethod').hide()
} }
// if (typeOne == 3) {
// $('.playMethod').show()
// } else {
// $('.playMethod').hide()
// }
}); });
$("input[name=typeTwo]").change(function(e){ $("input[name=typeTwo]").change(function(e){
typeTwo = e.target.value; typeTwo = e.target.value;
...@@ -438,9 +457,8 @@ ...@@ -438,9 +457,8 @@
$('#iptModal').hide(); $('#iptModal').hide();
$('.sendType').hide(); $('.sendType').hide();
$('.phoneNumber').hide(); $('.phoneNumber').hide();
$('.test1').val(''); $('.test1').val('').hide();
$('.phoneNum').val(''); $('.phoneNum').val('');
$('.test1').hide();
$('#exchange').hide(); $('#exchange').hide();
$('#dataOne1').hide(); $('#dataOne1').hide();
} else { } else {
...@@ -450,9 +468,8 @@ ...@@ -450,9 +468,8 @@
$('#exchange').show(); $('#exchange').show();
$('.sendType').hide(); $('.sendType').hide();
$('.phoneNumber').hide(); $('.phoneNumber').hide();
$('.test1').val(''); $('.test1').val('').hide();
$('.phoneNum').val(''); $('.phoneNum').val('');
$('.test1').hide();
} }
}); });
$("input[name=sendType]").change(function(e){ $("input[name=sendType]").change(function(e){
...@@ -503,9 +520,6 @@ ...@@ -503,9 +520,6 @@
let useScope = 100; let useScope = 100;
let busiName = $('#searchIpt').val(); let busiName = $('#searchIpt').val();
let busiId = ''; let busiId = '';
if (!$('#searchIpt').val()) {
showId = '';
}
if (showId) { if (showId) {
useScope = 90; useScope = 90;
busiId = showId; busiId = showId;
...@@ -521,14 +535,12 @@ ...@@ -521,14 +535,12 @@
// busiName = selectThreeName; // busiName = selectThreeName;
} }
if (typeOne == 2) { if (typeOne == 2) {
if (showId) { useScope = 80;
useScope = 80; busiId = showId;
busiId = showId; busiName = $("#searchIpt2").val() || '全部商品';
}
busiName = $("#searchIpt").val() || '全部商品';
} }
if (typeOne == 0) { if (typeOne == 0) {
busiName = $("#searchIpt").val() || '全场适用'; busiName = '全场适用';
} }
if (typeOne == 3) { if (typeOne == 3) {
if (showId) { if (showId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment