6c2661eafbcc66e7a08d2b664e21d0295ea8651a.svn-base 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <div>
  3. <div v-if="isDisplay">
  4. <div v-if="obj.a">
  5. <yd-accordion>
  6. <yd-accordion-item class="Match-game" title="波胆" open>
  7. <div class="box title-box row item-center" >
  8. <span>{{home_team}}</span>
  9. </div>
  10. <div v-for="(item ,index) in data" :key="'a'+index" class="box" style="background: #F4F4F4;">
  11. <div v-if="item.odds_code.startsWith('bodanhome')">
  12. <div class="row allAlignment center row-box">
  13. <span>{{item.condition}}</span>
  14. <div v-if="item.odds >0" class="The-club-box row center"
  15. :class="{active:item.isTrue,increased_color:item.change == 'add',reduce_color:item.change == 'red'}"
  16. @click="bettingBtn(item.id,home_team,item.odds,item.odds_only,item.p_code,match_id,item.odds_code,'波胆',item.condition)"
  17. >
  18. <span>{{item.odds}}</span>
  19. </div>
  20. <div v-else class="ratio 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>
  26. <div class="box title-box row item-center" >
  27. <span>{{guest_team}}</span>
  28. </div>
  29. <div v-for="(item ,index) in data" :key="'b'+index" class="box" style="background: #F4F4F4;">
  30. <div v-if="item.odds_code.startsWith('bodanguest')">
  31. <div class="row allAlignment center row-box">
  32. <span>{{item.condition}}</span>
  33. <div v-if="item.odds >0" class="The-club-box row center"
  34. :class="{active:item.isTrue,increased_color:item.change == 'add',reduce_color:item.change == 'red'}"
  35. @click="bettingBtn(item.id,guest_team,item.odds,item.odds_only,item.p_code,match_id,item.odds_code,'波胆',item.condition)"
  36. >
  37. <span>{{item.odds}}</span>
  38. </div>
  39. <div v-else class="ratio column center">
  40. <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </yd-accordion-item>
  46. </yd-accordion>
  47. </div>
  48. <div v-if="obj.b">
  49. <yd-accordion>
  50. <yd-accordion-item class="Match-game" title="波胆-上半场" open>
  51. <div class="box title-box row item-center" >
  52. <span>{{home_team}}</span>
  53. </div>
  54. <div v-for="(item ,index) in data" :key="'a'+index" class="box" style="background: #F4F4F4;">
  55. <div v-if="item.odds_code.startsWith('bodanhome')">
  56. <div class="row allAlignment center row-box">
  57. <span>{{item.condition}}</span>
  58. <div v-if="item.odds >0" class="The-club-box row center"
  59. :class="{active:item.isTrue,increased_color:item.change == 'add',reduce_color:item.change == 'red'}"
  60. @click="bettingBtn(item.id,home_team,item.odds,item.odds_only,item.p_code,match_id,item.odds_code,'波胆-上半场',item.condition)"
  61. >
  62. <span>{{item.odds}}</span>
  63. </div>
  64. <div v-else class="ratio column center">
  65. <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="box title-box row item-center" >
  71. <span>{{guest_team}}</span>
  72. </div>
  73. <div v-for="(item ,index) in data" :key="'b'+index" class="box" style="background: #F4F4F4;">
  74. <div v-if="item.odds_code.startsWith('bodanguest')">
  75. <div class="row allAlignment center row-box">
  76. <span>{{item.condition}}</span>
  77. <div v-if="item.odds >0" class="The-club-box row center"
  78. :class="{active:item.isTrue,increased_color:item.change == 'add',reduce_color:item.change == 'red'}"
  79. @click="bettingBtn(item.id,guest_team,item.odds,item.odds_only,item.p_code,match_id,item.odds_code,'波胆-上半场',item.condition)"
  80. >
  81. <span>{{item.odds}}</span>
  82. </div>
  83. <div v-else class="ratio column center">
  84. <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </yd-accordion-item>
  90. </yd-accordion>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. export default {
  97. // 独赢
  98. data() {
  99. return {
  100. title: "bodan",
  101. home_team: " ",
  102. match_id:'',
  103. guest_team: " ",
  104. obj:'',//
  105. data: [],
  106. lg_id:'',
  107. isDisplay: "", //是否显示
  108. betting: [], //已投注倍率id集合
  109. dataNum: 10000 //对应的数据的下标
  110. };
  111. },
  112. methods: {
  113. //玩法投注
  114. bettingBtn(id, name, odds,odds_only,p_code,match_id,odds_code,play_name,condition = "", bettingTime = "") {
  115. //console.log(this.data)
  116. let _this = this;
  117. let bettingInfo = {
  118. id,
  119. home_team: this.home_team,
  120. guest_team: this.guest_team,
  121. name,
  122. odds,
  123. ballId:this.$store.getters.getBallId,
  124. condition,
  125. odds_code,
  126. score: this.score,
  127. bettingTime,
  128. odds_only,
  129. p_code,
  130. lg_id:this.lg_id,
  131. odds_id:id,
  132. play_name,
  133. match_id,
  134. };
  135. //调用玩法投注公共方法
  136. this.$public.bettingFunction(
  137. this.betting,
  138. bettingInfo,
  139. this.data,
  140. this.$store.getters.getBetting,
  141. this.title,
  142. this.dataNum,
  143. this.$store.getters.getLimit,
  144. function(res, type) {
  145. _this.$set(res, "isTrue", type);
  146. },
  147. function(data, val,type) {
  148. if(type) {
  149. _this.$dialog.alert({mes: '你的注单已达到上限啦!'});
  150. }
  151. _this.$store.dispatch("BETTING", []);
  152. _this.$store.dispatch("BETTING", data ? data : val);
  153. if(_this.$store.getters.getIsBetting == '100') return false
  154. _this.$store.dispatch("ISBETTING",'100')
  155. }
  156. );
  157. },
  158. //获取玩法id
  159. getBettingId(data) {
  160. if (data) {
  161. data.forEach((res, index) => {
  162. if (res.title == this.title) {
  163. this.betting = res.data;
  164. this.dataNum = index;
  165. }
  166. });
  167. }
  168. },
  169. /*-------------------------------*/
  170. //获取子玩法分类
  171. getChildPlay(data){
  172. let obj ={};
  173. this.data = [];
  174. data.forEach(e=>{
  175. if(e.odds >0){
  176. if(e.odds_code.startsWith('bodan')){
  177. obj.a = true;
  178. }else if(e.odds_code.startsWith('half')){
  179. obj.b = true;
  180. }
  181. this.data.push(e);
  182. }
  183. })
  184. this.obj = obj
  185. },
  186. },
  187. computed: {
  188. getUserIcons() {
  189. return this.$store.getters.getGameRatio;
  190. },
  191. getBetting() {
  192. return this.$store.getters.getBetting;
  193. },
  194. // 获取投注删除状态
  195. deleteType() {
  196. return this.$store.getters.getDeleteType;
  197. }
  198. },
  199. watch: {
  200. getUserIcons(val) {
  201. this.match_id=val.match_id
  202. if (!val) return false;
  203. this.home_team = val.home_team;
  204. this.guest_team = val.guest_team;
  205. this.lg_id = val.lg_id;
  206. val.oddsData.forEach(res => {
  207. if (res[0].p_code == this.title) {
  208. this.isDisplay = true;
  209. this.getChildPlay(res);
  210. }
  211. });
  212. this.getBettingId(this.$store.getters.getBetting);
  213. if (this.dataNum != 10000) {
  214. this.betting.forEach(res => {
  215. this.data.forEach((e, index) => {
  216. if (res.id == e.id) {
  217. this.$set(e, "isTrue", true);
  218. }
  219. });
  220. });
  221. }
  222. },
  223. //获取已投注信息
  224. getBetting(val) {
  225. let _this = this;
  226. this.$public.getBettingId(val, this.title, function(data, index) {
  227. _this.betting = data;
  228. _this.dataNum = index;
  229. });
  230. },
  231. //监听投注框删除处理
  232. deleteType(val) {
  233. this.data.forEach(e => {
  234. if (val == "all") {
  235. this.$set(e, "isTrue", false);
  236. } else {
  237. if (e.id == val) {
  238. this.$set(e, "isTrue", false);
  239. }
  240. }
  241. });
  242. },
  243. },
  244. mounted() {
  245. }
  246. };
  247. </script>
  248. <style scoped>
  249. div /deep/ .yd-accordion-head-arrow:after {
  250. border: none;
  251. width: 0.5rem;
  252. height: 0.5rem;
  253. background: url(../assets/st-imges/xiangxia.png) no-repeat;
  254. background-size: 100% 100%;
  255. }
  256. div /deep/ .yd-accordion-head,
  257. div /deep/ .yd-accordion-head-content,
  258. div /deep/ .yd-accordion-title {
  259. font-size: 0.28rem;
  260. color: #fefefe;
  261. background: #a0a0a0;
  262. }
  263. div /deep/ .yd-accordion-head {
  264. padding: 0 0.32rem;
  265. }
  266. .box {
  267. padding: 0 0.32rem;
  268. }
  269. .title-box{
  270. background:#e4e4e4;
  271. min-height: 0.7rem;
  272. font-size: 0.24rem;
  273. }
  274. .row-box {
  275. height: 0.9rem;
  276. font-size: 0.26rem;
  277. border-bottom: 1px solid #e4e4e4;
  278. }
  279. .The-club-box {
  280. width: 1.07rem;
  281. height: 0.76rem;
  282. font-size: 0.24rem;
  283. padding: 0.1rem;
  284. border: 1px solid #cecece;
  285. border-radius: 0.1rem;
  286. margin: 0.06rem;
  287. }
  288. .active {
  289. background: #f76649;
  290. color: #f4f4f4;
  291. padding: 0.1rem;
  292. border: 1px solid #f76649;
  293. }
  294. .active i {
  295. color: #f4f4f4 !important;
  296. }
  297. .ratio {
  298. width: 1.07rem;
  299. height: 0.76rem;
  300. border: 1px solid #cecece;
  301. margin-right: 0.14rem;
  302. border-radius: 0.1rem;
  303. margin: 0.06rem;
  304. }
  305. </style>