diff --git a/components/balance/balance.vue b/components/balance/balance.vue index 0955394..d8a2275 100644 --- a/components/balance/balance.vue +++ b/components/balance/balance.vue @@ -6,7 +6,7 @@ - {{currencySymbol}} {{currentBalance}} + {{currencySymbol}} {{currentBalance}} Recharge diff --git a/components/cont/cont.vue b/components/cont/cont.vue index eb9e0ca..612754d 100644 --- a/components/cont/cont.vue +++ b/components/cont/cont.vue @@ -1,6 +1,5 @@ - + diff --git a/components/gamecont/gamecont.vue b/components/gamecont/gamecont.vue index 121d38e..1367020 100644 --- a/components/gamecont/gamecont.vue +++ b/components/gamecont/gamecont.vue @@ -46,308 +46,55 @@ frequency - - 6 - - - 3 - - - 26 - - - 7 - - - 19 - - - 9 - - - 8 - - - 12 - - - 1 - - - 0 + + {{item}} - + - 20210602234 + {{item.period}} - - 6 - - - 3 - - - 26 - - - 7 - - - 19 - - - 9 - - - 8 - - - 12 - - - 1 - - + + 0 - - - - - 20210602233 - - - - 6 - - - 3 - - - 26 - - - 7 - - - 19 - - - 9 - - - 8 - - - 12 - - + 1 - - 0 + + 2 - - - - - - 20210602232 - - - - 6 - - + 3 - - 26 - - - 7 - - - 19 - - - 9 - - - 8 - - - 12 - - - 1 + + 4 - - 0 + + 5 - - - - - - 20210602231 - - - + 6 - - 3 - - - 26 - - + 7 - - 19 - - - 9 - - + 8 - - 12 - - - 1 - - - 0 - - - - - - 20210602230 - - - - 6 - - - 3 - - - 26 - - - 7 - - - 19 - - + 9 - - 8 - - - 12 - - - 1 - - - 0 - - - - - 20210602229 - - - - 6 - - - 3 - - - 26 - - - 7 - - - 19 - - - 9 - - - 8 - - - 12 - - - 1 - - - 0 - - - - - - 20210602228 - - - - 6 - - - 3 - - - 26 - - - 7 - - - 19 - - - 9 - - - 8 - - - 12 - - - 1 - - - 0 - + - - -

More

