| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- <template>
- <div class="goal">
- <div v-if="isDisplay">
- <yd-accordion :accordion="true">
- <yd-accordion-item title="进球:单/双" open>
- <div class="row allAlignment box">
- <div
- v-for="(item,index) in data"
- :key="'b'+index"
- v-if="item.odds_code =='two_sides_single'"
- class="left_box row allAlignment"
- >
- <div>{{item.condition}}</div>
- <div class="ratio" :class="item.isTrue ==true ? 'col':''" @click="toggle(item.id,item.condition,item.odds,item.odds_onlys,item.p_code,match_id)">
- <span>{{item.odds}}</span>
- </div>
- </div>
- <div
- v-for="(item,index) in data"
- :key="'b'+index"
- v-if="item.odds_code =='two_sides_double' "
- class="right_box row allAlignment"
- >
- <div>{{item.condition}}</div>
- <div class="ratio" :class="item.isTrue ==true ? 'col':''" @click="toggle(item.id,item.condition,item.odds,item.odds_only,item.p_code,match_id)">
- <span>{{item.odds}}</span>
- </div>
- </div>
- </div>
- </yd-accordion-item>
- </yd-accordion>
- <yd-accordion :accordion="true">
- <yd-accordion-item title="进球:单/双-上半场" open>
- <div class="row allAlignment box">
- <div
- v-for="(item,index) in data"
- :key="item.id"
- v-if="item.odds_code =='half_two_sides_single'"
- class="left_box row allAlignment"
- >
- <div>{{item.condition}}</div>
- <div class="ratio" :class="item.isTrue ==true ? 'col':''" @click="toggle(item.id,item.condition,item.odds,item.odds_only,item.p_code,match_id)">
- <span>{{item.odds}}</span>
- </div>
- </div>
- <div
- v-for="(item,index) in data"
- :key="item.id"
- v-if="item.odds_code =='half_two_sides_double' "
- class="right_box row allAlignment"
- >
- <div>{{item.condition}}</div>
- <div class="ratio" :class="item.isTrue ==true ? 'col':''" @click="toggle(item.id,item.condition,item.odds,item.odds_only,item.p_code,match_id)">
- <span>{{item.odds}}</span>
- </div>
- </div>
- </div>
- </yd-accordion-item>
- </yd-accordion>
- </div>
- </div>
- </template>
- <script>
- export default {
- // 进球大小单双数
- data() {
- return {
- title: "two_sides",
- // status: -1,
- smallStatus: [],
- isDisplay: false,
- home_team:'',
- guest_team:'',
- match_id:'',
- score:'0',
- data: [], //
- betting: [], //已投注倍率id集合
- dataNum: 10000 //对应的数据的下标
- };
- },
- methods: {
- //玩法投注
- toggle(id,name,odds,odds_only,p_code,match_id) {
- console.log(this.data)
- let _this = this;
- let bettingInfo = {
- id,
- home_team:this.home_team,
- guest_team:this.guest_team,
- name,
- odds,
- ballId:this.$store.getters.getBallId,
- // condition,
- ganame:this.title,
- score:this.score,
- bettingTime:'',
- odds_only,
- p_code,
- match_id
- }
- //调用玩法投注公共方法
- this.$public.bettingFunction(this.betting,bettingInfo,this.data,this.$store.getters.getBetting,this.title,this.dataNum,function(res,type){
- _this.$set(res,'isTrue',type);
- },function(data,val){
- _this.$store.dispatch("BETTING", []);
- _this.$store.dispatch("BETTING", data ? data : val);
- if(_this.$store.getters.getIsBetting) return false
- _this.$store.dispatch("ISBETTING",true)
- })
- },
- //获取玩法id
- getBettingId(data) {
- console.log(data);
- if(data){
- data.forEach((res, index) => {
- if (res.title == this.title) {
- this.betting = res.data;
- this.dataNum = index;
- }
- });
- }
- }
- },
- computed: {
- getUserIcons() {
- return this.$store.getters.getGameRatio;
- },
- getBetting() {
- return this.$store.getters.getBetting;
- },
- //获取投注框删除的投注信息
- getDeleteType(){
- return this.$store.getters.getDeleteType;
- },
- },
- watch: {
- //监听vuex里面数据
- getUserIcons(val) {
- this.match_id=val.match_id
- if (!val) return false;
- this.home_team = val.home_team;
- this.guest_team = val.guest_team;
- val.oddsData.forEach(res => {
- if (res[0].p_code == this.title) {
- this.isDisplay = true;
- this.data = res;
- }
- });
- this.getBettingId(this.$store.getters.getBetting);
- 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(val,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;
- }
- .goalBox {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: #f8f8f8;
- padding: 0 0.32rem;
- }
- 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%;
- }
- .box {
- font-size: 0.24rem;
- color: #333333;
- background: #f4f4f4;
- padding: 0 0.32rem;
- }
- .left_box {
- width: 50%;
- border-right: 1px solid #e4e4e4;
- line-height: 0.9rem;
- }
- .right_box {
- width: 50%;
- padding-left: 0.16rem;
- line-height: 0.9rem;
- }
- .ratio {
- width: 1.07rem;
- height: 0.76rem;
- line-height: 0.76rem;
- border: 2px solid #cecece;
- border-radius: 0.1rem;
- margin-top: 0.06rem;
- text-align: center;
- margin-right: 0.14rem;
- }
- /* .odds {
- display: flex;
- width: 50%;
- justify-content: space-between;
- background: #f8f8f8;
- text-align: left;
- }
- .odds .odd {
- width: 100%;
- }
- .odds .small {
- width: 50%;
- display: flex;
- justify-content: space-between;
- border-right: 1px solid #e4e4e4;
- }
- .odds .large {
- width: 100%;
- display: flex;
- justify-content: space-between;
- border-right: 1px solid #e4e4e4;
- }
- .odds .small {
- border-right: none;
- padding-left: 0.16rem;
- }
- .odds .large div,
- .odds .small div {
- height: 0.88rem;
- font-size: 0.24rem;
- color: #333333;
- }
- .odds .large div:nth-child(1),
- .odds .small div:nth-child(1) {
- line-height: 0.88rem;
- }
- .odds .large .ratio,
- .odds .small .ratio {
- width: 1.07rem;
- height: 0.76rem;
- line-height: 0.76rem;
- border: 2px solid #cecece;
- border-radius: 0.1rem;
- margin-top: 0.06rem;
- text-align: center;
- margin-right: 0.14rem;
- }
- .odds .large .ratio span,
- .odds .small .ratio span {
- font-size: 0.24rem;
- }
- .odds .large .score,
- .odds .small .score {
- color: #fd8f26;
- }
- .odds:nth-last-child(1) .large,
- .odds:nth-last-child(1) .small {
- border-bottom: none;
- }
- .largeScore,
- .smallScore {
- line-height: 0.76rem;
- }*/
- .col {
- background: #f76649;
- border: 2px solid #f76649 !important;
- }
- .col span {
- color: #f4f4f4 !important;
- }
- /* .odds .score {
- display: block;
- margin-top: 0.04rem;
- } */
- </style>
|