053ab12e1f4c0f489bc1d5685ccf79cfb9e072d6.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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)" >
  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)" >
  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)" >
  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)" >
  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)">
  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)">
  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)" >
  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)"
  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='',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. }
  166. //调用玩法投注公共方法
  167. this.$public.bettingFunction(
  168. this.betting,
  169. bettingInfo,
  170. this.data,
  171. this.$store.getters.getBetting,
  172. this.title,
  173. this.dataNum,
  174. this.$store.getters.getLimit,
  175. function(res, type) {
  176. _this.$set(res, "isTrue", type);
  177. },
  178. function(data, val,type) {
  179. if(type) {
  180. _this.$dialog.alert({mes: '你的注单已达到上限啦!'});
  181. }
  182. _this.$store.dispatch("BETTING", []);
  183. _this.$store.dispatch("BETTING", data ? data : val);
  184. if(_this.$store.getters.getIsBetting == '100') return false
  185. _this.$store.dispatch("ISBETTING",'100')
  186. }
  187. );
  188. },
  189. //数据排序处理
  190. dataSorting(data){
  191. let arr = [],home = [],goust = [],other = [];
  192. data.forEach((res, i) => {
  193. if (res.odds_code.startsWith("bodanguest") == true || res.odds_code.startsWith("halfbodanguest") == true) {
  194. goust.push(res);
  195. goust.sort((a, z) => {
  196. let str1 = a.condition.split("-");
  197. let str2 = z.condition.split("-");
  198. if (str1[1] - str2[1] != 0) {
  199. return str1[1] - str2[1];
  200. } else {
  201. return str1[0] - str2[0];
  202. }
  203. });
  204. } else if (res.odds_code.startsWith("bodanhome") == true || res.odds_code.startsWith("halfbodanhome") == true ) {
  205. home.push(res);
  206. // 主队排序
  207. home.sort((a, z) => {
  208. let str1 = a.condition.split("-");
  209. let str2 = z.condition.split("-");
  210. if (str1[0] - str2[0] != 0) {
  211. return str1[0] - str2[0];
  212. } else {
  213. return str1[1] - str2[1];
  214. }
  215. });
  216. } else if (res.odds_code.startsWith("bodandogfall") == true || res.odds_code.startsWith("halfbodandogfall") == true) {
  217. arr.push(res);
  218. // 和排序
  219. arr.sort((a, z) => {
  220. let str1 = a.condition.split("-");
  221. let str2 = z.condition.split("-");
  222. return str1[0] - str2[0];
  223. });
  224. } else if (res.odds_code.startsWith("bodanother") == true || res.odds_code.startsWith("halfbodanother") == true) {
  225. other.push(res);
  226. }
  227. });
  228. this.data= [...home, ...goust, ...arr, ...other];
  229. }
  230. },
  231. computed: {
  232. getUserIcons() {
  233. return this.$store.getters.getGameRatio;
  234. },
  235. getBetting() {
  236. return this.$store.getters.getBetting;
  237. },
  238. //获取投注框删除的投注信息
  239. getDeleteType(){
  240. return this.$store.getters.getDeleteType;
  241. },
  242. },
  243. watch: {
  244. getUserIcons(val) {
  245. this.match_id=val.match_id
  246. if (!val) return false;
  247. this.home_team = val.home_team;
  248. this.guest_team = val.guest_team;
  249. this.lg_id=val.lg_id;
  250. val.oddsData.forEach(res => {
  251. if (res[0].p_code == this.title) {
  252. this.isDisplay = true;
  253. // console.log(res);
  254. this.dataSorting(res);
  255. //this.data = res;
  256. }
  257. });
  258. let _this =this;
  259. this.$public.getBettingId(this.$store.getters.getBetting,this.title,function(data,index){
  260. _this.betting = data;
  261. _this.dataNum = index;
  262. });
  263. if (this.dataNum != 10000) {
  264. this.betting.forEach(res => {
  265. this.data.forEach((e, index) => {
  266. if (res.id == e.id) {
  267. this.$set(e, "isTrue", true);
  268. }
  269. });
  270. });
  271. }
  272. },
  273. //获取已投注信息
  274. getBetting(val) {
  275. let _this =this;
  276. this.$public.getBettingId(this.$store.getters.getBetting,this.title,function(data,index){
  277. _this.betting = data;
  278. _this.dataNum = index;
  279. });
  280. },
  281. //监听投注框删除处理
  282. getDeleteType(val){
  283. this.data.forEach(e =>{
  284. if(val =='all'){
  285. this.$set(e, "isTrue", false);
  286. }else{
  287. if(e.id == val){
  288. this.$set(e, "isTrue", false);
  289. }
  290. }
  291. })
  292. }
  293. }
  294. };
  295. </script>
  296. <style scoped>
  297. div /deep/ .yd-accordion-head {
  298. padding: 0 0.32rem;
  299. background: #a0a0a0;
  300. }
  301. div /deep/ .yd-accordion-head:after{
  302. height: 0;
  303. }
  304. div /deep/ .yd-accordion-title {
  305. color: #FEFEFE;
  306. font-size: 0.28rem;
  307. }
  308. div /deep/ .yd-accordion-head-arrow:after {
  309. border: none;
  310. width: 0.5rem;
  311. height: 0.5rem;
  312. background: url("../assets/st-imges/xiangxia.png") no-repeat;
  313. background-size: 100% 100%;
  314. }
  315. .grids{
  316. width: 100%;
  317. }
  318. .grids div {
  319. background: #f4f4f4;
  320. }
  321. .trueSelected{
  322. color: #f4f4f4 !important
  323. }
  324. .middle {
  325. border-left: 1px solid #e4e4e4;
  326. border-right: 1px solid #e4e4e4;
  327. }
  328. .rulesName {
  329. font-size: 0.26rem;
  330. background: #bcbcbc;
  331. color: #333;
  332. }
  333. div /deep/ .yd-accordion-content:after{
  334. height: 0;
  335. }
  336. .gridsDiv,
  337. .rulesName div {
  338. border-bottom: 1px solid #e4e4e4;
  339. height: 0.88rem;
  340. justify-content: center;
  341. width: 2.49rem;
  342. }
  343. .minGrid {
  344. width: 1.07rem;
  345. height: 0.76rem;
  346. font-size: 0.24rem;
  347. text-align: center;
  348. border: 1px solid #cecece;
  349. border-radius: 0.1rem;
  350. }
  351. .minGrid span {
  352. font-size: 0.24rem;
  353. padding: 0.08rem 0;
  354. line-height: 0;
  355. }
  356. .minGridAll {
  357. margin-right: 0.69rem;
  358. line-height: 0.76rem;
  359. text-align: center;
  360. }
  361. .trueSelected {
  362. background: #f76649 !important;
  363. border: 2px solid #f76649;
  364. }
  365. .trueSelected span {
  366. color: #f4f4f4 !important;
  367. }
  368. </style>