| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <template>
- <div>
- <!-- //v-for="(item,index) in data" -->
- <div v-if="isDisplay">
- <yd-accordion>
- <yd-accordion-item title="波胆" open>
- <div>
- <div class="rulesName row average">
- <div class="row item-center">{{home_team}}</div>
- <div class="row item-center">和局</div>
- <div class="row item-center">{{guest_team}}</div>
- </div>
- <div class="row grids average">
- <div class="column">
- <div class="gridsDiv row center" v-for="(item,index) in data " :key="item.id" v-if="item.odds_code.startsWith('bodanhome')" >
- <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)" >
- <span style="color:#f76649 ">{{item.condition}}</span>
- <span>{{item.odds}}</span>
- </div>
- <div v-else class="minGrid column center">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- <div class="column middle">
- <div class="gridsDiv row center" v-for="(item,index) in data " :key="item.id" v-if="item.odds_code.startsWith('bodandogfall')" >
- <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)" >
- <span style="color:#f76649 ">{{item.condition}}</span>
- <span>{{item.odds}}</span>
- </div>
- <div v-else class="minGrid column center">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- <div class="column">
- <div class="gridsDiv row center" v-for="(item,index) in data " :key="item.id" v-if="item.odds_code.startsWith('bodanguest')" >
- <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)" >
- <span style="color:#f76649 ">{{item.condition}}</span>
- <span>{{item.odds}}</span>
- </div>
- <div v-else class="minGrid column center">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- </div>
- <div style="background:#f8f8f8;">
- <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')">
- <span>其他比分:</span>
- <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.odds}}
- </div>
- <div v-else class="minGrid minGridAll">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- </div>
- </yd-accordion-item>
- </yd-accordion>
- <yd-accordion>
- <yd-accordion-item title="波胆-上半场" open>
- <div>
- <div class="rulesName row average">
- <div class="row item-center">{{home_team}}</div>
- <div class="row item-center">和局</div>
- <div class="row item-center">{{guest_team}}</div>
- </div>
- <div class="row grids average">
- <div class="column">
- <div class="gridsDiv row center" v-for="(item,index) in data " :key="item.id" v-if="item.odds_code.startsWith('halfbodanhome')" >
- <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)">
- <span style="color:#f76649 ">{{item.condition}}</span>
- <span>{{item.odds}}</span>
- </div>
- <div v-else class="minGrid column center">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- <div class="column middle">
- <div class="gridsDiv row center" v-for="(item,index) in data " :key="item.id" v-if="item.odds_code.startsWith('halfbodandogfall')" >
- <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)">
- <span style="color:#f76649">{{item.condition}}</span>
- <span>{{item.odds}}</span>
- </div>
- <div v-else class="minGrid column center">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- <div class="column">
- <div class="gridsDiv row center" v-for="(item,index) in data " :key="item.id" v-if="item.odds_code.startsWith('halfbodanguest')">
- <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)" >
- <span style="color:#f76649">{{item.condition}}</span>
- <span>{{item.odds}}</span>
- </div>
- <div v-else class="minGrid column center">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- </div>
- <div style="background:#f8f8f8;">
- <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')" >
- <span>其他比分:</span>
- <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.odds}}</div>
- <div v-else class="minGrid minGridAll">
- <img style="width: 0.7rem;height: 0.5rem;" src="@/assets/st-imges/mima.png"><img>
- </div>
- </div>
- </div>
- </div>
- </yd-accordion-item>
- </yd-accordion>
- </div>
- </div>
- </template>
- <script>
- import "../css/index.css";
- import Vue from "vue";
- import { Accordion, AccordionItem } from "vue-ydui/dist/lib.rem/accordion";
- Vue.component(Accordion.name, Accordion);
- Vue.component(AccordionItem.name, AccordionItem);
- export default {
- name: "WaveBladder",
- data() {
- return {
- title: "bodan",
- home_team: "",
- guest_team: "",
- isDisplay: false,
- data: [],
- match_id:'',
- lg_id:'',
- betting: [], //已投注倍率id集合
- dataNum: 10000 //对应的数据的下标
- };
- },
- methods: {
- /*---------------------------------------------------- */
- //玩法投注
- btnChoose: function(id,name,odds,odds_only,p_code,match_id,odds_code,play_name,condition='',bettingTime='') {
- //console.log('我需要的',this.data)
- let _this = this;
- let bettingInfo = {
- id,
- home_team:this.home_team,
- guest_team:this.guest_team,
- name:'',
- odds,
- condition,
- odds_code,
- score:this.score,
- bettingTime,
- odds_only,
- odds_id:id,
- lg_id:this.lg_id,
- play_name,
- ballId:this.$store.getters.getBallId,
- p_code,
- match_id,
- }
- //调用玩法投注公共方法
- this.$public.bettingFunction(
- this.betting,
- bettingInfo,
- this.data,
- this.$store.getters.getBetting,
- this.title,
- this.dataNum,
- this.$store.getters.getLimit,
- function(res, type) {
- _this.$set(res, "isTrue", type);
- },
- function(data, val,type) {
- if(type) {
- _this.$dialog.alert({mes: '你的注单已达到上限啦!'});
- }
- _this.$store.dispatch("BETTING", []);
- _this.$store.dispatch("BETTING", data ? data : val);
- if(_this.$store.getters.getIsBetting == '100') return false
- _this.$store.dispatch("ISBETTING",'100')
- }
- );
- },
- //数据排序处理
- dataSorting(data){
-
- let arr = [],home = [],goust = [],other = [];
- data.forEach((res, i) => {
- if (res.odds_code.startsWith("bodanguest") == true || res.odds_code.startsWith("halfbodanguest") == true) {
- goust.push(res);
- goust.sort((a, z) => {
- let str1 = a.condition.split("-");
- let str2 = z.condition.split("-");
- if (str1[1] - str2[1] != 0) {
- return str1[1] - str2[1];
- } else {
- return str1[0] - str2[0];
- }
- });
- } else if (res.odds_code.startsWith("bodanhome") == true || res.odds_code.startsWith("halfbodanhome") == true ) {
- home.push(res);
- // 主队排序
- home.sort((a, z) => {
- let str1 = a.condition.split("-");
- let str2 = z.condition.split("-");
- if (str1[0] - str2[0] != 0) {
- return str1[0] - str2[0];
- } else {
- return str1[1] - str2[1];
- }
- });
- } else if (res.odds_code.startsWith("bodandogfall") == true || res.odds_code.startsWith("halfbodandogfall") == true) {
- arr.push(res);
- // 和排序
- arr.sort((a, z) => {
- let str1 = a.condition.split("-");
- let str2 = z.condition.split("-");
- return str1[0] - str2[0];
- });
- } else if (res.odds_code.startsWith("bodanother") == true || res.odds_code.startsWith("halfbodanother") == true) {
- other.push(res);
- }
- });
-
- this.data= [...home, ...goust, ...arr, ...other];
- }
- },
- computed: {
- getUserIcons() {
- return this.$store.getters.getGameRatio;
- },
- getBetting() {
- return this.$store.getters.getBetting;
- },
- //获取投注框删除的投注信息
- getDeleteType(){
- return this.$store.getters.getDeleteType;
- },
- },
- watch: {
- getUserIcons(val) {
- this.match_id=val.match_id
- if (!val) return false;
- this.home_team = val.home_team;
- this.guest_team = val.guest_team;
- this.lg_id=val.lg_id;
- val.oddsData.forEach(res => {
- if (res[0].p_code == this.title) {
- this.isDisplay = true;
- // console.log(res);
- this.dataSorting(res);
- //this.data = res;
- }
- });
- let _this =this;
- this.$public.getBettingId(this.$store.getters.getBetting,this.title,function(data,index){
- _this.betting = data;
- _this.dataNum = index;
- });
- if (this.dataNum != 10000) {
- this.betting.forEach(res => {
- this.data.forEach((e, index) => {
- if (res.id == e.id) {
- this.$set(e, "isTrue", true);
- }
- });
- });
- }
- },
- //获取已投注信息
- getBetting(val) {
- let _this =this;
- this.$public.getBettingId(this.$store.getters.getBetting,this.title,function(data,index){
- _this.betting = data;
- _this.dataNum = index;
- });
- },
- //监听投注框删除处理
- getDeleteType(val){
- this.data.forEach(e =>{
- if(val =='all'){
- this.$set(e, "isTrue", false);
- }else{
- if(e.id == val){
- this.$set(e, "isTrue", false);
- }
- }
- })
- }
- }
- };
- </script>
- <style scoped>
- div /deep/ .yd-accordion-head {
- padding: 0 0.32rem;
- background: #a0a0a0;
-
-
- }
- div /deep/ .yd-accordion-head:after{
- height: 0;
- }
- div /deep/ .yd-accordion-title {
- color: #FEFEFE;
- font-size: 0.28rem;
- }
- div /deep/ .yd-accordion-head-arrow:after {
- border: none;
- width: 0.5rem;
- height: 0.5rem;
- background: url("../assets/st-imges/xiangxia.png") no-repeat;
- background-size: 100% 100%;
- }
- .grids{
- width: 100%;
- }
- .grids div {
- background: #f4f4f4;
- }
- .trueSelected{
- color: #f4f4f4 !important
- }
- .middle {
- border-left: 1px solid #e4e4e4;
- border-right: 1px solid #e4e4e4;
- }
- .rulesName {
- font-size: 0.26rem;
- background: #bcbcbc;
- color: #333;
- }
- div /deep/ .yd-accordion-content:after{
- height: 0;
- }
- .gridsDiv,
- .rulesName div {
- border-bottom: 1px solid #e4e4e4;
- height: 0.88rem;
- justify-content: center;
- width: 2.49rem;
- }
- .minGrid {
- width: 1.07rem;
- height: 0.76rem;
- font-size: 0.24rem;
- text-align: center;
- border: 1px solid #cecece;
- border-radius: 0.1rem;
- }
- .minGrid span {
- font-size: 0.24rem;
- padding: 0.08rem 0;
- line-height: 0;
-
- }
- .minGridAll {
- margin-right: 0.69rem;
- line-height: 0.76rem;
- text-align: center;
- }
- .trueSelected {
- background: #f76649 !important;
- border: 2px solid #f76649;
- }
- .trueSelected span {
- color: #f4f4f4 !important;
- }
- </style>
|