6e69ac57ab8ff3fcfcb807b0b8b0966891019640.svn-base 10 KB

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