diff --git a/pages/home/home.vue b/pages/home/home.vue index 3bfc3ca..ad6e10a 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -450,6 +450,7 @@ this.changeChannel.username = this.loginUser.userPhone uni.setStorageSync('channelId', items.channelId) oilIdentityApi.changeChannelLogin(this.changeChannel).then((res) => { + if (res.code == 20000) { uni.setStorageSync('siteOli', items.otherSiteName) this.accountName = items.otherSiteName @@ -462,7 +463,9 @@ uni.setStorageSync('loginUser', { id: res.data.authTokenDTO.loginUser.id, name: res.data.authTokenDTO.loginUser.name, - userPhone: res.data.authTokenDTO.loginUser.userPhone + userPhone: res.data.authTokenDTO.loginUser.userPhone, + channelCode: items.channelCode, + secondChannelCode: items.secondChannelCode }) this.getSiteInfo(res.data.authTokenDTO.loginUser.channelId) this.getUserInfo(id) diff --git a/pages/login/boforeLogin/boforeLogin.vue b/pages/login/boforeLogin/boforeLogin.vue index 44cb33d..57e7d29 100644 --- a/pages/login/boforeLogin/boforeLogin.vue +++ b/pages/login/boforeLogin/boforeLogin.vue @@ -199,9 +199,9 @@ unionId: uni.getStorageSync('unionid'), openId: uni.getStorageSync('openid') } - console.log(data, '这里是自动登录data') + // console.log(data, '这里是自动登录data') oilIdentityApi.loginPersonal(data).then(res => { //微信自动登录 - console.log(res, '这里是自动登录res') + // console.log(res, '这里是自动登录res') if (res.data.authTokenDTO.loginFlag == true) { this.setStored(res) } @@ -227,21 +227,21 @@ key: 'Authorization', data: res.data.authTokenDTO.accessToken, success: () => { - console.log('Authorization成功', res.data.authTokenDTO.accessToken) + // console.log('Authorization成功', res.data.authTokenDTO.accessToken) } }) uni.setStorage({ key: 'device', data: openId, success: () => { - console.log('deviceopenid', openId) + // console.log('deviceopenid', openId) } }) uni.setStorage({ key: 'unionId', data: unionId, success: () => { - console.log('deviceunionId', unionId) + // console.log('deviceunionId', unionId) } }) uni.setStorageSync('userMenu', res.data.authTokenDTO.loginUser.roleMenus) //获取权限菜单列表 @@ -251,9 +251,9 @@ userPhone: res.data.authTokenDTO.loginUser.userPhone }) //根据获取手机号 获取其号下的油站信息 - console.log('这里是获取手机号登录') + // console.log('这里是获取手机号登录') oliUserApi.getByPhone(phone).then((res) => { - console.log('这里是获取手机号登录', res) + // console.log('这里是获取手机号登录', res) if (res.code == 20000) { uni.setStorageSync('oliList', res.data) //本地存储当前用户其下有多少油站,用于用户登录进入时选择进入油站 // 获取信息存储本地 @@ -266,7 +266,7 @@ uni.reLaunch({ url: '/pages/index/index', fail: (err) => { - console.log(err) + // console.log(err) } }) } else { @@ -342,8 +342,8 @@ getUserInfo({ detail }) { - console.log('三方登录只演示登录api能力,暂未关联云端数据'); - console.log('detail', detail) + // console.log('三方登录只演示登录api能力,暂未关联云端数据'); + // console.log('detail', detail) if (detail.userInfo) { this.loginLocal(detail.userInfo.nickName); } else { @@ -369,10 +369,10 @@ uni.reLaunch({ url: '/pages/index/index', success: () => { - console.log('success') + // console.log('success') }, fail: err => { - console.log(err) + // console.log(err) } }); } else { diff --git a/pages/login/posLogin/posLogin.vue b/pages/login/posLogin/posLogin.vue index 138fa9d..43109d4 100644 --- a/pages/login/posLogin/posLogin.vue +++ b/pages/login/posLogin/posLogin.vue @@ -210,23 +210,22 @@ } }, checkOli(n) { - - if (!this.checked) { - this.$refs.popup.open('center') + if (!this.auth.phone) { + uni.showToast({ + title: '请输入手机号', + icon: "none" + }) return } + this.checkType = n if (n == 0) { - this.loginRandom() - //console.log('这里是验证码登录') - } else { - if (!this.auth.phone) { - uni.showToast({ - title: '请输入手机号', - icon: "none" - }) + if (!this.checked) { + this.$refs.popup.open('center') return } + this.loginRandom() + } else { if (!this.auth.password) { uni.showToast({ title: '请输入密码', @@ -234,6 +233,10 @@ }) return } + if (!this.checked) { + this.$refs.popup.open('center') + return + } this.loginPwd() } }, diff --git a/pages/station-info/scan-camera/scan-camera.vue b/pages/station-info/scan-camera/scan-camera.vue index a24a8f4..41aa1de 100644 --- a/pages/station-info/scan-camera/scan-camera.vue +++ b/pages/station-info/scan-camera/scan-camera.vue @@ -105,59 +105,65 @@ scanType: 'qrCode', onlyFromCamera: false, success: (resResult) => { - console.log('%c 扫码结果↓','color:red;font-size:30px') - console.log(resResult) - // innerAudioContext.play() - console.log('play滴~') let res = resResult.result - console.log(res) + let loginUser = uni.getStorageSync('loginUser') + if (res.substring(0, 6) == 'XOILUC' && (loginUser.channelCode !== 'XOIL' || loginUser + .secondChannelCode)) { + uni.showModal({ + content: '该油站不支持付款码支付', + showCancel:false, + complete:res => { + if(res.confirm) { + uni.navigateBack() + } + } + }) + return + } + uni.setStorageSync('qrCode', res) this.once = true let url = '' // console.log('这里是顺丰测试',res.substring(0,7)) const tag = res.substring(0, 2); // 老星油 XM , HT G7 , 则一 ZEYI , 新星油 XOIL new则一 XINGYOU - if (res.indexOf('fykc') != -1 ){ - url = '/pages/stationDetail/ZYSite?type=fykc' - console.log('这里是测试福佑' ,res.substring(0,7)) - }else if (tag == "SP") { - url = '/pages/stationDetail/ZYSite?type=G7' - } else if (tag == "XM" || tag == "HT" || tag == "G7") { + if (res.indexOf('fykc') != -1) { + url = '/pages/stationDetail/ZYSite?type=fykc' + // console.log('这里是测试福佑', res.substring(0, 7)) + } else if (tag == "SP") { + url = '/pages/stationDetail/ZYSite?type=G7' + } else if (tag == "XM" || tag == "HT" || tag == "G7") { url = '/pages/stationDetail/stationDetail?type=G7' - } else if (res.indexOf('ZEYI') != -1 ){ - console.log('这里是测试则一sss' ,res.substring(0,7)) - url = '/pages/stationDetail/ZYSite?type=ZEYI' - } else if (res.substring(0, 4) == 'XING' || res.substring(0, 4) == 'XOIL' ) { - console.log('这里是测试XING' ,res.substring(0,7)) - url = '/pages/stationDetail/ZYSite?type=xoli' - } else if (res.substring(0,8) == 'SHUNFENG') { - console.log('这里是顺丰') + } else if (res.indexOf('ZEYI') != -1) { + // console.log('这里是测试则一sss', res.substring(0, 7)) + url = '/pages/stationDetail/ZYSite?type=ZEYI' + } else if (res.substring(0, 4) == 'XING' || res.substring(0, 4) == 'XOIL' || res.substring( + 0, 6) == 'XOILUC') { + + // console.log('这里是测试XING', res.substring(0, 7)) + url = '/pages/stationDetail/ZYSite?type=xoli' + } else if (res.substring(0, 8) == 'SHUNFENG') { + // console.log('这里是顺丰') url = '/pages/stationDetail/ZYSite?type=shunfeng' - } else if (res.substring(0, 4) == 'RIRI'){ - url = '/pages/stationDetail/ZYSite?type=RIRISHUN' - } else if (res.indexOf('OP') != -1 ){ - url = '/pages/stationDetail/openStationDetail' - }else{ + } else if (res.substring(0, 4) == 'RIRI') { + url = '/pages/stationDetail/ZYSite?type=RIRISHUN' + } else if (res.indexOf('OP') != -1) { + url = '/pages/stationDetail/openStationDetail' + } else { uni.showToast({ title: '未知二维码', icon: 'none' }) setTimeout(() => { - uni.navigateBack({ - }) + uni.navigateBack({}) }, 800) return false; } - console.log(tag) + // return + // console.log(tag) uni.redirectTo({ // url: `/pages/stationDetail/stationDetail`, - url: url, - fail: (err) => { - // console.log(err) - }, - success: (res) => { - // console.log('chengg', res) - } + url: url }) }, fail: (err) => { diff --git a/pages/stationDetail/ZYSite.vue b/pages/stationDetail/ZYSite.vue index 090785f..838391d 100644 --- a/pages/stationDetail/ZYSite.vue +++ b/pages/stationDetail/ZYSite.vue @@ -12,14 +12,15 @@ - + {{siteData.siteName}} {{siteData.siteAddress}} - + - + - + - - + + + 星 - {{ type=='RIRISHUN'? '日日顺司机': type=='shunfeng'?'顺丰司机': siteData.customerName}} - {{ type=='RIRISHUN'? '保密': type=='shunfeng'?'保密': siteData.customerPhone}} + + {{ type=='RIRISHUN'? '日日顺司机': type=='shunfeng'?'顺丰司机': siteData.customerName}} + + {{ type=='RIRISHUN'? '保密': type=='shunfeng'?'保密': siteData.customerPhone}} - + ¥{{siteData.userBalance || 0}} @@ -93,65 +98,63 @@ 需包含加油升数和价格 - + - + 车牌号 - + - - - + + + {{String(carNumber).charAt(0)||''}} - - {{String(carNumber).substr(1,6)||'请输入车牌号'}} - + {{String(carNumber).substr(1,6)||'请输入车牌号'}} + + - + - - + + - - {{item.oilProductCode}} + + {{item.oilProductCode}} - + - + - + 星油价格: ¥{{(insertResult.sitePrice -1+1)|numberFilter}}/{{siteData.siteType|company}} 无价格 - 市场价¥{{insertResult.oilSitePrice|numberFilter}}/{{siteData.siteType|company}} - - + 市场价¥{{insertResult.oilSitePrice|numberFilter}}/{{siteData.siteType|company}} + + - + - + - + 星油价格: ¥{{ insertResult.sitePrice|numberFilter}}/{{siteData.siteType|company}} - 无价格 + 无价格 - 油站价格:¥ - {{insertResult.oilSitePrice}}/{{siteData.siteType|company }} - 无价格 + 油站价格:¥ + {{insertResult.oilSitePrice}}/{{siteData.siteType|company }} + 无价格 - - - - - + 枪号选择: - - - + 加油升数 {{siteData.siteType=='2'?'加气升数':'加油金额'}} - + - {{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'元':'L'):''}} - {{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}} + {{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'元':'L'):''}} + {{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}} - + 星卡优惠金额 @@ -231,7 +241,8 @@ - + @@ -315,7 +326,7 @@ }, data() { return { - shake:null, + shake: null, vlom: '', companyId: '', activeSitePrice: '', @@ -378,34 +389,34 @@ } }, onLoad(option) { - console.log(option) //接收option.type + // // console.log(option) //接收option.type if (option.user == 'kl') { let code = uni.getStorageSync('qrCode'), orderId = code.slice(0, -3) this.qrCode = orderId this.isOtherUser = true - console.log('这里是onload', 'CODE', code, '++++', orderId, '------', 'END') - console.log(this.qrCode) + // // console.log('这里是onload', 'CODE', code, '++++', orderId, '------', 'END') + // // console.log(this.qrCode) } // if(option.type =='RIRISHUN'){ - // console.log('这里是日日顺') + // // console.log('这里是日日顺') this.type = option.type //根据option.type 进行本地赋值 // }if(option.type =='zeyi'){ - // console.log('这里是日日顺') + // // console.log('这里是日日顺') // this.type = 'zeyi' //根据option.type 进行本地赋值 // } // if(option.type =='shunfeng'){ - // console.log('这里是顺丰') + // // console.log('这里是顺丰') // this.type = 'shunfeng' //根据option.type 进行本地赋值 // } // if(option.type =='fykc'){ - // console.log('这里是福佑') + // // console.log('这里是福佑') // this.type = 'fykc' //根据option.type 进行本地赋值 // } if (this.qrCode) { - if (this.qrCode.substr(0, 2) == 'HT' || this.qrCode.substr(0, 2) == 'G7'|| this.type === 'G7') { + if (this.qrCode.substr(0, 2) == 'HT' || this.qrCode.substr(0, 2) == 'G7' || this.type === 'G7') { this.isG7 = true - console.log('G7加油站') + // // console.log('G7加油站') } } this.verifyQrCode() @@ -419,7 +430,7 @@ watch: { oilTypeList: { handler(newVal, oldVal) { - console.log('深度监听', newVal, oldVal) + // // console.log('深度监听', newVal, oldVal) this.oilTypeList = newVal if (!this.insertResult.oilCode) { this.initForm() @@ -431,11 +442,11 @@ deep: true, immediate: true, handler(newVal, oldVal) { - console.log(newVal) - console.log(oldVal) + // // console.log(newVal) + // // console.log(oldVal) this.selected = newVal if (newVal) { - console.log('selected发生变化') + // // console.log('selected发生变化') // oilSitePrice 市场价格 sitePrice 实际加油价格 if (this.selected.oilSitePrice) { this.insertResult.oilSitePrice = this.selected.oilSitePrice @@ -446,8 +457,8 @@ this.insertResult.sitePrice = this.selected.sitePrice this.insertResult.oilProductCode = this.selected.oilProductCode if (this.type != undefined) { - console.log(this.type) - console.log('changeMoney') + // // console.log(this.type) + // // console.log('changeMoney') this.changeMoney() } @@ -466,9 +477,9 @@ }, methods: { - hz(e){ + hz(e) { // carNumber.length>0 - // console.log(new RegExp("[\u4E00-\u9FA5]+").test(e),'*-*-*-*-*-*') + // // console.log(new RegExp("[\u4E00-\u9FA5]+").test(e),'*-*-*-*-*-*') return new RegExp("[\u4E00-\u9FA5]+").test(e) }, checkNumber(e) { @@ -478,18 +489,18 @@ }) }, changeBar(item, i) { - console.log(item) + // // console.log(item) this.activeSitePrice = item.priceId this.curIndex = i this.selected = { ...item } // this.insertResult.sitePrice = this.statOil.sitePrice - // console.log(this.statOil) + // // console.log(this.statOil) if (this.insertResult.vol) { this.getMoney(this.InputNumber) } - // console.log('选择你/n', this.selected, '/n') + // // console.log('选择你/n', this.selected, '/n') }, isNumber(value) { // 判断是否为正常数字 const regPos = /^\d+(\.\d+)?$/; //非负浮点数 @@ -504,7 +515,7 @@ } }, getMoney(e) { - console.log(e) + // // console.log(e) if (e.detail.value == '') { // uni.showToast({ // title: '请输入金额', @@ -524,7 +535,7 @@ if (this.siteData.oilCardNature == 1) { var uerTyps = '0' // 0是个人 1是企业 } else { - console.log('当前为企业') + // // console.log('当前为企业') var uerTyps = '1' // 0是个人 1是企业 } if (this.type == 'ZEYI' || this.type == 'RIRISHUN') { @@ -543,7 +554,7 @@ xoilAmountGun: e.detail.value, priceId: this.activeSitePrice, companyId: this.siteData.companyId, - createSource:this.siteData.siteType=='2'?'XOIL':'' + createSource: this.siteData.siteType == '2' ? 'XOIL' : '' } } this.xoilAmountGun = e.detail.value @@ -576,8 +587,8 @@ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 // sourceType: ['album'], //从相册选择 success: function(res) { - console.log(res) - console.log('进入1') + // // console.log(res) + // // console.log('进入1') const JSESSIONID = utils.uuid() uni.uploadFile({ url: 'https://www.xingoil.com/adminapi/oil-oss/obejct/uploadFile', @@ -598,8 +609,8 @@ 'token': utils.md5Salt(JSESSIONID) }, success(e) { - console.log('进入2') - console.log(e) + // // console.log('进入2') + // // console.log(e) let obj = JSON.parse(e.data), url = obj.data.publicUrl if (type == 'car') { @@ -608,17 +619,17 @@ plateNumberImage: obj.data.publicUrl } _that.PlateNumberImages = url - console.log('这里是司机车牌', url) + // // console.log('这里是司机车牌', url) _that.isPlateNumber = false oliSiteApi.plateNumberRecognition(data).then((res) => { let obj = JSON.parse(res.data) - console.log(obj.NUMBER) + // // console.log(obj.NUMBER) _that.carNumber = obj.NUMBER }) } else { _that.refuellerImages = url _that.isUefueller = false - console.log('这里是油站图片', _that.refuellerImages, url) + // // console.log('这里是油站图片', _that.refuellerImages, url) } } @@ -635,12 +646,12 @@ charge() { //防抖 clearTimeout(this.shake) - this.shake = setTimeout(()=>{ + this.shake = setTimeout(() => { this.tsetPlate() - console.log(this.plateText) - console.log(this.plateNo) - console.log(this.carNumber) - console.log(this.testResult) + // // console.log(this.plateText) + // // console.log(this.plateNo) + // // console.log(this.carNumber) + // // console.log(this.testResult) if ((this.insertResult.sitePrice - 1 + 1) > 0) { if (this.type == 'RIRISHUN') { //根据type值判断是否为日日顺 this.RrsOrder() @@ -650,10 +661,10 @@ this.SfOrder() return } - if (this.type === 'G7') { - this.G7Order() - return - } + if (this.type === 'G7') { + this.G7Order() + return + } if (this.type == 'fykc') { this.FyOrder() return @@ -669,17 +680,17 @@ title: '车牌号校验不通过', icon: 'none' }); - this.shake=null + this.shake = null } } else { uni.showToast({ title: '您选择的油品没有油价,不能加油', icon: 'none' }); - this.shake=null + this.shake = null } - },500) - + }, 500) + }, //福佑 FyOrder() { @@ -694,13 +705,13 @@ version: 1, //类型:Number 必有字段 备注:版本号 xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 } - console.log(data6) + // console.log(data6) if (!data6.qrCode) { uni.showToast({ title: 'qrCode为空', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.siteId) { @@ -708,7 +719,7 @@ title: '请选择油站id', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.companyId) { @@ -716,7 +727,7 @@ title: '请选择企业id', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.customerId) { @@ -724,7 +735,7 @@ title: '请选择司机id', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.volume) { @@ -732,7 +743,7 @@ title: '请输入加油体积', icon: 'none' }); - this.shake=null + this.shake = null return false } oliSiteApi.FYPay(data6).then(res => { @@ -741,7 +752,7 @@ title: '下单成功!' }); // uni.setStorageSync('orderInfo',data6) - // console.log(res.data.orderId) + // // console.log(res.data.orderId) // let orderId = res.data.orderId // this.checkSf(res.data.orderId) // this.gotoOrderStatus(res.data) @@ -778,13 +789,13 @@ version: 1, //类型:Number 必有字段 备注:版本号 xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 } - console.log(data6) + // console.log(data6) if (!data6.qrCode) { uni.showToast({ title: 'qrCode为空', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.siteId) { @@ -792,7 +803,7 @@ title: '请选择油站id', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.companyId) { @@ -800,7 +811,7 @@ title: '请选择企业id', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.customerId) { @@ -808,7 +819,7 @@ title: '请选择司机id', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.volume) { @@ -816,7 +827,7 @@ title: '请输入加油体积', icon: 'none' }); - this.shake=null + this.shake = null return false } oliSiteApi.sfPay(data6).then(res => { @@ -825,7 +836,7 @@ title: '下单成功!' }); uni.setStorageSync('orderInfo', data6) - console.log(res.data.orderId) + // // console.log(res.data.orderId) let orderId = res.data.orderId // this.checkSf(res.data.orderId) this.gotoOrderStatus(res.data) @@ -855,87 +866,87 @@ url: '/pages/stationDetail/OrderStatus?item=' + item }) }, - // g7 - G7Order() { - const g7OrderInfo = { - qr_code: uni.getStorageSync('qrCode'), //类型:String 必有字段 二维码 qrcode - station_id: this.siteData.siteId, //类型:String 必有字段 油站id siteId - oilPriceId: this.insertResult.priceId, //类型:String 必有字段 油价id priceId - driver_phone: this.siteData.customerPhone, //类型:String 必有字段 油价id priceId - companyId: this.siteData.companyId, //类型:String 必有字段 企业id companyId - customerId: this.siteData.customerId, //类型:String 必有字段 司机id customerId - truck_no: this.carNumber, - gun_money: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 - gun_number: this.insertResult.bar, //类型:String 必有字段 备注:加油升数 - deduction_mode: 1, - } - console.log("加油信息===================",this.insertResult) - console.log(g7OrderInfo) - if (!g7OrderInfo.qr_code) { - uni.showToast({ - title: 'qr_code为空', - icon: 'none' - }); - this.shake=null - return false - } - if (!g7OrderInfo.station_id) { - uni.showToast({ - title: '请选择油站id', - icon: 'none' - }); - this.shake=null - return false - } - if (!g7OrderInfo.companyId) { - uni.showToast({ - title: '请选择企业id', - icon: 'none' - }); - this.shake=null - return false - } - if (!g7OrderInfo.customerId) { - uni.showToast({ - title: '请选择司机id', - icon: 'none' - }); - this.shake=null - return false - } - if (!g7OrderInfo.gun_money) { - uni.showToast({ - title: '请输入加油金额', - icon: 'none' - }); - this.shake=null - return false - } - oliSiteApi.G7Pay(g7OrderInfo).then(res => { - if (res.code === 20000) { - uni.showToast({ - title: '下单成功!' - }); - uni.setStorageSync('orderSource', 'mpxoil') - console.log("是否是g7================",this.isG7) - if (!this.isG7) { - setTimeout(() => { - this.toDetails(res.data.orderId) - }, 400) - } else { - this.beforePay = false - setTimeout(() => { - this.orderId = res.data.orderId - console.log("queryTimer",this.orderId) - this.queryTimer() - console.log("getPayStatus",this.orderId) - this.getPayStatus(this.orderId) - }, 400) - } - this.shake=null - } - }) - }, + // g7 + G7Order() { + const g7OrderInfo = { + qr_code: uni.getStorageSync('qrCode'), //类型:String 必有字段 二维码 qrcode + station_id: this.siteData.siteId, //类型:String 必有字段 油站id siteId + oilPriceId: this.insertResult.priceId, //类型:String 必有字段 油价id priceId + driver_phone: this.siteData.customerPhone, //类型:String 必有字段 油价id priceId + companyId: this.siteData.companyId, //类型:String 必有字段 企业id companyId + customerId: this.siteData.customerId, //类型:String 必有字段 司机id customerId + truck_no: this.carNumber, + gun_money: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 + gun_number: this.insertResult.bar, //类型:String 必有字段 备注:加油升数 + deduction_mode: 1, + } + // console.log("加油信息===================",this.insertResult) + // console.log(g7OrderInfo) + if (!g7OrderInfo.qr_code) { + uni.showToast({ + title: 'qr_code为空', + icon: 'none' + }); + this.shake = null + return false + } + if (!g7OrderInfo.station_id) { + uni.showToast({ + title: '请选择油站id', + icon: 'none' + }); + this.shake = null + return false + } + if (!g7OrderInfo.companyId) { + uni.showToast({ + title: '请选择企业id', + icon: 'none' + }); + this.shake = null + return false + } + if (!g7OrderInfo.customerId) { + uni.showToast({ + title: '请选择司机id', + icon: 'none' + }); + this.shake = null + return false + } + if (!g7OrderInfo.gun_money) { + uni.showToast({ + title: '请输入加油金额', + icon: 'none' + }); + this.shake = null + return false + } + oliSiteApi.G7Pay(g7OrderInfo).then(res => { + if (res.code === 20000) { + uni.showToast({ + title: '下单成功!' + }); + uni.setStorageSync('orderSource', 'mpxoil') + // console.log("是否是g7================",this.isG7) + if (!this.isG7) { + setTimeout(() => { + this.toDetails(res.data.orderId) + }, 400) + } else { + this.beforePay = false + setTimeout(() => { + this.orderId = res.data.orderId + // console.log("queryTimer",this.orderId) + this.queryTimer() + // console.log("getPayStatus",this.orderId) + this.getPayStatus(this.orderId) + }, 400) + } + this.shake = null + } + }) + }, //日日顺 RrsOrder() { const data6 = { @@ -965,7 +976,7 @@ title: '请选择油品', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.volume) { @@ -973,7 +984,7 @@ title: '请输入加油体积', icon: 'none' }); - this.shake=null + this.shake = null return false } oliSiteApi.RrsPay(data6).then(res => { @@ -1025,7 +1036,7 @@ let PlateNumberImages = this.PlateNumberImages, refuellerImages = this.refuellerImages if (PlateNumberImages == '') { - this.shake=null + this.shake = null uni.showToast({ icon: 'none', title: '请上传车辆照片' @@ -1037,7 +1048,7 @@ icon: 'none', title: '请上传油机照片' }) - this.shake=null + this.shake = null return } var data6 = { @@ -1062,7 +1073,7 @@ oilCardType: this.siteData.oilCardNature, //类型:String 必有字段 备注:油卡性质 1:个人 2:企业 3:外请 accountCardCode: this.siteData.accountCardCode, //类型:String 必有字段 备注:油卡卡号 siteUserName: "1", //类型:String 必有字段 备注:加油员名称 - version: this.siteData.siteType=='2'?null:'1', //类型:Number 必有字段 备注:版本号 + version: this.siteData.siteType == '2' ? null : '1', //类型:Number 必有字段 备注:版本号 xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 } } else { @@ -1087,7 +1098,7 @@ oilCardType: this.siteData.oilCardNature, //类型:String 必有字段 备注:油卡性质 1:个人 2:企业 3:外请 accountCardCode: this.siteData.accountCardCode, //类型:String 必有字段 备注:油卡卡号 siteUserName: "1", //类型:String 必有字段 备注:加油员名称 - version: this.siteData.siteType=='2'?null:"1", //类型:Number 必有字段 备注:版本号 + version: this.siteData.siteType == '2' ? null : "1", //类型:Number 必有字段 备注:版本号 xoilAmountGun: this.insertResult.vol, //类型:String 必有字段 备注:加油升数 } } @@ -1097,25 +1108,28 @@ title: '请选择油品', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!Number(data6.volume)) { - if(this.siteData.siteType=='2'){ + if (this.siteData.siteType == '2') { uni.showToast({ title: '请输入加油升数', icon: 'none' }); - }else{ + } else { uni.showToast({ title: '请输入加油金额', icon: 'none' }); } - this.shake=null + this.shake = null return false } - let location = uni.getStorageSync('location')||{longitude:'',latitude:''}; + let location = uni.getStorageSync('location') || { + longitude: '', + latitude: '' + }; // if(!location){ // let locationChenk = true // let that = this @@ -1137,7 +1151,7 @@ // icon:'error' // }) // } - // console.log(location,'**************************************************') + // // console.log(location,'**************************************************') // return // } // uni.getLocation({ @@ -1156,11 +1170,11 @@ // wx.openSetting({ // success:function(e){ // if (res.authSetting['scope.userLocation']){ - // console.log('******') + // // console.log('******') // } // }, // fail:function(e){ - // console.log(e,'//////') + // // console.log(e,'//////') // } // }) // } @@ -1169,9 +1183,12 @@ // }); // return // - console.log(data6, 'data6+++++') - oliSiteApi.xoilPay(Object.assign(data6,{longitude:location.longitude,latitude:location.latitude})).then(res => { - console.log(res) + // console.log(data6, 'data6+++++') + oliSiteApi.xoilPay(Object.assign(data6, { + longitude: location.longitude, + latitude: location.latitude + })).then(res => { + // console.log(res) if (res.code === 20000) { uni.showToast({ title: '下单成功!' @@ -1208,9 +1225,9 @@ }, 400) } } - setTimeout(()=>{ - this.shake=null - },1000) + setTimeout(() => { + this.shake = null + }, 1000) }) }, // 收费则yi @@ -1237,7 +1254,7 @@ title: '请选择油品', icon: 'none' }); - this.shake=null + this.shake = null return false } if (!data6.volume) { @@ -1245,7 +1262,7 @@ title: '请输入加油体积', icon: 'none' }); - this.shake=null + this.shake = null return false } oliSiteApi.zeyiPay(data6).then(res => { @@ -1286,15 +1303,15 @@ this.getPayStatus(this.orderId) }, 400) } - setTimeout(()=>{ - this.shake=null - },1000) + setTimeout(() => { + this.shake = null + }, 1000) } }) }, getPayStatus(id) { // 获取订单支付状态 - console.log('获取支付状态', id) + // console.log('获取支付状态', id) g7Api.getPayStatus(id).then(res => { if (res.code == 20000) { this.payState = res.data.payState @@ -1316,7 +1333,7 @@ toDetails(id) { uni.setStorageSync('orderId', id) - console.log('id', id) + // console.log('id', id) uni.redirectTo({ url: '/packageOrders/pages/orderList/OrderDetail/OrderDetail' }) @@ -1326,22 +1343,22 @@ this.insertResult.bar = index + 1 }, oilNameSel(item) { - console.log(item, 'item') + // console.log(item, 'item') this.selected = { ...item } this.activeSitePrice = item.priceId - console.log('选择你/n', this.selected, '/n') + // console.log('选择你/n', this.selected, '/n') }, initForm() { if (!this.insertResult.realPrice) { this.selected = this.siteData.oilSitePriceDetailsVos[0] } this.insertResult.bar = 1 - console.log(this.selected) + // console.log(this.selected) }, verifyQrCode() { - console.log(this.zyInfo) + // console.log(this.zyInfo) // if(this.zyInfo.oilsStationId !=undefined){ // let obj={ // qrCode: this.zyInfo.qrCode, //类型:String 必有字段 备注:二维码字符串 @@ -1353,7 +1370,7 @@ oilsStationId: uni.getStorageSync('oilSiteId') //类型:String 必有字段 备注:加油站id } // } - console.log(obj,'**************'); + // console.log(obj,'**************'); oliSiteApi.verifyQrCode(obj).then(res => { if (res.code === 20000) { this.siteData = res.data @@ -1379,7 +1396,7 @@ icon: 'none' }) setTimeout(() => { - uni.navigateBack() + // uni.navigateBack() }, 800) } }) @@ -1392,18 +1409,18 @@ // this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult // .sitePrice) // this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice - console.log('%c look me ↓','font-size:50px;color:green') - console.log(this.insertResult.vMoney,this.insertResult,this.selected) - if(this.insertResult.vol!==''){ + // console.log('%c look me ↓','font-size:50px;color:green') + // console.log(this.insertResult.vMoney,this.insertResult,this.selected) + if (this.insertResult.vol !== '') { this.getMoney({ - detail:{ - value:this.insertResult.vol + detail: { + value: this.insertResult.vol } }) } }, calcMoney(e) { - // console.log(e) + // // console.log(e) if (this.changTypes = 1) { let rrs = e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]; // 处理输入油升数 只保留小数点后两位 this.$nextTick(() => { //重新赋值给input @@ -1419,7 +1436,7 @@ queryTimer() { var count = 5 this.timer = setInterval(() => { - console.log('查询次', count) + // console.log('查询次', count) count-- this.getPayStatus(this.orderId) }, 5000); @@ -1493,15 +1510,15 @@ } }, filters: { - company(e){ - if(e){ - return e=='2' ?'KG':'L'; + company(e) { + if (e) { + return e == '2' ? 'KG' : 'L'; } else { return '' } }, moneyVolm(value) { - console.log(value, '++awdad+++++++-') + // console.log(value, '++awdad+++++++-') if (value != 'xxx.x') { return Math.round(value * 100) / 100; } else {