bd70e3678482bc339bd785d23e2cd85a75019022.svn-base 11 KB

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