c0b128c35f974ad6ab04d9256c7dcdd500bdc546.svn-base 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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,item.oddsType)"
  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,item.oddsType)"
  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,item.oddsType)"
  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,item.oddsType)"
  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 = "",oddsType, 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. oddsType
  135. };
  136. //调用玩法投注公共方法
  137. this.$public.bettingFunction(
  138. this.betting,
  139. bettingInfo,
  140. this.data,
  141. this.$store.getters.getBetting,
  142. this.title,
  143. this.dataNum,
  144. this.$store.getters.getLimit,
  145. function(res, type) {
  146. _this.$set(res, "isTrue", type);
  147. },
  148. function(data, val,type) {
  149. if(type) {
  150. _this.$dialog.alert({mes: '你的注单已达到上限啦!'});
  151. }
  152. _this.$store.dispatch("BETTING", []);
  153. _this.$store.dispatch("BETTING", data ? data : val);
  154. if(_this.$store.getters.getIsBetting == '100') return false
  155. _this.$store.dispatch("ISBETTING",'100')
  156. }
  157. );
  158. },
  159. //获取玩法id
  160. getBettingId(data) {
  161. if (data) {
  162. data.forEach((res, index) => {
  163. if (res.title == this.title) {
  164. this.betting = res.data;
  165. this.dataNum = index;
  166. }
  167. });
  168. }
  169. },
  170. /*-------------------------------*/
  171. //获取子玩法分类
  172. getChildPlay(data){
  173. let obj ={};
  174. this.data = [];
  175. data.forEach(e=>{
  176. if(e.odds >0){
  177. if(e.odds_code.startsWith('bodan')){
  178. obj.a = true;
  179. }else if(e.odds_code.startsWith('half')){
  180. obj.b = true;
  181. }
  182. this.data.push(e);
  183. }
  184. })
  185. this.obj = obj
  186. },
  187. },
  188. computed: {
  189. getUserIcons() {
  190. return this.$store.getters.getGameRatio;
  191. },
  192. getBetting() {
  193. return this.$store.getters.getBetting;
  194. },
  195. // 获取投注删除状态
  196. deleteType() {
  197. return this.$store.getters.getDeleteType;
  198. }
  199. },
  200. watch: {
  201. getUserIcons(val) {
  202. this.match_id=val.match_id
  203. if (!val) return false;
  204. this.home_team = val.home_team;
  205. this.guest_team = val.guest_team;
  206. this.lg_id = val.lg_id;
  207. val.oddsData.forEach(res => {
  208. if (res[0].p_code == this.title) {
  209. this.isDisplay = true;
  210. this.getChildPlay(res);
  211. }
  212. });
  213. this.getBettingId(this.$store.getters.getBetting);
  214. if (this.dataNum != 10000) {
  215. this.betting.forEach(res => {
  216. this.data.forEach((e, index) => {
  217. if (res.id == e.id) {
  218. this.$set(e, "isTrue", true);
  219. }
  220. });
  221. });
  222. }
  223. },
  224. //获取已投注信息
  225. getBetting(val) {
  226. let _this = this;
  227. this.$public.getBettingId(val, this.title, function(data, index) {
  228. _this.betting = data;
  229. _this.dataNum = index;
  230. });
  231. },
  232. //监听投注框删除处理
  233. deleteType(val) {
  234. this.data.forEach(e => {
  235. if (val == "all") {
  236. this.$set(e, "isTrue", false);
  237. } else {
  238. if (e.id == val) {
  239. this.$set(e, "isTrue", false);
  240. }
  241. }
  242. });
  243. },
  244. },
  245. mounted() {
  246. }
  247. };
  248. </script>
  249. <style scoped>
  250. div /deep/ .yd-accordion-head-arrow:after {
  251. border: none;
  252. width: 0.5rem;
  253. height: 0.5rem;
  254. background: url(../assets/st-imges/xiangxia.png) no-repeat;
  255. background-size: 100% 100%;
  256. }
  257. div /deep/ .yd-accordion-head,
  258. div /deep/ .yd-accordion-head-content,
  259. div /deep/ .yd-accordion-title {
  260. font-size: 0.28rem;
  261. color: #fefefe;
  262. background: #a0a0a0;
  263. }
  264. div /deep/ .yd-accordion-head {
  265. padding: 0 0.32rem;
  266. }
  267. .box {
  268. padding: 0 0.32rem;
  269. }
  270. .title-box{
  271. background:#e4e4e4;
  272. min-height: 0.7rem;
  273. font-size: 0.24rem;
  274. }
  275. .row-box {
  276. height: 0.9rem;
  277. font-size: 0.26rem;
  278. border-bottom: 1px solid #e4e4e4;
  279. }
  280. .The-club-box {
  281. width: 1.07rem;
  282. height: 0.76rem;
  283. font-size: 0.24rem;
  284. padding: 0.1rem;
  285. border: 1px solid #cecece;
  286. border-radius: 0.1rem;
  287. margin: 0.06rem;
  288. }
  289. .active {
  290. background: #f76649;
  291. color: #f4f4f4;
  292. padding: 0.1rem;
  293. border: 1px solid #f76649;
  294. }
  295. .active i {
  296. color: #f4f4f4 !important;
  297. }
  298. .ratio {
  299. width: 1.07rem;
  300. height: 0.76rem;
  301. border: 1px solid #cecece;
  302. margin-right: 0.14rem;
  303. border-radius: 0.1rem;
  304. margin: 0.06rem;
  305. }
  306. </style>