11 Commits

Author SHA1 Message Date
02a74211d6 Merge pull request 'zyj' (#14) from zyj into master
Reviewed-on: #14
2024-02-21 07:06:31 +00:00
1cc0753efc 更新 2024-02-21 15:04:21 +08:00
71a3188491 更新 2024-02-19 16:54:24 +08:00
d7746faca3 OCR 2024-02-07 16:52:36 +08:00
16bbe24e5b OCR 2024-02-05 16:16:23 +08:00
xiaozhiyong
607e13f266 更新 2024-01-19 13:39:47 +08:00
xiaozhiyong
fdf4935fb2 更新 2023-11-29 18:12:08 +08:00
xiaozhiyong
5c11f4644f 更新 2023-11-21 16:29:43 +08:00
xiaozhiyong
66ce529d41 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/MP_XOIL_company_new 2023-11-20 13:24:33 +08:00
xiaozhiyong
74d32fa0a7 更新 2023-11-20 13:24:17 +08:00
928947bab4 Merge pull request '12' (#13) from caolc into master
Reviewed-on: #13
2023-11-19 10:42:05 +00:00
8 changed files with 242 additions and 33 deletions

26
App.vue
View File

@@ -67,7 +67,7 @@
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
// console.log(channelCodes, productCodes, siteBrands)
this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes)
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
@@ -95,10 +95,12 @@
if(view.route === 'BagStation/pages/stationDetail/stationDetail') {
uni.removeStorageSync('refuseLogin')
}
// console.log('white.includes(view.route)',white.includes(view.route))
// // 是否跳过登陆
let isRefuseLogin = uni.getStorageSync('refuseLogin')
if(isRefuseLogin || white.includes(view.route) || view.route.includes('BagAuth')) return
this.getAmount()
// console.log('111111111111111')
this.getAmount()
})
},
// 是否token过期或ip更改
@@ -106,10 +108,14 @@
// clearTimeout(loginTimer)
accountApi.getTotalOilCardInfo().then(res => {
if (res.code == 42011) {
uni.setStorageSync('Authorization',null)
uni.setStorageSync('openid',null)
uni.showModal({
title: '需要您重新登录',
content: res.msg,
duration: '3000',
showCancel:false,
success: function(res) {
if (res.confirm) {
uni.redirectTo({
@@ -125,13 +131,17 @@
onReady() {
},
onUnload() {
uni.hideLoading()
},
onShow: function(option) {
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
if (token && openid) {
this.getAmount()
}
// const token = uni.getStorageSync('Authorization')
// const openid = uni.getStorageSync('openid')
// if (token && openid) {
// this.getAmount()
// }
uni.getLocation({
type: 'wgs84',
success: function(res) {
@@ -142,7 +152,9 @@
}
});
},
}
</script>
<style lang="scss">

View File

@@ -280,9 +280,16 @@
submit() {
this.checkFn('name');
this.checkFn('plateNumber');
if (!this.fromStyle.nameType || !this.fromStyle.plateNumberType) {
if (!this.fromStyle.nameType) {
uni.showToast({
title: '还有信息没有填哦',
title: '请输入姓名',
icon: 'error'
});
return
};
if (!this.fromStyle.plateNumberType) {
uni.showToast({
title: '车牌号格式有误',
icon: 'error'
});
return

View File

@@ -153,7 +153,7 @@
<!-- <button class="cu-btn block lg margin-top " @tap="delOrder">删除订单</button> -->
</view>
<view class="customer-service" @click="arousePhone">
<image src="../../static/img/customer-service.png"></image>
<image src="../../BagStation/static/img/customer-service.png"></image>
联系客服
</view>
</view>

View File

@@ -188,6 +188,24 @@
</view>
</view>
</view>
<view class=" menu cu-list " v-if="plateNumberOcrShow==true">
<view class="cu-item nowrap">
<view class="text-bold ">
车牌识别
</view>
<view @tap="srcPhoto" class="text-center" style="width: 60%;margin: 0 2%;">
<input v-model="plateNumberOcr" type="digit" class="block"
placeholder="请点击拍照识别车牌" value="" style="border-bottom: 1px solid #efefef;" />
</view>
<view @tap="srcPhoto">
<uni-icons type="camera-filled" size="30"></uni-icons>
</view>
</view>
</view>
<view class="bg-white padding">
<view class="">
<text class="text-bold">优惠</text>
@@ -367,6 +385,39 @@
</view>
</view>
</view>
<view class="cu-modal bottom-modal " :class="showPlicePhoto">
<view class="cu-dialog bg-white">
<view class="cu-bar bg-white justify-end">
<view class="content"></view>
<view class="action" @tap="showPlicePhoto=''">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view style="height: 1000rpx;">
<view style="margin: 100rpx 0;">
<uni-icons type="clear" size="80" color="#f56c6c"></uni-icons>
<view>
<text style="color: #d9001b;font-size: 30rpx;font-weight: bold;">识别失败!</text>
</view>
</view>
<view style="margin: 60rpx 0;">
<button @tap="srcPhoto" style="width: 60%;background-color: #409EFF;color: #ffffff;">重新拍照</button>
</view>
<view style="margin: 60rpx 0;">
<button style="width: 60%;background-color: #F59A23;color: #ffffff;" @click="manualInput">手动输入车牌号</button>
</view>
</view>
</view>
</view>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog mode="input" title="请输入车牌号" value="" :before-close="true"
placeholder="请输入" @close="inputClose" @confirm="inputConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</template>
@@ -377,6 +428,7 @@
import oilOssApi from '@/api/oil-oss.js'
import utils from '@/utils/encode'
import oilInterfacesApi from '@/api/oil-interfaces.js'
import user from '@/api/user.js'
export default {
props: {
channelList: {
@@ -504,13 +556,18 @@
activeChannelCode: '',
checkBar: [],
realMoney: '',
xoilAmountGun: ''
xoilAmountGun: '',
plateNumberOcr:'',
plateNumberOcrShow:false,
showPlicePhoto:'',
plateNumberImages:''
}
},
created() {
let oilItem = uni.getStorageSync('oilItem'),
oilSite = uni.getStorageSync(''),
otherUser = uni.getStorageSync('otherUserInfo')
otherUser = uni.getStorageSync('otherUserInfo'),
companyId = JSON.parse(uni.getStorageSync('companyCard')).companyId
if (otherUser) {
// console.log('这里是卡里')
this.isOtherUser = true
@@ -520,6 +577,8 @@
console.log('oilItem', oilItem)
this.showtitles = oilItem.listTag;
this.init()
console.log(companyId)
this.getCompanyConfig(companyId)
},
watch: {
activeChannelCode: {
@@ -598,6 +657,86 @@
}
},
methods: {
manualInput(){
this.showPlicePhoto=''
this.$refs.inputDialog.open()
},
inputClose(){
this.$refs.inputDialog.close()
},
inputConfirm(val){
if(val){
this.plateNumberOcr = val
this.$refs.inputDialog.close()
}else{
uni.showToast({
title: '请输入车牌号',
icon: 'none'
})
}
},
getCompanyConfig(companyId){
if(companyId){
user.getCompanyConfigByCompanyId(companyId).then(res=>{
if(res.data.plateNumberOcr==1){
this.plateNumberOcrShow = true
}else{
this.plateNumberOcrShow = false
}
})
}
},
srcPhoto(){
this.showPlicePhoto=''
let _that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera'], // 只能拍照
success: function(res) {
uni.showLoading({
title: '识别中',
mask: true
});
const JSESSIONID = utils.uuid()
uni.uploadFile({
url: 'http://uat.xingoil.com/adminapi/oil-oss/obejct/carNoIdentify',
filePath: res.tempFilePaths[0],
name: 'file',
header: {
"Content-Type": "multipart/form-data",
"Authorization": uni.getStorageSync('Authorization'),
'dataSources': 'MP',
"imei": uni.getStorageSync('unionid'),
"openId": uni.getStorageSync('openid'),
'JSESSIONID': JSESSIONID,
'token': utils.md5Salt(JSESSIONID)
},
success(e) {
uni.hideLoading()
let obj = JSON.parse(e.data)
if(obj.data&&obj.data.carNo){
_that.plateNumberOcr = obj.data.carNo
_that.plateNumberImages = obj.data.imgUrl
}else{
_that.plateNumberOcr = ''
_that.showPlicePhoto = 'show'
}
},fail(res){
uni.hideLoading()
_that.showPlicePhoto = 'show'
}
})
}
})
},
typeChenk() {
return this.channelList[this.activeCur]?.secondChannelCode && this.thirdPartyDynamicData.includes(this
.channelList[this.activeCur].secondChannelCode)
@@ -1135,14 +1274,23 @@
'xoilAmountGun': this.vol
}
} else {
var orderData = {
if(!this.plateNumberOcr){
uni.showToast({
icon: 'none',
title: '请上传车牌照片'
})
return
}
if(this.plateNumberOcrShow == true){
var orderData = {
amountGun: this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
shareCompanyQuota: 0, // 共享标识
priceId: this.oilSitePriceDetailsVo[this.radio].priceId, //类型String 必有字段 备注:油价主键
orderType: "REAL_ORDER", //类型String 必有字段 备注订单类型REAL_ORDER真实订单 VIRTUAL_ORDER虚拟订单
orderSource: "WECHAT_MINIAPPS", //类型String 必有字段 备注订单来源WECHAT_MINIAPPS
plateNumber: this.plateNumber ? this.plateNumber : this
.plateNumberSel, //类型String 必有字段 备注:车牌号
plateNumber: this.plateNumberOcrShow == true ? this.plateNumberOcr : this
.plateNumber, //类型String 必有字段 备注:车牌号
plateNumberImages: this.plateNumberImages, // 车牌照片地址
siteUserName: this.jober, //类型String 必有字段 备注:加油员
oilsBar: this.oilBar, //类型Number 必有字段 备注:油枪
volume: this.activeChannelCode == 'TY' ? this.tyRes.liter : this
@@ -1155,6 +1303,29 @@
'version': 1,
'xoilAmountGun': this.vol
}
}else{
var orderData = {
amountGun: this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
shareCompanyQuota: 0, // 共享标识
priceId: this.oilSitePriceDetailsVo[this.radio].priceId, //类型String 必有字段 备注:油价主键
orderType: "REAL_ORDER", //类型String 必有字段 备注订单类型REAL_ORDER真实订单 VIRTUAL_ORDER虚拟订单
orderSource: "WECHAT_MINIAPPS", //类型String 必有字段 备注订单来源WECHAT_MINIAPPS
plateNumber: this.plateNumber ? this.plateNumber : this
.plateNumberSel, //类型String 必有字段 备注:车牌号
siteUserName: this.jober, //类型String 必有字段 备注:加油员
oilsBar: this.oilBar, //类型Number 必有字段 备注:油枪
volume: this.activeChannelCode == 'TY' ? this.tyRes.liter : this
.vol, //类型Number 必有字段 备注:加油升数
realPrice: this.oilSitePriceDetailsVo[this.radio].sitePrice, //类型Number 必有字段 备注:实际加油价格
suppleMark: 0, //类型Number 必有字段 备注补录标识0实时订单 1补录订单
createSource: "XOIL_DRIVER_COMPANY_WECHAT_APPLET", //类型String 必有字段 备注:创建来源( XOIL_DRIVER_COMPANY_WECHAT_APPLET
// "deviceImei": "mock", //类型String 可有字段 备注:设备唯一码
// "networkIp": "mock" //类型String 可有字段 备注ip地址
'version': 1,
'xoilAmountGun': this.vol
}
}
}
// console.log(orderData)
let location = uni.getStorageSync('location') || {

View File

@@ -56,16 +56,16 @@
seleIndex:0,
kmData:[
{
lable:'20KM',
value:20000
lable:'5KM',
value:5000
},
{
lable:'10KM',
value:10000
},
{
lable:'30KM',
value:30000
},
{
lable:'50KM',
value:50000
}
]
}

View File

@@ -62,7 +62,7 @@
width: 40,
height: 50
},
radius: 20000,
radius: 5000,
LastCoordinate: [],
timer: null,
TXSDK: null,
@@ -212,7 +212,7 @@
// list.length = 100;
this.markers = this.locationProcessing(res.data);
this.spareMarkers = JSON.parse(JSON.stringify(this.markers));
console.log(this.spareMarkers, '////////////////////////')
// console.log(this.spareMarkers, '////////////////////////')
// markersArray.forEach((item,index)=>{
// })
@@ -363,8 +363,8 @@
},
mapUpdated(e) {
let that = this
console.log('%c 更新', 'font-size:50px;color:red');
console.log(e, '*****************************************')
// console.log('%c 更新', 'font-size:50px;color:red');
// console.log(e, '*****************************************')
// that.mapContext.getScale({
// success: function(e) {
// // that.$nextTick(function() {

19
api/user.js Normal file
View File

@@ -0,0 +1,19 @@
import request from '@/utils/request'
const service_name = "oil-user"
const group_name = "oilCustomerInfo"
export default{
carNoIdentify(data) { //图片上传-ORC识别
return request({
url: `/${service_name}/${group_name}/carNoIdentify`,
method: 'post',
data: data
})
},
// 查询企业配置
getCompanyConfigByCompanyId(id) {
return request({
url: `/${service_name}/sysCompanyConfig/getCompanyConfigByCompanyId/${id}`,
method: 'GET'
})
},
}

View File

@@ -53,7 +53,7 @@
}
},
mounted() {
console.log('mounted')
// console.log('mounted')
},
onLoad(option) {
this.option = option;
@@ -62,7 +62,7 @@
onReady(option) {},
methods: {
versionUpdate() {
console.log('versionUpdate')
// console.log('versionUpdate')
let that = this
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
@@ -102,7 +102,7 @@
if(res.code==20000) isOnline = true
}).catch(err=>{})
}
console.log(isOnline,'isOnline')
// console.log(isOnline,'isOnline')
if (isOnline) {
this.key = '在线'
} else {
@@ -131,7 +131,7 @@
})
}
if (this.key == '在线') {
console.log(type, 'typetypetypetype');
// console.log(type, 'typetypetypetype');
uni.switchTab({
url: `/pages/tabbar/home/home`,
@@ -148,7 +148,7 @@
},
Interceptor(id) {
let taht = this
console.log(`%c 检测到参数拦截器启动`, 'color:red;font-size:50px');
// console.log(`%c 检测到参数拦截器启动`, 'color:red;font-size:50px');
// this.tools.overallInterceptor((opentype) => {
// uni.removeInterceptor(opentype);
// wxCode.getQrCodeType({
@@ -181,7 +181,7 @@
})
},
getFilterData() {
console.log('wodefenzhi')
// console.log('wodefenzhi')
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
@@ -206,13 +206,13 @@
value: item.id
})
})
console.log(channelCodes, productCodes, siteBrands)
// console.log(channelCodes, productCodes, siteBrands)
this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes)
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes)
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
uni.setStorageSync('filterData', this.menuList)
uni.setStorageSync('productCodeList', res.data.productCodeList)
console.log(res, '%c 这里是启动页调用的菜单列表', 'font-size:36px;color:red;')
// console.log(res, '%c 这里是启动页调用的菜单列表', 'font-size:36px;color:red;')
// this.$refs.slFilter.resetMenuList(this.menuList)
}
})