d952938c7c4fa057c5ad467ab4a28640b863c8a9.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <div>
  3. <div class="lod">
  4. <Loading></Loading>
  5. </div>
  6. <div>
  7. <SportsHead></SportsHead>
  8. <div class="Serch">
  9. <div class="Soccer-game row center">
  10. <div class="Soccer-game-title row center" @click="isreturn()">
  11. <img class="returnimg" :src="searchreturn">
  12. {{name}}
  13. </div>
  14. </div>
  15. </div>
  16. <div class="gambling">
  17. <div class="leagueMatch">
  18. <yd-button size="large" @click.native="show = true"></yd-button>
  19. <div class="leagueName">
  20. <span>{{list.leagueName}}</span>
  21. </div>
  22. <div class="teamName">
  23. <span>{{list.home_team}}</span>
  24. <div class="vs">vs</div>
  25. <span>{{list.guest_team}}</span>
  26. </div>
  27. <div class="time">
  28. <span>{{list.match_ptime? list.match_ptime :list.match_time }}</span>
  29. </div>
  30. <div v-if="satatus" class="icon" :class="status == true ? 'rotate':'backRotate'">
  31. <i></i>
  32. </div>
  33. </div>
  34. <div class="box">
  35. <div id="NavSlide">
  36. <nav>
  37. <p v-for="(item,$index) in key" @click="toggleNav($index)" :key="$index">
  38. <span :class="{active:$index==active}">{{item}}</span>
  39. </p>
  40. </nav>
  41. </div>
  42. </div>
  43. <!-- 模态框 -->
  44. <yd-popup v-if="satatus" v-model="show" position="center" width="90%">
  45. <div class="modality">
  46. <div
  47. class="list"
  48. v-for="(item,index) in list.league"
  49. :key="index"
  50. @click="check(index,item.match_id)"
  51. >
  52. <span :class="list.match_id == item.match_id?'col':''">{{item.home_team}}</span>
  53. <span :class="list.match_id == item.match_id?'col':''">v</span>
  54. <span :class="list.match_id == item.match_id?'col':''">{{item.guest_team}}</span>
  55. </div>
  56. </div>
  57. </yd-popup>
  58. </div>
  59. <div v-show="isShow">
  60. <!--让球大小-->
  61. <div v-show="Single =='让球大小' || isAll ">
  62. <goal></goal>
  63. </div>
  64. <!--独赢-->
  65. <div v-show="Single =='独赢'|| isAll ">
  66. <OnlyWin></OnlyWin>
  67. </div>
  68. <!--最先/最后进球-->
  69. <div v-show="Single =='最先/最后进球' || isAll ">
  70. <StartEnd></StartEnd>
  71. </div>
  72. <!-- 总进球数 -->
  73. <div v-show="Single =='总进球数' || isAll ">
  74. <GoalSize></GoalSize>
  75. </div>
  76. <!-- 波胆 -->
  77. <div v-show="Single =='波胆' || isAll ">
  78. <WaveBladder></WaveBladder>
  79. </div>
  80. <!--入球数单双-->
  81. <div v-show="Single =='进球数单双' || isAll ">
  82. <GoalSingleAndDouble></GoalSingleAndDouble>
  83. </div>
  84. <!--半场/全场-->
  85. <div v-show="Single =='半场/全场'|| isAll ">
  86. <FullHalf></FullHalf>
  87. </div>
  88. <!-- 角球 -->
  89. <div v-show="Single =='角球' || isAll ">
  90. <Corner></Corner>
  91. </div>
  92. <!-- 球队进球大小 -->
  93. <div v-show="Single =='球队进球大小' || isAll ">
  94. <TeamGoalSize></TeamGoalSize>
  95. </div>
  96. </div>
  97. <div v-if="!isShow">
  98. <NotOpend :title="tipsTitle"></NotOpend>
  99. </div>
  100. <StLinkFooter></StLinkFooter>
  101. <BettingWindow v-if="isWindow"/>
  102. </div>
  103. </div>
  104. </template>
  105. <script>
  106. import Goal from "@/components/StGoal";
  107. import NotOpend from "@/components/StNotOpend";
  108. import Loading from "@/components/StLoading";
  109. import WaveBladder from "@/components/StWaveBladder";
  110. import StLinkFooter from "@/components/StLinkFooter";
  111. import SportsHead from "@/components/StSportsHead";
  112. import OnlyWin from "@/components/dedicated/StOnlyWin";
  113. import GoalSize from "@/components/dedicated/StGoalSize";
  114. import StartEnd from "@/components/dedicated/StStartEnd";
  115. import FullHalf from "@/components/dedicated/StFullHalf";
  116. import TeamGoalSize from "@/components/dedicated/StTeamGoalSize";
  117. import GoalSingleAndDouble from "@/components/dedicated/StGoalSingleAndDouble";
  118. import Corner from "@/components/dedicated/StCorner";
  119. import BettingWindow from "@/components/StBettingWindow";
  120. export default {
  121. data() {
  122. return {
  123. name:this.$route.query.name, // 球名
  124. searchreturn: require("@/assets/st-imges/returnbox.png"),
  125. gameCode: this.$route.query.gameCode, //别名
  126. match_id: "",
  127. list: [], //数据
  128. key: [], //存储key值进行判定
  129. isShow: "", //更具数据是否显示
  130. status: false,
  131. tipsTitle: "暂无相关数据信息",
  132. active: 0,
  133. // 投注页是否打开
  134. isWindow: false,
  135. // isIphone: false,//是否ios
  136. // isAndroid: false,//是否Android
  137. show: false, //是否显示模态框
  138. satatus: true,
  139. isAll: true,
  140. Single: "",
  141. timers : true
  142. };
  143. },
  144. methods: {
  145. getAjax: function(gameCode, match_id) {
  146. this.$store.dispatch("GETSHOW", true);
  147. this.$http
  148. .get(this.$ports.gambling.matchOdds, {
  149. game_code: gameCode,
  150. matchID: match_id
  151. })
  152. .then(res => {
  153. if (res.data.status == 1) {
  154. this.key = [];
  155. if (
  156. res.data.data.oddsData == [] ||
  157. res.data.data.oddsData.length == 0 ||
  158. res.data.data.oddsData == null
  159. ) {
  160. this.$store.dispatch("GETSHOW", false);
  161. this.isShow = false;
  162. return false;
  163. }
  164. this.list = res.data.data;
  165. let arrayData = [];
  166. let key = Object.keys(res.data.data.p_code_array);
  167. let values = Object.values(res.data.data.p_code_array);
  168. this.isShow = true;
  169. this.key = ["所有盘口"];
  170. key.forEach((e, index) => {
  171. this.key.push(values[index]);
  172. let stripData = [];
  173. res.data.data.oddsData.forEach(data => {
  174. if (data.p_code == e) {
  175. stripData.push(data);
  176. }
  177. arrayData[index] = stripData;
  178. });
  179. });
  180. this.list.oddsData = arrayData;
  181. this.$store.dispatch("GETGAMERATIO", this.list);
  182. console.log("数据源", arrayData);
  183. }
  184. this.$store.dispatch("GETSHOW", false);
  185. });
  186. },
  187. /**
  188. * 切换赛事
  189. */
  190. check(index, match_id) {
  191. this.show = false;
  192. if (this.list.match_id == match_id) return false;
  193. this.$store.dispatch("MACTH_ID", match_id);
  194. this.getAjax(this.gameCode, match_id);
  195. },
  196. /**
  197. * 切换玩法类型
  198. */
  199. toggleNav: function(index) {
  200. this.active = index;
  201. if (this.key[index] == "所有盘口") {
  202. this.isAll = true;
  203. } else {
  204. this.isAll = false;
  205. this.Single = this.key[index];
  206. }
  207. }
  208. /**
  209. // 如果需要区分,则放里面;
  210. clickApp() {
  211. let ua = navigator.userAgent.toLowerCase();
  212. //Android终端
  213. let isAndroid = ua.indexOf("Android") > -1 || ua.indexOf("Adr") > -1; //Ios终端
  214. let isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
  215. if (isWeixinBrowser()) {
  216. this.$router.push({
  217. path: "/product"
  218. });
  219. } else {
  220. if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
  221. //Ios
  222. console.log("iphone");
  223. this.iphone = true;
  224. } else if (/(Android)/i.test(navigator.userAgent)) {
  225. //Android终端
  226. console.log("");
  227. }
  228. }
  229. function isWeixinBrowser() {
  230. return /micromessenger/.test(ua) ? true : false;
  231. }
  232. }
  233. */
  234. },
  235. /**
  236. * 计算属性
  237. */
  238. computed: {
  239. IsWindow() {
  240. return this.$store.getters.getIsBetting;
  241. }
  242. },
  243. /**
  244. * 监听器
  245. */
  246. watch: {
  247. // 监听投注框开关
  248. IsWindow(val) {
  249. this.isWindow = val;
  250. }
  251. },
  252. mounted() {
  253. let _this = this;
  254. this.$public.ajaxTimerFun(function(timing) {
  255. _this.getAjax(_this.gameCode, _this.match_id);
  256. if (!_this.timers) {
  257. clearInterval(timing);
  258. }
  259. });
  260. this.match_id = this.$store.getters.getMatchId;
  261. this.getAjax(this.gameCode, this.match_id);
  262. if (this.$store.getters.getIsBetting) {
  263. this.isWindow = true;
  264. }
  265. },
  266. beforeDestroy() {
  267. this.timers = false;
  268. },
  269. components: {
  270. Corner,
  271. Goal,
  272. WaveBladder,
  273. StLinkFooter,
  274. SportsHead,
  275. OnlyWin,
  276. StartEnd,
  277. GoalSize,
  278. FullHalf,
  279. GoalSingleAndDouble,
  280. TeamGoalSize,
  281. Loading,
  282. NotOpend,
  283. BettingWindow
  284. }
  285. };
  286. </script>
  287. <style scoped>
  288. /* 头部 */
  289. .Serch {
  290. height: 0.88rem;
  291. display: flex;
  292. justify-content: space-between;
  293. align-items: center;
  294. background: linear-gradient(to bottom, #6a6a6a, #565656);
  295. color: #f76649;
  296. font-family: "PingFang-SC-Regular";
  297. padding: 0 0.33rem;
  298. }
  299. .returnimg {
  300. width: 0.37rem;
  301. height: 0.3rem;
  302. margin-right: 0.1rem;
  303. }
  304. .Soccer-game-title {
  305. height: 0.88rem;
  306. font-size: 0.3rem;
  307. }
  308. .Soccer-game-box {
  309. height: 0.88rem;
  310. /* padding: 0 0.32rem; */
  311. background-color: #626262;
  312. }
  313. .gambling {
  314. background: #f8f8f8;
  315. }
  316. .leagueMatch {
  317. position: relative;
  318. padding: 0.3rem 0.32rem;
  319. display: flex;
  320. justify-content: space-between;
  321. align-items: center;
  322. flex-wrap: nowrap;
  323. border-bottom: 1px solid #e4e4e4;
  324. background: linear-gradient(to top, #ffe9c9, #fff3e2);
  325. }
  326. .leagueMatch div {
  327. font-size: 0.28rem;
  328. text-align: left;
  329. color: #333333;
  330. }
  331. .leagueName {
  332. width: 2.26rem;
  333. }
  334. .leagueMatch .teamName {
  335. text-align: center;
  336. }
  337. .teamName .vs {
  338. text-align: center;
  339. font-size: 0.24rem;
  340. color: #fd8f26;
  341. }
  342. .leagueMatch .time {
  343. width: 1.3rem;
  344. color: #333333;
  345. font-size: 0.24rem;
  346. }
  347. .leagueMatch .icon i {
  348. display: inline-block;
  349. width: 0.4rem;
  350. height: 0.4rem;
  351. background: url("../../../assets/st-imges/xiangxia.png") no-repeat;
  352. background-size: 100% 100%;
  353. transform: rotate(180deg);
  354. }
  355. .leagueMatch .rotate {
  356. transform: rotate(180deg);
  357. transition: 0.2s;
  358. }
  359. .leagueMatch .backRotate {
  360. transform: rotate(0deg);
  361. transition: 0.2s;
  362. }
  363. .box {
  364. padding: 0 0.32rem;
  365. background: #f8f8f8;
  366. }
  367. #NavSlide {
  368. width: 100%;
  369. overflow: hidden;
  370. }
  371. #NavSlide nav {
  372. display: -webkit-box;
  373. display: -ms-flexbox;
  374. display: flex;
  375. -webkit-box-align: middle;
  376. -ms-flex-align: middle;
  377. align-items: middle;
  378. overflow: auto;
  379. }
  380. #NavSlide p {
  381. text-align: center;
  382. font-size: 0.28rem;
  383. -ms-flex-negative: 0;
  384. flex-shrink: 0;
  385. padding: 0 0.2rem 0 0;
  386. margin: 0 0.1rem 0 0;
  387. color: #b8b8b8;
  388. height: 0.88rem;
  389. line-height: 0.88rem;
  390. }
  391. /* #NavSlide p a{
  392. color: #E5E5E5;
  393. text-decoration: none;
  394. } */
  395. #NavSlide p span.active {
  396. color: #363636;
  397. }
  398. #NavSlide .fixadd {
  399. position: absolute;
  400. right: -4px;
  401. background-color: #31c17b;
  402. }
  403. button.yd-btn-block {
  404. background: #f8f8f8;
  405. position: absolute;
  406. left: 0;
  407. top: 0;
  408. width: 100%;
  409. height: 100%;
  410. /* z-index: -1; */
  411. margin: 0;
  412. opacity: 0;
  413. }
  414. .modality {
  415. text-align: center;
  416. background: #fbfbfb;
  417. padding: 0.2rem 0;
  418. height: 5rem;
  419. /* overflow: hidden; */
  420. }
  421. .modality span {
  422. color: #000000;
  423. font-size: 0.28rem;
  424. }
  425. .modality div {
  426. /* margin: 0.06rem 0; */
  427. padding: 0.2rem 0;
  428. background: #fbfbfb;
  429. border-bottom: 1px solid #e4e4e4;
  430. }
  431. .modality div .col {
  432. color: #fd8f26;
  433. }
  434. </style>