更新
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<view v-show="isTransfer" :class="isTransfer?'active':''" class="card-container second">
|
<view v-show="isTransfer" :class="isTransfer?'active':''" class="card-container second">
|
||||||
<view class="inCard" @click="sweepCard">
|
<view class="inCard" @click="sweepCard">
|
||||||
<text>扫码</text>
|
<text>扫一扫</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="inCard phone" @tap='gotocard'>
|
<view class="inCard phone" @tap='gotocard'>
|
||||||
<text>手机号码</text>
|
<text>手机号码</text>
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import serve from '@/api/account.js'
|
||||||
export default {
|
export default {
|
||||||
filters: {
|
filters: {
|
||||||
companyType(e) {
|
companyType(e) {
|
||||||
@@ -108,8 +109,17 @@
|
|||||||
sweepCard() {
|
sweepCard() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res)
|
let result = JSON.parse(res.result)
|
||||||
let {} = res.result
|
if (result.qrcodeText) {
|
||||||
|
serve.checkQrStr(result.giveCustomerId, result.qrcodeText).then(res => {
|
||||||
|
let currentCard = this.card || []
|
||||||
|
this.$emit('buttomPopup', {
|
||||||
|
...currentCard,
|
||||||
|
...result
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<swiper-item v-for="(item,index) in cardList" :key="index" :class="cardCur==index?'cur':''">
|
<swiper-item v-for="(item,index) in cardList" :key="index" :class="cardCur==index?'cur':''">
|
||||||
<!-- <image :src="imgURL+ (item.type=='zs'?'card-zs.png':'card-other.png')" mode="aspectFill">
|
<!-- <image :src="imgURL+ (item.type=='zs'?'card-zs.png':'card-other.png')" mode="aspectFill">
|
||||||
</image> -->
|
</image> -->
|
||||||
<oil-card :card="item"></oil-card>
|
<oil-card :card="item" @buttomPopup="buttomPopup"></oil-card>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -89,15 +89,19 @@
|
|||||||
<view class="bg-white">
|
<view class="bg-white">
|
||||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<transBlcok ref="transBlcok" @reloadCard="getCards"/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import transBlcok from '@/components/transBlock/index.vue'
|
||||||
import oilCard from '../../components/oil-card/oil-card.vue'
|
import oilCard from '../../components/oil-card/oil-card.vue'
|
||||||
import accountApi from '@/api/account.js'
|
import accountApi from '@/api/account.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
oilCard
|
oilCard,
|
||||||
|
transBlcok
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -180,6 +184,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
buttomPopup(result) {
|
||||||
|
this.$refs.transBlcok._open(result)
|
||||||
|
},
|
||||||
getTotalOilCardInfo() {
|
getTotalOilCardInfo() {
|
||||||
accountApi.getTotalOilCardInfo().then(res => {
|
accountApi.getTotalOilCardInfo().then(res => {
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
@@ -226,8 +233,9 @@
|
|||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
|
|
||||||
let staging = res.data.filter(item => item.companyType != 5).filter(item => !this.hideCard.includes(item
|
let staging = res.data.filter(item => item.companyType != 5).filter(item => !this
|
||||||
.companyId))
|
.hideCard.includes(item
|
||||||
|
.companyId))
|
||||||
staging.forEach(item => {
|
staging.forEach(item => {
|
||||||
this.$set(item, 'currentPage', 1)
|
this.$set(item, 'currentPage', 1)
|
||||||
this.$set(item, 'loadStatus', 'more')
|
this.$set(item, 'loadStatus', 'more')
|
||||||
@@ -265,7 +273,9 @@
|
|||||||
for (let value of map.values()) {
|
for (let value of map.values()) {
|
||||||
values.push(value)
|
values.push(value)
|
||||||
}
|
}
|
||||||
values.sort((a,b)=>{return a - b})
|
values.sort((a, b) => {
|
||||||
|
return a - b
|
||||||
|
})
|
||||||
values.reverse()
|
values.reverse()
|
||||||
values.forEach(value => {
|
values.forEach(value => {
|
||||||
keys.forEach(key => {
|
keys.forEach(key => {
|
||||||
@@ -347,7 +357,11 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style lang="scss" scoped>
|
||||||
|
/deep/.vue-ref {
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.boxsingForCard {
|
.boxsingForCard {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,240 +1,248 @@
|
|||||||
<template xlang="wxml" minapp="mpvue">
|
<template xlang="wxml" minapp="mpvue">
|
||||||
<view class="tki-qrcode">
|
<view class="tki-qrcode">
|
||||||
<image src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/qr-bg.png" mode="" class="bgs"></image>
|
<image v-if="isHaveBg" class="bgs" src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/qr-bg.png" />
|
||||||
<!-- #ifndef MP-ALIPAY -->
|
|
||||||
<canvas class="tki-qrcode-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
<canvas class="tki-qrcode-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
||||||
<!-- #endif -->
|
<!-- <canvas :id="cid" :width="cpSize" :height="cpSize" class="tki-qrcode-canvas" /> -->
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
<!-- <image v-show="show" :src="result" class="erweima" :style="{width:cpSize+'px',height:cpSize+'px'}" /> -->
|
||||||
<canvas :id="cid" :width="cpSize" :height="cpSize" class="tki-qrcode-canvas" />
|
|
||||||
<!-- #endif -->
|
|
||||||
<image v-show="show" :src="result" class="erweima" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import QRCode from "./qrcode.js"
|
import QRCode from "./qrcode.js"
|
||||||
// import indexBackgroundImage from "@/static/img/qr-bg.png"
|
// import indexBackgroundImage from "@/static/img/qr-bg.png"
|
||||||
|
|
||||||
let qrcode
|
let qrcode
|
||||||
export default {
|
export default {
|
||||||
name: "tki-qrcode",
|
name: "tki-qrcode",
|
||||||
props: {
|
props: {
|
||||||
cid: {
|
cid: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'tki-qrcode-canvas'
|
default: 'tki-qrcode-canvas'
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 200
|
default: 200
|
||||||
},
|
},
|
||||||
unit: {
|
unit: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'upx'
|
default: 'upx'
|
||||||
},
|
},
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
val: {
|
val: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
background: {
|
background: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '#ffffff'
|
default: '#fff'
|
||||||
},
|
},
|
||||||
foreground: {
|
foreground: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '#000000'
|
default: '#000'
|
||||||
},
|
},
|
||||||
pdground: {
|
pdground: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '#000000'
|
default: '#000'
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
iconSize: {
|
iconSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 40
|
default: 40
|
||||||
},
|
},
|
||||||
lv: {
|
lv: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 3
|
default: 3
|
||||||
},
|
},
|
||||||
onval: {
|
onval: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
loadMake: {
|
loadMake: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
usingComponents: {
|
usingComponents: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
showLoading: {
|
showLoading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
loadingText: {
|
loadingText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '二维码生成中'
|
default: '二维码生成中'
|
||||||
},
|
},
|
||||||
},
|
isHaveBg: {
|
||||||
data() {
|
type: Boolean,
|
||||||
return {
|
default: true
|
||||||
result: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_makeCode() {
|
|
||||||
let that = this
|
|
||||||
if (!this._empty(this.val)) {
|
|
||||||
qrcode = new QRCode({
|
|
||||||
context: that, // 上下文环境
|
|
||||||
canvasId:that.cid, // canvas-id
|
|
||||||
usingComponents: that.usingComponents, // 是否是自定义组件
|
|
||||||
showLoading: that.showLoading, // 是否显示loading
|
|
||||||
loadingText: that.loadingText, // loading文字
|
|
||||||
text: that.val, // 生成内容
|
|
||||||
size: that.cpSize, // 二维码大小
|
|
||||||
background: that.background, // 背景色
|
|
||||||
foreground: that.foreground, // 前景色
|
|
||||||
pdground: that.pdground, // 定位角点颜色
|
|
||||||
correctLevel: that.lv, // 容错级别
|
|
||||||
image: that.icon, // 二维码图标
|
|
||||||
imageSize: that.iconSize,// 二维码图标大小
|
|
||||||
cbResult: function (res) { // 生成二维码的回调
|
|
||||||
that._result(res)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '二维码内容不能为空',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_clearCode() {
|
data() {
|
||||||
this._result('')
|
return {
|
||||||
qrcode.clear()
|
result: '',
|
||||||
},
|
|
||||||
_saveCode() {
|
|
||||||
let that = this;
|
|
||||||
if (this.result != "") {
|
|
||||||
uni.saveImageToPhotosAlbum({
|
|
||||||
filePath: that.result,
|
|
||||||
success: function () {
|
|
||||||
uni.showToast({
|
|
||||||
title: '二维码保存成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_result(res) {
|
methods: {
|
||||||
this.result = res;
|
_makeCode() {
|
||||||
this.$emit('result', res)
|
|
||||||
},
|
let that = this
|
||||||
_empty(v) {
|
|
||||||
let tp = typeof v,
|
|
||||||
rt = false;
|
|
||||||
if (tp == "number" && String(v) == "") {
|
|
||||||
rt = true
|
|
||||||
} else if (tp == "undefined") {
|
|
||||||
rt = true
|
|
||||||
} else if (tp == "object") {
|
|
||||||
if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
|
|
||||||
} else if (tp == "string") {
|
|
||||||
if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
|
|
||||||
} else if (tp == "function") {
|
|
||||||
rt = false
|
|
||||||
}
|
|
||||||
return rt
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
size: function (n, o) {
|
|
||||||
if (n != o && !this._empty(n)) {
|
|
||||||
this.cSize = n
|
|
||||||
if (!this._empty(this.val)) {
|
if (!this._empty(this.val)) {
|
||||||
setTimeout(() => {
|
qrcode = new QRCode({
|
||||||
this._makeCode()
|
context: that, // 上下文环境
|
||||||
}, 100);
|
canvasId: that.cid, // canvas-id
|
||||||
|
usingComponents: that.usingComponents, // 是否是自定义组件
|
||||||
|
showLoading: that.showLoading, // 是否显示loading
|
||||||
|
loadingText: that.loadingText, // loading文字
|
||||||
|
text: that.val, // 生成内容
|
||||||
|
size: that.cpSize, // 二维码大小
|
||||||
|
background: that.background, // 背景色
|
||||||
|
foreground: that.foreground, // 前景色
|
||||||
|
pdground: that.pdground, // 定位角点颜色
|
||||||
|
correctLevel: that.lv, // 容错级别
|
||||||
|
image: that.icon, // 二维码图标
|
||||||
|
imageSize: that.iconSize, // 二维码图标大小
|
||||||
|
cbResult: function(res) { // 生成二维码的回调
|
||||||
|
// that._result(res)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '二维码内容不能为空',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_clearCode() {
|
||||||
|
// this._result('')
|
||||||
|
qrcode.clear()
|
||||||
|
},
|
||||||
|
_saveCode() {
|
||||||
|
let that = this;
|
||||||
|
if (this.result != "") {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: that.result,
|
||||||
|
success: function() {
|
||||||
|
uni.showToast({
|
||||||
|
title: '二维码保存成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_result(res) {
|
||||||
|
this.result = res;
|
||||||
|
this.$emit('result', res)
|
||||||
|
},
|
||||||
|
_empty(v) {
|
||||||
|
let tp = typeof v,
|
||||||
|
rt = false;
|
||||||
|
if (tp == "number" && String(v) == "") {
|
||||||
|
rt = true
|
||||||
|
} else if (tp == "undefined") {
|
||||||
|
rt = true
|
||||||
|
} else if (tp == "object") {
|
||||||
|
if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
|
||||||
|
} else if (tp == "string") {
|
||||||
|
if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
|
||||||
|
} else if (tp == "function") {
|
||||||
|
rt = false
|
||||||
|
}
|
||||||
|
return rt
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
size: function(n, o) {
|
||||||
|
if (n != o && !this._empty(n)) {
|
||||||
|
this.cSize = n
|
||||||
|
if (!this._empty(this.val)) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this._makeCode()
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
val: function(n, o) {
|
||||||
|
if (this.onval) {
|
||||||
|
if (n != o && !this._empty(n)) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this._makeCode()
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
val: function (n, o) {
|
computed: {
|
||||||
if (this.onval) {
|
cpSize() {
|
||||||
if (n != o && !this._empty(n)) {
|
if (this.unit == "upx") {
|
||||||
|
return uni.upx2px(this.size)
|
||||||
|
} else {
|
||||||
|
return this.size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
if (this.loadMake) {
|
||||||
|
if (!this._empty(this.val)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._makeCode()
|
this._makeCode()
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
}
|
||||||
computed: {
|
|
||||||
cpSize() {
|
|
||||||
if(this.unit == "upx"){
|
|
||||||
return uni.upx2px(this.size)
|
|
||||||
}else{
|
|
||||||
return this.size
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted: function () {
|
|
||||||
if (this.loadMake) {
|
|
||||||
if (!this._empty(this.val)) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this._makeCode()
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.tki-qrcode{
|
.tki-qrcode {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.erweima{
|
|
||||||
padding: 2%;
|
.erweima {
|
||||||
background: #ffff;
|
padding: 2%;
|
||||||
border:1px solid #f1f1f1;
|
background: #ffff;
|
||||||
|
border: 1px solid #f1f1f1;
|
||||||
}
|
}
|
||||||
.bgs{
|
|
||||||
|
.bgs {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 2%;
|
padding: 2%;
|
||||||
}
|
}
|
||||||
.tki-qrcode {
|
|
||||||
position: relative;
|
.tki-qrcode {
|
||||||
padding:8%;
|
position: relative;
|
||||||
background-image:url('https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/qr-bg.png') ;
|
padding: 8%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
/* background-image:url('https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/qr-bg.png') ; */
|
||||||
.tki-qrcode-canvas {
|
}
|
||||||
|
|
||||||
|
.tki-qrcode-canvas {
|
||||||
|
display: inline-block;
|
||||||
|
background: 'transparent'
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .tki-qrcode-canvas {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: -99999upx;
|
top: -99999upx;
|
||||||
left: -99999upx;
|
left: -99999upx;
|
||||||
z-index: -99999;
|
z-index: -99999;
|
||||||
}
|
} */
|
||||||
image{
|
image {}
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,17 +4,24 @@
|
|||||||
<block slot="backText">返回</block>
|
<block slot="backText">返回</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<view class="oil-qrcode">
|
<view class="oil-qrcode">
|
||||||
<view class="info">
|
<view class="round first"></view>
|
||||||
<view>肖师傅</view>
|
<view class="card">
|
||||||
<view>13216655221</view>
|
<view class="info">
|
||||||
<image></image>
|
<view>{{user.name || ''}}</view>
|
||||||
|
<view>{{user.userPhone || ''}}</view>
|
||||||
|
</view>
|
||||||
|
<tki-qrcode ref="qrcode" cid="2" :val="qrcodeText" :size="400" :isHaveBg="false" pdground="#000"
|
||||||
|
foreground="#000" background="#fff" onval showLoading loadMake />
|
||||||
|
<view class="tip">扫一扫上面的二维码图案,给我赠油,可截图保存。</view>
|
||||||
|
<button class="button" @click="regeneration">重新生成</button>
|
||||||
</view>
|
</view>
|
||||||
<tki-qrcode ref="qrcode" cid="2" :val="qrcodeText" :size="400" onval showLoading loadMake />
|
<view class="tip-sec">注: 重新生成收油码后, 以前截图保存的收油码将作废!</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import serve from '@/api/account.js'
|
||||||
import tkiQrcode from '@/BagStation/pages/components/tki-qrcode/tki-qrcode.vue'
|
import tkiQrcode from '@/BagStation/pages/components/tki-qrcode/tki-qrcode.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -22,7 +29,29 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
qrcodeText:'13216655221'
|
qrcodeText: '',
|
||||||
|
user: uni.getStorageSync('user')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getQrStr()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getQrStr(reset = 0) {
|
||||||
|
console.log('this.user', this.user)
|
||||||
|
if (this.user.id) {
|
||||||
|
serve.getQrStr(this.user.id, reset).then(res => {
|
||||||
|
if (!res.data) return
|
||||||
|
this.qrcodeText = JSON.stringify({
|
||||||
|
giveCustomerId: this.user.id,
|
||||||
|
qrcodeText: res.data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
regeneration() {
|
||||||
|
this.getQrStr(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,33 +59,70 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.round {}
|
||||||
|
|
||||||
.oil-qrcode {
|
.oil-qrcode {
|
||||||
height: 100vh;
|
height: calc(100vh - 87px);
|
||||||
padding-top: 200rpx;
|
padding-top: 200rpx;
|
||||||
text-align: center;
|
background: #FF6700;
|
||||||
|
|
||||||
.info {
|
.card {
|
||||||
position: relative;
|
margin: 0 auto;
|
||||||
display: inline-block;
|
padding-top: 70rpx;
|
||||||
text-align: left;
|
padding-bottom: 50rpx;
|
||||||
width: 400rpx;
|
width: 598rpx;
|
||||||
padding: 20rpx 20rpx 20rpx 100rpx;
|
background: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
|
||||||
view {
|
.info {
|
||||||
&:nth-of-type(1) {}
|
view {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
&:nth-of-type(2) {
|
&:nth-of-type(1) {
|
||||||
margin-top: 15rpx;
|
color: #000;
|
||||||
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(2) {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
.tip {
|
||||||
position: absolute;
|
margin-top: 70rpx;
|
||||||
left: 0;
|
color: #9E9E9E;
|
||||||
top: 0;
|
font-size: 22rpx;
|
||||||
width: 50rpx;
|
text-align: center;
|
||||||
height: 50rpx;
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
margin-top: 50rpx;
|
||||||
|
margin-right: 53rpx;
|
||||||
|
width: 172rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
background: #409eff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tip-sec {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 70rpx;
|
||||||
|
width: 100%;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.tki-qrcode {
|
||||||
|
margin-top: 71rpx;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
154
api/account.js
154
api/account.js
@@ -3,35 +3,35 @@ const service_name = "oil-site"
|
|||||||
const group_name = "oilSiteAccountAppInfo"
|
const group_name = "oilSiteAccountAppInfo"
|
||||||
export default {
|
export default {
|
||||||
//统计用户油卡总数量、总余额
|
//统计用户油卡总数量、总余额
|
||||||
getTotalOilCardInfo (data) {
|
getTotalOilCardInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/getTotalOilCardInfo`,
|
url: `/${service_name}/${group_name}/getTotalOilCardInfo`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data:data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//查询不可用油卡
|
//查询不可用油卡
|
||||||
getSyncDeductions (data) {
|
getSyncDeductions(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/oil-dict/areaCode/getSyncDeductions`,
|
url: `/oil-dict/areaCode/getSyncDeductions`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data:data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取用户油卡账户信息 (个人 / 自营 / 外请)
|
//获取用户油卡账户信息 (个人 / 自营 / 外请)
|
||||||
getUserAccount (data) {
|
getUserAccount(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/getUserAccount`,
|
url: `/${service_name}/${group_name}/getUserAccount`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data:data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserInfo(data) {
|
getUserInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/getUserSetInfo`,
|
url: `/${service_name}/${group_name}/getUserSetInfo`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data:data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// logout(){
|
// logout(){
|
||||||
// return request({
|
// return request({
|
||||||
@@ -39,42 +39,42 @@ export default {
|
|||||||
// method: 'get'
|
// method: 'get'
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
logout(){
|
logout() {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/logoutAuthSystem/XOIL_DRIVER`,
|
url: `/${service_name}/${group_name}/logoutAuthSystem/XOIL_DRIVER`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCustomerAccount(){
|
getCustomerAccount() {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/getCustomerAccount`,
|
url: `/${service_name}/${group_name}/getCustomerAccount`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserPayInfo(data) {
|
getUserPayInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/getUserPayInfo`,
|
url: `/${service_name}/${group_name}/getUserPayInfo`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data:data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pollingPayResult(id) {
|
pollingPayResult(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/pollingPayResult/${id}`,
|
url: `/${service_name}/${group_name}/pollingPayResult/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getOilCardRecordByPage(data) {
|
getOilCardRecordByPage(data) {
|
||||||
return request({
|
|
||||||
url: `/${service_name}/${group_name}/getOilCardRecordByPage`,
|
|
||||||
method: 'post',
|
|
||||||
data:data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
switchAccountInfo(role){
|
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/${group_name}/switchAccountInfo/${role}`,
|
url: `/${service_name}/${group_name}/getOilCardRecordByPage`,
|
||||||
method: 'get'
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchAccountInfo(role) {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/${group_name}/switchAccountInfo/${role}`,
|
||||||
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// getByPhone(role){ //old 获取用户信息
|
// getByPhone(role){ //old 获取用户信息
|
||||||
@@ -83,31 +83,43 @@ export default {
|
|||||||
// method: 'get'
|
// method: 'get'
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
getByPhone(role){ //new 获取用户信息
|
getByPhone(role) { //new 获取用户信息
|
||||||
return request({
|
return request({
|
||||||
url: `/oil-user/sysCustomerInfo/getByPhoneNoGlobalEnable/${role}`,
|
url: `/oil-user/sysCustomerInfo/getByPhoneNoGlobalEnable/${role}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
giveCard(role) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-user/sysCustomerInfo/giveCard`,
|
||||||
|
method: 'post',
|
||||||
|
data: role
|
||||||
|
})
|
||||||
|
},
|
||||||
|
oilCustomerAccountRecord(role) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-finance/oilCustomerAccountRecord/giveCard`,
|
||||||
|
method: 'post',
|
||||||
|
data: role
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getNewUserAccount(data) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-site/oilSiteAccountAppInfo/getNewUserAccount`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQrStr(id, reset) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-user/oilCustomerInfo/getQrStr/${id}?reset=${reset}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkQrStr(id, qrStr) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-user/oilCustomerInfo/checkQrStr/${id}?qrStr=${qrStr}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
},
|
},
|
||||||
giveCard(role){
|
|
||||||
return request({
|
|
||||||
url: `/oil-user/sysCustomerInfo/giveCard`,
|
|
||||||
method: 'post',
|
|
||||||
data:role
|
|
||||||
})
|
|
||||||
},
|
|
||||||
oilCustomerAccountRecord(role){
|
|
||||||
return request({
|
|
||||||
url: `/oil-finance/oilCustomerAccountRecord/giveCard`,
|
|
||||||
method: 'post',
|
|
||||||
data:role
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getNewUserAccount(data){
|
|
||||||
return request({
|
|
||||||
url: `/oil-site/oilSiteAccountAppInfo/getNewUserAccount`,
|
|
||||||
method: 'post',
|
|
||||||
data:data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
240
components/transBlock/index.vue
Normal file
240
components/transBlock/index.vue
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<uni-popup ref="indexPopup" type="bottom">
|
||||||
|
<view class="trans-block">
|
||||||
|
<view class="title">请输入赠卡金额</view>
|
||||||
|
<text>¥</text><input v-model="params.occurAmount" class="uni-input" type="digit"
|
||||||
|
:placeholder=" '最多可以赠送'+ info.balance + '元'" />
|
||||||
|
<button @click="sendTextMessage">确认赠卡</button>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
|
||||||
|
<uni-popup ref="smscodePopup" type="center">
|
||||||
|
<view class="poput_tip">
|
||||||
|
<view :style="'background-image: url('+popupbg+ ');'" class="popup_header">短信身份验证</view>
|
||||||
|
<view style="margin: 20rpx auto;width: 90%;">转出验证:本次转出需要短信确认,验证码 已发送至您的手机
|
||||||
|
{{phoneHandle(this.user.userPhone)}}
|
||||||
|
</view>
|
||||||
|
<xt-verify-code class="code" v-model="params.code" @confirm="submit"></xt-verify-code>
|
||||||
|
<button @click="send" class="oliout_butten"
|
||||||
|
style="width:60%; border-radius: 50rpx;">{{time===0?'重新发送验证码':time+'S'}}
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
|
||||||
|
<uni-popup ref="successPopupt" type="center">
|
||||||
|
<view class="poput_tip">
|
||||||
|
<view :style="'background-image: url('+popupbg+ ');'" class="popup_header">温馨提示</view>
|
||||||
|
<view style="margin: 20rpx auto;width: 90%;text-align: center;">
|
||||||
|
<view class="container_img">
|
||||||
|
<image class="success_img" src="../../static/img/success.png"></image>
|
||||||
|
</view>
|
||||||
|
转出成功!
|
||||||
|
</view>
|
||||||
|
<button @click="$refs.successPopupt.close()" class="oliout_butten"
|
||||||
|
style="width:60%; border-radius: 50rpx;">确认</button>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import serve from '@/api/account.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
popupbg: 'https://xoi-support.oss-cn-hangzhou.aliyuncs.com/web/cuscomtrac/popupbg.png',
|
||||||
|
time: 0,
|
||||||
|
price: '',
|
||||||
|
info: {},
|
||||||
|
user: uni.getStorageSync('user') || {},
|
||||||
|
params: {
|
||||||
|
occurAmount: '',
|
||||||
|
code: '',
|
||||||
|
verifyCodeToken: '',
|
||||||
|
billType: 'OIL_DONATION',
|
||||||
|
createSource: 'XOIL_DRIVER_WECHAT_APPLET',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
_open(item) {
|
||||||
|
if (item) {
|
||||||
|
console.log('itemitemitemitem', item)
|
||||||
|
this.params.occurAmount = ''
|
||||||
|
this.info = item
|
||||||
|
this.$refs.indexPopup.open()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sendTextMessage() {
|
||||||
|
if (!this.submitCheck()) return
|
||||||
|
|
||||||
|
if (this.time === 0) {
|
||||||
|
this.params.code = ''
|
||||||
|
this.params.verifyCodeToken = ''
|
||||||
|
serve.giveCard({
|
||||||
|
phone: this.user.userPhone
|
||||||
|
}).then(res => {
|
||||||
|
this.time = 60
|
||||||
|
this.params.verifyCodeToken = res.data.verifyCodeToken
|
||||||
|
this.timefn()
|
||||||
|
this.$refs.smscodePopup.open()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitCheck() {
|
||||||
|
let {
|
||||||
|
occurAmount
|
||||||
|
} = this.params
|
||||||
|
if (!occurAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入赠送金额',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (occurAmount > this.info.balance) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '超过最多赠送金额',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (occurAmount < 5) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '赠送金额不可低于5元',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
let {
|
||||||
|
giveCustomerId, //收款方
|
||||||
|
companyId, //付款方
|
||||||
|
accountCardCode //付款方
|
||||||
|
} = this.info
|
||||||
|
|
||||||
|
serve.oilCustomerAccountRecord({
|
||||||
|
giveCustomerId,
|
||||||
|
givePhone: '',
|
||||||
|
companyId,
|
||||||
|
payerCustomerId: this.user.id,
|
||||||
|
accountCardCode,
|
||||||
|
...this.params
|
||||||
|
}).then(res => {
|
||||||
|
this.$refs.indexPopup.close()
|
||||||
|
this.$refs.smscodePopup.close()
|
||||||
|
this.$refs.successPopupt.open()
|
||||||
|
this.$emit('reloadCard')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
phoneHandle(e) {
|
||||||
|
return e.substr(0, 3) + "****" + e.substr(7);
|
||||||
|
},
|
||||||
|
|
||||||
|
timefn() {
|
||||||
|
if (this.time !== 0) {
|
||||||
|
this.time--
|
||||||
|
setTimeout(() => {
|
||||||
|
this.timefn()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.poput_tip {
|
||||||
|
width: 85vw;
|
||||||
|
height: 40vh;
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup_header {
|
||||||
|
height: 20%;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #FE0505;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-size: 100% 30vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container_img {
|
||||||
|
height: 100rpx;
|
||||||
|
width: 100rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
margin-bottom: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .xt__verify-code .xt__input-ground .xt__box-box.data-v-e4b72d00 {
|
||||||
|
// height: 100rpx !important;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .xt__verify-code {
|
||||||
|
// width: 90% !important;
|
||||||
|
// margin: 0 auto !important;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.oliout_butten {
|
||||||
|
width: 90vw;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #FE0505;
|
||||||
|
margin-top: 60rpx;
|
||||||
|
color: #F0F0F0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trans-block {
|
||||||
|
padding: 54rpx 43rpx 0 63rpx;
|
||||||
|
width: 100%;
|
||||||
|
height: 679rpx;
|
||||||
|
background: #FFF;
|
||||||
|
border-radius: 15rpx 15rpx 0 0;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin-bottom: 35rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 550;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
>text {
|
||||||
|
position: relative;
|
||||||
|
top: -10rpx;
|
||||||
|
font-size: 42rpx;
|
||||||
|
font-weight: 550;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
>input {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
>button {
|
||||||
|
margin-top: 320rpx;
|
||||||
|
width: 441rpx;
|
||||||
|
height: 89rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #FF6700;
|
||||||
|
border-radius: 10rpx
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -159,10 +159,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
|
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
|
||||||
<three-sites @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
|
<three-sites @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
|
||||||
|
<transBlcok ref="transBlcok" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import transBlcok from '@/components/transBlock/index.vue'
|
||||||
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
|
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
|
||||||
import msgModels from '../../components/showModels.vue'
|
import msgModels from '../../components/showModels.vue'
|
||||||
import accountApi from '@/api/account.js'
|
import accountApi from '@/api/account.js'
|
||||||
@@ -176,7 +178,8 @@
|
|||||||
siteItem,
|
siteItem,
|
||||||
threeSites,
|
threeSites,
|
||||||
msgModels,
|
msgModels,
|
||||||
SwitchEnterprises
|
SwitchEnterprises,
|
||||||
|
transBlcok
|
||||||
// slFilter
|
// slFilter
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -331,10 +334,7 @@
|
|||||||
onReady() {
|
onReady() {
|
||||||
let _that = this
|
let _that = this
|
||||||
let IsOtherUser = _that.isOther
|
let IsOtherUser = _that.isOther
|
||||||
console.log(IsOtherUser, '这里是判断是否为卡力')
|
|
||||||
console.log('这里是onShow', IsOtherUser, '++++++')
|
|
||||||
if (IsOtherUser) {
|
if (IsOtherUser) {
|
||||||
console.log('首页 卡力 进入')
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '卡力用户只支持跳转登录',
|
title: '卡力用户只支持跳转登录',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -350,10 +350,7 @@
|
|||||||
this.refreshLocation()
|
this.refreshLocation()
|
||||||
let _that = this
|
let _that = this
|
||||||
let IsOtherUser = _that.isOther
|
let IsOtherUser = _that.isOther
|
||||||
console.log(IsOtherUser, '这里是判断是否为卡力')
|
|
||||||
console.log('这里是onShow', IsOtherUser, '++++++')
|
|
||||||
if (IsOtherUser) {
|
if (IsOtherUser) {
|
||||||
console.log('首页 卡力 进入')
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '卡力用户只支持跳转登录',
|
title: '卡力用户只支持跳转登录',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -363,15 +360,13 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log('首页 非卡力 进入')
|
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
let _that = this
|
let _that = this
|
||||||
let IsOtherUser = _that.isOther
|
let IsOtherUser = _that.isOther
|
||||||
// console.log(IsOtherUser, '这里是判断是否为卡力')
|
|
||||||
// console.log('这里是onLoad', IsOtherUser, '++++++')
|
|
||||||
if (IsOtherUser) {
|
if (IsOtherUser) {
|
||||||
console.log('首页 卡力 进入')
|
// 卡力
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '卡力用户只支持跳转登录',
|
title: '卡力用户只支持跳转登录',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -381,7 +376,7 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// console.log('首页 非卡力 进入测试++')
|
//非卡力
|
||||||
this.reverseGeocoder(this.location);
|
this.reverseGeocoder(this.location);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
let startParamsData = uni.getStorageSync('isJump') || null;
|
let startParamsData = uni.getStorageSync('isJump') || null;
|
||||||
@@ -417,20 +412,12 @@
|
|||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// uni.navigateTo({
|
|
||||||
// url: `/BagStation/pages/stationDetail/stieQr?siteId=1372099296709754880&activeChannelCode=XOIL`
|
|
||||||
// })
|
|
||||||
// uni.redirectTo({
|
|
||||||
// url:'/BagStation/pages/makeOrder/makeOrder'
|
|
||||||
// // url:'/BagStation/pages/makeOrder/payResult?status=success'
|
|
||||||
// })
|
|
||||||
// url:'/BagStation/pages/makeOrder/payResult?status=success'
|
|
||||||
this.getSiteList();
|
this.getSiteList();
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
beforeCreate() {},
|
beforeCreate() {},
|
||||||
onReady() {
|
onReady() {
|
||||||
// this.getSiteList()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
swiperClick(item, index) {
|
swiperClick(item, index) {
|
||||||
@@ -475,33 +462,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// refreshLocation() {
|
|
||||||
// wx.showLoading({
|
|
||||||
// title: '定位中...',
|
|
||||||
// mask: true,
|
|
||||||
// })
|
|
||||||
// return new Promise((resolve, reject) => {
|
|
||||||
// let _locationChangeFn = (res) => {
|
|
||||||
// console.log('location change', res)
|
|
||||||
// uni.setStorageSync('location', res)
|
|
||||||
// this.getSiteList();
|
|
||||||
// wx.hideLoading()
|
|
||||||
// wx.offLocationChange(_locationChangeFn)
|
|
||||||
// }
|
|
||||||
// wx.startLocationUpdate({
|
|
||||||
// success: (res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// wx.onLocationChange(_locationChangeFn)
|
|
||||||
// resolve()
|
|
||||||
// },
|
|
||||||
// fail: (err) => {
|
|
||||||
// console.log('获取当前位置失败', err)
|
|
||||||
// wx.hideLoading()
|
|
||||||
// reject()
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
refreshLocation() {
|
refreshLocation() {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
@@ -509,7 +470,6 @@
|
|||||||
uni.setStorageSync('location', res)
|
uni.setStorageSync('location', res)
|
||||||
},
|
},
|
||||||
complete: (res) => {
|
complete: (res) => {
|
||||||
// console.log('定位',res)
|
|
||||||
this.getSiteList()
|
this.getSiteList()
|
||||||
var msgTip = ''
|
var msgTip = ''
|
||||||
if (res.errMsg == 'getLocation:fail auth deny') {
|
if (res.errMsg == 'getLocation:fail auth deny') {
|
||||||
@@ -534,7 +494,6 @@
|
|||||||
if (this.showAuthFrzen <= new Date().getTime()) {
|
if (this.showAuthFrzen <= new Date().getTime()) {
|
||||||
// 一小时后再提示
|
// 一小时后再提示
|
||||||
uni.setStorageSync('showAuthFrzen', new Date().getTime() + 10 * 1000)
|
uni.setStorageSync('showAuthFrzen', new Date().getTime() + 10 * 1000)
|
||||||
// uni.setStorageSync('showAuthFrzen', new Date().getTime() + 1 * 60 * 60 * 1000)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -543,8 +502,6 @@
|
|||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
let _that = this
|
let _that = this
|
||||||
let IsOtherUser = _that.isOther
|
let IsOtherUser = _that.isOther
|
||||||
// console.log(IsOtherUser, '这里是判断是否为卡力')
|
|
||||||
// console.log('这里是getUserAuthInfo', IsOtherUser, '++++++')
|
|
||||||
if (IsOtherUser) {
|
if (IsOtherUser) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '卡力用户只支持跳转登录',
|
title: '卡力用户只支持跳转登录',
|
||||||
@@ -584,27 +541,13 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
shadoumeiyou(index) {
|
shadoumeiyou(index) {
|
||||||
// if(!uni.getStorageSync('user')){
|
|
||||||
// uni.showToast({
|
|
||||||
// title:'请先登登录',
|
|
||||||
// icon:'none'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/tabbar/station/stationList'
|
url: '/pages/tabbar/station/stationList'
|
||||||
})
|
})
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
// const referer = '星油云'; //调用插件的app的名称
|
|
||||||
// const endPoint = JSON.stringify({
|
|
||||||
// name: '输入目的地',
|
|
||||||
// latitude: 39.89631551,
|
|
||||||
// longitude: 116.323459711
|
|
||||||
// });
|
|
||||||
// wx.navigateTo({
|
|
||||||
// url: 'plugin://routePlan/index?key=' + this.qqMapKey + '&referer=' + referer +
|
|
||||||
// '&endPoint=' + endPoint
|
|
||||||
// })
|
|
||||||
if (!uni.getStorageSync('user')) {
|
if (!uni.getStorageSync('user')) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '请您登录',
|
title: '请您登录',
|
||||||
@@ -623,19 +566,13 @@
|
|||||||
uni.removeStorageSync("origins")
|
uni.removeStorageSync("origins")
|
||||||
uni.removeStorageSync("destination")
|
uni.removeStorageSync("destination")
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
// url:'../../../BagStation/pages/routePlain/routePlain',
|
|
||||||
url: '../../../BagStation/pages/newRoutePlanning/newRoutePlanning'
|
url: '../../../BagStation/pages/newRoutePlanning/newRoutePlanning'
|
||||||
// url:'../../../BagStation/pages/overviewMap/overviewMap',
|
|
||||||
})
|
})
|
||||||
} else if (index == 9) {
|
} else if (index == 9) {
|
||||||
this.goToPage('/BagAuth/pages/agreeMent/OperationGuide')
|
this.goToPage('/BagAuth/pages/agreeMent/OperationGuide')
|
||||||
}
|
} else if (index == 2) {
|
||||||
// else if(index==8){
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/BagStation/myCars/myCars'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
else if (index == 2) {
|
|
||||||
if (!uni.getStorageSync('user')) {
|
if (!uni.getStorageSync('user')) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '请您登录',
|
title: '请您登录',
|
||||||
@@ -652,8 +589,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
// url:'../../../BagStation/pages/routePlain/routePlain',
|
|
||||||
// url:'../../../BagStation/pages/newRoutePlanning/newRoutePlanning'
|
|
||||||
url: '../../../BagStation/pages/overviewMap/overviewMap',
|
url: '../../../BagStation/pages/overviewMap/overviewMap',
|
||||||
})
|
})
|
||||||
} else if (index == 6) {
|
} else if (index == 6) {
|
||||||
@@ -809,23 +745,13 @@
|
|||||||
uni.setStorageSync('OtherSiteInfo', item)
|
uni.setStorageSync('OtherSiteInfo', item)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
|
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
|
||||||
fail: (err) => {
|
|
||||||
// console.log(err)
|
|
||||||
},
|
|
||||||
success: () => {
|
|
||||||
// console.log('err')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
||||||
fail: (err) => {
|
|
||||||
// console.log(err)
|
|
||||||
},
|
|
||||||
success: () => {
|
|
||||||
// console.log('err')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -948,8 +874,26 @@
|
|||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
scanType: 'qrCode',
|
scanType: 'qrCode',
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
success: (res) => {
|
success: async (res) => {
|
||||||
console.log(res.result)
|
if (typeof res.result === 'string') {
|
||||||
|
let result = JSON.parse(res.result)
|
||||||
|
if (result.qrcodeText) {
|
||||||
|
let accountResult = await accountApi.getUserAccount()
|
||||||
|
if (accountResult.data.length) {
|
||||||
|
accountApi.checkQrStr(result.giveCustomerId, result.qrcodeText).then(
|
||||||
|
res => {
|
||||||
|
let currentCard = accountResult.data[0] || []
|
||||||
|
this.$refs.transBlcok._open({
|
||||||
|
...currentCard,
|
||||||
|
...result
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.getScanRes(res.result)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.getScanRes(res.result)
|
this.getScanRes(res.result)
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
@@ -982,6 +926,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
/deep/.vue-ref {
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.showBtn {
|
.showBtn {
|
||||||
padding-right: 3%;
|
padding-right: 3%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,7 +211,8 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.xt__verify-code {
|
.xt__verify-code {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.xt__input {
|
.xt__input {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import utils from '@/utils/encode'
|
|||||||
// const env = 'test'
|
// const env = 'test'
|
||||||
const env = 'production'
|
const env = 'production'
|
||||||
// 45
|
// 45
|
||||||
const testUrl = 'http://192.168.1.132:38080'
|
const testUrl = 'http://192.168.1.83:38080'
|
||||||
// const productUrl = 'https://www.xingoil.com/adminapi'
|
// const productUrl = 'https://www.xingoil.com/adminapi'
|
||||||
|
|
||||||
const productUrl = 'http://uat.xingoil.com/adminapi'
|
const productUrl = 'http://uat.xingoil.com/adminapi'
|
||||||
@@ -19,7 +19,7 @@ const service = axios.create({
|
|||||||
let closeShowLoading
|
let closeShowLoading
|
||||||
var url = ''
|
var url = ''
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
// 拦截请求
|
// 拦截请求
|
||||||
closeShowLoading = config?.closeShowLoading||false;
|
closeShowLoading = config?.closeShowLoading||false;
|
||||||
// console.log(closeShowLoading,'isLoadingisLoadingisLoading')
|
// console.log(closeShowLoading,'isLoadingisLoadingisLoading')
|
||||||
@@ -125,6 +125,7 @@ service.interceptors.response.use(
|
|||||||
})
|
})
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
return Promise.reject()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user