882e4021addebed4e57be5d10fc03eff5bc7604b.svn-base 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. <template>
  2. <!-- 禁止滚动 -->
  3. <div>
  4. <div class="Serch row item-center">
  5. <div class="Soccer-game row item-center">
  6. <div
  7. style=" display:flex;align-items:center;justify-content:center;"
  8. class="Soccer-game-title"
  9. @click="isreturn()"
  10. >
  11. <img class="box-img" src="../assets/st-imges/returnbox.png">
  12. {{this.title}}
  13. </div>
  14. </div>
  15. <div class="Serch-box row item-center">
  16. <div class="Serch-box-home row item-center">
  17. <img class="Serch-box-img" src="../assets/st-imges/sousuo.png">
  18. <input
  19. v-model="SerchValue"
  20. @input="searchTeam(SerchValue)"
  21. class="Serch-box-input"
  22. type="text"
  23. placeholder="请输入球队名称"
  24. >
  25. <img
  26. class="Serch-box-del"
  27. @click="delinputvalue()"
  28. v-if="Serchchange==true"
  29. src="../assets/st-imges/del.png"
  30. >
  31. </div>
  32. </div>
  33. </div>
  34. <div v-if="isMatchShow" class="row allAlignment box center">
  35. <span>{{data.leagueName}}</span>
  36. <div class="Match-title-num">
  37. <span>{{data.matchNum}}</span>
  38. </div>
  39. </div>
  40. <div v-if="isMatchShow && ballSelt == 10" v-for=" (item,index) in data.matchData" :key="index" class="Match-box">
  41. <div class="row allAlignment Match-box-top">
  42. <div class="Match-box-top-left">
  43. <span>{{item.match_date}}</span>
  44. <span>{{item.match_time}}</span>
  45. </div>
  46. <div class="Match-box-top-right row">
  47. <span style="margin-right: .15rem;" class="Match-box-top-num">{{item.tag}}</span>
  48. <span style="margin-right: .15rem;">让球</span>
  49. <span style="margin-right: .15rem;">大小</span>
  50. </div>
  51. </div>
  52. <div
  53. class="row allAlignment center"
  54. @click="matchInfo(item.match_id);"
  55. style="padding:0 .32rem"
  56. >
  57. <div class="column average name-box">
  58. <div>{{item.home_team}}</div>
  59. <div>{{item.guest_team}}</div>
  60. </div>
  61. <div class="Match-bottom-right">
  62. <!-- 主队 -->
  63. <div class="" v-for="(items,indexs) in item.oddsData" :key="indexs">
  64. <div v-if="items.odds">
  65. <div class="" v-if="items.odds_code.startsWith('concede')">
  66. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="letballHome" v-if="items.odds_code.endsWith('home')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',data.lg_id,items.status,items.p_code,'让球')">
  67. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  68. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  69. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  70. </div>
  71. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="letballGuest" v-if="items.odds_code.endsWith('guest')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',data.lg_id,items.status,items.p_code,'让球')">
  72. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  73. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  74. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  75. </div>
  76. </div>
  77. <div v-if="items.odds_code.startsWith('size')" class="row bigSmall" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'大小')">
  78. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigHome" v-if="items.odds_code.endsWith('home')">
  79. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  80. <span class="bigSmall">大</span>
  81. <span v-if="items.condition != '大'">{{items.condition}}</span>
  82. </div>
  83. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  84. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  85. </div>
  86. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigGuest" v-if="items.odds_code.endsWith('guest')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'大小')">
  87. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  88. <span class="bigSmall">小</span>
  89. <span v-if="items.condition != '小'">{{items.condition}}</span>
  90. </div>
  91. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  92. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  93. </div>
  94. </div>
  95. <div v-if="items.odds_code.startsWith('goal')" class="row bigSmall" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'大小')">
  96. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigHome" v-if="items.odds_code.endsWith('big')">
  97. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  98. <span class="bigSmall">大</span>
  99. <span v-if="items.condition != '大'">{{items.condition}}</span>
  100. </div>
  101. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  102. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  103. </div>
  104. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigGuest" v-if="items.odds_code.endsWith('small')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'大小')">
  105. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  106. <span class="bigSmall">小</span>
  107. <span v-if="items.condition != '小'">{{items.condition}}</span>
  108. </div>
  109. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  110. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  111. </div>
  112. </div>
  113. <div v-if="items.odds_code.startsWith('total')" class="row bigSmall" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'大小')">
  114. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigHome" v-if="items.odds_code.endsWith('big')">
  115. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  116. <span class="bigSmall">大</span>
  117. <span v-if="items.condition != '大'">{{items.condition}}</span>
  118. </div>
  119. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  120. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  121. </div>
  122. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigGuest" v-if="items.odds_code.endsWith('small')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'大小')">
  123. <div style="color: rgb(247, 102, 73); " class="stardBig" v-if="items.odds > 0">
  124. <span class="bigSmall">小</span>
  125. <span v-if="items.condition != '小'">{{items.condition}}</span>
  126. </div>
  127. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  128. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <!-- 网球 -->
  137. <div v-if="isMatchShow && ballSelt == 100" v-for=" (item,index) in data.matchData" :key="item.id" class="Match-box">
  138. <div class="row allAlignment Match-box-top wqMatch-box">
  139. <div class="Match-box-top-left">
  140. <span>{{item.match_date}}</span>
  141. <span style="color: rgb(253, 143, 38);">{{item.match_time}}</span>
  142. <div>三盘两胜</div>
  143. </div>
  144. <div class="Match-box-top-right row">
  145. <span style="margin-right: .15rem;height:100%;line-height:0.65rem;" class="Match-box-top-num">{{item.tag}}</span>
  146. <span style="margin-right: .15rem;line-height:0.65rem;">独赢盘</span>
  147. <span style="margin-right: .15rem;line-height:0.65rem;">让盘</span>
  148. </div>
  149. </div>
  150. <div
  151. class="row allAlignment center"
  152. @click="matchInfo(item.match_id);"
  153. style="padding:0 .32rem"
  154. >
  155. <div class="column average wqavg name-box">
  156. <div>{{item.home_team}}</div>
  157. <div>{{item.guest_team}}</div>
  158. </div>
  159. <div class="Match-bottom-right">
  160. <!-- 主队 -->
  161. <div class="" v-for="(items,indexs) in item.oddsData" :key="indexs">
  162. <div class="" v-if="items.odds_code.startsWith('kemp')">
  163. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="letballHome" v-if="items.odds_code.endsWith('home')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',data.lg_id,items.status,items.p_code,'独赢盘')">
  164. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  165. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  166. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  167. </div>
  168. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="letballGuest" v-if="items.odds_code.endsWith('guest')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',data.lg_id,items.status,items.p_code,'独赢盘')">
  169. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  170. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  171. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  172. </div>
  173. </div>
  174. <div v-if="items.odds_code.startsWith('dishes')" class="row bigSmall" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'让盘')">
  175. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigHome" v-if="items.odds_code.endsWith('home')">
  176. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  177. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  178. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  179. </div>
  180. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigGuest" v-if="items.odds_code.endsWith('guest')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'让盘')">
  181. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  182. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  183. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. <!-- 棒球 -->
  191. <div v-if="isMatchShow && ballSelt == 1000" v-for=" (item,index) in data.matchData" :key="item.id" class="Match-box">
  192. <div class="row allAlignment Match-box-top">
  193. <div class="Match-box-top-left">
  194. <span>{{item.match_date}}</span>
  195. <span>{{item.match_time}}</span>
  196. </div>
  197. <div class="Match-box-top-right row">
  198. <span style="margin-right: .15rem;" class="Match-box-top-num">{{item.tag}}</span>
  199. <span style="margin-right: .15rem;">独赢盘</span>
  200. </div>
  201. </div>
  202. <div
  203. class="row allAlignment center"
  204. @click="matchInfo(item.match_id);"
  205. style="padding:0 .32rem"
  206. >
  207. <div class="column average name-box">
  208. <div>{{item.home_team}}</div>
  209. <div>{{item.guest_team}}</div>
  210. </div>
  211. <!-- <div class="Match-bottom-right">
  212. <div class="row">
  213. <div
  214. class="Match-list-left"
  215. v-for="(items,indexs) in item.oddsData.homeOdds"
  216. :key="indexs"
  217. @click.stop="bteBetting(item.match_id, items.id,item.home_team,item.guest_team,item.home_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',items.lg_id,items.status,items.p_code)"
  218. >
  219. <div :class="{ 'active' : items.isTrue == true}" class="column center">
  220. <span style="color:#FD8F26" v-if="items.odds > 0">{{items.condition}}</span>
  221. <span v-if="items.odds >0">{{items.odds}}</span>
  222. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  223. </div>
  224. </div>
  225. </div>
  226. <div class="row">
  227. <div
  228. class="Match-list-right row"
  229. v-for="(items,indexs) in item.oddsData.guestOdds"
  230. :key="indexs"
  231. @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',items.lg_id,items.status,items.p_code)"
  232. >
  233. <div :class="{'active':items.isTrue==true}" class="column center">
  234. <span v-if="items.odds > 0">
  235. <i style="color:#FD8F26">{{items.condition}}</i>
  236. </span>
  237. <span v-if="items.odds >0">{{items.odds}}</span>
  238. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  239. </div>
  240. </div>
  241. </div>
  242. </div> -->
  243. <div class="Match-bottom-right">
  244. <!-- 主队 -->
  245. <div class="" v-for="(items,indexs) in item.oddsData" :key="indexs">
  246. <div v-if="items.odds_code">
  247. <div v-if="items.odds_code.startsWith('capot')" class="row bigSmall" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'homeOdds',data.lg_id,items.status,items.p_code,'独赢盘')">
  248. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigHome" v-if="items.odds_code.endsWith('home')">
  249. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  250. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  251. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  252. </div>
  253. <div :class="{active:items.isTrue,increased_color:items.change == 'add',reduce_color:items.change == 'red'}" class="bigGuest" v-if="items.odds_code.endsWith('guest')" @click.stop="bteBetting(item.match_id,items.id,item.home_team,item.guest_team,item.guest_team,items.odds,items.condition,items.odds_only,items.odds_code,'guestOdds',data.lg_id,items.status,items.p_code,'独赢盘')">
  254. <span style="color: rgb(247, 102, 73); " v-if="items.odds > 0">{{items.condition}}</span>
  255. <span v-if="items.odds >0" :class="items.condition == '' ? 'mg':''">{{items.odds}}</span>
  256. <img v-if="items.odds <= 0" style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. <!-- <div class = "lod">
  265. <Loading></Loading>
  266. </div>-->
  267. <div class="BettingWindow" v-if="isBettingShow =='100'">
  268. <BettingWindow/>
  269. </div>
  270. <div v-if="noData">
  271. <NotOpend :title="this.info"/>
  272. </div>
  273. </div>
  274. </template>
  275. <script>
  276. import BettingWindow from "./StBettingWindow.vue";
  277. import NotOpend from "@/components/StNotOpend";
  278. import Loading from "@/components/StLoading";
  279. export default {
  280. name: "SerchBox",
  281. data() {
  282. return {
  283. SerchValue: "",
  284. Serchchange: false,
  285. title: " ", //标题
  286. data: " ",
  287. isMatchShow: true,
  288. lg_id: "",
  289. isAddData: false, //判断是否添加
  290. game_code: this.$route.query.game_code, //球的类型别名
  291. leagueID: this.$route.query.leagueID, //获取联赛id
  292. isBettingShow: "0", //投注显示关闭默认false
  293. score: "0", //比分
  294. codeShow: false, // 如果是参赛表传值过来,则显示另一部分
  295. info: "没有相关联赛信息",
  296. noData: false, //没有数据为true
  297. betting: [], //vuex里面玩法投注数据
  298. timers: true,
  299. getIsShow:true,
  300. ballSelt:0, // 当为10的时候为篮球,足球,100的时候为网球,1000的时候为棒球
  301. // 存储变色数据
  302. previousStorage:[]
  303. };
  304. },
  305. components: {
  306. BettingWindow,
  307. NotOpend,
  308. Loading
  309. },
  310. /**
  311. *函数方法
  312. */
  313. methods: {
  314. /*--------------------------------------------------------------------------------*/
  315. // 返回上一页
  316. isreturn() {
  317. history.go(-1);
  318. },
  319. /*--------------------------------------------------------------------------------*/
  320. // 是否显示删除按钮
  321. serchchange(val) {
  322. if (val.length >= 1) {
  323. this.Serchchange = true;
  324. } else {
  325. this.Serchchange = false;
  326. }
  327. },
  328. /*--------------------------------------------------------------------------------*/
  329. // 查询球队
  330. searchTeam(val) {
  331. let getActivity = this.$store.getters.getActivity;
  332. let matchDate = this.$route.query.matchDate;
  333. let dataObj = this.dataObj;
  334. if (val.length >= 1) {
  335. this.Serchchange = true;
  336. } else {
  337. this.Serchchange = false;
  338. }
  339. dataObj.search = val;
  340. if (this.$route.query.navBall) {
  341. this.getMatchData(this.$ports.match.matchState, dataObj);
  342. } else {
  343. dataObj.type_code = "";
  344. dataObj.search = val;
  345. this.getMatchData(this.$ports.match.matchDetails, dataObj);
  346. }
  347. },
  348. /*--------------------------------------------------------------------------------*/
  349. // 清空输入
  350. delinputvalue() {
  351. this.SerchValue = "";
  352. this.Serchchange = false;
  353. let matchDate = this.$route.query.matchDate;
  354. let dataObj = {
  355. oddsType: this.$store.getters.activity,
  356. game_code: this.game_code,
  357. leagueID: "",
  358. lg_id: this.leagueID,
  359. type_code: this.$store.getters.getActivity,
  360. matchDate: "",
  361. match_date: matchDate,
  362. search: "",
  363. str_type: ""
  364. };
  365. if (this.$route.query.navBall) {
  366. this.getMatchData(this.$ports.match.matchState, dataObj);
  367. } else {
  368. dataObj.leagueID = this.leagueID;
  369. dataObj.lg_id = "";
  370. dataObj.type_code = "";
  371. dataObj.matchDate = matchDate;
  372. dataObj.match_date = "";
  373. this.getMatchData(this.$ports.match.matchDetails, dataObj);
  374. }
  375. },
  376. /*--------------------------------------------------------------------------------*/
  377. // 添加、删除vuex投注数据公共方法
  378. AddDelete: function(match_id,id,home,guest,name,odds,condition,odds_only,odds_code,type,lg_id,status,p_code,play_name
  379. ) {
  380. let isAdd = true,isNew=true;
  381. let matchList = this.$store.getters.getBetting;
  382. if (status == "-1") return false;
  383. let ball = this.$store.getters.getBallId;
  384. // if(ball == 'zq'){
  385. let bettingInfo = {
  386. id,
  387. home_team: home,
  388. guest_team: guest,
  389. name,
  390. odds,
  391. match_id,
  392. condition,
  393. ballId: ball,
  394. odds_code: odds_code,
  395. p_code,
  396. play_name,
  397. score: this.score,
  398. bettingTime: "",
  399. odds_only,
  400. lg_id,
  401. odds_id: id
  402. };
  403. //添加新的玩法赔率数据
  404. let obj = {
  405. title:p_code,
  406. data: [bettingInfo]
  407. };
  408. if(matchList !=null ){
  409. for(let i =0 ;i < matchList.length; i++ ){
  410. if(matchList[i].title == p_code){
  411. //删除vuex投注数据
  412. matchList[i].data.forEach((res, index) => {
  413. // console.log(res.id,id)
  414. if (res.id == id) {
  415. matchList[i].data.splice(index, 1);
  416. this.$store.dispatch("SET_LIMIT", false);
  417. this.$store.dispatch("BETTING", []);
  418. this.$store.dispatch("BETTING", matchList);
  419. isAdd = false;
  420. isNew = false;
  421. //处理当前页面样式
  422. this.modifyStyle(id,type);
  423. }
  424. });
  425. //添加vuex投注数据
  426. if (isAdd){
  427. isNew = false;
  428. if (this.$store.getters.getLimit * 1 >= 10) return false;
  429. //处理当前页面样式
  430. this.modifyStyle(id, type);
  431. matchList[i].data.push(bettingInfo);
  432. this.$store.dispatch("BETTING",[]);
  433. this.$store.dispatch("BETTING",matchList);
  434. if (this.$store.getters.getIsBetting == "100") return false;
  435. this.$store.dispatch("ISBETTING",100);
  436. }
  437. break;
  438. }
  439. }
  440. if(isNew){
  441. matchList.push(obj)
  442. this.$store.dispatch("BETTING",[]);
  443. this.$store.dispatch("BETTING",matchList);
  444. this.modifyStyle(id, type);
  445. if (this.$store.getters.getIsBetting == "100") return false;
  446. this.$store.dispatch("ISBETTING", "100");
  447. }
  448. }else{
  449. this.$store.dispatch("BETTING",[obj]);
  450. this.modifyStyle(id, type);
  451. if (this.$store.getters.getIsBetting == "100") return false;
  452. this.$store.dispatch("ISBETTING", "100");
  453. }
  454. },
  455. /*--------------------------------------------------------------------------------*/
  456. //修改当前页面样式公共方法
  457. modifyStyle: function(id, type) {
  458. // console.log('type',type)
  459. //if(this.$store.getters.getLimit*1 > 10 )
  460. this.data.matchData.every(e => {
  461. let ret = false;
  462. if (type == "homeOdds") {
  463. e.oddsData.every((res, index) => {
  464. if (res.id == id) {
  465. this.$set(
  466. res,
  467. "isTrue",
  468. res.isTrue ? false : true
  469. );
  470. this.$forceUpdate()
  471. ret = true;
  472. return false;
  473. }
  474. return true;
  475. });
  476. } else if (type == "guestOdds") {
  477. e.oddsData.every((res, index) => {
  478. if (res.id == id) {
  479. this.$set(
  480. res,
  481. "isTrue",
  482. res.isTrue ? false : true
  483. );
  484. this.$forceUpdate()
  485. ret = true;
  486. return false;
  487. }
  488. return true;
  489. });
  490. }
  491. if (ret) {
  492. return false;
  493. } else {
  494. return true;
  495. }
  496. });
  497. },
  498. /*--------------------------------------------------------------------------------*/
  499. // 修改投注样式
  500. bteBetting( match_id, id,home,guest,name,odds,condition,odds_only,odds_code,type,lg_id,status,p_code,play_name) {
  501. // console.log('data',id)
  502. if(odds > 0){
  503. if (this.data) {
  504. //处理vuex里面数据
  505. this.AddDelete(match_id,id,home,guest,name,odds, condition, odds_only,odds_code, type,lg_id,status,p_code,play_name);
  506. if (this.$store.getters.getLimit * 1 >= 10) {
  507. this.$dialog.alert({ mes: "你的注单已达到上限啦!" });
  508. }
  509. }
  510. }
  511. },
  512. /*--------------------------------------------------------------------------------*/
  513. //跳转到赛事详情
  514. matchInfo: function(id) {
  515. this.$router.push({
  516. path:"/StRollBallBettingPage",
  517. query: {
  518. gameCode: this.game_code,
  519. home: 1,
  520. name: this.$route.query.name
  521. }
  522. });
  523. this.$store.dispatch("MACTH_ID", id);
  524. },
  525. /*--------------------------------------------------------------------------------*/
  526. // url : 地址, game_code 球类 leagueID lg_id 联赛id type_code 状态 matchDate match_date 赛事日期 search 搜索 str_type 选项类型
  527. //获取联赛比赛列表
  528. getMatchData: function(url, data) {
  529. // console.log('ajax')
  530. //“concede_home”: 主队全场让球,“concede_guest”: 客队全场让球,“size_home”: 主队大小,“size_guest”: 客队大小
  531. this.$http.get(url, data).then(res => {
  532. this.codeShow = true;
  533. // let
  534. if (res.data.status == 1 && res.data.data != null) {
  535. this.lg_id = res.data.data.lg_id;
  536. if (res.data.data.matchData && res.data.data.matchData.length < 1) {
  537. this.isMatchShow = false;
  538. this.noData = true;
  539. } else if (res.data.data.matchData &&res.data.data.matchData.length > 0 ) {
  540. this.isMatchShow = true;
  541. this.noData = false;
  542. this.dataGroup(res.data.data);
  543. }
  544. }else{
  545. this.data = '';
  546. this.noData = true;
  547. this.isMatchShow = false;
  548. }
  549. });
  550. let _this = this;
  551. setTimeout(function(){
  552. _this.$store.dispatch("GETSHOW", false);
  553. },1000)
  554. },
  555. /*--------------------------------------------------------------------------------*/
  556. /*--------------------------------------------------------------------------------*/
  557. // 赛事赔率玩法数据组合方法
  558. dataGroup: function(data) {
  559. console.log('SerchBox')
  560. let homeOdds = [],guestOdds = [];
  561. let A, B, C, D;
  562. // console.log('beeeee',this.betting)
  563. let ball = this.$store.getters.getBallId;
  564. data.matchData.forEach((column, index) => {
  565. if (column.oddsData == null || column.oddsData.length == 0) {
  566. if(ball == 'bq'){
  567. column.oddsData = {
  568. homeOdds: [{ status: -1 }],
  569. guestOdds: [{ status: -1 }]
  570. };
  571. }else{
  572. column.oddsData = {
  573. homeOdds: [{ status: -1 }, { status: -1 }],
  574. guestOdds: [{ status: -1 }, { status: -1 }]
  575. };
  576. }
  577. } else {
  578. column.oddsData.forEach(val => {
  579. if(this.betting.length > 0){
  580. this.betting.forEach(e =>{
  581. e.forEach(item =>{
  582. if(val.id == item.id){
  583. val.isTrue = true;
  584. }
  585. })
  586. })
  587. }
  588. });
  589. }
  590. });
  591. this.data = data;
  592. // console.log('处理数据',this.data);
  593. //更新数据和上一次的数据匹配
  594. let storage =this.previousStorage;
  595. if(storage && storage != null && storage.length > 0){
  596. // if(this.data){
  597. // this.data.forEach(e =>{
  598. // e.match_info.forEach(k =>{
  599. this.data.matchData.forEach(k=>{
  600. k.oddsData.forEach(item =>{
  601. storage.forEach(a =>{
  602. a.forEach(b =>{
  603. if(item.id == b.id){
  604. if(item.odds > b.odds){
  605. item.change = 'add'
  606. }else if(item.odds < b.odds){
  607. item.change = 'red';
  608. }else{
  609. item.change = '';
  610. }
  611. }
  612. })
  613. })
  614. })
  615. })
  616. //})
  617. // }else{
  618. // console.log('ss')
  619. // }
  620. }
  621. this.previousStorage = [];
  622. console.log('111',this.data)
  623. this.data.matchData.forEach(e =>{
  624. this.previousStorage.push(e.oddsData)
  625. })
  626. this.$store.dispatch('GETGAMERATIO',this.data)
  627. }
  628. },
  629. /**
  630. * 计算属性
  631. */
  632. computed: {
  633. //
  634. getIsBettingType() {
  635. return this.$store.getters.getIsBetting;
  636. },
  637. //获取投注框删除的投注信息
  638. getDeleteType() {
  639. return this.$store.getters.getDeleteType;
  640. },
  641. },
  642. /**
  643. * 监听器
  644. */
  645. watch: {
  646. /*--------------------------------------------------------------------------------*/
  647. // 监听投注框开关
  648. getIsBettingType(val) {
  649. this.isBettingShow = val;
  650. },
  651. getDeleteType(val) {
  652. let flag = true;
  653. this.data.matchData.forEach(e => {
  654. if (val == "all") {
  655. e.oddsData.forEach(data => {
  656. this.$set(data, "isTrue", false);
  657. });
  658. e.oddsData.forEach(data => {
  659. this.$set(data, "isTrue", false);
  660. });
  661. } else {
  662. let showData = true;
  663. e.oddsData.forEach(data => {
  664. if (data.id == val) {
  665. this.$set(data, "isTrue", false);
  666. showData = false;
  667. }
  668. });
  669. if (showData) {
  670. e.oddsData.forEach(data => {
  671. if (data.id == val) {
  672. this.$set(data, "isTrue", false);
  673. }
  674. });
  675. }
  676. }
  677. });
  678. },
  679. /*--------------------------------------------------------------------------------*/
  680. },
  681. /***
  682. * 页面加载完成触发事件
  683. */
  684. mounted() {
  685. // 获取球类,判定状态
  686. let ball = this.$store.getters.getBallId;
  687. if(ball == 'zq' || ball == 'lq'){
  688. this.ballSelt = 10;
  689. }else if(ball == 'wq'){
  690. this.ballSelt = 100;
  691. }else if(ball == 'bq'){
  692. this.ballSelt = 1000;
  693. }
  694. if (this.getIsShow) {
  695. this.$store.dispatch("GETSHOW", true);
  696. this.getIsShow = false;
  697. }
  698. let _this = this;
  699. let matchDate = this.$route.query.matchDate;
  700. let query = this.$route.query;
  701. let { game_code, leagueID, name } = this.$route.query;
  702. this.title = name;
  703. this.game_code = game_code;
  704. let dataObj = {
  705. oddsType: this.$store.getters.getActivity,
  706. game_code: this.game_code,
  707. leagueID: "",
  708. lg_id: this.leagueID,
  709. type_code: this.$store.getters.getActivity,
  710. matchDate: "",
  711. match_date: matchDate,
  712. search: "",
  713. str_type: ""
  714. };
  715. this.dataObj = dataObj;
  716. //
  717. if (this.$store.getters.getIsBetting == "100") {
  718. this.isBettingShow = 100;
  719. }
  720. // //获取vuex玩法已投注相对应的数据
  721. let getBetting = this.$store.getters.getBetting;
  722. if(getBetting){
  723. if(ball == 'zq'){
  724. getBetting.forEach((e,index) =>{
  725. if('concede' == e.title || 'goal_size' == e.title){
  726. this.betting.push(e.data);
  727. }
  728. })
  729. }else if(ball == 'lq'){
  730. getBetting.forEach((e,index) =>{
  731. if('concede' == e.title || 'total_size' == e.title){
  732. this.betting.push(e.data);
  733. }
  734. })
  735. }else if(ball == 'bq'){
  736. getBetting.forEach((e,index) =>{
  737. if('capot' == e.title){
  738. this.betting.push(e.data);
  739. }
  740. })
  741. }else if(ball == 'wq'){
  742. getBetting.forEach((e,index) =>{
  743. if('dishes' == e.title || 'kemp' == e.title){
  744. this.betting.push(e.data);
  745. }
  746. })
  747. }
  748. }
  749. if (query.navBall &&query.strType != undefined && query.code != undefined) {
  750. this.$public.ajaxTimerFun(function(timing) {
  751. // console.log(1)
  752. if (_this.timers) {
  753. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  754. }else{
  755. clearInterval(timing);
  756. }
  757. },(1000*10));
  758. this.getMatchData(this.$ports.match.matchState, dataObj);
  759. } else if (this.$route.query.strType != undefined) {
  760. dataObj.str_type = this.$route.query.strType;
  761. if (this.$store.getters.getActivity != "StChampion") {
  762. this.$public.ajaxTimerFun(function(timing) {
  763. // console.log(2)
  764. if (_this.timers) {
  765. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  766. }else{
  767. clearInterval(timing);
  768. }
  769. },(1000*10));
  770. this.getMatchData(this.$ports.match.matchState, dataObj);
  771. } else {
  772. this.$public.ajaxTimerFun(function(timing) {
  773. // console.log(3)
  774. if (_this.timers) {
  775. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  776. }else{
  777. clearInterval(timing);
  778. }
  779. },(1000*10));
  780. this.getMatchData(this.$ports.match.matchState, dataObj);
  781. }
  782. } else if (this.$route.query.matchDtl != undefined) {
  783. this.$public.ajaxTimerFun(function(timing) {
  784. dataObj.leagueID = _this.leagueID;
  785. dataObj.lg_id='';
  786. dataObj.matchDate = matchDate
  787. if (_this.timers) {
  788. _this.getMatchData(_this.$ports.match.matchDetails, dataObj);
  789. }else{
  790. // console.log(4)
  791. clearInterval(timing);
  792. }
  793. },(1000*10));
  794. dataObj.leagueID=this.leagueID;
  795. dataObj.matchDate = this.$route.query.matchDate;
  796. dataObj.lg_id='';
  797. this.getMatchData(this.$ports.match.matchDetails, dataObj);
  798. } else if (this.$route.query.btn != undefined) {
  799. dataObj.lg_id = "27822";
  800. this.getMatchData(this.$ports.match.matchState, dataObj);
  801. } else {
  802. this.$public.ajaxTimerFun(function(timing) {
  803. // console.log(5)
  804. if (_this.timers) {
  805. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  806. }else{
  807. clearInterval(timing);
  808. }
  809. },(1000*10));
  810. this.getMatchData(this.$ports.match.matchState, dataObj);
  811. }
  812. },
  813. beforeDestroy() {
  814. this.timers = false;
  815. }
  816. };
  817. </script>
  818. <style scoped>
  819. .Serch {
  820. height: 0.75rem;
  821. display: flex;
  822. justify-content: space-between;
  823. align-items: center;
  824. background-color: #363636;
  825. color: #fd8f26;
  826. font-family: "PingFang-SC-Regular";
  827. padding: 0 0.32rem;
  828. }
  829. .lock {
  830. background: #f4f4f4;
  831. }
  832. .Serch-box-input {
  833. width: 2rem;
  834. border: none;
  835. position: absolute;
  836. left: 0.5rem;
  837. top: 0.06rem;
  838. }
  839. .Serch-box-img {
  840. width: 0.3rem;
  841. height: 0.3rem;
  842. position: absolute;
  843. left: 0.1rem;
  844. top: 0.06rem;
  845. }
  846. .Serch-box-del {
  847. width: 0.2rem;
  848. height: 0.2rem;
  849. position: absolute;
  850. right: 0.2rem;
  851. }
  852. .Serch-box-home {
  853. height: 0.44rem;
  854. width: 4.73rem;
  855. background: #e4e4e4;
  856. border-radius: 0.2rem;
  857. display: flex;
  858. justify-content: space-around;
  859. align-items: center;
  860. padding-left: 0.1rem;
  861. padding-right: 0.1rem;
  862. position: relative;
  863. }
  864. .box-img {
  865. width: 0.37rem;
  866. height: 0.3rem;
  867. margin-right: 0.18rem;
  868. }
  869. .Soccer-game-title {
  870. display: flex;
  871. color: #f76649;
  872. align-items: center;
  873. width: 1.5rem;
  874. height: 0.75rem;
  875. font-size: 0.3rem;
  876. }
  877. .Soccer-game-box {
  878. display: flex;
  879. left: -0.3rem;
  880. top: 0.2rem;
  881. background: #fff;
  882. background: #626262;
  883. color: #a6a6a6;
  884. height: 0.7rem;
  885. align-items: center;
  886. }
  887. .Soccer-game-src {
  888. width: 0.25rem;
  889. height: 0.25rem;
  890. }
  891. .box {
  892. padding: 0 0.32rem;
  893. color: #e1e1df;
  894. height: 0.88rem;
  895. font-size: 0.32rem;
  896. background: linear-gradient(to bottom, #999999, #6a6a6b);
  897. }
  898. .Match-title-num {
  899. width: 0.46rem;
  900. height: 0.46rem;
  901. line-height: 0.46rem;
  902. text-align: center;
  903. background: #f76649;
  904. font-size: 0.26rem;
  905. border-radius: 50%;
  906. color: #f5f5f5;
  907. }
  908. .Match-box-top-right > span {
  909. width: 1.07rem;
  910. text-align: center;
  911. }
  912. .Match-box {
  913. /* height: 2.45rem; */
  914. }
  915. .name-box {
  916. height: 1.76rem;
  917. }
  918. .Match-box-top {
  919. height: 0.45rem;
  920. line-height: 0.45rem;
  921. background: #dcdcdc;
  922. font-size: 0.23rem;
  923. padding: 0 0.32rem;
  924. }
  925. div.wqMatch-box{
  926. height: 0.65rem;
  927. line-height: 0.3rem;
  928. }
  929. .Match-box-top-num {
  930. width: 0.64rem !important;
  931. height: 0.45rem;
  932. background: #ebebeb;
  933. font-size: 0.24rem;
  934. }
  935. .Match-box {
  936. background: #f8f8f8;
  937. }
  938. .Match-bottom-right {
  939. height: 2rem;
  940. width: 2.5rem;
  941. padding: 0.1rem 0.1rem 0 0.14rem;
  942. position: relative;
  943. }
  944. .Match-list-left div {
  945. width: 1.07rem;
  946. height: 0.76rem;
  947. border: 1px solid #e4e4e4;
  948. border-radius: 0.1rem;
  949. padding: 0.1rem;
  950. margin: 0.06rem 0.08rem;
  951. }
  952. .Match-list-right div {
  953. width: 1.07rem;
  954. height: 0.76rem;
  955. border: 1px solid #e4e4e4;
  956. border-radius: 0.1rem;
  957. margin: 0.06rem 0.08rem;
  958. }
  959. .active {
  960. background: #f76649;
  961. border: none;
  962. color: #e1e1df !important;
  963. }
  964. .wqavg{
  965. width: 4.3rem;
  966. }
  967. /* 赔率 */
  968. .letballHome,.letballGuest,.bigHome,.bigGuest{
  969. width: 1.07rem;
  970. height: 0.76rem;
  971. border: 1px solid #e4e4e4;
  972. border-radius: 0.1rem;
  973. margin: 0.06rem 0.08rem;
  974. padding: 0.05rem 0;
  975. /* margin: 0.06rem 0.6rem 0.06rem 0; */
  976. text-align: center;
  977. }
  978. .letballGuest{
  979. position: absolute;
  980. bottom: 0.19rem;
  981. }
  982. .bigHome span,.bigGuest span,.letballHome span,.letballGuest span{
  983. display: block;
  984. }
  985. .bigHome{
  986. position: absolute;
  987. right: 0;
  988. top: 0.1rem;
  989. }
  990. .bigGuest{
  991. position: absolute;
  992. right: 0;
  993. top: 0.93rem;
  994. }
  995. .active span{
  996. color: #e1e1df !important;
  997. }
  998. .stardBig{
  999. display: flex;
  1000. align-items: center;
  1001. justify-content: center;
  1002. }
  1003. .stardBig .bigSmall{
  1004. color: #9b9999;
  1005. }
  1006. .mg{
  1007. margin-top: 0.2rem;
  1008. }
  1009. </style>