-
Notifications
You must be signed in to change notification settings - Fork 112
/
top.html
108 lines (104 loc) · 4.49 KB
/
top.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!--顶部-->
<div class="nav-top">
<!--页面顶部白条条,由js动态加载-->
<!--头部-->
<div class="header" id="headApp">
<div class="py-container">
<div class="yui3-g Logo">
<div class="yui3-u Left logoArea">
<a class="logo-bd" title="乐优" @click="gotoHome()" href="javascript:void(0)" target="_blank"></a>
</div>
<div class="yui3-u Center searchArea">
<div class="search">
<form action="" class="sui-form form-inline">
<!--searchAutoComplete-->
<div class="input-append">
<input type="text" id="autocomplete" type="text" v-model="key"
class="input-error input-xxlarge"/>
<button @click="search" class="sui-btn btn-xlarge btn-danger" type="button">搜索</button>
</div>
</form>
</div>
<div class="hotwords">
<ul>
<li class="f-item">乐优首发</li>
<li class="f-item">亿元优惠</li>
<li class="f-item">9.9元团购</li>
<li class="f-item">每满99减30</li>
<li class="f-item">亿元优惠</li>
<li class="f-item">9.9元团购</li>
<li class="f-item">办公用品</li>
</ul>
</div>
</div>
<div class="yui3-u Right shopArea">
<div class="fr shopcar">
<div class="show-shopcar" id="shopcar">
<span class="car"></span>
<a class="sui-btn btn-default btn-xlarge" href="cart.html" target="_blank">
<span>我的购物车</span>
<i class="shopnum">0</i>
</a>
<div class="clearfix shopcarlist" id="shopcarlist" style="display:none">
<p>"啊哦,你的购物车还没有商品哦!"</p>
<p>"啊哦,你的购物车还没有商品哦!"</p>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-g NavList">
<div class="yui3-u Left all-sort">
<h4>乐优精品</h4>
</div>
<div class="yui3-u Center navArea">
<ul class="nav">
<li class="f-item">服装城</li>
<li class="f-item">美妆馆</li>
<li class="f-item">品优超市</li>
<li class="f-item">全球购</li>
<li class="f-item">闪购</li>
<li class="f-item">团购</li>
<li class="f-item">有趣</li>
<li class="f-item"><a href="seckill-index.html" target="_blank">秒杀</a></li>
</ul>
</div>
<div class="yui3-u Right"></div>
</div>
</div>
</div>
<script src="./js/vue/vue.js"></script>
<script src="./js/pages/shortcut.js"></script>
<script type="text/javascript">
console.log(Vue);
var headVm = new Vue({
el: "#headApp",
data: {
key: "",
query: location.search
},
methods: {
search() {
window.location = 'search.html?key=' + this.key;
},
getUrlParam: function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURI(r[2]);
}
return null;
},
gotoHome(){
window.location = "http://www.leyou.com/index.html";
}
},
created() {
this.key = this.getUrlParam("key");
},
components: {
shortcut
}
})
</script>
</div>