- -
@@ -357,18 +104,19 @@ import cont from "../cont/cont.vue" const COMPONENT_NAME = 'gamecont' export default { + props:["gameRecordCont","lotteryNumResult"], name: COMPONENT_NAME, data() { return { - + white:'white', } }, computed: { }, mounted() { - + }, methods: { sendCond(){ @@ -403,6 +151,7 @@ text-align: center; font-size: 28rpx; color: #303133; + margin:0 10rpx; } .num_con{ width: 514rpx; @@ -412,6 +161,7 @@ } .miss{ width: 236rpx; + overflow-x: scroll; color: #606266; font-size: 28rpx; text-transform: capitalize; diff --git a/components/gamecont2/gamecont2.vue b/components/gamecont2/gamecont2.vue index 96497f0..39df7ef 100644 --- a/components/gamecont2/gamecont2.vue +++ b/components/gamecont2/gamecont2.vue @@ -17,7 +17,7 @@ - + {{item.period}} @@ -33,7 +33,7 @@ - +

More

@@ -67,6 +67,11 @@ diff --git a/pages/menu/color/index.css b/pages/menu/color/index.css index c22c13a..257cac7 100644 --- a/pages/menu/color/index.css +++ b/pages/menu/color/index.css @@ -2,6 +2,104 @@ .content{ position: relative; } + +.item{ + margin-top: 60rpx; +/* height: 380rpx; + overflow-y: scroll; + overflow-x: hidden; */ + } + .img2{ + width: 60rpx; + height: 60rpx; + } + .p2{ + font-size: 28rpx; + color: #303133FF; + margin-left: 20rpx; + } + .p1{ + font-size: 28rpx; + color: #606266FF; + } + .colseKefu{ + position: absolute; + right: 36rpx; + top: 36rpx; + width: 36rpx; + height: 36rpx; + } + .img1{ + display: block; + margin: 0 auto; + width: 108rpx; + height: 108rpx; + } + .title{ + text-transform: capitalize; + font-size: 28rpx; + color: #954DE3FF; + text-align: center; + } +.title p{ + margin-top: 18rpx; +} +.body_item{ + display: flex; + align-items: center; + padding-bottom: 40rpx; +} + .body_item_info{ + font-size: 28rpx; + color: #606266; + text-transform: capitalize; + margin-top: 28rpx; + margin-bottom: 20rpx; + } + .tc{ + width: 600rpx; + background-color: #fff; + border-radius: 24rpx; + padding-top: 48rpx; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + z-index: 999; + } + .tc_body{ + padding: 48rpx 36rpx; + padding-bottom: 0rpx; + position: relative; + } + .tc_body::before{ + content: ''; + position: absolute; + top: 20rpx; + left: 50%; + transform: translateX(-50%); + width: 100%; + height: 2rpx; + background-color: #EDEFF2FF; + } + .my-cont{ + width: 180rpx; + height: 180rpx; + position: fixed; + top: 75%; + right: 0; + } + .my-cont image{ + width: 100%; + height: 100%; + } + .flex{ + align-items: center; + } + .flex .my-cont{ + margin-left: auto; + + } .rules-btn{ font-size: 24rpx; color: #FFFFFF; diff --git a/pages/menu/color/index.vue b/pages/menu/color/index.vue index 6484228..1ef9a9d 100644 --- a/pages/menu/color/index.vue +++ b/pages/menu/color/index.vue @@ -1,7 +1,7 @@ @@ -347,7 +358,15 @@ export default { data() { return { - + // 客服 + keCode:0, + teList:[], + whatAppList:[], + serviceTime:'', + + touzhuMoney:0, + currencySymbol:'', + currentBalance:'', gameNavNum: 0, xiaSul: 0, gsxia: 0, @@ -443,7 +462,7 @@ numindex: -1, ganumArr: [], gg: 3, - lotteryData: {}, + lotteryData: {}, gameNav2: [{ id: 1, text: 'Chart Trending', @@ -456,49 +475,97 @@ id: 3, text: '' }, - ] + ], + totalPage2:'', + lotteryNum:[], + lotteryNumResult:[0,0,0,0,0,0,0,0,0,0], } }, onLoad() { - - this.myName = uni.getStorageSync('MyInfo').nickname; - this.myImgUrl = uni.getStorageSync('MyInfo').headImgPath; -<<<<<<< HEAD - this.nextBtting(); - uni.request({ - url: '/start/api/lottery/lotteryClassList', - data: { - "ticket": uni.getStorageSync('logInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - console.log(res.data.data, 888888888888) - this.colorList = res.data.data; - this.colorData=this.colorList[0]; - this.gameNav2[1].text=this.colorData.name+" record" - this.gameNav2[2].text='My '+this.colorData.name+" record" - }, - fail: (res) => { - console.log(res); + // 客服 + this.serviceTime = uni.getStorageSync('siteInfo').serviceTime; + const siteTelegram = uni.getStorageSync('siteInfo').siteTelegram; + + const siteWhatsapp = uni.getStorageSync('siteInfo').siteWhatsapp; + if (siteTelegram != undefined && siteTelegram != '') { + this.teList = siteTelegram.split(',') + console.log(1111111 + this.teList) } - }); - - - -======= + if (siteWhatsapp != undefined && siteWhatsapp != '') { + this.whatAppList = siteWhatsapp.split(',') + console.log(2222222 + this.whatAppList) + } + + + this.currencySymbol=uni.getStorageSync('siteInfo').currencySymbol; + this.currentBalance=uni.getStorageSync('currentBalance'); + this.myName = uni.getStorageSync('MyInfo').nickname; + this.myImgUrl = uni.getStorageSync('MyInfo').headImgPath; + this.getLotteryClassList(); - //this.getBettingConfig(); ->>>>>>> 568bf6045ac1252bb15844d528ceabdb0f66ad2f + this.getBettingConfig(); this.getLottertRecord(); - + // 获取整个往期记录 + const post = api.lotteryRecords({ + "ticket": uni.getStorageSync('logInfo').data, + "classId": this.gg, + "pageNumber": 1, + "pageSize": 1277, + }) + post.then(res => { + this.lotteryNum = res.data.content; + console.log(this.lotteryNum,666666666666666666666) + for (var i = 0; i < this.lotteryNum.length; i++) { + if(!this.lotteryNum[i].lotteryResult){ + this.lotteryNumResult[0]=this.lotteryNumResult[0]+1; + } + if(this.lotteryNum[i].lotteryResult==1){ + this.lotteryNumResult[1]=this.lotteryNumResult[1]+1; + + } + if(this.lotteryNum[i].lotteryResult==2){ + this.lotteryNumResult[2]=this.lotteryNumResult[2]+1; + + } + if(this.lotteryNum[i].lotteryResult==3){ + this.lotteryNumResult[3]=this.lotteryNumResult[3]+1; + + } + if(this.lotteryNum[i].lotteryResult==4){ + this.lotteryNumResult[4]=this.lotteryNumResult[4]+1; + + } + if(this.lotteryNum[i].lotteryResult==5){ + this.lotteryNumResult[5]=this.lotteryNumResult[5]+1; + + } + if(this.lotteryNum[i].lotteryResult==6){ + this.lotteryNumResult[6]=this.lotteryNumResult[6]+1; + + } + if(this.lotteryNum[i].lotteryResult==7){ + this.lotteryNumResult[7]=this.lotteryNumResult[7]+1; + + } + if(this.lotteryNum[i].lotteryResult==8){ + this.lotteryNumResult[8]=this.lotteryNumResult[8]+1; + + } + if(this.lotteryNum[i].lotteryResult==9){ + this.lotteryNumResult[9]=this.lotteryNumResult[9]+1; + + } + } + console.log(this.lotteryNumResult) + }) + .catch(e => { + console.log(e) + }) }, onReachBottom() { this.pageSize += 9; @@ -513,6 +580,46 @@ }, methods: { + // 客服 + gotoWeb(gotoUrl) { + // #ifdef H5 + window.location.href = gotoUrl + // #endif + // #ifdef APP-PLUS + var networkType = '' + uni.getNetworkType({ + success: function(res) { + networkType = res.networkType + } + }); + if (networkType == 'none') { + uni.showToast({ + title: 'no Network', + icon: 'none', + duration: 1500 + }) + } else { + var param = { + url: gotoUrl + } + uni.navigateTo({ + url: '/pages/menu/me/rechange/topay/index?' + qs.stringify(param) + }) + } + // #endif + }, + + getLink(item) { + return item.replace(item.split(':')[0] + ':', '') + }, + getName(item) { + // console.log(item,20000); + return item.split(':')[0] + }, + + tmoney(){ + this.touzhuMoney=this.bettingNumber*this.bettingPrice; + }, getBettingConfig() { const post = api.bettingConfig({ "ticket": uni.getStorageSync('logInfo').data, @@ -546,9 +653,17 @@ }, timeChange(timestamp) { - console.log(timestamp) + // if(timestamp==0){ + // this.ganum+=1; + // this.gNum="G"+ Number(this.gNum.substring(1)+1) ; + // console.log(this.gNum,5555555555555) + // this.gaClick(this.ganum,this.gNum); + // } + // console.log(timestamp) + // console.log(123) if (timestamp <= this.colorData.lottery) { this.canBuy = false + this.xiazhuCode=false } else { this.canBuy = true } @@ -588,6 +703,8 @@ numColor(i, j) { this.numindex = i; this.bettingPrice = j; + this.touzhuMoney=j; + this.bettingNumber=1; }, nextBtting(gNum) { const post = api.nextLotteryPeriod({ @@ -641,14 +758,38 @@ "bettingNumber": this.bettingNumber, }) post.then(res => { + uni.showLoading({ + title:'loading' + }) console.log(res.data) - if (res.data.success == true) { - this.xiaSul = 1; + if (res.success == true) { + // this.xiaSul = 1; uni.showToast({ title: 'Successful bet', icon: 'success', duration: 1500 }) + //更新余额 + const post = api.withdrawConfig({ + "ticket": uni.getStorageSync('logInfo').data, + }) + post.then(res => { + if(res.data){ + this.currentBalance=res.data.currentBalance; + uni.setStorage({ + key: 'currentBalance', + data: this.currentBalance, + success: function() { + console.log('success') + } + }); + } + + }) + + setTimeout(function(){ + location.reload(); + },2000) } else { uni.showToast({ title: res.data.errMsg, @@ -679,7 +820,7 @@ this.myGameRecord = res.data.content; this.totalPage = res.data.totalElements; for (var i = 0; i < this.myGameRecord.length; i++) { - this.myGameRecord[i].period = this.myGameRecord[i].period.substring(2, 13); + // this.myGameRecord[i].period = this.myGameRecord[i].period.substring(2, 13); this.myGameRecord[i].addTime = index.formatyymmddhhmmss(this.myGameRecord[i] .addTime); } @@ -704,12 +845,17 @@ } this.gameRecordCont = res.data.content; this.totalPage = res.data.totalElements; + this.totalPage2 = res.data.totalPages; for (var i = 0; i < this.gameRecordCont.length; i++) { - this.gameRecordCont[i].period = this.gameRecordCont[i].period.substring(2, 13); - this.gameRecordCont[i].lotteryColor = this.gameRecordCont[i].lotteryColor.split( - ','); + // this.gameRecordCont[i].period = this.gameRecordCont[i].period.substring(2, 13); + this.gameRecordCont[i].lotteryColor = this.gameRecordCont[i].lotteryColor.split(','); + if(!this.gameRecordCont[i].lotteryResult){ + this.gameRecordCont[i].lotteryResult=0 + } + + } - // console.log(res.data,77777777777777) + }) .catch(e => { console.log(e) @@ -718,8 +864,10 @@ }, - gaClick(i, j) { + + gaClick(i, j) { + console.log(j,8000000) this.ganum = i this.gNum = j; this.colorData = this.colorList[i]; @@ -753,4 +901,4 @@ + \ No newline at end of file diff --git a/pages/menu/index/index.vue b/pages/menu/index/index.vue index 5508999..1b84927 100644 --- a/pages/menu/index/index.vue +++ b/pages/menu/index/index.vue @@ -17,6 +17,7 @@ diff --git a/pages/menu/promotion/promotionRecord/index.vue b/pages/menu/promotion/promotionRecord/index.vue index 75b5c4e..5394fe0 100644 --- a/pages/menu/promotion/promotionRecord/index.vue +++ b/pages/menu/promotion/promotionRecord/index.vue @@ -95,36 +95,36 @@ this.level=i+1; this.getBounsRecord(); }, + getBounsRecord(){ - uni.request({ - url: '/start/api/summary/promotionRecords', - data: { - "ticket": uni.getStorageSync('logInfo').data, - "level":this.level, - "pageNumber": 1, - "pageSize": this.pageSize, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.totalElements=res.data.data.totalElements; - if(res.data.data.content){ - this.promotionRecord=res.data.data.content; - for(var i=0;i { - console.log(res.data); - } - }); + + const post = api.promotionRecords({ + "ticket": uni.getStorageSync('logInfo').data, + "level":this.level, + "pageNumber": 1, + "pageSize": this.pageSize, + }) + post.then(res => { + this.totalElements=res.data.totalElements; + if(res.data.content){ + this.promotionRecord=res.data.content; + for(var i=0;i { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) } }, } diff --git a/pages/menu/recharge/index.css b/pages/menu/recharge/index.css index d4921f1..2a1bfcb 100644 --- a/pages/menu/recharge/index.css +++ b/pages/menu/recharge/index.css @@ -119,17 +119,7 @@ display: flex; color: #909399; text-transform: capitalize; } -.capy{ - font-size: 32rpx; - color: #954DE3; - display: flex; - align-items: center; -} -.capy image{ - width: 34rpx; - height: 34rpx; - padding-right: 12rpx; -} + .rech-btn{ margin-top: 58rpx; line-height: 96rpx; @@ -151,4 +141,22 @@ display: flex; .payTypenName{ text-transform: capitalize; font-size: 32rpx; +} +.offline-text{ + padding: 0 36rpx; + font-size: 28rpx; + color: #303133; + line-height: 60rpx; + margin-top: 40rpx; +} +.offline-button{ + display: inline-block; + width: 80rpx; + margin: 0 10rpx; + vertical-align: middle; + line-height: 40rpx; + text-align: center; + font-size: 28rpx; + padding: 0; + color: rgb(149, 77, 227); } \ No newline at end of file diff --git a/pages/menu/recharge/index.vue b/pages/menu/recharge/index.vue index 72f3639..d5e21d4 100644 --- a/pages/menu/recharge/index.vue +++ b/pages/menu/recharge/index.vue @@ -51,7 +51,7 @@ payment
- + {{item.typeName}} @@ -65,6 +65,28 @@ Confirm
+ + You can follow the steps to pay: + + 1. Go to your M-Pesa menu or App on your phone. + + + 2. Go to Lipa na M-Pena then select "Pay Bill" option. + + + 3. Enter business number: {{mobile}} Account number: Enter your ID : {{userId}} + + + 5. Enter the amount + + + 6. Enter your M-Pesa PIN. + + + 7. Confirm that all details are correct and submit. + + +
@@ -76,6 +98,7 @@ export default { data() { return { + copyText: '', pd:0, mobile:'', areacode: '', @@ -85,65 +108,71 @@ paymentType: [], payType: '', currencySymbol:'', - currentBalance:'' + currentBalance:'', + userId:'', } }, onLoad() { + this.copyText=uni.getStorageSync('loginMobile'); this.mobile=uni.getStorageSync('loginMobile'); this.currentBalance=uni.getStorageSync('currentBalance'); this.areacode = uni.getStorageSync('siteInfo').areaCode; this.currencySymbol=uni.getStorageSync('siteInfo').currencySymbol; - uni.request({ - url: '/start/api/recharge/rechargeConfig', - data: { - "ticket": uni.getStorageSync('logInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - uni.setStorage({ - key: 'rechargeInfo', - data: res.data.data, - success: function() { - console.log('success') - } - }); - this.rechangeInfo = res.data.data; - this.recharge_amount = this.rechangeInfo.recharge_amount.split(','); - console.log(res.data, 9990); - - - }, - fail: (res) => { - - console.log(res.data); - } - }); - - uni.request({ - url: '/start/api/recharge/getPayType', - data: { - "ticket": uni.getStorageSync('logInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.paymentType = res.data.data; - console.log(res.data.data); - }, - fail: (res) => { - console.log(res.data); - } - }); + this.userId=uni.getStorageSync('MyInfo').userId; + const post = api.rechargeConfig({ + "ticket": uni.getStorageSync('logInfo').data, + }) + post.then(res => { + uni.setStorage({ + key: 'rechargeInfo', + data: res.data, + success: function() { + console.log('success') + } + }); + this.rechangeInfo = res.data; + this.recharge_amount = this.rechangeInfo.recharge_amount.split(','); + console.log(res.data, 9990); + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + + const post2 = api.getPayType({ + "ticket": uni.getStorageSync('logInfo').data, + }) + post2.then(res => { + this.paymentType = res.data; + console.log(res.data); + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + }, methods: { + copyTextMethod() { + this.$copyText(this.copyText).then(res => { + uni.showToast({ + title: 'Copy succeeded', + icon: 'success' + }) + }) + }, PayTo(){ + uni.showLoading({ + title:'loading' + }) if(this.payType==''){ uni.showToast({ title: 'Please choose the payment method', @@ -185,99 +214,61 @@ }) return; } - uni.request({ - url: '/start/api/recharge/recharge', - data: { - "ticket": uni.getStorageSync('logInfo').data, - "payType":this.payType, - "tranAmt":this.tranAmt, - "mobile":this.mobile, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - - if(res.data.errCode=='SUCCESS'){ - uni.request({ - url: '/start/api/recharge/toPay', - data: { - "ticket": uni.getStorageSync('logInfo').data, - 'orderNo': res.data.data.orderNo, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - if(res.data.success==true){ - uni.showToast({ - title: 'Recharge success', - icon: 'success', - duration: 1500 - }) - setTimeout(function(){ - location.reload() - },1000) - }else{ - uni.showToast({ - title: 'Payment failed', - icon: 'none', - duration: 1500 - }) - } - - console.log(res.data); - }, - fail: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 - }) - console.log(res.data); - }, - }); - }else{ + + const post2 = api.recharge({ + "ticket": uni.getStorageSync('logInfo').data, + "payType":this.payType, + "tranAmt":this.tranAmt, + "mobile":this.mobile, + }) + post2.then(res => { + if(res.success==true){ uni.showToast({ - title: res.data.errMsg, + title: 'Recharge success', + icon: 'success', + duration: 1500 + }) + setTimeout(function(){ + location.reload() + },1000) + }else{ + uni.showToast({ + title: 'Payment failed', icon: 'none', duration: 1500 }) - } - console.log(res.data,666666666); - console.log(res.data.data.orderNo,666666666); + } + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) }, - fail: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 - }) - console.log(res.data); - } - - }); - }, + radioChange(e) { if(e.payType=='pay.offline'){ this.pd=1; + this.payType=e.payType }else{ this.pd=0; + this.payType=e.payType } + console.log(e) }, // 选中任一radio时,由radio-group触发 radioGroupChange(e) { - // console.log(e); + console.log(this.payType,8888888888888) }, getMonVal(m) { this.tranAmt = m } - }, + }, } diff --git a/pages/menu/recharge/rechargeRule.vue b/pages/menu/recharge/rechargeRule.vue index e442817..da2e96f 100644 --- a/pages/menu/recharge/rechargeRule.vue +++ b/pages/menu/recharge/rechargeRule.vue @@ -21,29 +21,25 @@ }, onLoad() { - - uni.request({ - url: '/start/api/recharge/rechargeConfig', - data: { + + const post2 = api.rechargeConfig({ "ticket": uni.getStorageSync('logInfo').data, + }) + post2.then(res => { + this.rechangeRule=res.data.tips; + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + + }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.rechangeRule=res.data.data.tips; - - - }, - fail: (res) => { - - console.log(res.data); - } - }); - - - }, + methods:{ diff --git a/pages/menu/recharge/record/index.vue b/pages/menu/recharge/record/index.vue index f656c66..b96e6e0 100644 --- a/pages/menu/recharge/record/index.vue +++ b/pages/menu/recharge/record/index.vue @@ -62,30 +62,35 @@ methods:{ getRechardRecord(){ - uni.request({ - url: '/start/api/recharge/rechargeList', - data: { - "ticket": uni.getStorageSync('logInfo').data, - "pageNumber":this.pageNumber, - "pageSize":this.pageSize, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.record_list=res.data.data.content; - for(var i=0;i { - console.log(res); - } - }); + + + + const post2 = api.rechargeList({ + "ticket": uni.getStorageSync('logInfo').data, + "pageNumber":this.pageNumber, + "pageSize":this.pageSize, + }) + post2.then(res => { + if(res.data.content){ + this.record_list=res.data.content; + for(var i=0;i { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + + }, }, diff --git a/pages/menu/rule/index.vue b/pages/menu/rule/index.vue index bf96ed5..68e3d47 100644 --- a/pages/menu/rule/index.vue +++ b/pages/menu/rule/index.vue @@ -21,22 +21,23 @@ } }, onLoad(){ - uni.request({ - url: '/start/api/lottery/bettingConfig', - data: { - "ticket": uni.getStorageSync('logInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.betting_rule=res.data.data.tips; - }, - fail: (res) => { - console.log(res); - } - }); + + + const post2 = api.bettingConfig({ + "ticket": uni.getStorageSync('logInfo').data, + }) + post2.then(res => { + this.betting_rule=res.data.tips; + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + }, methods: { diff --git a/pages/menu/rule/inviteRule/index.vue b/pages/menu/rule/inviteRule/index.vue index d1182c0..cbe8034 100644 --- a/pages/menu/rule/inviteRule/index.vue +++ b/pages/menu/rule/inviteRule/index.vue @@ -44,23 +44,25 @@ } }, onLoad() { - uni.request({ - url: '/start/api/user/inviteCode', - data: { - "ticket": uni.getStorageSync('logInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.inviteRule=res.data.data - console.log(res.data,9999); - }, - fail: (res) => { - console.log(res.errMsg); - } - }); + + const post2 = api.inviteCode({ + "ticket": uni.getStorageSync('logInfo').data, + }) + post2.then(res => { + this.inviteRule=res.data + + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + + + }, methods: { back(){ diff --git a/pages/menu/withdrawl/index.vue b/pages/menu/withdrawl/index.vue index 9293e3d..0c2f6c9 100644 --- a/pages/menu/withdrawl/index.vue +++ b/pages/menu/withdrawl/index.vue @@ -129,26 +129,28 @@ onLoad() { this.currentBalance = uni.getStorageSync('currentBalance'); this.mobile = uni.getStorageSync('loginMobile'); - uni.request({ - url: '/start/api/withdraw/withdrawConfig', - data: { - "ticket": uni.getStorageSync('logInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.withdrawConfig = res.data.data; - this.content = this.withdrawConfig.tips; - console.log(res.data, 8880); - console.log(this.withdrawConfig, 9990); - this.show = true; - }, - fail: (res) => { - console.log(res.data); - } - }); + + + + + const post2 = api.withdrawConfig({ + "ticket": uni.getStorageSync('logInfo').data, + }) + post2.then(res => { + this.withdrawConfig = res.data; + this.content = this.withdrawConfig.tips; + console.log(res.data, 8880); + console.log(this.withdrawConfig, 9990); + this.show = true; + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) }, @@ -235,7 +237,7 @@ uni.showLoading({ title: 'loading' }); - if (this.tranAmt == null) { + if (this.tranAmt == '') { uni.showToast({ title: 'Please enter the withdrawal amount', icon: 'none', @@ -246,49 +248,37 @@ - uni.request({ - url: '/start/api/withdraw/withdraw', - data: { + + const post2 = api.withdraw({ "ticket": uni.getStorageSync('logInfo').data, // 'password': md5(this.password), "tranAmt": this.tranAmt, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - - if (res.data.success == true) { + }) + post2.then(res => { + if (res.success == true) { uni.showToast({ - title: res.data.errMsg, + title: res.errMsg, icon: 'none', duration: 1500 }) - uni.request({ - url: '/start/api/withdraw/withdrawServiceCharge', - data: { + + const post = api.withdrawServiceCharge({ "ticket": uni.getStorageSync('logInfo').data, // 'password': md5(this.password), "tranAmt": this.tranAmt, "ticket": uni.getStorageSync('MyInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - - console.log(res.data, '45464654646446'); - }, - fail: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 + }) + post.then(res => { + console.log(res.data, '45464654646446'); + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) }) - } - }); } else { uni.showToast({ title: 'Withdrawal failed', @@ -296,17 +286,16 @@ duration: 1500 }) } - console.log(res.data); - }, - fail: (res) => { - - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 + }) - } - }); + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + } }, diff --git a/pages/menu/withdrawl/transactions/index.vue b/pages/menu/withdrawl/transactions/index.vue index 43db9eb..ef3d85c 100644 --- a/pages/menu/withdrawl/transactions/index.vue +++ b/pages/menu/withdrawl/transactions/index.vue @@ -66,29 +66,35 @@ onLoad() { - uni.request({ - url: '/start/api/summary/billList', - data: { + + const post = api.billList({ "ticket": uni.getStorageSync('logInfo').data, "pageNumber":this.pageNumber, "pageSize":this.pageSize, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.record_list=res.data.data.content; - for(var i=0;i { + if(res.data.content){ + this.record_list=res.data.content; + for(var i=0;i { - console.log(res.errMsg); - } - }); - + + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + + + + + + }, diff --git a/pages/menu/withdrawl/withdrawlRecord/index.vue b/pages/menu/withdrawl/withdrawlRecord/index.vue index 5fa6a6d..b52e2ed 100644 --- a/pages/menu/withdrawl/withdrawlRecord/index.vue +++ b/pages/menu/withdrawl/withdrawlRecord/index.vue @@ -65,30 +65,32 @@ }, onLoad() { - - uni.request({ - url: '/start/api/withdraw/withdrawList', - data: { + const post = api.withdrawList({ "ticket": uni.getStorageSync('logInfo').data, "pageNumber":this.pageNumber, "pageSize":this.pageSize, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.record_list=res.data.data.content; - for(var i=0;i { + if(res.data.content){ + this.record_list=res.data.content; + for(var i=0;i { - console.log(res.errMsg); - } - }); + + + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) + + + + diff --git a/pages/register/index.vue b/pages/register/index.vue index bb2fac6..35c6c89 100644 --- a/pages/register/index.vue +++ b/pages/register/index.vue @@ -141,7 +141,7 @@ }) return; } - var a = /^[0-9]{4,14}$/; + var a = /^[0-9]{9}$/; if (!a.test(this.mobile)) { uni.showToast({ title: 'Wrong format of mobile phone number', @@ -161,35 +161,27 @@ this.$refs.uCode.start(); }, 2000); this.countryCode = uni.getStorageSync('siteInfo').countryCode - uni.request({ - url: '/start/api/home/sendSmsCode', - data: { - "mobile": this.mobile, - "mark": this.mark, - "countryCode": this.countryCode, - "code": this.picCode - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 2500 - }) - console.log(res.data); - }, - fail: (res) => { + const post = api.sendSmsCode({ + "mobile": this.mobile, + "mark": this.mark, + "countryCode": this.countryCode, + "code": this.picCode + }) + post.then(res => { + var that = this; uni.showToast({ - title: res.data.errMsg, + title: res.errMsg, icon: 'none', duration: 2500 }) - console.log(res.data); - } - }); + }) + .catch(e => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2500 + }) + }) } else { this.$u.toast('Send after the countdown'); } @@ -209,21 +201,6 @@ url: '../login/index' }) }, - checPas() { - - }, - - getInfoCode() { - - - - - - - - }, - - getPicCode() { this.imgcodeUrl = "/start/api/home/imgCode?uuid=" + this.$u.guid(20); @@ -296,45 +273,44 @@ uni.showLoading({ title: 'loading' }); - uni.request({ - url: '/start/api/home/register', - data: { - "mobile": this.mobile, - 'password': md5(this.password), - 'inviteCode': this.inviteCode, - 'code': this.infoCode, - - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 + + + + + + const post = api.register({ + "mobile": this.mobile, + 'password': md5(this.password), + 'inviteCode': this.inviteCode, + 'code': this.infoCode, + }) + post.then(res => { + uni.showToast({ + title: res.errMsg, + icon: 'none', + duration: 1500 + }) + setTimeout(function() { + uni.reLaunch({ + url: '../login/index' + }) + }, 1500) + }) - setTimeout(function() { - uni.reLaunch({ - url: '../login/index' - }) - }, 1500) - }, - fail: (res) => { + .catch(e => { uni.showToast({ - title: res.data.errMsg, + title: e, icon: 'none', - duration: 1500 + duration: 2500 }) - } - }); + }) + } }, goLogin() { - uni.reLaunch({ + uni.navigateTo({ url: '../login/index', }) } diff --git a/utils/api.js b/utils/api.js index 7e00afb..2755d32 100644 --- a/utils/api.js +++ b/utils/api.js @@ -43,6 +43,9 @@ const api = { inviteCode: (params) => Vue.prototype.$axios.post('/api/user/inviteCode',params), bonusOut: (params) => Vue.prototype.$axios.post('/api/summary/bonusOut',params), bonusOutRecords: (params) => Vue.prototype.$axios.post('/api/summary/bonusOutRecords',params), + promotionRecords: (params) => Vue.prototype.$axios.post('/api/summary/promotionRecords',params), + bonusRecords: (params) => Vue.prototype.$axios.post('/api/summary/bonusRecords',params), + } diff --git a/utils/axios.js b/utils/axios.js index 732664b..124065f 100644 --- a/utils/axios.js +++ b/utils/axios.js @@ -20,17 +20,6 @@ const service = axios.create({ }) // request拦截器,在请求之前做一些处理 -<<<<<<< HEAD -// service.interceptors.request.use( -// config => { - // console.log('showDialog' + Vue.prototype.$showDialog) - // if (Vue.prototype.$showDialog) { - // uni.showLoading({ - // title: 'loading', - // mask: true - // }) - // } -======= service.interceptors.request.use( config => { console.log('showDialog' + Vue.prototype.$showDialog) @@ -40,7 +29,6 @@ service.interceptors.request.use( mask: true }) } ->>>>>>> 568bf6045ac1252bb15844d528ceabdb0f66ad2f // if (store.state.token) { // // 给请求头添加user-token // config.headers["user-token"] = store.state.token; @@ -69,8 +57,8 @@ service.interceptors.request.use( } var keys = []; let sign=''; -     for (var k in config.data) -       keys.push(k); + for (var k in config.data) + keys.push(k); keys.sort(function(a,b){ return a