| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006 |
- <template>
- <div class="head" :class="newIsShrink ?'hiddenbox':'bgcolor'">
- <div style="padding-top:2rem; height:100%;width:90%" class="baffleBox" v-show="!newIsShrink">
- <div class="allBox">
- <div class="box">
- <div class="row allAlignment center">
- <span style="color:#f8f8f8;font-size:0.24rem;">余额:{{cash}}</span>
- <span style="font-size:0.28rem; color:#333333;font-weight:bold">投注单</span>
- <img style="width:.50rem;height:0.8rem" :src="img_size" alt @click="shrink()">
- <!-- style="color:#33333;font-size:0.24rem;" -->
- </div>
- </div>
- <!-- 数据列表 -->
- <div
- class="titleBox"
- v-for="(item,index) in dataList"
- :key="index"
- @click="activekey(index)"
- >
- <div class="tilteMatch">
- <div class="row center allAlignment" style="height:.5rem;padding-left:0.32rem">
- <span :style="item.repeat? 'background: #f76649;':'' ">{{item.play_name}}</span>
- <span class="cancel" @click.stop="delarr(item.p_code,item.id)">
- <img style="width:.25rem;height:.25rem" :src="img" alt>
- </span>
- </div>
- <div class="tilteMatchDiv" style="min-height:1rem;padding:0 .32rem">
- <div class="row item-center" style="height:50%">
-
- <div v-if="item.p_code =='capot'">
- <span>{{item.name}}</span> 
- <span>{{item.condition == 1 ? item.home_team :item.condition == 'x'? '和局':item.condition == 2? item.guest_team:item.condition }}</span>@
- <span>{{item.odds}}</span>
- </div>
- <div v-else>
- <span>{{item.name}}</span> 
- <span>{{item.condition}}</span>@
- <span>{{item.odds}}</span>
- </div>
- </div>
- <div class="row item-center" style="height:50%;">
- <span>{{item.home_team}}</span>
- <span style="color:#F76649">vs</span>
- <span>{{item.guest_team}}</span>
- </div>
- </div>
- </div>
- <div class="bettingInput row item-center allAlignment">
- <div class="inputBox row allAlignment">
- <input
- class="input_text"
- type
- @click.stop="go()"
- v-model="bettingNumber[index]"
- placeholder="投注额"
- @click="activekey(index)"
- >
- <span style="padding:0 0.22rem;" @click.stop="ClearData(index)">
- <img style="width:.2rem;height:.2rem" :src="img" alt>
- </span>
- </div>
- <div class>
- <span v-if="bettingNumber[index]">{{(bettingNumber[index]*item.odds).toFixed(2)}}</span>
- <span v-else>可赢额</span>
- </div>
- </div>
- <div class="bottonBox row allAlignment" v-show="clickIndex==index">
- <div class="bottonBox-num column allAlignment center">
- <div @click="additionFun(100,index) ">+100</div>
- <div @click="additionFun(1000,index) ">+1000</div>
- <div @click="additionFun(10000,index) ">+10000</div>
- </div>
- <div class="column allAlignment center" >
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n,index)">
- <button>{{n}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n+3,index)">
- <button>{{n+3}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n+6,index)">
- <button>{{n+6}}</button>
- </div>
- </div>
- </div>
- <div class="column allAlignment center" >
- <button class="btn-right" @click="delNumder(index)" >x</button>
- <button class="btn-right" style="margin:0.1rem 0;" @click="updateNumber('0',index)">0</button>
- <button class="btn-right" @click="updateNumber('00',index)">00</button>
- </div>
- </div>
- </div>
- <!-- 单注 -->
- <div class="showNumber" @click.stop="activekey('all')">
- <div v-if="dataList.length>1">
- <span v-if="dataList" style="font-size:.3rem">单注</span>
- <div class="bettingInput row item-center allAlignment">
- <div class="inputBox row allAlignment">
- <input type @click="go()" v-model="arrNumber" placeholder="投注额">
- <span class="cancel" @click.stop="ClearData('all')">
- <img style="width:.2rem;height:.2rem" :src="img" alt>
- </span>
- <!-- <span @click.stop="ClearData('all')">x</span> -->
- </div>
- <div class>
- <span v-if="arrNumber">{{(datamMoney).toFixed(2)}}</span>
- <span v-else>可赢额</span>
- </div>
- </div>
- <!-- <div class="bottonBox" v-if="clickIndex=='all'">
- <div class="bottonBox-num row allAlignment" style="padding:0 .2rem">
- <div @click="additionFun(100,'all') ">+100</div>
- <div @click="additionFun(1000,'all')">+1000</div>
- <div @click="additionFun(10000,'all')">+10000</div>
- </div>
- <div style="margin-top:0.42rem;margin-bottom:0.42rem">
- <div class="row allAlignment center">
- <div v-for=" n in 6" @click="updateNumber(n,'all')">
- <button>{{n}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="margin-top:0.17rem;">
- <div v-for=" n in 3" @click="updateNumber(n+6,'all')">
- <button>{{n+6}}</button>
- </div>
- <button @click="updateNumber('0','all')">0</button>
- <button @click="updateNumber('00','all')">00</button>
- <button
- @click="delNumder('all')"
- style="background:rgb(247, 102, 73);font-size:.4rem;line-height:.86rem;"
- >x</button>
- </div>
- </div>
- </div> -->
- <div class="bottonBox row allAlignment" v-if="clickIndex=='all'">
- <div class="bottonBox-num column allAlignment center">
- <div @click="additionFun(100,'all') ">+100</div>
- <div @click="additionFun(1000,'all') ">+1000</div>
- <div @click="additionFun(10000,'all') ">+10000</div>
- </div>
- <div class="column allAlignment center" >
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n,'all')">
- <button>{{n}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n+3,'all')">
- <button>{{n+3}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n+6,'all')">
- <button>{{n+6}}</button>
- </div>
-
- </div>
- </div>
- <div class="column allAlignment center" >
- <button class="btn-right" @click="delNumder('all')" >x</button>
- <button class="btn-right" style="margin:0.1rem 0;" @click="updateNumber('0','all')">0</button>
- <button class="btn-right" @click="updateNumber('00','all')">00</button>
- </div>
- </div>
- </div>
- </div>
- <!-- 过关投注 && compound.length > 0 -->
- <div v-if="!passThroughPlay && dataList.length > 2 ">
- <yd-accordion>
- <yd-accordion-item title="复式连串过关投注" open>
- <div
- class="showNumber"
- v-for="(item,index) in compound"
- @click.stop="activekey('through'+index)"
- >
- <span v-if="dataList" style="font-size:.3rem">{{item.title}}</span>
- <div class="bettingInput row item-center allAlignment">
- <div class="row center">
- <div class="inputBox row allAlignment">
- <input type @click="go()" v-model="item.money " placeholder="投注额">
- <!-- <span @click.stop="ClearData('through')">x</span> -->
- <span class="cancel" @click.stop="ClearData('through',index)">
- <img style="width:.2rem;height:.2rem" :src="img" alt>
- </span>
- </div>
- <span style="font-size:0.26rem;margin-left: 0.1rem;">X{{item.index}}</span>
- </div>
- <div class>
- <span v-if="item.money*1 > 0 ">{{(item.money * item.odds).toFixed(2)}}</span>
- <span v-else>可赢额</span>
- </div>
- </div>
- <!-- <div class="bottonBox" v-if="clickIndex=='through'+index">
- <div class="bottonBox-num " style="padding:0 .2rem">
- <div @click="additionFun(100,'through',index) ">+100</div>
- <div @click="additionFun(1000,'through',index)">+1000</div>
- <div @click="additionFun(10000,'through',index)">+10000</div>
- </div>
- <div style="margin-top:0.42rem;margin-bottom:0.42rem">
- <div class="row allAlignment center">
- <div v-for=" n in 6" @click="updateNumber(n,'through',index)">
- <button>{{n}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="margin-top:0.17rem;">
- <div v-for=" n in 3" @click="updateNumber(n+6,'through',index)">
- <button>{{n+6}}</button>
- </div>
- <button @click="updateNumber('0','through',index)">0</button>
- <button @click="updateNumber('00','through',index)">00</button>
- <button
- @click="delNumder('through',index)"
- style="background:rgb(247, 102, 73);font-size:.4rem;line-height:.86rem;"
- >x</button>
- </div>
- </div>
- </div> -->
- <div class="bottonBox row allAlignment" v-if="clickIndex=='through'+index">
- <div class="bottonBox-num column allAlignment center">
- <div @click="additionFun(100,'through',index) ">+100</div>
- <div @click="additionFun(1000,'through',index) ">+1000</div>
- <div @click="additionFun(10000,'through',index) ">+10000</div>
- </div>
- <div class="column allAlignment center" >
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n,'through',index)">
- <button>{{n}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n+3,'through',index)">
- <button>{{n+3}}</button>
- </div>
- </div>
- <div class="row allAlignment center" style="width:3.8rem">
- <div v-for=" n in 3" @click="updateNumber(n+6,'through',index)">
- <button>{{n+6}}</button>
- </div>
-
- </div>
- </div>
- <div class="column allAlignment center" >
- <button class="btn-right" @click="delNumder('through',index)" >x</button>
- <button class="btn-right" style="margin:0.1rem 0;" @click="updateNumber('0','through',index)">0</button>
- <button class="btn-right" @click="updateNumber('00','through',index)">00</button>
- </div>
- </div>
- </div>
- </yd-accordion-item>
- </yd-accordion>
- <!-- <div class="row allAlignment center " style="height: 0.8rem;background: #ccc;padding: 0 0.2rem;">
- <span>复式连串过关投注</span>
- <img style="width:.4rem;height:.4rem" src="../assets/st-imges/xiangxia.png" alt="">
- </div>-->
- </div>
- <div v-if="passThroughPlay" class="row center" style="background:#f8f8f8;">
- <span style="color:red ">红色选项不可以结合进行过关投注</span>
- </div>
- <!-- 总数据展示 -->
- <div class="row allAlignment" style="padding:.1rem .2rem;background:#f8f8f8;">
- <span v-if="dataNum" class="showNumberSpan">所有投注({{dataNum}}):</span>
- <span v-else class="showNumberSpan">所有投注:</span>
- <span v-if="dataNumbe" style="font-size:0.24rem">{{(dataNumbe)}}</span>
- <span v-else style="font-size:0.24rem">0.00</span>
- </div>
- <div class="row allAlignment" style="padding:0 .2rem;background:#f8f8f8;">
- <span class="showNumberSpan">可赢金额:</span>
- <span
- v-if="datamMoney || compound_amount "
- style="font-size:0.24rem;color:#F76649;"
- >{{compound_amount *1 ?(compound_amount*1+datamMoney*1).toFixed(2):(datamMoney).toFixed(2)}}</span>
- <span v-else style="font-size:0.24rem;color:#F76649;">0.00</span>
- </div>
- <div style="background:#f8f8f8;padding:.1rem 0;border-radius: 0 0 .1rem .1rem; ">
- <div class="btn" style="background:#F76649;" @click="betOrder" v-if="isLogin">
- <span>确认投注</span>
- </div>
- <div class="btn" style="background:#F76649;" @click="loginReg" v-else>
- <span>登陆/注册</span>
- </div>
- <div class="btn" style="background:#A1A1A1;" @click="shrink">
- <span>添加更多的选择</span>
- </div>
- <div class="btn" style="background:#333;margin-bottom:.1rem;" @click.stop="alldel()">
- <span>全删除</span>
- </div>
- </div>
- </div>
- <!-- <div class="loading_box row center" >
- <div class="weui-loading"></div>
- </div>-->
- </div>
- <div
- class="shrink"
- :style="newIsShrink?'':'display:none'"
- @click="show()"
- >
- 投注单--选项
- <span class="num">{{dataList?dataList.length:'0'}}</span>
- </div>
- <div></div>
- <div v-if="isshow" class="login">
- <Login></Login>
- </div>
- <div v-else-if="rgShow" class="login">
- <register></register>
- </div>
- </div>
- </template>
- <script>
- import "../css/index.css";
- import Login from "@/pages/Login/index/StLogin";
- import register from "@/pages/Login/index/register";
- export default {
- data() {
- return {
- img: require("../assets/st-imges/del.png"),
- img_size: require("../assets/st-imges/narrow.png"),
- bettingNumber: [],
- balance: "", //余额
- bettingquantity: "", // 投注信息
- betting: "",
- dataList: [],
- arr: [], // 是否缩小
- isshrink: false, //小键盘显示位
- clickIndex: 0,
- // money:0,//可赢金额
- arrNumber: "", //单注数量
- dataNum: 0, //已投注数量
- dataNumbe: 0, //总投数
- datamMoney: 0, //可赢总金额
- isThrough: false, //触发过关玩法
- cash: 0.0, //余额
- compound: [], //复合玩法
- passThroughPlay: false, //判断比赛数据是否有相同赛事
- isLogin: false, //是否登陆
- isshow: false, //登陆显示/隐藏
- rgShow: false, //注册显示/隐藏
- compound_amount: "", //复合玩法可赢金额
- isSubmit: false //防止重复提交
- };
- },
- components: {
- Login,
- register
- },
- methods: {
- //
- /*---------------------------------- */
- //阻止input框获取焦点
- go: function() {
- document.activeElement.blur();
- },
- /*---------------------------------- */
- //小键盘数字字符串拼接
- updateNumber: function(val, index, num) {
- // console.log(index);
- let temporaryData = "";
- let isNumbers = true;
- if (index != "through" && index == "all") {
- temporaryData =
- this.arrNumber * 1 ? this.arrNumber + val + "" : val + "";
- if (temporaryData * 1 > 999999999) {
- temporaryData = 999999999 + "";
- }
- this.arrNumber = temporaryData;
- }
- if (index == "through") {
- isNumbers = false;
- let dataVal =
- this.compound[num].money * 1 > 0
- ? this.compound[num].money + (val + "")
- : val + "";
- if (dataVal * 1 > 999999999) {
- dataVal = 999999999 + "";
- }
- this.$set(this.compound[num], "money", dataVal);
- } else {
- this.dataList.forEach((e, i) => {
- if (index != "all" && index != "through") {
- if (index == i) {
- temporaryData =
- this.bettingNumber[index] * 1
- ? this.bettingNumber[index] + (val + "")
- : val + "";
- if (temporaryData * 1 > 999999999) {
- temporaryData = 999999999 + "";
- }
- this.bettingNumber.splice(index, 1, temporaryData);
- this.arrNumber = "";
- }
- } else if (index == "all") {
- this.bettingNumber.splice(i, 1, temporaryData);
- }
- });
- }
- this.profitFun();
- },
- /*---------------------------------------------*/
- //投注加法
- additionFun: function(val, index, num) {
- let data = "";
- let isNumbers = true;
- if (index != "through" && index == "all") {
- let dataAdd = 0;
- data =
- this.arrNumber * 1 ? this.arrNumber * 1 + val * 1 + "" : val + "";
- if (data * 1 > 999999999) {
- data = 999999999 + "";
- }
- this.arrNumber = data;
- }
- if (index == "through") {
- isNumbers = false;
- let dataVal =
- this.compound[num].money * 1 > 0
- ? this.compound[num].money * 1 + val * 1
- : val + "";
- if (dataVal * 1 > 999999999) {
- dataVal = 999999999 + "";
- }
- this.$set(this.compound[num], "money", dataVal);
- } else {
- this.dataList.forEach((e, i) => {
- if (index != "all" && index != "through") {
- if (index == i) {
- data =
- this.bettingNumber[index] * 1
- ? this.bettingNumber[index] * 1 + val + ""
- : val + "";
- if (data * 1 > 999999999) {
- data = 999999999 + "";
- }
- this.bettingNumber.splice(index, 1, data);
- this.arrNumber = "";
- }
- } else if (index == "all") {
- this.bettingNumber.splice(i, 1, data);
- }
- });
- }
- //if(!isNumbers) return false;
- this.profitFun();
- },
- /*---------------------------------- */
- //删除投注数的一位数
- delNumder: function(index, num) {
- //console.log(this.compound);
- let Str = this.bettingNumber;
- let strVal = "";
- let isNumbers = true;
- if (index == "through") {
- isNumbers = false;
- strVal = this.compound[num].money.substring(
- 0,
- this.compound[num].money.length - 1
- );
- this.$set(this.compound[num], "money", strVal);
- } else {
- if (index != "all") {
- Str.forEach((e, i) => {
- if (i == index) {
- strVal = e;
- e = strVal.substring(0, strVal.length - 1);
- this.bettingNumber.splice(index, 1, e);
- this.arrNumber = "";
- }
- });
- } else {
- Str.forEach((e, i) => {
- strVal = e.substring(0, e.length - 1);
- // console.log(strVal);
- this.bettingNumber.splice(i, 1, strVal);
- });
- this.arrNumber = this.arrNumber.substring(
- 0,
- this.arrNumber.length - 1
- );
- }
- }
- //if(!isNumbers) return false;
- this.profitFun();
- },
- /*---------------------------------- */
- //清空input框数据
- ClearData: function(index, num) {
- let isNumbers = true;
- if (index == "through") {
- //console.log(num);
- isNumbers = false;
- this.$set(this.compound[num], "money", "");
- } else {
- this.bettingNumber.forEach((e, i) => {
- if (index != "all") {
- if (i == index) {
- this.bettingNumber.splice(index, 1, "");
- this.arrNumber = "";
- }
- } else if (index == "all") {
- this.bettingNumber.splice(i, 1, "");
- this.arrNumber = "";
- }
- });
- }
- //if(!isNumbers) return false;
- this.profitFun();
- },
- /*---------------------------------- */
- // 删除所有投注
- alldel() {
- let betting = this.$store.getters.getBetting;
- betting.forEach(e => {
- e.data = [];
- });
- this.$store.dispatch("SET_NOROLL", false);
- this.bettingNumber = [];
- this.$store.dispatch("BETTING", []);
- this.$store.dispatch("BETTING", betting);
- this.$public.setItem("box_size", 2);
- this.$store.dispatch("ISBETTING", "-1");
- this.$store.dispatch("DEL_TYPE", "all");
- this.profitFun();
- },
- /*---------------------------------- */
- // 激活投注框的小键盘
- activekey(index) {
- this.clickIndex = index;
- },
- /*---------------------------------- */
- // 删除指定的投注数据
- delarr(name, numid) {
- let betting = this.$store.getters.getBetting;
- betting.forEach(res => {
- if (res.title == name) {
- res.data.forEach((e, index) => {
- if (e.id == numid) {
- res.data.splice(index, 1);
- //删除数据也要删除想对应的值
- this.bettingNumber.splice(index, 1);
- }
- });
- }
- this.$store.dispatch("BETTING", []);
- this.$store.dispatch("BETTING", betting);
- });
- this.$store.dispatch("DEL_TYPE", numid);
- this.profitFun();
- },
- /*---------------------------------- */
- //投注窗口放大
- shrink() {
- this.isshrink = true;
- this.$public.setItem("box_size", 1);
- },
- /*---------------------------------- */
- //计算可赢金额(总额)
- profitFun() {
- let dataNum = 0;
- let dataNumbe = 0;
- let datamMoney = 0;
- let compound_amount = 0;
- this.bettingNumber.forEach((e, i) => {
- if (e) {
- dataNum++;
- dataNumbe += e * 1;
- datamMoney += e * 1 * this.dataList[i].odds;
- }
- });
- this.compound.forEach(e => {
- //console.log(e);
- if (e.money * 1 > 0) {
- dataNum += e.index * 1;
- dataNumbe += e.money * 1 * e.index * 1;
- compound_amount += e.money * e.odds;
- }
- });
- this.dataNum = dataNum;
- this.dataNumbe = dataNumbe + "";
- this.datamMoney = datamMoney;
- this.compound_amount = compound_amount;
- },
- /*---------------------------------- */
- //投注窗口缩小
- show() {
- this.isshrink = false;
- this.$public.setItem("box_size", 2);
- },
- /*---------------------------------- */
- //登陆
- loginReg() {
- let isShow = true;
- this.isshow = true;
- this.$store.dispatch("GET_ISSHOW", isShow);
- },
- /*------------------------------- */
- //投注确认提交
- betOrder() {
- if (this.isSubmit) return false;
- let limitingCond = JSON.parse(this.$public.getItem('limitingCond'));
- this.isSubmit = true;
- let list = [],
- obj = {},
- obj1 = {};
- this.dataList.forEach((res, index) => {
- //单式数据组合
- if (this.bettingNumber[index]) {
- obj = {
- type: "1",
- index: index,
- bet_amount: this.bettingNumber[index]
- };
- list.push(obj);
- }
- });
- //串式数据组合
- this.compound.forEach(e => {
- if (e.money) {
- obj = {
- type: e.title,
- // odds:e.odds,
- bet_amount: e.money //e.amount
- };
- list.push(obj);
- }
- });
- list.push(this.dataList);
- if (list.length > 1 && this.dataNumbe *1 >0 ) {
- if(limitingCond.lower_limit * 1 <= this.dataNumbe && limitingCond.upper_limit * 1 >= this.dataNumbe){
- let token = this.$public.getItem("token");
- this.$http.post(this.$ports.betOrder.Bet, {
- data: list,
- token,
- bet_money: this.dataNumbe
- }).then(res => {
- //console.log('数据',res.data);
- if (res.data.status == 1) {
- this.alldel();
- this.cash = (this.cash - this.dataNumbe * 1).toFixed(2);
- this.$dialog.alert({ mes: "亲!你已经投注成功啦。" });
- } else if (res.data.status == "-4001") {
- this.isLogin = false;
- this.$dialog.alert({ mes: "亲!你的登陆已过期。" });
- } else if (res.data.status == "4204") {
- this.$dialog.alert({ mes: "亲!你的余额不足。" });
- }else if(res.data.status == '7027' ){
- this.$dialog.alert({ mes: "亲!赔率发生变法,请重新选择。" });
- this.alldel();
- }else{
- this.$dialog.alert({ mes: "错误代码:"+res.data.status});
- }
- this.isSubmit = false;
- });
- }else if(this.dataNumbe < limitingCond.lower_limit*1 ){
- this.$dialog.alert({ mes: `亲!你输入的投注额,小于最低投注限制${limitingCond.lower_limit}元` });
- this.isSubmit = false;
- }else if(this.dataNumbe > limitingCond.upper_limit*1 ){
- this.$dialog.alert({ mes: `亲!你输入的投注额,大于最高投注限制${limitingCond.upper_limit}元` });
- this.isSubmit = false;
- }
- } else {
- this.$dialog.alert({ mes: "亲!你还未输入投注金额啦。" });
- this.isSubmit = false;
- }
- },
- /*---------------------------------- */
- //投注页面数据处理
- getDataList: function(val) {
- let arrays = [];
- this.dataList = [];
- if (val) {
- val.forEach(e => {
- if (e.data.length > 0) {
- e.data.forEach((res, index) => {
- if (this.bettingNumber.length < e.data.length) {
- this.bettingNumber.push("");
- }
- res.repeat = false;
- this.passThroughPlay = false;
- arrays.push(res);
- //console.log('什么数据',arrays);
- });
- }
- });
- this.dataList = arrays;
- //判断比赛数据是否相同赛事
- if (this.dataList.length > 1) {
- this.dataList.forEach((res, i) => {
- this.dataList.forEach((e, index) => {
- if (res.match_id == e.match_id && i != index) {
- e.repeat = true;
- this.passThroughPlay = true;
- }
- });
- });
- }
- // 查看是否还有数据确定是否要关闭窗口
- }
- if (this.dataList.length == 0) {
- this.$public.setItem("box_size", 2);
- this.$store.dispatch("ISBETTING", "-1");
- }
- //console.log('处理完成的数据',this.dataList);
- //判断是否有过关玩法
- if (this.dataList.length >= 3) {
- this.compound.splice(0, this.compound.length);
- this.isThrough = true;
- this.dataList.forEach((res, index) => {
- if (index >= 2) {
- //this.$public.betPlay(index+1,this.dataList)
- this.compound.push(this.$public.betPlay(index + 1, this.dataList));
- }
- });
- } else {
- this.compound.splice(0, this.compound.length);
- }
- this.$store.dispatch("DEL_TYPE", "");
- },
- /*---------------------------------- */
- //获取用户个人信息
- getUserInfo() {
- let token = this.$public.getItem("token");
- this.$http.post(this.$ports.login.getAgent, { token }).then(res => {
- //console.log('检测',res);
- if (res.data.status == 1 && res.data.data != null) {
- this.cash = res.data.data.cash;
- this.isLogin = true;
- } else {
- this.isLogin = false;
- }
- });
- }
- },
- /**
- *
- */
- computed: {
- //获取vuex投注数据
- getBetting: function() {
- return this.$store.getters.getBetting;
- },
- /*------------------------------*/
- //获取投注框放大缩小状态
- newIsShrink() {
- // 改变背景滑动
- this.$store.dispatch("SET_NOROLL", !this.isshrink);
- return this.isshrink;
- },
- //获取注册页面状态
- getRgShow() {
- return this.$store.getters.getRgShow;
- },
- //获取登陆页面状态
- getIsShow() {
- return this.$store.getters.getIsShow;
- },
- //获取用户token
- getToken() {
- return this.$store.getters.getToken;
- }
- },
- /**
- *
- */
- watch: {
- getIsShow(val) {
- this.isshow = val;
- },
- getBetting(val) {
- this.getDataList(val);
- },
- //显示注册页面
- getRgShow(val) {
- this.rgShow = val;
- this.isshow = val ? false : true;
- //console.log(this.rgShow);
- },
- getToken(val) {
- //this.getUserInfo();
- this.isLogin = true;
- }
- },
- /**
- * 页面初始化完成进行挂载
- */
- mounted() {
- if (this.$public.getItem("box_size") == 1) {
- this.isshrink = true;
- }
- this.getDataList(this.$store.getters.getBetting);
- this.getUserInfo();
- if (this.$public.getItem("token")) {
- this.isLogin = true;
- }
- }
- };
- </script>
- <style scoped>
- div /deep/ .yd-accordion-head {
- padding: 0 0.32rem;
- background: #a0a0a0;
- }
- 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%;
- }
- .login {
- z-index: 999999;
- position: fixed;
- top: 0;
- }
- .num {
- display: inline-block;
- width: 0.46rem;
- height: 0.46rem;
- background: #dcdcdc;
- border-radius: 50%;
- line-height: 0.46rem;
- text-align: center;
- color: #f76649;
- }
- .bgcolor {
- background: rgba(40, 40, 40, 0.75);
- height: 55rem;
- }
- .hiddenbox {
- height: 1rem;
- }
- .head {
- display: flex;
- justify-content: center;
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- z-index: 1000000;
- }
- .baffleBox {
- position: fixed;
- overflow-y: scroll;
- top: 0;
- left: 0.4rem;
- width: 100%;
- height: 100%;
- -webkit-overflow-scrolling: touch;
- z-index: 29;
- box-sizing: border-box;
- }
- .baffleBox::-webkit-scrollbar {
- width: 0;
- height: 0;
- background: transparent;
- }
- .allBox {
- width: 100%;
- height: 100%;
- border-radius: 0.1rem 0.1rem;
- }
- .box {
- background: #f76649;
- border-radius: 0.1rem 0.1rem 0 0;
- height: 1rem;
- line-height: 1rem;
- padding: 0 0.32rem 0 0.22rem;
- }
- .bottonBox {
- /* margin-top: 0.1rem;*/
- padding: 0.22rem 0;
- background: #CFD3D9;
- }
- .titleBox {
- padding: 0.21rem 0.07rem;
- border-bottom: 1px solid #ebebeb;
- background: #f8f8f8;
- }
- .bettingInput {
- padding-right: 0.32rem;
- padding-left: 0.45rem;
- height: 0.9rem;
- margin-top: 0.1rem;
- }
- .inputBox {
- width: 2.6rem;
- height: 0.8rem;
- border: 1px solid #CFD3D9;
- border-radius: 0.1rem;
- line-height: 0.8rem;
- padding-left: 0.22rem;
- }
- input {
- border: 0;
- width: 1.7rem;
- }
- .tilteMatch {
- height: 1.52rem;
- background: #ebebeb;
- }
- .tilteMatchDiv {
- margin-left: 0.13rem;
- }
- .cancel {
- padding: 0 0.15rem;
- }
- .btn-right{
- color: #FFFFFF;
- background: #A7AFBC;
- }
- button {
- width: 1.2rem;
- height: 0.8rem;
- border: 0;
- background: #FFFFFF;
- border-radius: 0.1rem;
- color: #000000;
- }
- .bottonBox-num > div {
- text-align: center;
- width: 1.2rem;
- height: 0.8rem;
- line-height: 0.8rem;
- border-radius: 0.1rem;
- color: #FFFFFF;
- background: #A7AFBC;
- }
- .showNumber {
- /* margin-top: 0.36rem; */
- border-bottom: 1px solid #ebebeb;
- background: #f8f8f8;
- padding-top: 0.2rem;
- padding: 0.21rem 0.2rem;
- }
- .btn {
- width: 100%;
- height: 0.94rem;
- border-radius: 0.1rem;
- line-height: 0.94rem;
- color: #f8f8f8;
- text-align: center;
- margin-top: 0.1rem;
- }
- .showNumberSpan {
- color: #363636;
- font-size: 0.28rem;
- }
- .shrink {
- height: 1rem;
- width: 100%;
- background: #f76649;
- color: #dcdcdc;
- position: fixed;
- left: 0;
- bottom: 0rem;
- line-height: 1rem;
- text-align: center;
- font-size: 0.3rem;
- }
- .loading_box {
- width: 3rem;
- height: 3rem;
- background: #ebebeb;
- }
- </style>
|