aaaefb7fd1b3b687c976301cd9402520456e9ca0.svn-base 14 KB

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