7c77ae2183c61635871bad3332f06c840b71f1e9.svn-base 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  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. let homeOdds = [],guestOdds = [];
  560. let A, B, C, D;
  561. // console.log('beeeee',this.betting)
  562. let ball = this.$store.getters.getBallId;
  563. data.matchData.forEach((column, index) => {
  564. if (column.oddsData == null || column.oddsData.length == 0) {
  565. if(ball == 'bq'){
  566. column.oddsData = {
  567. homeOdds: [{ status: -1 }],
  568. guestOdds: [{ status: -1 }]
  569. };
  570. }else{
  571. column.oddsData = {
  572. homeOdds: [{ status: -1 }, { status: -1 }],
  573. guestOdds: [{ status: -1 }, { status: -1 }]
  574. };
  575. }
  576. } else {
  577. column.oddsData.forEach(val => {
  578. if(this.betting.length > 0){
  579. this.betting.forEach(e =>{
  580. e.forEach(item =>{
  581. if(val.id == item.id){
  582. val.isTrue = true;
  583. }
  584. })
  585. })
  586. }
  587. });
  588. }
  589. });
  590. this.data = data;
  591. // console.log('处理数据',this.data);
  592. //更新数据和上一次的数据匹配
  593. let storage =this.previousStorage;
  594. // console.log('storege',storage)
  595. if(storage && storage != null && storage.length > 0){
  596. this.data.forEach(e =>{
  597. e.match_info.forEach(k =>{
  598. k.oddsData.forEach(item =>{
  599. storage.forEach(a =>{
  600. a.forEach(b =>{
  601. if(item.id == b.id){
  602. if(item.odds > b.odds){
  603. item.change = 'add'
  604. }else if(item.odds < b.odds){
  605. item.change = 'red';
  606. }else{
  607. item.change = '';
  608. }
  609. }
  610. })
  611. })
  612. })
  613. })
  614. })
  615. }
  616. this.previousStorage = [];
  617. console.log('111',this.data)
  618. this.data.matchData.forEach(e =>{
  619. this.previousStorage.push(e.oddsData)
  620. })
  621. this.$store.dispatch('GETGAMERATIO',this.data)
  622. }
  623. },
  624. /**
  625. * 计算属性
  626. */
  627. computed: {
  628. //
  629. getIsBettingType() {
  630. return this.$store.getters.getIsBetting;
  631. },
  632. //获取投注框删除的投注信息
  633. getDeleteType() {
  634. return this.$store.getters.getDeleteType;
  635. },
  636. },
  637. /**
  638. * 监听器
  639. */
  640. watch: {
  641. /*--------------------------------------------------------------------------------*/
  642. // 监听投注框开关
  643. getIsBettingType(val) {
  644. this.isBettingShow = val;
  645. },
  646. getDeleteType(val) {
  647. let flag = true;
  648. this.data.matchData.forEach(e => {
  649. if (val == "all") {
  650. e.oddsData.forEach(data => {
  651. this.$set(data, "isTrue", false);
  652. });
  653. e.oddsData.forEach(data => {
  654. this.$set(data, "isTrue", false);
  655. });
  656. } else {
  657. let showData = true;
  658. e.oddsData.forEach(data => {
  659. if (data.id == val) {
  660. this.$set(data, "isTrue", false);
  661. showData = false;
  662. }
  663. });
  664. if (showData) {
  665. e.oddsData.forEach(data => {
  666. if (data.id == val) {
  667. this.$set(data, "isTrue", false);
  668. }
  669. });
  670. }
  671. }
  672. });
  673. },
  674. /*--------------------------------------------------------------------------------*/
  675. },
  676. /***
  677. * 页面加载完成触发事件
  678. */
  679. mounted() {
  680. // 获取球类,判定状态
  681. let ball = this.$store.getters.getBallId;
  682. if(ball == 'zq' || ball == 'lq'){
  683. this.ballSelt = 10;
  684. }else if(ball == 'wq'){
  685. this.ballSelt = 100;
  686. }else if(ball == 'bq'){
  687. this.ballSelt = 1000;
  688. }
  689. if (this.getIsShow) {
  690. this.$store.dispatch("GETSHOW", true);
  691. this.getIsShow = false;
  692. }
  693. let _this = this;
  694. let matchDate = this.$route.query.matchDate;
  695. let query = this.$route.query;
  696. let { game_code, leagueID, name } = this.$route.query;
  697. this.title = name;
  698. this.game_code = game_code;
  699. let dataObj = {
  700. oddsType: this.$store.getters.getActivity,
  701. game_code: this.game_code,
  702. leagueID: "",
  703. lg_id: this.leagueID,
  704. type_code: this.$store.getters.getActivity,
  705. matchDate: "",
  706. match_date: matchDate,
  707. search: "",
  708. str_type: ""
  709. };
  710. this.dataObj = dataObj;
  711. //
  712. if (this.$store.getters.getIsBetting == "100") {
  713. this.isBettingShow = 100;
  714. }
  715. // //获取vuex玩法已投注相对应的数据
  716. let getBetting = this.$store.getters.getBetting;
  717. if(getBetting){
  718. if(ball == 'zq'){
  719. getBetting.forEach((e,index) =>{
  720. if('concede' == e.title || 'goal_size' == e.title){
  721. this.betting.push(e.data);
  722. }
  723. })
  724. }else if(ball == 'lq'){
  725. getBetting.forEach((e,index) =>{
  726. if('concede' == e.title || 'total_size' == e.title){
  727. this.betting.push(e.data);
  728. }
  729. })
  730. }else if(ball == 'bq'){
  731. getBetting.forEach((e,index) =>{
  732. if('capot' == e.title){
  733. this.betting.push(e.data);
  734. }
  735. })
  736. }else if(ball == 'wq'){
  737. getBetting.forEach((e,index) =>{
  738. if('dishes' == e.title || 'kemp' == e.title){
  739. this.betting.push(e.data);
  740. }
  741. })
  742. }
  743. }
  744. if (query.navBall &&query.strType != undefined && query.code != undefined) {
  745. this.$public.ajaxTimerFun(function(timing) {
  746. // console.log(1)
  747. if (_this.timers) {
  748. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  749. }else{
  750. clearInterval(timing);
  751. }
  752. },(1000*10*60));
  753. this.getMatchData(this.$ports.match.matchState, dataObj);
  754. } else if (this.$route.query.strType != undefined) {
  755. dataObj.str_type = this.$route.query.strType;
  756. if (this.$store.getters.getActivity != "StChampion") {
  757. this.$public.ajaxTimerFun(function(timing) {
  758. // console.log(2)
  759. if (_this.timers) {
  760. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  761. }else{
  762. clearInterval(timing);
  763. }
  764. },(1000*10*60));
  765. this.getMatchData(this.$ports.match.matchState, dataObj);
  766. } else {
  767. this.$public.ajaxTimerFun(function(timing) {
  768. // console.log(3)
  769. if (_this.timers) {
  770. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  771. }else{
  772. clearInterval(timing);
  773. }
  774. },(1000*10*60));
  775. this.getMatchData(this.$ports.match.matchState, dataObj);
  776. }
  777. } else if (this.$route.query.matchDtl != undefined) {
  778. this.$public.ajaxTimerFun(function(timing) {
  779. dataObj.leagueID = _this.leagueID;
  780. dataObj.lg_id='';
  781. dataObj.matchDate = matchDate
  782. if (_this.timers) {
  783. _this.getMatchData(_this.$ports.match.matchDetails, dataObj);
  784. }else{
  785. // console.log(4)
  786. clearInterval(timing);
  787. }
  788. },(1000*10*60));
  789. dataObj.leagueID=this.leagueID;
  790. dataObj.matchDate = this.$route.query.matchDate;
  791. dataObj.lg_id='';
  792. this.getMatchData(this.$ports.match.matchDetails, dataObj);
  793. } else if (this.$route.query.btn != undefined) {
  794. dataObj.lg_id = "27822";
  795. this.getMatchData(this.$ports.match.matchState, dataObj);
  796. } else {
  797. this.$public.ajaxTimerFun(function(timing) {
  798. // console.log(5)
  799. if (_this.timers) {
  800. _this.getMatchData(_this.$ports.match.matchState, dataObj);
  801. }else{
  802. clearInterval(timing);
  803. }
  804. },(1000*10*60));
  805. this.getMatchData(this.$ports.match.matchState, dataObj);
  806. }
  807. },
  808. beforeDestroy() {
  809. this.timers = false;
  810. }
  811. };
  812. </script>
  813. <style scoped>
  814. .Serch {
  815. height: 0.75rem;
  816. display: flex;
  817. justify-content: space-between;
  818. align-items: center;
  819. background-color: #363636;
  820. color: #fd8f26;
  821. font-family: "PingFang-SC-Regular";
  822. padding: 0 0.32rem;
  823. }
  824. .lock {
  825. background: #f4f4f4;
  826. }
  827. .Serch-box-input {
  828. width: 2rem;
  829. border: none;
  830. position: absolute;
  831. left: 0.5rem;
  832. top: 0.06rem;
  833. }
  834. .Serch-box-img {
  835. width: 0.3rem;
  836. height: 0.3rem;
  837. position: absolute;
  838. left: 0.1rem;
  839. top: 0.06rem;
  840. }
  841. .Serch-box-del {
  842. width: 0.2rem;
  843. height: 0.2rem;
  844. position: absolute;
  845. right: 0.2rem;
  846. }
  847. .Serch-box-home {
  848. height: 0.44rem;
  849. width: 4.73rem;
  850. background: #e4e4e4;
  851. border-radius: 0.2rem;
  852. display: flex;
  853. justify-content: space-around;
  854. align-items: center;
  855. padding-left: 0.1rem;
  856. padding-right: 0.1rem;
  857. position: relative;
  858. }
  859. .box-img {
  860. width: 0.37rem;
  861. height: 0.3rem;
  862. margin-right: 0.18rem;
  863. }
  864. .Soccer-game-title {
  865. display: flex;
  866. color: #f76649;
  867. align-items: center;
  868. width: 1.5rem;
  869. height: 0.75rem;
  870. font-size: 0.3rem;
  871. }
  872. .Soccer-game-box {
  873. display: flex;
  874. left: -0.3rem;
  875. top: 0.2rem;
  876. background: #fff;
  877. background: #626262;
  878. color: #a6a6a6;
  879. height: 0.7rem;
  880. align-items: center;
  881. }
  882. .Soccer-game-src {
  883. width: 0.25rem;
  884. height: 0.25rem;
  885. }
  886. .box {
  887. padding: 0 0.32rem;
  888. color: #e1e1df;
  889. height: 0.88rem;
  890. font-size: 0.32rem;
  891. background: linear-gradient(to bottom, #999999, #6a6a6b);
  892. }
  893. .Match-title-num {
  894. width: 0.46rem;
  895. height: 0.46rem;
  896. line-height: 0.46rem;
  897. text-align: center;
  898. background: #f76649;
  899. font-size: 0.26rem;
  900. border-radius: 50%;
  901. color: #f5f5f5;
  902. }
  903. .Match-box-top-right > span {
  904. width: 1.07rem;
  905. text-align: center;
  906. }
  907. .Match-box {
  908. /* height: 2.45rem; */
  909. }
  910. .name-box {
  911. height: 1.76rem;
  912. }
  913. .Match-box-top {
  914. height: 0.45rem;
  915. line-height: 0.45rem;
  916. background: #dcdcdc;
  917. font-size: 0.23rem;
  918. padding: 0 0.32rem;
  919. }
  920. div.wqMatch-box{
  921. height: 0.65rem;
  922. line-height: 0.3rem;
  923. }
  924. .Match-box-top-num {
  925. width: 0.64rem !important;
  926. height: 0.45rem;
  927. background: #ebebeb;
  928. font-size: 0.24rem;
  929. }
  930. .Match-box {
  931. background: #f8f8f8;
  932. }
  933. .Match-bottom-right {
  934. height: 2rem;
  935. width: 2.5rem;
  936. padding: 0.1rem 0.1rem 0 0.14rem;
  937. position: relative;
  938. }
  939. .Match-list-left div {
  940. width: 1.07rem;
  941. height: 0.76rem;
  942. border: 1px solid #e4e4e4;
  943. border-radius: 0.1rem;
  944. padding: 0.1rem;
  945. margin: 0.06rem 0.08rem;
  946. }
  947. .Match-list-right div {
  948. width: 1.07rem;
  949. height: 0.76rem;
  950. border: 1px solid #e4e4e4;
  951. border-radius: 0.1rem;
  952. margin: 0.06rem 0.08rem;
  953. }
  954. .active {
  955. background: #f76649;
  956. border: none;
  957. color: #e1e1df !important;
  958. }
  959. .wqavg{
  960. width: 4.3rem;
  961. }
  962. /* 赔率 */
  963. .letballHome,.letballGuest,.bigHome,.bigGuest{
  964. width: 1.07rem;
  965. height: 0.76rem;
  966. border: 1px solid #e4e4e4;
  967. border-radius: 0.1rem;
  968. margin: 0.06rem 0.08rem;
  969. /* padding: 0.1rem 0; */
  970. /* margin: 0.06rem 0.6rem 0.06rem 0; */
  971. text-align: center;
  972. }
  973. .letballGuest{
  974. position: absolute;
  975. bottom: 0.19rem;
  976. }
  977. .bigHome span,.bigGuest span,.letballHome span,.letballGuest span{
  978. display: block;
  979. }
  980. .bigHome{
  981. position: absolute;
  982. right: 0;
  983. top: 0.1rem;
  984. }
  985. .bigGuest{
  986. position: absolute;
  987. right: 0;
  988. top: 0.93rem;
  989. }
  990. .active span{
  991. color: #e1e1df !important;
  992. }
  993. .stardBig{
  994. display: flex;
  995. align-items: center;
  996. justify-content: center;
  997. }
  998. .stardBig .bigSmall{
  999. color: #9b9999;
  1000. }
  1001. .mg{
  1002. margin-top: 0.2rem;
  1003. }
  1004. </style>