From d97f8a59e9e9ea4f97d8fa45679a1bd5dc4cc63a Mon Sep 17 00:00:00 2001 From: caolc <572275724@qq.com> Date: Mon, 25 Apr 2022 17:08:43 +0800 Subject: [PATCH] 11 --- pages/stationDetail/ZYSite.vue | 64 +++++++++++++++++++++++++++++++--- utils/request.js | 6 ++-- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/pages/stationDetail/ZYSite.vue b/pages/stationDetail/ZYSite.vue index e13d8df..2e15e36 100644 --- a/pages/stationDetail/ZYSite.vue +++ b/pages/stationDetail/ZYSite.vue @@ -105,11 +105,11 @@ name="input" /> --> - - {{carNumber.charAt(0)||''}} + + {{String(carNumber).charAt(0)||''}} - {{carNumber.substr(1,6)||'请输入车牌号'}} + {{String(carNumber).substr(1,6)||'请输入车牌号'}} @@ -1026,8 +1026,62 @@ this.shake=null return false } + let location = uni.getStorageSync('location')||{longitude:'',latitude:''}; + // if(!location){ + // let locationChenk = true + // let that = this + // uni.getLocation({ + // type: 'gcj02', + // success: function(res) { + // uni.setStorage({ + // key:'location', + // data:res + // }) + // }, + // fail(e) { + // locationChenk = false + // }, + // }); + // if(!locationChenk){ + // uni.showToast({ + // title:'请授权位置', + // icon:'error' + // }) + // } + // console.log(location,'**************************************************') + // return + // } + // uni.getLocation({ + // type: 'gcj02', + // success: function(res) { + // uni.setStorage({ + // key:'location', + // data:res + // }) + // }, + // fail(e) { + // uni.showModal({ + // title:'获取定位', + // content:'是否重新获取定位?', + // success:function(e){ + // wx.openSetting({ + // success:function(e){ + // if (res.authSetting['scope.userLocation']){ + // console.log('******') + // } + // }, + // fail:function(e){ + // console.log(e,'//////') + // } + // }) + // } + // }) + // }, + // }); + // return + // console.log(data6, 'data6+++++') - oliSiteApi.xoilPay(data6).then(res => { + oliSiteApi.xoilPay(Object.assign(data6,{longitude:location.longitude,latitude:location.latitude})).then(res => { console.log(res) if (res.code === 20000) { uni.showToast({ @@ -1205,7 +1259,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 diff --git a/utils/request.js b/utils/request.js index aab16f1..ce2846c 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,15 +1,15 @@ import axios from 'axios' import utils from '@/utils/encode' - // const env = 'production' /* */ - const env = 'test'// 仅用于测试、 + const env = 'production' /* */ + // const env = 'test'// 仅用于测试、 // const env = 'production' //42 洛超 /29 孙志华 /40 阿浩 // 测试日日顺时需要连阿浩 const testUrl = 'http://192.168.0.31:38080' // const productionUrl = 'https://www.51xingka.net/oilApp' // 生产,加密 old -// const productionUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new +const productionUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new // const productionUrl = 'http://121.196.213.68/adminapi' //预生产 // const env = process.env.NODE_ENV // 环境 const service = axios.create({