<html>
|
<head>
|
<meta charset="utf-8">
|
<title>团队订单</title>
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<link rel="stylesheet" type="text/css" href="../teamFans/css/fansSearchMain.css" />
|
<script>
|
window.onresize = function() {
|
document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
|
};
|
window.onresize();
|
</script>
|
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
|
<script src="http://img.flqapp.com/resource/js/app2019112217.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
</head>
|
<body>
|
<div id="root" style="display: none;">
|
<div class="div_search">
|
<div class="div_search_gary">
|
<img src="img/icon_search.png">
|
<form action="" v-on:submit.prevent>
|
<input id="input_result" class="inputc" type="search" autofocus="autofocus" placeholder="输入快省ID/订单号" />
|
</form>
|
</div>
|
<div class="div_search_button" @click="touchSearch">
|
搜索
|
</div>
|
</div>
|
|
<div v-show="show" class="div_historySearch">
|
<div class="historySearch">
|
历史搜索
|
</div>
|
<div class="clearSearch" @click="clearAll">
|
清空
|
</div>
|
</div>
|
|
<div class="div_item_bg">
|
<div class="items" v-for="(item, index) in dataList" @click="didSelect(item)">
|
<div class="div_topHeader" style="height: 0.16rem;"></div>
|
<div class="div_garyBG">
|
<p>{{item}}</p>
|
</div>
|
<img src="img/icon_close.png" class="imageClose">
|
<div class="div_closeClick" @click="deleteList(index)"></div>
|
</div>
|
</div>
|
</div>
|
</body>
|
|
<script>
|
var host = "http://api.flqapp.com";
|
// "http://apph5.banliapp.com" || "http://192.168.1.114:8848/flqFront/"
|
var h5host = "http://apph5.banliapp.com/";
|
|
$(function() {
|
var app = new Vue({
|
el: '#root',
|
data: {
|
show: false,
|
dataList: [],
|
},
|
watch: {
|
dataList: function(val) {
|
if (val != null && val.length != 0) {
|
app.show = true;
|
}
|
$('#root').css('display', 'block');
|
}
|
},
|
methods: {
|
deleteList: function(index) {
|
var list = app.dataList;
|
list.splice(index, 1);
|
app.dataList = list;
|
if (list.length == 0 || list == null) {
|
app.show = false;
|
}
|
localStorage.setItem('orderResut', JSON.stringify(list));
|
},
|
|
didSelect: function(result) {
|
yesApp.jumpWeb(h5host + 'AppInside/teamOrder/orderSearchResult.html?key=' + result,
|
null)
|
},
|
|
touchSearch: function() {
|
var result = $('#input_result').val();
|
if (result == null || result.length == 0) {
|
yesApp.toast('请输入搜索关键字');
|
return;
|
}
|
|
var userJsonStr = localStorage.getItem('orderResut');
|
var userEntity = JSON.parse(userJsonStr);
|
|
var list = userEntity;
|
if (list == null || list.length == 0) {
|
list = [];
|
|
} else {
|
for (i = 0; i < list.length; i++) {
|
if (list[i] == result) {
|
list.splice(i, 1);
|
}
|
}
|
}
|
list.unshift(result);
|
app.dataList = list;
|
|
localStorage.setItem('orderResut', JSON.stringify(list));
|
|
yesApp.jumpWeb(h5host + 'AppInside/teamOrder/orderSearchResult.html?key=' + result,
|
null)
|
},
|
|
clearAll: function() {
|
app.dataList = [];
|
app.show = false;
|
localStorage.removeItem("orderResut");
|
},
|
|
fetchData: function() {
|
var userJsonStr = localStorage.getItem('orderResut');
|
var userEntity = JSON.parse(userJsonStr);
|
|
var list = userEntity;
|
app.dataList = list;
|
}
|
}
|
});
|
app.fetchData();
|
|
setTimeout(function() {
|
$('#input_result').focus();
|
}, 1000);
|
|
$("#input_result").keypress(function(e) {
|
var key = $.trim($(this).val());
|
if (e.keyCode === 13) {
|
|
if (key == null || key.length == 0) {
|
yesApp.toast('请输入搜索关键字');
|
return;
|
}
|
|
var userJsonStr = localStorage.getItem('orderResut');
|
var userEntity = JSON.parse(userJsonStr);
|
|
var list = userEntity;
|
if (list == null || list.length == 0) {
|
list = [];
|
|
} else {
|
for (i = 0; i < list.length; i++) {
|
if (list[i] == key) {
|
list.splice(i, 1);
|
}
|
}
|
}
|
list.unshift(key);
|
app.dataList = list;
|
|
localStorage.setItem('orderResut', JSON.stringify(list));
|
|
yesApp.jumpWeb(h5host + 'AppInside/teamOrder/orderSearchResult.html?key=' + key,
|
null)
|
}
|
})
|
});
|
</script>
|
</html>
|