121285f46911f0098e1c6c253d8ed3839ebcf9fc.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div>
  3. <div class="box">
  4. <div class="row allAlignment center head_on_box">
  5. <p
  6. class="logo"
  7. style="font-size:.6rem;color:#E1E1DF;font-family: 'Franklin Gothic Medium'"
  8. >
  9. <i style="color:#F76649;">HX</i>669
  10. </p>
  11. <!-- <img class="log" src="../assets/st-imges/indexlogo.png" alt=""> -->
  12. <div class="row allAlignment center">
  13. <yd-button type="primary" bgcolor="rgba(0,0,0,0)" @click.native="isshow()">
  14. <img class="user-ion" src="../assets/st-imges/user.png" alt>
  15. </yd-button>
  16. <!-- <div v-if="nameShow" class="row allAlignment center username">
  17. {{name}}
  18. </div> -->
  19. <img
  20. style="margin-left: 0.44rem;"
  21. class="user-ion"
  22. src="../assets/st-imges/contact.png"
  23. alt
  24. >
  25. </div>
  26. </div>
  27. <div class="navtitle-box row">
  28. <div style="width:1rem;height:1rem" class="row center">
  29. <img
  30. @click="returnHome"
  31. :src="indeximg==true?img1:img2"
  32. style="width:0.4rem;height:0.4rem;"
  33. alt
  34. >
  35. </div>
  36. <div class="head_box">
  37. <nav>
  38. <div v-for="(item,$index) in title" class="row pan nav-arr" :key="item.id">
  39. <div class="navtitle row pan">
  40. <div class="nav-box row item-center">
  41. <div
  42. class="headbox"
  43. @click="activityJump($index,item[0].type_code)"
  44. :class="{active:$index==active}"
  45. >{{item[0].type_name}}</div>
  46. <span
  47. :class="{numactive:$index==active}"
  48. class="head_box_num row center"
  49. >{{item[0].matchNum>99?'1+':item[0].matchNum}}</span>
  50. </div>
  51. </div>
  52. </div>
  53. </nav>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import "../css/index.css";
  61. import Login from "@/pages/Login/index/StLogin";
  62. import register from "@/pages/Login/index/register";
  63. export default {
  64. name: "SportsHead",
  65. data() {
  66. return {
  67. show: this.$store.state.isShow,
  68. indeximg: this.$route.query.home ? false : true,
  69. img1: require("../assets/st-imges/home.png"),
  70. img2: require("../assets/st-imges/gengduo-1.png"),
  71. title: "",
  72. active: this.$route.query.number,
  73. init: true,
  74. nameShow:false, //展示登录组件或者是名字
  75. };
  76. },
  77. methods: {
  78. isshow() {
  79. let isShow = true;
  80. this.$store.dispatch("GET_ISSHOW", isShow);
  81. console.log('这是我要的结果',this.$store.state.isShow)
  82. },
  83. /**
  84. * 头部导航
  85. */
  86. activityJump: function(index, code) {
  87. this.indeximg = false;
  88. if (this.active != index) {
  89. this.active = index; //改变当前组件样式
  90. this.$store.dispatch("GETACTIVITY", code); //将活动类别存入vuex里面
  91. //console.log('vuex',this.$store.getters.getActivity);
  92. if (this.$route.query.isTrue) return false;
  93. this.$router.replace({
  94. path: "/StRollBallpage",
  95. query: { number: index, home: 1 }
  96. });
  97. }
  98. },
  99. /**
  100. * 回到首页
  101. */
  102. returnHome: function() {
  103. this.$router.replace({ path: "/" });
  104. this.indeximg = true;
  105. }
  106. },
  107. watch: {
  108. show:{
  109. updata(){
  110. this.updata()
  111. }
  112. }
  113. },
  114. mounted() {
  115. if(localStorage.getItem('name')){
  116. this.name = localStorage.getItem('name')
  117. this.nameShow = true;
  118. }else{
  119. this.nameShow = false;
  120. }
  121. this.$store.dispatch("GETSHOW", true);
  122. this.$http.get(this.$ports.home.navTypeList).then(res => {
  123. console.log('res',res)
  124. if (res.data.status == 1) {
  125. this.title = res.data.data;
  126. for(var i = 0; i < this.title.length; i++){
  127. if(sessionStorage.getItem('activity')){
  128. if(sessionStorage.getItem('activity') == this.title[i][0].type_code){
  129. if(this.indeximg == true){
  130. // console.log("!")
  131. this.active = this.$route.query.number
  132. }else if(this.$route.query.hmsts){
  133. this.active = 0;
  134. // console.log("2")
  135. }else if(this.$route.query.scroll){
  136. // console.log("scroll")
  137. }
  138. else{
  139. this.active = i;
  140. }
  141. }
  142. }
  143. }
  144. this.$store.dispatch("GETSHOW", false);
  145. }
  146. });
  147. },
  148. };
  149. </script>
  150. <style scoped>
  151. .head_on_box{
  152. padding: 0 .32rem;
  153. }
  154. .box {
  155. height: 1.76rem;
  156. background: linear-gradient(to bottom, #999999, #6a6a6b);
  157. overflow: hidden;
  158. }
  159. .navtitle-box{
  160. height: 1rem;
  161. padding: 0 .32rem 0 0;
  162. }
  163. .headbox{
  164. font-size: .3rem;
  165. font-weight: bold;
  166. color: #E1E1DF;
  167. }
  168. .head_box {
  169. width: 86%;
  170. height: 1rem;
  171. }
  172. .head_box nav{
  173. display: -webkit-box;
  174. display: -ms-flexbox;
  175. -webkit-box-align: middle;
  176. -ms-flex-align: middle;
  177. align-items: middle;
  178. overflow-x: auto;
  179. -webkit-overflow-scrolling: touch;
  180. }
  181. .navtitle {
  182. font-size: 0.16rem;
  183. height: 1rem;
  184. -ms-flex-negative: 0;
  185. flex-shrink: 0;
  186. }
  187. .nav-arr{
  188. width: 1.3rem;
  189. }
  190. .user-ion {
  191. width: 0.3rem;
  192. height: 0.3rem;
  193. }
  194. div.active {
  195. color: #f76649;
  196. }
  197. .numactive {
  198. background: #f76649 !important;
  199. color: #f8f8f8 !important;
  200. }
  201. .head_box_num{
  202. width: .4rem;
  203. height: .4rem;
  204. border-radius: 50%;
  205. font-size: .2rem;
  206. background: #E1E1DF;
  207. color: #333;
  208. margin-left: .1rem;
  209. }
  210. .username{
  211. color: #E1E1DF;
  212. }
  213. </style>