bcb942409e1122cbee4a93c85ea5cdfe899ff0b3.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <div>
  3. <div v-if="isDisplay">
  4. <yd-accordion>
  5. <yd-accordion-item title="让球" open>
  6. <div v-for="(item,index) in data" :accordion="true">
  7. <div v-if="item.odds_code == 'concede_home' || item.odds_code == 'concede_guest'">
  8. <div style="padding:0 0.32rem;" class="odds">
  9. <div class="row allAlignment center small">
  10. <span>{{item.odds_code =='concede_home' ? home_team :guest_team}}</span>
  11. <div class="ratio column center" @click="bettingBtn(item.id,item.odds_code =='concede_home' ? home_team :guest_team,item.odds,item.odds_only,item.p_code,match_id,item.condition)" :class="item.isTrue ? 'col':''">
  12. <span class="score">{{item.condition}}</span>
  13. <span>{{item.odds}}</span>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </yd-accordion-item>
  20. </yd-accordion>
  21. <yd-accordion>
  22. <yd-accordion-item title="让球-上半场" open>
  23. <div v-for="(item,index) in data" :accordion="true">
  24. <div
  25. v-if="item.odds_code == 'half_concede_home' || item.odds_code == 'half_concede_guest'"
  26. >
  27. <div style="padding:0 0.32rem;" class="odds">
  28. <div class="row allAlignment center small">
  29. <span>{{item.odds_code =='half_concede_home' ? home_team :guest_team}}</span>
  30. <div class="ratio column center" @click="bettingBtn(item.id,item.odds_code =='half_concede_home' ? home_team :guest_team,item.odds,item.odds_only,item.p_code,match_id,item.condition)" :class="item.isTrue ? 'col':''">
  31. <span class="score">{{item.condition}}</span>
  32. <span>{{item.odds}}</span>
  33. </div>
  34. </div>
  35. <!-- </div> -->
  36. </div>
  37. </div>
  38. </div>
  39. </yd-accordion-item>
  40. </yd-accordion>
  41. <yd-accordion :accordion="true">
  42. <yd-accordion-item title="进球:大/小" open>
  43. <div style="padding:0 0.32rem;" class="odds">
  44. <div class="row allAlignment center">
  45. <div style="width:50% ;" class="column">
  46. <div v-for="(item,index) in data" :accordion="true">
  47. <div v-if="item.odds_code == 'size_home'">
  48. <div
  49. style="border-right: 1px solid #e4e4e4; padding-right:0.1rem; "
  50. class="small row allAlignment center"
  51. >
  52. <div>大</div>
  53. <div
  54. class="ratio column center"
  55. :class="item.isTrue ? 'col':''"
  56. @click="bettingBtn(item.id,'大',item.odds,item.odds_only,item.p_code,match_id,item.condition)"
  57. >
  58. <span class="score">{{item.condition}}</span>
  59. <span>{{item.odds}}</span>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div style="width:50% ;" class="column">
  66. <div v-for="(item,index) in data" :accordion="true">
  67. <div v-if="item.odds_code == 'size_guest'">
  68. <div class="small row allAlignment center">
  69. <div>小</div>
  70. <div
  71. class="ratio column center"
  72. :class="item.isTrue? 'col':''"
  73. @click="bettingBtn(item.id,'小',item.odds,item.odds_only,item.p_code,match_id,item.condition)"
  74. >
  75. <span class="score">{{item.condition}}</span>
  76. <span>{{item.odds}}</span>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </yd-accordion-item>
  85. </yd-accordion>
  86. <yd-accordion :accordion="true">
  87. <yd-accordion-item title="进球:大/小-上半场" open>
  88. <div style="padding:0 0.32rem;" class="odds">
  89. <div class="row allAlignment center">
  90. <div style="width:50% ;" class="column">
  91. <div v-for="(item,index) in data" :accordion="true">
  92. <div v-if="item.odds_code == 'half_size_home'">
  93. <div
  94. style="border-right: 1px solid #e4e4e4; padding-right:0.1rem; "
  95. class="small row allAlignment center"
  96. >
  97. <div>大</div>
  98. <div
  99. class="ratio column center"
  100. :class="item.isTrue ? 'col':''"
  101. @click="bettingBtn(item.id,'大',item.odds,item.odds_only,item.p_code,match_id,item.condition)"
  102. >
  103. <span class="score">{{item.condition}}</span>
  104. <span>{{item.odds}}</span>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div style="width:50% ;" class="column">
  111. <!-- || item.odds_code == 'half_size_guest' -->
  112. <div v-for="(item,index) in data" :accordion="true">
  113. <div v-if="item.odds_code == 'half_size_guest'">
  114. <div class="small row allAlignment center">
  115. <div>小</div>
  116. <div
  117. class="ratio column center"
  118. :class="item.isTrue? 'col':''"
  119. @click="bettingBtn(item.id,'小',item.odds,item.odds_only,item.p_code,match_id,item.condition)"
  120. >
  121. <span class="score">{{item.condition}}</span>
  122. <span>{{item.odds}}</span>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </yd-accordion-item>
  131. </yd-accordion>
  132. </div>
  133. <!-- <div class="BettingWindow" v-if="isWindow">
  134. <BettingWindow />
  135. </div> -->
  136. </div>
  137. </template>
  138. <script>
  139. // import BettingWindow from "@/components/StBettingWindow";
  140. export default {
  141. data() {
  142. return {
  143. title: "concede_size",
  144. isDisplay: false,
  145. home_team: "",
  146. guest_team: "",
  147. data: [],
  148. match_id:'',
  149. betting: [], //已投注倍率id集合
  150. dataNum: 10000 //对应的数据的下标
  151. };
  152. },
  153. methods: {
  154. //玩法投注
  155. bettingBtn(id,name,odds,odds_only,p_code,match_id,condition='',bettingTime='') {
  156. console.log('大哥',this.data)
  157. // // 投注页面显示
  158. // if(this.$store.getters.newIsBetting==true){
  159. // return false
  160. // }
  161. // this.$store.dispatch('ISBETTING',true)
  162. let _this = this;
  163. let bettingInfo = {
  164. id,
  165. home_team:this.home_team,
  166. guest_team:this.guest_team,
  167. name,
  168. odds,
  169. p_code,
  170. ballId:this.$store.getters.getBallId,
  171. match_id,
  172. condition,
  173. ganame:this.title,
  174. score:this.score,
  175. bettingTime,
  176. odds_only,
  177. }
  178. //调用玩法投注公共方法
  179. this.$public.bettingFunction(
  180. this.betting,
  181. bettingInfo,
  182. this.data,
  183. this.$store.getters.getBetting,
  184. this.title,
  185. this.dataNum,
  186. function(res, type) {
  187. _this.$set(res, "isTrue", type);
  188. },
  189. function(data, val) {
  190. _this.$store.dispatch("BETTING", []);
  191. _this.$store.dispatch("BETTING", data ? data : val);
  192. if(_this.$store.getters.getIsBetting) return false
  193. _this.$store.dispatch("ISBETTING",true)
  194. }
  195. );
  196. },
  197. //获取玩法id
  198. getBettingId(data) {
  199. if (data) {
  200. data.forEach((res, index) => {
  201. if (res.title == this.title) {
  202. this.betting = res.data;
  203. this.dataNum = index;
  204. }
  205. });
  206. }
  207. }
  208. },
  209. /**
  210. * 计算属性
  211. */
  212. computed: {
  213. getUserIcons() {
  214. return this.$store.getters.getGameRatio;
  215. },
  216. getBetting() {
  217. return this.$store.getters.getBetting;
  218. },
  219. //获取投注框删除的投注信息
  220. getDeleteType(){
  221. return this.$store.getters.getDeleteType;
  222. },
  223. },
  224. /**
  225. * 监听器
  226. */
  227. watch: {
  228. getUserIcons(val) {
  229. this.match_id=val.match_id;
  230. console.log("更新数据", val);
  231. console.log(this.match_id)
  232. if (!val) return false;
  233. this.home_team = val.home_team;
  234. this.guest_team = val.guest_team;
  235. val.oddsData.forEach(res => {
  236. if (res[0].p_code == this.title) {
  237. this.isDisplay = true;
  238. this.data = res;
  239. }
  240. });
  241. this.getBettingId(this.$store.getters.getBetting);
  242. if (this.dataNum != 10000) {
  243. this.betting.forEach(res => {
  244. this.data.forEach((e, index) => {
  245. if (res.id == e.id) {
  246. this.$set(e, "isTrue", true);
  247. }
  248. });
  249. });
  250. }
  251. },
  252. //获取已投注信息
  253. getBetting(val) {
  254. let _this =this;
  255. this.$public.getBettingId(val,this.title,function(data,index){
  256. _this.betting = data;
  257. _this.dataNum = index;
  258. });
  259. },
  260. //监听投注框删除处理
  261. getDeleteType(val){
  262. this.data.forEach(e =>{
  263. if(val =='all'){
  264. this.$set(e, "isTrue", false);
  265. }else{
  266. if(e.id == val){
  267. this.$set(e, "isTrue", false);
  268. }
  269. }
  270. })
  271. }
  272. },
  273. // component:{BettingWindow},
  274. };
  275. </script>
  276. <style scoped>
  277. div /deep/ .yd-accordion-head {
  278. padding: 0 0.32rem;
  279. background: #a0a0a0;
  280. }
  281. div /deep/ .yd-accordion-title {
  282. color: #FEFEFE;
  283. font-size: 0.28rem;
  284. }
  285. div /deep/ .yd-accordion-head-arrow:after {
  286. border: none;
  287. width: 0.5rem;
  288. height: 0.5rem;
  289. background: url("../assets/st-imges/xiangxia.png") no-repeat;
  290. background-size: 100% 100%;
  291. }
  292. .small {
  293. font-size: 0.26rem;
  294. border-bottom: 1px solid #e4e4e4;
  295. padding-left: 0.16rem;
  296. }
  297. .odds {
  298. background: #f4f4f4;
  299. text-align: left;
  300. }
  301. .ratio {
  302. width: 1.07rem;
  303. height: 0.76rem;
  304. border: 2px solid #cecece;
  305. margin-right: 0.14rem;
  306. border-radius: 0.1rem;
  307. margin: 0.06rem;
  308. }
  309. .score {
  310. color: #fd8f26;
  311. }
  312. .col {
  313. background: #f76649;
  314. border: 2px solid #f76649 !important;
  315. }
  316. .col span {
  317. color: #f4f4f4 !important;
  318. }
  319. </style>