1.3.3.8扫本地图片二维码
This commit is contained in:
27
App.vue
27
App.vue
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import utils from '@/utils/encode'
|
||||
import utils from '@/utils/encode'
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
uni.getSystemInfo({
|
||||
@@ -13,14 +13,14 @@ import utils from '@/utils/encode'
|
||||
Vue.prototype.CustomBar = e.statusBarHeight + 45;
|
||||
};
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
Vue.prototype.StatusBar = e.statusBarHeight;
|
||||
let custom = wx.getMenuButtonBoundingClientRect();
|
||||
Vue.prototype.Custom = custom;
|
||||
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef MP-ALIPAY
|
||||
Vue.prototype.StatusBar = e.statusBarHeight;
|
||||
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
|
||||
@@ -29,23 +29,24 @@ import utils from '@/utils/encode'
|
||||
})
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
console.log('App Show')
|
||||
const JSESSIONID = utils.uuid()
|
||||
console.log(JSESSIONID)
|
||||
// console.log(utils.bcrypt(JSESSIONID))
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function (res) {
|
||||
console.log('当前位置的经度:' + res.longitude);
|
||||
console.log('当前位置的纬度:' + res.latitude);
|
||||
type: 'wgs84',
|
||||
success: function(res) {
|
||||
console.log('当前位置的经度:' + res.longitude);
|
||||
console.log('当前位置的纬度:' + res.latitude);
|
||||
uni.setStorage({
|
||||
key: 'service_baseUrl',
|
||||
data: 'https://www.51xingka.net/LSMOIL/',
|
||||
success: function () {
|
||||
console.log('缓存baseUrl成功');
|
||||
}
|
||||
key: 'service_baseUrl',
|
||||
data: 'https://www.51xingka.net/LSMOIL/',
|
||||
success: function() {
|
||||
console.log('缓存baseUrl成功');
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onHide: function() {
|
||||
|
||||
@@ -212,6 +212,9 @@
|
||||
"path": "", //启动页面,必选
|
||||
"query": "" //启动参数,在页面的onLoad函数里面得到
|
||||
}]
|
||||
},
|
||||
"window": {// 开发者可在 app.json 配置 renderingMode 关闭同层来规避此问题。
|
||||
"renderingMode": "seperated"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getUserInfo()
|
||||
// let url = '/pages/station-info/scan-camera/scan-camera'
|
||||
// uni.redirectTo({
|
||||
// url: url
|
||||
// })
|
||||
},
|
||||
onReady(option) {
|
||||
const updateManager = uni.getUpdateManager();
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<text class="color-000">版本号</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<text class="text-grey text-sm">1.3.0</text>
|
||||
<text class="text-grey text-sm">1.3.3.8</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
267
pages/station-info/scan-camera/scan-camera - 副本.vue
Normal file
267
pages/station-info/scan-camera/scan-camera - 副本.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<view class="page-content">
|
||||
<cu-custom :isBack="true" class="main-topbar bg-main-oil" bgColor="bg-main-oil">
|
||||
<block slot="content">扫描二维码</block>
|
||||
<block slot="backText">返回</block>
|
||||
</cu-custom>
|
||||
<camera class='scan-camera' :flash="flashValue" mode="scanCode" @scancode="scancode" @initdone="initdone"
|
||||
@stop="openStop" @error="openFail" frame-size='large'>
|
||||
<cover-view class='scan-animation' :animation="animationData2"></cover-view>
|
||||
<cover-view class="cover-aquare">
|
||||
<cover-view class='cover-aquare-inner'></cover-view>
|
||||
<cover-view class='cover-corner cover-left-top'>
|
||||
<cover-view class="w-line"></cover-view>
|
||||
<cover-view class="h-line"></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class='cover-corner cover-right-top'>
|
||||
<cover-view class="w-line w1-line"></cover-view>
|
||||
<cover-view class="h-line h1-line"></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class='cover-corner cover-left-bottom'>
|
||||
<cover-view class="h-line"></cover-view>
|
||||
<cover-view class="w-line"></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class='cover-corner cover-right-bottom'>
|
||||
<cover-view class="h-line h3-line"></cover-view>
|
||||
<cover-view class="w-line w3-line"></cover-view>
|
||||
</cover-view>
|
||||
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="flash text-center">
|
||||
<cover-view @tap="touchFlash" class=" text-white lg" v-show="flashValue!='on'">
|
||||
打开手电筒
|
||||
</cover-view>
|
||||
<cover-view @tap="touchFlash" class=" text-white lg" v-show="flashValue=='on'">
|
||||
关闭手电筒
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
|
||||
|
||||
</camera>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let diSrc = 'http://downsc.chinaz.net/Files/DownLoad/sound1/201711/9360.mp3'
|
||||
let innerAudioContext = wx.createInnerAudioContext()
|
||||
innerAudioContext.src = diSrc
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
once: false,
|
||||
lightOn: false,
|
||||
animationData2: {},
|
||||
flashValue: 'auto'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.donghua()
|
||||
setInterval(() => {
|
||||
this.donghua()
|
||||
}, 6000);
|
||||
},
|
||||
// onShow() {
|
||||
// this.donghua()
|
||||
|
||||
// },
|
||||
methods: {
|
||||
touchFlash() {
|
||||
if (this.flashValue != 'on') {
|
||||
this.flashValue = 'on'
|
||||
} else if (this.flashValue == 'on') {
|
||||
this.flashValue = 'off'
|
||||
}
|
||||
},
|
||||
donghua() {
|
||||
var animation2 = uni.createAnimation({
|
||||
duration: 1000,
|
||||
timingFunction: 'linear',
|
||||
})
|
||||
|
||||
this.animation2 = animation2
|
||||
|
||||
animation2.translateY(235).step({
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
this.animationData2 = animation2.export()
|
||||
|
||||
setTimeout(() => {
|
||||
animation2.translateY(0).step({
|
||||
duration: 3000
|
||||
})
|
||||
this.animationData2 = animation2.export()
|
||||
|
||||
}, 3000)
|
||||
},
|
||||
initdone(e) {
|
||||
console.log('相机初始化完成时触发', e)
|
||||
|
||||
},
|
||||
openStop(err) {
|
||||
console.log('摄像头异常终止', err)
|
||||
uni.showToast({
|
||||
title:'摄像头异常终止',
|
||||
icon:'none'
|
||||
})
|
||||
},
|
||||
openFail(err) {
|
||||
console.log('用户不允许使用摄像头时触发', err)
|
||||
uni.showToast({
|
||||
title:'用户不允许使用摄像头',
|
||||
icon:'none'
|
||||
})
|
||||
},
|
||||
scancode(e) {
|
||||
if (!this.once) {
|
||||
var scanUrl = ''
|
||||
// uni.getStorageSync('scanUrl')
|
||||
// 提示音
|
||||
innerAudioContext.play()
|
||||
console.log('play滴~')
|
||||
// 校验扫描结果,并处理
|
||||
let res = e.detail.result
|
||||
console.log(res)
|
||||
console.log(e)
|
||||
uni.setStorageSync('qrCode', res)
|
||||
this.once = true
|
||||
let url = ''
|
||||
const tag = res.substring(0, 2)
|
||||
if (tag == "XM" || tag == "HT" || tag == "G7") {
|
||||
url = '/pages/stationDetail/stationDetail'
|
||||
} else {
|
||||
url = '/pages/stationDetail/ZYSite'
|
||||
}
|
||||
console.log(tag)
|
||||
uni.redirectTo({
|
||||
// url: `/pages/stationDetail/stationDetail`,
|
||||
url: url,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
// console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.scan-camera {
|
||||
width: 750upx;
|
||||
height: 92vh;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.cover-corner {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.cover-left-top {
|
||||
left: 0upx;
|
||||
top: 0upx;
|
||||
|
||||
}
|
||||
|
||||
.cover-right-top {
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
}
|
||||
|
||||
.cover-left-bottom {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
|
||||
}
|
||||
|
||||
.cover-right-bottom {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
}
|
||||
|
||||
.scan-animation {
|
||||
position: absolute;
|
||||
width: 480rpx;
|
||||
height: 8rpx;
|
||||
top: 200upx;
|
||||
left: 135upx;
|
||||
background-color: #FE0505;
|
||||
border-radius: 50%;
|
||||
box-shadow: 5upx 5upx 0 10upx #FE0505;
|
||||
}
|
||||
|
||||
.cover-aquare-inner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border: 2upx solid #f1f3f7;
|
||||
}
|
||||
|
||||
.cover-aquare {
|
||||
position: absolute;
|
||||
width: 500upx;
|
||||
height: 500upx;
|
||||
overflow: inherit;
|
||||
top: 200upx;
|
||||
left: 125upx;
|
||||
/* border: 1px solid #FE0505; */
|
||||
}
|
||||
|
||||
.h-line {
|
||||
width: 10upx;
|
||||
height: 20upx;
|
||||
background-color: #FE0505;
|
||||
}
|
||||
|
||||
.w-line {
|
||||
width: 30upx;
|
||||
height: 10upx;
|
||||
background-color: #FE0505;
|
||||
}
|
||||
|
||||
.h1-line {
|
||||
width: 10upx;
|
||||
float: right;
|
||||
height: 20upx;
|
||||
}
|
||||
|
||||
.w1-line {
|
||||
width: 30upx;
|
||||
height: 10upx;
|
||||
}
|
||||
|
||||
.h3-line {
|
||||
right: -21upx;
|
||||
position: relative;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.flash {
|
||||
position: absolute;
|
||||
width: 750upx;
|
||||
top: 800upx;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.cu-avatar {
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.cu-avatar [class*="cuIcon-"] {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
@@ -1,44 +1,88 @@
|
||||
<template>
|
||||
<view class="page-content">
|
||||
<cu-custom :isBack="true" class="main-topbar bg-main-oil" bgColor="bg-main-oil">
|
||||
<block slot="content">扫描二维码</block>
|
||||
<block slot="backText">返回</block>
|
||||
</cu-custom>
|
||||
<camera class='scan-camera' :flash="flashValue" mode="scanCode" binderror="cameraError" bindscancode='scancode'
|
||||
@scancode="scancode" frame-size='large'>
|
||||
<cover-view class='scan-animation' :animation="animationData2"></cover-view>
|
||||
<cover-view class="cover-aquare">
|
||||
<cover-view class='cover-aquare-inner'></cover-view>
|
||||
<cover-view class='cover-corner cover-left-top'>
|
||||
<cover-view class="w-line"></cover-view>
|
||||
<cover-view class="h-line"></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class='cover-corner cover-right-top'>
|
||||
<cover-view class="w-line w1-line"></cover-view>
|
||||
<cover-view class="h-line h1-line"></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class='cover-corner cover-left-bottom'>
|
||||
<cover-view class="h-line"></cover-view>
|
||||
<cover-view class="w-line"></cover-view>
|
||||
</cover-view>
|
||||
<cover-view class='cover-corner cover-right-bottom'>
|
||||
<cover-view class="h-line h3-line"></cover-view>
|
||||
<cover-view class="w-line w3-line"></cover-view>
|
||||
</cover-view>
|
||||
<view>
|
||||
<cu-custom class="main-topbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content bg-white"> </block>
|
||||
</cu-custom>
|
||||
<view class="cu-list menu-avatar">
|
||||
<view class="cu-item margin-sm margin-left margin-right radius">
|
||||
<view class="cu-avatar bg-gray round lg"></view>
|
||||
<view class="content money-container">
|
||||
<view class="">
|
||||
<view class="text-cut bg-gray"></view>
|
||||
</view>
|
||||
<view class="text-gray text-sm flex">
|
||||
<view class="text-cut bg-gray"></view> <text class="text-xs bg-gray"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action">
|
||||
<view class="text-white money-position padding-left-lg padding-xs bg-main-oil text-lg">
|
||||
<text class="text-xs bg-gray"></text>
|
||||
|
||||
</cover-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group margin margin-top-0 radius">
|
||||
<view class="title mini-label bg-gray"></view>
|
||||
<view class="title bg-gray"></view>
|
||||
<text class="cuIcon-write text-orange"></text>
|
||||
</view>
|
||||
<view class="my-cell margin-left margin-right padding-top padding-bottom radius">
|
||||
<view class="strong bg-gray padding-bottom-xs"></view>
|
||||
<view class="font-12 bg-gray">
|
||||
<text class="text-cut"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- -->
|
||||
<view class="padding-top-xs margin margin-top-xs margin-bottom-0 padding-bottom radius">
|
||||
<view class="bg-white padding padding-bottom-sm">
|
||||
<view class="padding-bottom-sm text-lg bg-gray"></view>
|
||||
<view class="padding-top-xs">
|
||||
<text class="strong padding-right-xs bg-gray font-16"></text>
|
||||
<text class="padding-right-xs bg-gray">
|
||||
|
||||
<cover-view class="flash text-center">
|
||||
<cover-view @tap="touchFlash" class=" text-white lg" v-show="flashValue!='on'">
|
||||
打开手电筒
|
||||
</cover-view>
|
||||
<cover-view @tap="touchFlash" class=" text-white lg" v-show="flashValue=='on'">
|
||||
关闭手电筒
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
<text class="text-blod bg-gray oil-main-color"></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="grid col-5 padding-top justify-start">
|
||||
<view class="padding-xs" v-for="(item,index) in 4" :key="index">
|
||||
<view class="bg-gray"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding solid-top padding-bottom-0 padding-top-xs bg-white">
|
||||
<view class="padding-bottom-sm text-lg bg-gray"></view>
|
||||
<view class="grid col-5 justify-start">
|
||||
<view class="padding-xs" v-for="(item,index) in 5" :key="index">
|
||||
<view class="bg-gray"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solid-top padding solid-top bg-white">
|
||||
<view class="shadow-warp ">
|
||||
<view class="cu-form-group">
|
||||
<view class="title"></view>
|
||||
<view class="bg-gray"></view>
|
||||
<view class="bg-gray"></view>
|
||||
</view>
|
||||
<view class="my-cell">
|
||||
<view class="bg-gray"></view>
|
||||
<view class="bg-gray"></view>
|
||||
</view>
|
||||
<view class="my-cell">
|
||||
<view class="text-gray"></view>
|
||||
<view class="text-gray"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="red-circle">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</camera>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -52,49 +96,61 @@
|
||||
once: false,
|
||||
lightOn: false,
|
||||
animationData2: {},
|
||||
flashValue: 'auto'
|
||||
flashValue: 'auto',
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.donghua()
|
||||
setInterval(() => {
|
||||
this.donghua()
|
||||
}, 6000);
|
||||
},
|
||||
// onShow() {
|
||||
// this.donghua()
|
||||
|
||||
// },
|
||||
methods: {
|
||||
touchFlash() {
|
||||
if (this.flashValue != 'on') {
|
||||
this.flashValue = 'on'
|
||||
} else if (this.flashValue == 'on') {
|
||||
this.flashValue = 'off'
|
||||
}
|
||||
},
|
||||
donghua() {
|
||||
var animation2 = uni.createAnimation({
|
||||
duration: 1000,
|
||||
timingFunction: 'linear',
|
||||
})
|
||||
onLoad() {
|
||||
uni.scanCode({
|
||||
scanType: 'qrCode',
|
||||
onlyFromCamera: false,
|
||||
success: (resResult) => {
|
||||
// innerAudioContext.play()
|
||||
console.log('play滴~')
|
||||
let res = resResult.result
|
||||
console.log(res)
|
||||
uni.setStorageSync('qrCode', res)
|
||||
this.once = true
|
||||
let url = ''
|
||||
const tag = res.substring(0, 2)
|
||||
// 老星油 XM , HT G7 , 则一 ZEYI , 新星油 XOIL
|
||||
if (tag == "XM" || tag == "HT" || tag == "G7") {
|
||||
url = '/pages/stationDetail/stationDetail'
|
||||
} else if (res.substring(0, 4) == 'ZEYI' || res.substring(0, 4) == 'XOIL') {
|
||||
url = '/pages/stationDetail/ZYSite'
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未知二维码',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
|
||||
this.animation2 = animation2
|
||||
|
||||
animation2.translateY(235).step({
|
||||
duration: 3000
|
||||
})
|
||||
|
||||
this.animationData2 = animation2.export()
|
||||
|
||||
setTimeout(() => {
|
||||
animation2.translateY(0).step({
|
||||
duration: 3000
|
||||
})
|
||||
}, 800)
|
||||
return false;
|
||||
}
|
||||
console.log(tag)
|
||||
uni.redirectTo({
|
||||
// url: `/pages/stationDetail/stationDetail`,
|
||||
url: url,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
// console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
this.animationData2 = animation2.export()
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.navigateBack({
|
||||
|
||||
}, 3000)
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
scancode(e) {
|
||||
if (!this.once) {
|
||||
var scanUrl = ''
|
||||
@@ -109,12 +165,25 @@
|
||||
uni.setStorageSync('qrCode', res)
|
||||
this.once = true
|
||||
let url = ''
|
||||
if (res.substring(0, 2) == "XM") {
|
||||
const tag = res.substring(0, 2)
|
||||
console.log(tag)
|
||||
if (tag == "XM" || tag == "HT" || tag == "G7") {
|
||||
url = '/pages/stationDetail/stationDetail'
|
||||
} else {
|
||||
} else if (res.substring(0, 4) == 'ZEYI') {
|
||||
url = '/pages/stationDetail/ZYSite'
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未知二维码',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
|
||||
})
|
||||
}, 800)
|
||||
return false;
|
||||
}
|
||||
console.log(res.substring(0, 2) )
|
||||
console.log(tag)
|
||||
uni.redirectTo({
|
||||
// url: `/pages/stationDetail/stationDetail`,
|
||||
url: url,
|
||||
@@ -134,6 +203,7 @@
|
||||
<style scoped>
|
||||
.page-content {
|
||||
overflow: hidden;
|
||||
color: transparent !important;
|
||||
}
|
||||
|
||||
.scan-camera {
|
||||
@@ -239,10 +309,81 @@
|
||||
|
||||
.cu-avatar {
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.cu-avatar [class*="cuIcon-"] {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
background-color: #f1f2f7;
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navigation {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.icon-self {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.oil-price {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.oil-price radio {
|
||||
position: absolute;
|
||||
left: 0rem;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.qr-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.pay-desc {
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.bottom-pay {
|
||||
min-height: 100rpx;
|
||||
width: 750upx;
|
||||
}
|
||||
|
||||
.pay-bar {
|
||||
width: 750upx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.money-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.money-position {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
min-height: 1rem;
|
||||
min-width: 3rem;
|
||||
display: block;
|
||||
border-radius: 0 0 0 100upx;
|
||||
}
|
||||
|
||||
.bg-gray {
|
||||
min-height: 1rem;
|
||||
min-width: 3rem;
|
||||
}
|
||||
|
||||
.red-circle {
|
||||
height: 200upx;
|
||||
border-radius: 50%;
|
||||
background-color: red;
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -513,9 +513,17 @@
|
||||
if (res.code === 20000) {
|
||||
this.siteData = res.data
|
||||
// this.carNumber = res.data.vehicleLicenseNum[0]
|
||||
this.carNumber = res.data.vehicleLicenseNum[0] || res.data.plateNumbers[0]
|
||||
if (res.data.vehicleLicenseNum) {
|
||||
this.carNumber = res.data.vehicleLicenseNum[0]
|
||||
} else if (res.data.plateNumbers) {
|
||||
this.carNumber = res.data.plateNumbers[0]
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg ? res.msg : '请确认是否油站二维码',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 800)
|
||||
|
||||
@@ -156,6 +156,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// <import src="stationDetail.skeleton.wxml"/>
|
||||
// <template is="skeleton" wx-if="{{loading}}" />
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
import g7Api from '@/api/g7.js'
|
||||
import PlateNumberPicker from '@/components/plate-number-picker/plate-number-picker.vue'
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
import axios from 'axios'
|
||||
import utils from '@/utils/encode'
|
||||
|
||||
const devUrl = 'http://192.168.0.33:48080' // 测试,不加密
|
||||
const testUrl = 'http://192.168.0.25:48080' // 测试,加密
|
||||
const productionUrl = 'https://www.51xingka.net/oilApp' // 生产,加密
|
||||
|
||||
const env = process.env.NODE_ENV // 环境
|
||||
// const env = 'production' // 仅用于测试
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: env=='production'?productionUrl:testUrl, //
|
||||
// baseURL: 'http://192.168.0.33:48080', //
|
||||
baseURL: 'https://www.51xingka.net/oilApp', //生产
|
||||
// baseURL: 'https://www.51xingka.net/oilApp', //生产
|
||||
timeout: 5000
|
||||
})
|
||||
var url = ''
|
||||
// const env = process.env.NODE_ENV
|
||||
const env = 'production' // 测试中的生茶、
|
||||
let outTimer = null
|
||||
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// 拦截请求
|
||||
@@ -76,6 +85,7 @@ service.interceptors.response.use(
|
||||
|
||||
uni.hideLoading()
|
||||
if (res.code != 20000) {
|
||||
clearTimeout(outTimer)
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
@@ -93,35 +103,38 @@ service.interceptors.response.use(
|
||||
// })
|
||||
// }
|
||||
if (res.msg === '您已被迫下线') {
|
||||
uni.showModal({
|
||||
title: '下线提醒',
|
||||
confirmText: '重新登录',
|
||||
cancelText: "退出",
|
||||
content: '您的账号在另一微信下登录了星油云站,请确认是否本加油站工作人员操作',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/startPage/startPage',
|
||||
success: () => {
|
||||
console.log('跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/boforeLogin/boforeLogin',
|
||||
success: () => {
|
||||
console.log('跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
outTimer = setTimeout(() => {
|
||||
uni.showModal({
|
||||
title: '下线提醒',
|
||||
confirmText: '重新登录',
|
||||
cancelText: "退出",
|
||||
content: '您的账号在另一微信下登录了星油云站,请确认是否本加油站工作人员操作',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/startPage/startPage',
|
||||
success: () => {
|
||||
console.log('跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/boforeLogin/boforeLogin',
|
||||
success: () => {
|
||||
console.log('跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
}
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user