38ccdeb02822d3eaf2f5ccf4bb0f69dd1aa8a79a.svn-base 10 KB

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