1.3.3.8扫本地图片二维码
This commit is contained in:
27
App.vue
27
App.vue
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import utils from '@/utils/encode'
|
import utils from '@/utils/encode'
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
@@ -13,14 +13,14 @@ import utils from '@/utils/encode'
|
|||||||
Vue.prototype.CustomBar = e.statusBarHeight + 45;
|
Vue.prototype.CustomBar = e.statusBarHeight + 45;
|
||||||
};
|
};
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
Vue.prototype.StatusBar = e.statusBarHeight;
|
Vue.prototype.StatusBar = e.statusBarHeight;
|
||||||
let custom = wx.getMenuButtonBoundingClientRect();
|
let custom = wx.getMenuButtonBoundingClientRect();
|
||||||
Vue.prototype.Custom = custom;
|
Vue.prototype.Custom = custom;
|
||||||
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
|
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
Vue.prototype.StatusBar = e.statusBarHeight;
|
Vue.prototype.StatusBar = e.statusBarHeight;
|
||||||
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
|
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
|
||||||
@@ -29,23 +29,24 @@ import utils from '@/utils/encode'
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
|
||||||
console.log('App Show')
|
console.log('App Show')
|
||||||
const JSESSIONID = utils.uuid()
|
const JSESSIONID = utils.uuid()
|
||||||
console.log(JSESSIONID)
|
console.log(JSESSIONID)
|
||||||
// console.log(utils.bcrypt(JSESSIONID))
|
// console.log(utils.bcrypt(JSESSIONID))
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
success: function (res) {
|
success: function(res) {
|
||||||
console.log('当前位置的经度:' + res.longitude);
|
console.log('当前位置的经度:' + res.longitude);
|
||||||
console.log('当前位置的纬度:' + res.latitude);
|
console.log('当前位置的纬度:' + res.latitude);
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'service_baseUrl',
|
key: 'service_baseUrl',
|
||||||
data: 'https://www.51xingka.net/LSMOIL/',
|
data: 'https://www.51xingka.net/LSMOIL/',
|
||||||
success: function () {
|
success: function() {
|
||||||
console.log('缓存baseUrl成功');
|
console.log('缓存baseUrl成功');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
|
|||||||
@@ -212,6 +212,9 @@
|
|||||||
"path": "", //启动页面,必选
|
"path": "", //启动页面,必选
|
||||||
"query": "" //启动参数,在页面的onLoad函数里面得到
|
"query": "" //启动参数,在页面的onLoad函数里面得到
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
"window": {// 开发者可在 app.json 配置 renderingMode 关闭同层来规避此问题。
|
||||||
|
"renderingMode": "seperated"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,10 @@
|
|||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
|
// let url = '/pages/station-info/scan-camera/scan-camera'
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: url
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
onReady(option) {
|
onReady(option) {
|
||||||
const updateManager = uni.getUpdateManager();
|
const updateManager = uni.getUpdateManager();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<text class="color-000">版本号</text>
|
<text class="color-000">版本号</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="action">
|
<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>
|
||||||
</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>
|
<template>
|
||||||
<view class="page-content">
|
<view class="page-content">
|
||||||
<cu-custom :isBack="true" class="main-topbar bg-main-oil" bgColor="bg-main-oil">
|
<view>
|
||||||
<block slot="content">扫描二维码</block>
|
<cu-custom class="main-topbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
|
||||||
<block slot="backText">返回</block>
|
<block slot="backText">返回</block>
|
||||||
</cu-custom>
|
<block slot="content bg-white"> </block>
|
||||||
<camera class='scan-camera' :flash="flashValue" mode="scanCode" binderror="cameraError" bindscancode='scancode'
|
</cu-custom>
|
||||||
@scancode="scancode" frame-size='large'>
|
<view class="cu-list menu-avatar">
|
||||||
<cover-view class='scan-animation' :animation="animationData2"></cover-view>
|
<view class="cu-item margin-sm margin-left margin-right radius">
|
||||||
<cover-view class="cover-aquare">
|
<view class="cu-avatar bg-gray round lg"></view>
|
||||||
<cover-view class='cover-aquare-inner'></cover-view>
|
<view class="content money-container">
|
||||||
<cover-view class='cover-corner cover-left-top'>
|
<view class="">
|
||||||
<cover-view class="w-line"></cover-view>
|
<view class="text-cut bg-gray"></view>
|
||||||
<cover-view class="h-line"></cover-view>
|
</view>
|
||||||
</cover-view>
|
<view class="text-gray text-sm flex">
|
||||||
<cover-view class='cover-corner cover-right-top'>
|
<view class="text-cut bg-gray"></view> <text class="text-xs bg-gray"></text>
|
||||||
<cover-view class="w-line w1-line"></cover-view>
|
</view>
|
||||||
<cover-view class="h-line h1-line"></cover-view>
|
</view>
|
||||||
</cover-view>
|
<view class="action">
|
||||||
<cover-view class='cover-corner cover-left-bottom'>
|
<view class="text-white money-position padding-left-lg padding-xs bg-main-oil text-lg">
|
||||||
<cover-view class="h-line"></cover-view>
|
<text class="text-xs bg-gray"></text>
|
||||||
<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>
|
</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">
|
<text class="text-blod bg-gray oil-main-color"></text>
|
||||||
<cover-view @tap="touchFlash" class=" text-white lg" v-show="flashValue!='on'">
|
</text>
|
||||||
打开手电筒
|
</view>
|
||||||
</cover-view>
|
<view class="grid col-5 padding-top justify-start">
|
||||||
<cover-view @tap="touchFlash" class=" text-white lg" v-show="flashValue=='on'">
|
<view class="padding-xs" v-for="(item,index) in 4" :key="index">
|
||||||
关闭手电筒
|
<view class="bg-gray"></view>
|
||||||
</cover-view>
|
</view>
|
||||||
</cover-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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,49 +96,61 @@
|
|||||||
once: false,
|
once: false,
|
||||||
lightOn: false,
|
lightOn: false,
|
||||||
animationData2: {},
|
animationData2: {},
|
||||||
flashValue: 'auto'
|
flashValue: 'auto',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
|
||||||
this.donghua()
|
|
||||||
setInterval(() => {
|
|
||||||
this.donghua()
|
|
||||||
}, 6000);
|
|
||||||
},
|
|
||||||
// onShow() {
|
|
||||||
// this.donghua()
|
|
||||||
|
|
||||||
// },
|
onLoad() {
|
||||||
methods: {
|
uni.scanCode({
|
||||||
touchFlash() {
|
scanType: 'qrCode',
|
||||||
if (this.flashValue != 'on') {
|
onlyFromCamera: false,
|
||||||
this.flashValue = 'on'
|
success: (resResult) => {
|
||||||
} else if (this.flashValue == 'on') {
|
// innerAudioContext.play()
|
||||||
this.flashValue = 'off'
|
console.log('play滴~')
|
||||||
}
|
let res = resResult.result
|
||||||
},
|
console.log(res)
|
||||||
donghua() {
|
uni.setStorageSync('qrCode', res)
|
||||||
var animation2 = uni.createAnimation({
|
this.once = true
|
||||||
duration: 1000,
|
let url = ''
|
||||||
timingFunction: 'linear',
|
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
|
})
|
||||||
|
}, 800)
|
||||||
animation2.translateY(235).step({
|
return false;
|
||||||
duration: 3000
|
}
|
||||||
})
|
console.log(tag)
|
||||||
|
uni.redirectTo({
|
||||||
this.animationData2 = animation2.export()
|
// url: `/pages/stationDetail/stationDetail`,
|
||||||
|
url: url,
|
||||||
setTimeout(() => {
|
fail: (err) => {
|
||||||
animation2.translateY(0).step({
|
// console.log(err)
|
||||||
duration: 3000
|
},
|
||||||
|
success: (res) => {
|
||||||
|
// console.log('chengg', res)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.animationData2 = animation2.export()
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.navigateBack({
|
||||||
|
|
||||||
}, 3000)
|
})
|
||||||
},
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
scancode(e) {
|
scancode(e) {
|
||||||
if (!this.once) {
|
if (!this.once) {
|
||||||
var scanUrl = ''
|
var scanUrl = ''
|
||||||
@@ -109,12 +165,25 @@
|
|||||||
uni.setStorageSync('qrCode', res)
|
uni.setStorageSync('qrCode', res)
|
||||||
this.once = true
|
this.once = true
|
||||||
let url = ''
|
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'
|
url = '/pages/stationDetail/stationDetail'
|
||||||
} else {
|
} else if (res.substring(0, 4) == 'ZEYI') {
|
||||||
url = '/pages/stationDetail/ZYSite'
|
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({
|
uni.redirectTo({
|
||||||
// url: `/pages/stationDetail/stationDetail`,
|
// url: `/pages/stationDetail/stationDetail`,
|
||||||
url: url,
|
url: url,
|
||||||
@@ -134,6 +203,7 @@
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.page-content {
|
.page-content {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scan-camera {
|
.scan-camera {
|
||||||
@@ -239,10 +309,81 @@
|
|||||||
|
|
||||||
.cu-avatar {
|
.cu-avatar {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background: transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cu-avatar [class*="cuIcon-"] {
|
.cu-avatar [class*="cuIcon-"] {
|
||||||
padding-left: 1.5rem;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -513,9 +513,17 @@
|
|||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
this.siteData = res.data
|
this.siteData = res.data
|
||||||
// this.carNumber = res.data.vehicleLicenseNum[0]
|
// 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 {
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg ? res.msg : '请确认是否油站二维码',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 800)
|
}, 800)
|
||||||
|
|||||||
@@ -156,6 +156,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// <import src="stationDetail.skeleton.wxml"/>
|
||||||
|
// <template is="skeleton" wx-if="{{loading}}" />
|
||||||
import cloudSiteApi from '@/api/cloud-site.js'
|
import cloudSiteApi from '@/api/cloud-site.js'
|
||||||
import g7Api from '@/api/g7.js'
|
import g7Api from '@/api/g7.js'
|
||||||
import PlateNumberPicker from '@/components/plate-number-picker/plate-number-picker.vue'
|
import PlateNumberPicker from '@/components/plate-number-picker/plate-number-picker.vue'
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import utils from '@/utils/encode'
|
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({
|
const service = axios.create({
|
||||||
|
baseURL: env=='production'?productionUrl:testUrl, //
|
||||||
// baseURL: 'http://192.168.0.33:48080', //
|
// baseURL: 'http://192.168.0.33:48080', //
|
||||||
baseURL: 'https://www.51xingka.net/oilApp', //生产
|
// baseURL: 'https://www.51xingka.net/oilApp', //生产
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
var url = ''
|
var url = ''
|
||||||
// const env = process.env.NODE_ENV
|
let outTimer = null
|
||||||
const env = 'production' // 测试中的生茶、
|
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
// 拦截请求
|
// 拦截请求
|
||||||
@@ -76,6 +85,7 @@ service.interceptors.response.use(
|
|||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if (res.code != 20000) {
|
if (res.code != 20000) {
|
||||||
|
clearTimeout(outTimer)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none"
|
icon: "none"
|
||||||
@@ -93,35 +103,38 @@ service.interceptors.response.use(
|
|||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
if (res.msg === '您已被迫下线') {
|
if (res.msg === '您已被迫下线') {
|
||||||
uni.showModal({
|
outTimer = setTimeout(() => {
|
||||||
title: '下线提醒',
|
uni.showModal({
|
||||||
confirmText: '重新登录',
|
title: '下线提醒',
|
||||||
cancelText: "退出",
|
confirmText: '重新登录',
|
||||||
content: '您的账号在另一微信下登录了星油云站,请确认是否本加油站工作人员操作',
|
cancelText: "退出",
|
||||||
success: function(res) {
|
content: '您的账号在另一微信下登录了星油云站,请确认是否本加油站工作人员操作',
|
||||||
if (res.confirm) {
|
success: function(res) {
|
||||||
uni.reLaunch({
|
if (res.confirm) {
|
||||||
url: '/pages/startPage/startPage',
|
uni.reLaunch({
|
||||||
success: () => {
|
url: '/pages/startPage/startPage',
|
||||||
console.log('跳转成功')
|
success: () => {
|
||||||
},
|
console.log('跳转成功')
|
||||||
fail: (err) => {
|
},
|
||||||
console.log(err)
|
fail: (err) => {
|
||||||
}
|
console.log(err)
|
||||||
})
|
}
|
||||||
} else if (res.cancel) {
|
})
|
||||||
uni.reLaunch({
|
} else if (res.cancel) {
|
||||||
url: '/pages/login/boforeLogin/boforeLogin',
|
uni.reLaunch({
|
||||||
success: () => {
|
url: '/pages/login/boforeLogin/boforeLogin',
|
||||||
console.log('跳转成功')
|
success: () => {
|
||||||
},
|
console.log('跳转成功')
|
||||||
fail: (err) => {
|
},
|
||||||
console.log(err)
|
fail: (err) => {
|
||||||
}
|
console.log(err)
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user