9ea4e42aacaf365d4dcf01b2ed283bd97b822ec4.svn-base 40 KB

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