a9a98820beb625231f871b43c7aa3748619dfc1f.svn-base 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div class="gambling">
  3. <div class="leagueMatch">
  4. <yd-button size="large" @click.native="show = true"></yd-button>
  5. <div class="leagueName">
  6. <span>{{name}}</span>
  7. </div>
  8. <div class="teamName">
  9. <span>{{team}}</span>
  10. <div class="vs">vs</div>
  11. <span>{{backTeam}}</span>
  12. </div>
  13. <div class="time">
  14. <span>{{time}}</span>
  15. </div>
  16. <div v-if = "satatus" class="icon" :class="status == true ? 'rotate':'backRotate'">
  17. <i></i>
  18. </div>
  19. </div>
  20. <div class="box">
  21. <div id="NavSlide">
  22. <nav>
  23. <p v-for="(item,$index) in arr" @click="toggleNav($index,item.id)" :key="item.id">
  24. <span :class="{active:$index==active}">{{item.title}}</span>
  25. </p>
  26. </nav>
  27. </div>
  28. </div>
  29. <!-- 模态框 -->
  30. <yd-popup v-if = "satatus" v-model="show" position="center" width = "90%">
  31. <div class="modality">
  32. <div class="list" v-for="(item,index) in modality" :key="item.id" @click="check(index)">
  33. <span :class= "idx == index?'col':''">{{item.name}}</span>
  34. <span :class= "idx == index?'col':''">v</span>
  35. <span :class= "idx == index?'col':''">{{item.backName}}</span>
  36. </div>
  37. </div>
  38. </yd-popup>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. status: false,
  46. active: 0,
  47. isIphone: false,
  48. isAndroid: false,
  49. show: false,
  50. name:'NBA美国职业篮球 联赛',
  51. team:'菲尼克斯太阳',
  52. backTeam:'犹他爵士',
  53. time:'12/03 22:00',
  54. satatus:true,
  55. idx : 0,
  56. arr: [
  57. { id: 1001, title: "受欢迎的" },
  58. { id: 1002, title: "所有盘口" },
  59. { id: 1003, title: "让球&大/小" },
  60. { id: 1004, title: "进球" },
  61. { id: 1005, title: "上半场" },
  62. { id: 1006, title: "上半场" }
  63. ],
  64. modality: [
  65. {
  66. name: "巴尼特",
  67. backName: "哈洛贾特"
  68. },
  69. {
  70. name:'特斯特菲尔德',
  71. backName:'萨顿联'
  72. },
  73. {
  74. name:'贝罗',
  75. backName:'哈洛贾特'
  76. },
  77. {
  78. name: "巴尼特",
  79. backName: "哈洛贾特"
  80. },
  81. {
  82. name:'特斯特菲尔德',
  83. backName:'萨顿联'
  84. },
  85. {
  86. name:'贝罗',
  87. backName:'哈洛贾特'
  88. } , {
  89. name: "巴尼特",
  90. backName: "哈洛贾特"
  91. },
  92. {
  93. name:'特斯特菲尔德',
  94. backName:'萨顿联'
  95. },
  96. {
  97. name:'贝罗',
  98. backName:'哈洛贾特'
  99. }
  100. ]
  101. };
  102. },
  103. mounted(){
  104. if(this.modality.length == 1){
  105. this.satatus = false;
  106. }
  107. },
  108. methods: {
  109. check(index){
  110. this.team = this.modality[index].name;
  111. this.backTeam = this.modality[index].backName;
  112. this.idx = index;
  113. this.show = false;
  114. },
  115. toggleNav: function(index, id) {
  116. this.active = index;
  117. console.log(index, id);
  118. },
  119. // 如果需要区分,则放里面;
  120. clickApp() {
  121. let ua = navigator.userAgent.toLowerCase();
  122. //Android终端
  123. let isAndroid = ua.indexOf("Android") > -1 || ua.indexOf("Adr") > -1; //Ios终端
  124. let isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
  125. if (isWeixinBrowser()) {
  126. this.$router.push({
  127. path: "/product"
  128. });
  129. } else {
  130. if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
  131. //Ios
  132. console.log("iphone");
  133. this.iphone = true;
  134. } else if (/(Android)/i.test(navigator.userAgent)) {
  135. //Android终端
  136. console.log("");
  137. }
  138. }
  139. function isWeixinBrowser() {
  140. return /micromessenger/.test(ua) ? true : false;
  141. }
  142. }
  143. }
  144. };
  145. </script>
  146. <style scoped>
  147. .gambling {
  148. background: #f8f8f8;
  149. }
  150. .leagueMatch {
  151. position: relative;
  152. padding: 0.3rem 0.32rem;
  153. display: flex;
  154. justify-content: space-between;
  155. align-items: center;
  156. flex-wrap: nowrap;
  157. border-bottom: 1px solid #e4e4e4;
  158. }
  159. .leagueMatch div {
  160. font-size: 0.28rem;
  161. text-align: left;
  162. color: #333333;
  163. }
  164. .leagueName {
  165. width: 2.26rem;
  166. }
  167. .leagueMatch .teamName {
  168. text-align: center;
  169. }
  170. .teamName .vs {
  171. text-align: center;
  172. font-size: 0.24rem;
  173. color: #fd8f26;
  174. }
  175. .leagueMatch .time {
  176. width: 0.66rem;
  177. color: #333333;
  178. font-size: 0.24rem;
  179. }
  180. .leagueMatch .icon i {
  181. display: inline-block;
  182. width: 0.4rem;
  183. height: 0.4rem;
  184. background: url("./../assets/st-imges/xiangxia.png") no-repeat;
  185. background-size: 100% 100%;
  186. transform: rotate(180deg);
  187. }
  188. .leagueMatch .rotate {
  189. transform: rotate(180deg);
  190. transition: 0.2s;
  191. }
  192. .leagueMatch .backRotate {
  193. transform: rotate(0deg);
  194. transition: 0.2s;
  195. }
  196. .box {
  197. padding: 0 0.32rem;
  198. background: #f8f8f8;
  199. }
  200. #NavSlide {
  201. width: 100%;
  202. overflow: hidden;
  203. }
  204. #NavSlide nav {
  205. display: -webkit-box;
  206. display: -ms-flexbox;
  207. display: flex;
  208. -webkit-box-align: middle;
  209. -ms-flex-align: middle;
  210. align-items: middle;
  211. overflow: auto;
  212. }
  213. #NavSlide p {
  214. text-align: center;
  215. font-size: 0.28rem;
  216. -ms-flex-negative: 0;
  217. flex-shrink: 0;
  218. padding: 0 0.2rem 0 0;
  219. margin: 0 0.1rem 0 0;
  220. color: #b8b8b8;
  221. height: 0.88rem;
  222. line-height: 0.88rem;
  223. }
  224. /* #NavSlide p a{
  225. color: #E5E5E5;
  226. text-decoration: none;
  227. } */
  228. #NavSlide p span.active {
  229. color: #363636;
  230. }
  231. #NavSlide .fixadd {
  232. position: absolute;
  233. right: -4px;
  234. background-color: #31c17b;
  235. }
  236. button.yd-btn-block {
  237. background: #f8f8f8;
  238. position: absolute;
  239. left: 0;
  240. top: 0;
  241. width: 100%;
  242. height: 100%;
  243. /* z-index: -1; */
  244. margin: 0;
  245. opacity: 0;
  246. }
  247. .modality {
  248. text-align: center;
  249. background: #fbfbfb;
  250. padding :0.2rem 0;
  251. height: 5rem;
  252. /* overflow: hidden; */
  253. }
  254. .modality span{
  255. color:#000000;
  256. font-size: 0.28rem;
  257. }
  258. .modality div{
  259. /* margin: 0.06rem 0; */
  260. padding: 0.2rem 0;
  261. background: #fbfbfb;
  262. border-bottom: 1px solid #e4e4e4;
  263. }
  264. .modality div .col{
  265. color: #fd8f26;
  266. }
  267. </style>