1212
This commit is contained in:
@@ -131,7 +131,12 @@
|
||||
},
|
||||
methods: {
|
||||
weChatLogin(option){
|
||||
uni.clearStorageSync()
|
||||
let isJump = uni.getStorageSync('isJump');
|
||||
|
||||
uni.clearStorageSync();
|
||||
if(isJump){
|
||||
uni.setStorageSync('isJump',isJump)
|
||||
}
|
||||
this.refreshLocation()
|
||||
let _that = this
|
||||
uni.login({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view class="padding-top">
|
||||
<scroll-view scroll-x class=" nav text-center">
|
||||
<view class="cu-item" v-for="(item,index) in channelList" :class="index==TabCur?'text-red cur':''" :key="item.channelId"
|
||||
@tap="tabSelect" :data-id="index">
|
||||
<view class="cu-item" v-for="(item,index) in channelList" :class="index==TabCur?'text-red cur':''"
|
||||
:key="item.channelId" @tap="tabSelect" :data-id="index">
|
||||
<image class="site-icon margin-right-sm" :src="imgURL+'site-'+item.channelCode+'.png'" mode="widthFix">
|
||||
</image>
|
||||
{{item.channelCode|channelCodeFamt}}
|
||||
@@ -28,11 +28,20 @@
|
||||
</view>
|
||||
<!-- 油站特色 -->
|
||||
<view v-if="ts" class="bg-gray padding-top-sm ">
|
||||
<view @click="goFinancial" style="margin-bottom: 20rpx;" class="bg-white padding ">
|
||||
<view class="advertisement_body">
|
||||
<view class="advertisement_body_label">车辆评估</view>
|
||||
<view>评估分数+改善建议,组合报告查询8.8折</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding ">
|
||||
<text>油站特色</text>
|
||||
<view class="">
|
||||
<text style="margin-top: 20rpx;margin-left: 0;" class="cu-tag line-yellow margin-right-xs" v-for="(itemy,index) in tagList" :key="index">{{itemy}}</text>
|
||||
<text style="margin-top: 20rpx;margin-left: 0;height: auto;line-height: 20px;" v-if="channelPrice.activitySwitch" class="cu-tag line-yellow margin-right-xs">{{channelPrice.activityContent}}</text>
|
||||
<text style="margin-top: 20rpx;margin-left: 0;" class="cu-tag line-yellow margin-right-xs"
|
||||
v-for="(itemy,index) in tagList" :key="index">{{itemy}}</text>
|
||||
<text style="margin-top: 20rpx;margin-left: 0;height: auto;line-height: 20px;"
|
||||
v-if="channelPrice.activitySwitch"
|
||||
class="cu-tag line-yellow margin-right-xs">{{channelPrice.activityContent}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -40,9 +49,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Financial from '@/api/Financial.js'
|
||||
export default {
|
||||
props: {
|
||||
channelPrice:{
|
||||
channelPrice: {
|
||||
type: Object,
|
||||
default () {}
|
||||
},
|
||||
@@ -50,8 +60,8 @@
|
||||
type: Array,
|
||||
default () {}
|
||||
},
|
||||
ts:{
|
||||
type:Boolean,
|
||||
ts: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
@@ -63,6 +73,7 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
activeChannelCode() {
|
||||
if (this.channelList.length && this.channelList[this.TabCur]) {
|
||||
let channelCode = this.channelList[this.TabCur].channelCode
|
||||
@@ -100,31 +111,54 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goFinancial(){
|
||||
const user = uni.getStorageSync('user');
|
||||
if(user){
|
||||
Financial.findHomePageReport({customerId:user.id}).then(res=>{
|
||||
if(res.data){
|
||||
uni.navigateTo({
|
||||
url:`../../../Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(res.data))}`
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'../../../Financial/pages/index?guide=1'
|
||||
})
|
||||
}
|
||||
});
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '请先登录!',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
tabSelect(e) {
|
||||
this.TabCur = e.currentTarget.dataset.id;
|
||||
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
moneyIntercept(value){
|
||||
moneyIntercept(value) {
|
||||
if (value != 'xxx.x') {
|
||||
console.log(value,'************************')
|
||||
console.log(value, '************************')
|
||||
// let valus = (parseInt(value * 100) / 100).toFixed(2)
|
||||
// let valus = `${String(value).split('.')[0]}.${String(value).split('.')[1].substring(1,2)}`
|
||||
// let valus = Number(valus).toFixed(2)
|
||||
// console.log(String(value).split('.')[1].substring(2,4),String(value).split('.')[1].length,'*-*-*-*-');
|
||||
// console.log( Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,2)}`)+0.01,'************');
|
||||
// return String(value).split('.')[1]&&String(value).split('.')[1].length>2? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,2)}`)+0.01 :Number(value).toFixed(2);
|
||||
return String(value).split('.')[1]&&String(value).split('.')[1].length>2?Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,2)}${Number(String(value).split('.')[1].substr(2))==0?'':9}`).toFixed(2) :Number(value).toFixed(2);
|
||||
return String(value).split('.')[1] && String(value).split('.')[1].length > 2 ? Number(
|
||||
`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,2)}${Number(String(value).split('.')[1].substr(2))==0?'':9}`
|
||||
).toFixed(2) : Number(value).toFixed(2);
|
||||
} else {
|
||||
return Number(value).toFixed(2)
|
||||
}
|
||||
}
|
||||
},
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
console.log('old:',value)
|
||||
let realAmount = Math.floor(value * 100) / 100
|
||||
console.log('new:',realAmount)
|
||||
console.log('old:', value)
|
||||
let realAmount = Math.floor(value * 100) / 100
|
||||
console.log('new:', realAmount)
|
||||
// return realAmount
|
||||
return Number(value).toFixed(2)
|
||||
} else {
|
||||
@@ -149,7 +183,7 @@
|
||||
case 'WJY':
|
||||
return '万金油'
|
||||
case 'LV':
|
||||
return '其他'
|
||||
return '其他'
|
||||
case 'TY':
|
||||
return '团油'
|
||||
case 'YDJY':
|
||||
@@ -162,6 +196,30 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.advertisement_body_label {
|
||||
color: #FFFFFF;
|
||||
margin-right: 20rpx;
|
||||
padding: 10rpx 35rpx 10rpx 10rpx;
|
||||
border-radius: 10rpx;
|
||||
border-right: 0px solid;
|
||||
background-image: linear-gradient(32deg, #FF9000 70%, rgba(255, 255, 255, 0) 50%), linear-gradient(148deg, #FF9000 70%, rgba(255, 255, 255, 0) 50%);
|
||||
}
|
||||
|
||||
.advertisement_body {
|
||||
width: 100%;
|
||||
height: 69rpx;
|
||||
background: rgba(255, 144, 0, 0.2);
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
opacity: 1;
|
||||
color: #FF9000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
/* justify-content: center; */
|
||||
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.site-icon {
|
||||
width: 2rem;
|
||||
vertical-align: middle;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
</view>
|
||||
<view class="seach_input_right">
|
||||
<input v-model="seachValue" placeholder="请输入地址" type="text" @confirm="seachFn" />
|
||||
<view @click="seachFn" class="seach_input_butten"> 搜索</view>
|
||||
<!-- <uni-combox @input="seachFn" emptyTips="请输入内容" class="seach_input_right_input" :border="false" :candidates="candidates" placeholder="Location..."></uni-combox> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -132,6 +133,7 @@
|
||||
that.List = e.data
|
||||
},
|
||||
fail(e) {
|
||||
that.loding(false);
|
||||
console.log(e, '错误')
|
||||
},
|
||||
})
|
||||
@@ -149,6 +151,14 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.seach_input_butten{
|
||||
color: #FF6700;
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.list_item_samall_size {
|
||||
color: #BBBBBB;
|
||||
font-size: 24rpx;
|
||||
@@ -199,8 +209,9 @@
|
||||
|
||||
.seach_input_right {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
margin:0 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.seach_input_left {
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
var date = new Date();
|
||||
var seperator1 = "-";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var month = date.getMonth() ;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
|
||||
@@ -229,7 +229,8 @@
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
params: {
|
||||
platenumOrVinnum: ''
|
||||
platenumOrVinnum: '',
|
||||
createSource:'XOIL-COMPANY'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
counter:0,
|
||||
ReconfirmData: [{
|
||||
label: '车牌号码',
|
||||
value: 'platenumOrVinnum',
|
||||
@@ -173,7 +174,8 @@
|
||||
lastQueryDate: seniorPage.lastQueryDate,
|
||||
appId: 'wx7a939c19b270cc3d',
|
||||
openId: uni.getStorageSync('openid'),
|
||||
unionId: uni.getStorageSync('unionid')
|
||||
unionId: uni.getStorageSync('unionid'),
|
||||
createSource:'XOIL-COMPANY'
|
||||
}
|
||||
this.$refs.Reconfirm.open()
|
||||
} catch (e) {
|
||||
@@ -202,29 +204,54 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
goEstimate() {
|
||||
goEstimate(payRecordId) {
|
||||
let that = this
|
||||
let user = uni.getStorageSync('user');
|
||||
console.log(user, 'user')
|
||||
Financial.findHomePageReport({
|
||||
customerId: user.id
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
console.log(res.data, 'res.data')
|
||||
uni.redirectTo({
|
||||
url: `/Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(res.data))}`,
|
||||
fail(e) {
|
||||
console.log(e)
|
||||
},
|
||||
})
|
||||
let data = {
|
||||
customerId: user.id,
|
||||
payRecordId
|
||||
}
|
||||
console.log(data,'datadatadatadata')
|
||||
Financial.findHomePageReport(data).then(res => {
|
||||
if (Boolean(Number(res.data?.isThereIsNewData))) {
|
||||
this.toEstimate(res.data)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title:'更新评估报告错误',
|
||||
icon:'error'
|
||||
})
|
||||
console.log('更新评估报告错误')
|
||||
if(this.counter>=3){
|
||||
uni.hideLoading();
|
||||
setTimeout(()=>{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '很抱歉,您的车辆可能因非重载货车或长时间未在公路行驶,所以无法查询到您的车辆数据,您所支付的款项将在48小时内原路退回',
|
||||
success: function (res) {
|
||||
that.counter = 0
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},1000)
|
||||
return
|
||||
}else{
|
||||
this.counter++;
|
||||
setTimeout(()=>{
|
||||
this.goEstimate(payRecordId)
|
||||
},3000)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toEstimate(data){
|
||||
uni.hideLoading();
|
||||
uni.redirectTo({
|
||||
url: `/Financial/pages/estimate/index?data=${encodeURIComponent(JSON.stringify(data))}`,
|
||||
success() {},
|
||||
fail(e) {
|
||||
console.log(e)
|
||||
},
|
||||
})
|
||||
},
|
||||
submit(e) {
|
||||
let that = this
|
||||
Financial.weiXinPay(this.palayData).then(res => {
|
||||
@@ -237,7 +264,13 @@
|
||||
success() {
|
||||
that.$refs.Reconfirm.close();
|
||||
setTimeout(()=>{
|
||||
that.goEstimate()
|
||||
uni.showLoading({
|
||||
title: '报告获取中',
|
||||
mask:true
|
||||
});
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
that.goEstimate(res.data.outTradeNo)
|
||||
},2000)
|
||||
},
|
||||
complete() {
|
||||
|
||||
@@ -5,7 +5,8 @@ export default {
|
||||
return request({
|
||||
url: `/oil-interfaces/xoilSinoiovCustomerRiskevalReport/findHomePageReport`,
|
||||
method: 'get',
|
||||
params: data
|
||||
params: data,
|
||||
closeShowLoading:true
|
||||
})
|
||||
},
|
||||
//获取支付记录
|
||||
|
||||
85
pages/components/Advertisement.vue
Normal file
85
pages/components/Advertisement.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-popup :mask-click='false' ref='showAdvertisement'>
|
||||
<view class="Advertisement_body">
|
||||
<image style="width: 100%;height: 100%;" :src="imgURL+'groupbannerzhongp.png'" mode=""></image>
|
||||
<view @click="informNext(true)" class="Advertisement_butten">
|
||||
立即进入
|
||||
</view>
|
||||
<view @click="closeAdvertisement" class="Advertisement_closeButten">
|
||||
<uni-icons color='#ffffff' type="closeempty" size="35"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imgURL: this.global.newImgURL,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('广告组件挂载完成');
|
||||
this.showAdvertisement()
|
||||
},
|
||||
methods: {
|
||||
showAdvertisement() {
|
||||
this.$refs.showAdvertisement.open('center')
|
||||
},
|
||||
closeAdvertisement() {
|
||||
this.$refs.showAdvertisement.close();
|
||||
this.informNext()
|
||||
},
|
||||
informNext(type=false) {
|
||||
this.$emit('informNext',type)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.Advertisement_butten {
|
||||
width: 278rpx;
|
||||
height: 70rpx;
|
||||
color: #FFFFFF;
|
||||
position: absolute;
|
||||
bottom: 30rpx;
|
||||
font-size: 32rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: linear-gradient(270deg, #FDA96A 0%, #FE5048 100%);
|
||||
box-shadow: 0px 3px 10px 0px rgba(178, 126, 81, 0.5);
|
||||
border-radius: 103px 103px 103px 103px;
|
||||
border-image: linear-gradient(90deg, rgba(255, 121.00000038743019, 94.0000019967556, 1), rgba(252.00000017881393, 158.00000578165054, 79.00000289082527, 1)) 1 1;
|
||||
}
|
||||
|
||||
.Advertisement_closeButten {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -45px;
|
||||
margin: auto;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
/* border: solid 1px #000000; */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.Advertisement_body {
|
||||
width: 602rpx;
|
||||
height: 690rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
@@ -1,15 +1,23 @@
|
||||
<template>
|
||||
<view class="page-content">
|
||||
<image :src="yellowURL+'start.png'" width="" mode="widthFix"></image>
|
||||
<Advertisement v-if="showAdvertisement" @informNext='goHome' ref='Advertisement'></Advertisement>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import oilSiteApi from '@/api/oil-site.js'
|
||||
import wxCode from '@/api/wxcode.js'
|
||||
import Advertisement from '../../components/Advertisement.vue'
|
||||
export default {
|
||||
components: {
|
||||
Advertisement
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showAdvertisement: false,
|
||||
key: '',
|
||||
option: null,
|
||||
imgURL: this.global.imgURL + 'start/',
|
||||
yellowURL: this.global.yellowURL + 'xq-ad/',
|
||||
menuList: [{
|
||||
@@ -44,75 +52,96 @@
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option,'启动页');
|
||||
console.log(`%c 二维码进入 ${option.scene}`, 'color:red;font-size:50px')
|
||||
|
||||
const token = uni.getStorageSync('Authorization')
|
||||
const openid = uni.getStorageSync('openid')
|
||||
let key = ''
|
||||
if (token && openid) {
|
||||
key = '在线'
|
||||
} else {
|
||||
key = '离线'
|
||||
}
|
||||
if (key == '在线') {
|
||||
if (!uni.getStorageSync('filterData')) {
|
||||
this.getFilterData()
|
||||
} else if (uni.getStorageSync('filterData')[0].detailList.length < 2) {
|
||||
this.getFilterData()
|
||||
}
|
||||
}
|
||||
if (option.scene) {
|
||||
this.Interceptor(option.scene);
|
||||
}else{
|
||||
setTimeout(() => {
|
||||
if (key == '在线') {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/home/home',
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
// url:'/BagStation/orderDetail/orderDetail'
|
||||
})
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/BagAuth/pages/login/login'
|
||||
// url:'/BagAuth/pages/login/oldLogin'
|
||||
})
|
||||
}
|
||||
}, 2000)
|
||||
}
|
||||
|
||||
mounted() {
|
||||
console.log('mounted')
|
||||
},
|
||||
onReady(option) {
|
||||
const updateManager = uni.getUpdateManager();
|
||||
|
||||
updateManager.onCheckForUpdate(function(res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log('请求完新版本信息的回调', res.hasUpdate);
|
||||
});
|
||||
|
||||
updateManager.onUpdateReady(function(res) {
|
||||
uni.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
console.log(res.confirm,'res.confirm版本信息')
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
}
|
||||
onLoad(option) {
|
||||
this.option = option;
|
||||
this.versionUpdate()
|
||||
},
|
||||
onReady(option) {},
|
||||
methods: {
|
||||
versionUpdate() {
|
||||
console.log('versionUpdate')
|
||||
let that = this
|
||||
const updateManager = uni.getUpdateManager();
|
||||
updateManager.onCheckForUpdate(function(res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log('请求完新版本信息的回调', res.hasUpdate);
|
||||
if (!res.hasUpdate) {
|
||||
that.initFn(that.option)
|
||||
}
|
||||
});
|
||||
});
|
||||
updateManager.onUpdateReady(function(res) {
|
||||
uni.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
console.log(res.confirm, 'res.confirm版本信息')
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
} else {
|
||||
that.initFn(that.option)
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
updateManager.onUpdateFailed(function(res) {
|
||||
// 新的版本下载失败
|
||||
});
|
||||
|
||||
},
|
||||
methods: {
|
||||
updateManager.onUpdateFailed(function(res) {
|
||||
console.log('新的版本下载失败')
|
||||
// 新的版本下载失败
|
||||
});
|
||||
},
|
||||
initFn(option) {
|
||||
console.log(option, '启动页');
|
||||
console.log(`%c 二维码进入 ${option.scene}`, 'color:red;font-size:50px')
|
||||
const token = uni.getStorageSync('Authorization')
|
||||
const openid = uni.getStorageSync('openid')
|
||||
this.key = ''
|
||||
if (token && openid) {
|
||||
this.key = '在线'
|
||||
} else {
|
||||
this.key = '离线'
|
||||
}
|
||||
if (this.key == '在线') {
|
||||
if (!uni.getStorageSync('filterData')) {
|
||||
this.getFilterData()
|
||||
} else if (uni.getStorageSync('filterData')[0].detailList.length < 2) {
|
||||
this.getFilterData()
|
||||
}
|
||||
}
|
||||
if (option.scene) {
|
||||
this.Interceptor(option.scene);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.showAdvertisement = true
|
||||
}, 2000)
|
||||
}
|
||||
},
|
||||
goHome(type) {
|
||||
if(type){
|
||||
uni.setStorageSync('isJump',{
|
||||
page:'Financial/pages/estimate/index',
|
||||
disposable:true
|
||||
})
|
||||
}
|
||||
if (this.key == '在线') {
|
||||
console.log(type, 'typetypetypetype');
|
||||
|
||||
uni.switchTab({
|
||||
url: `/pages/tabbar/home/home`,
|
||||
success() {},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/BagAuth/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
Interceptor(id) {
|
||||
let taht = this
|
||||
console.log(`%c 检测到参数拦截器启动`, 'color:red;font-size:50px');
|
||||
@@ -131,24 +160,27 @@
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
wxCode.getQrCodeType({
|
||||
qrCode: id
|
||||
}).then(res => {
|
||||
if (res.code == 20000) {
|
||||
uni.redirectTo({
|
||||
url: '/AppletCode/pages/index/index?details=' + JSON.stringify({...res.data,qrCode: id}),
|
||||
fail(e) {
|
||||
console.log(e,'跳转失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
wxCode.getQrCodeType({
|
||||
qrCode: id
|
||||
}).then(res => {
|
||||
if (res.code == 20000) {
|
||||
uni.redirectTo({
|
||||
url: '/AppletCode/pages/index/index?details=' + JSON.stringify({
|
||||
...res.data,
|
||||
qrCode: id
|
||||
}),
|
||||
fail(e) {
|
||||
console.log(e, '跳转失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getFilterData() {
|
||||
console.log('wodefenzhi')
|
||||
oilSiteApi.getCheckInfo().then(res => {
|
||||
if (res.code == 20000) {
|
||||
|
||||
|
||||
let channelCodes = []
|
||||
res.data.channelCodes.map(item => {
|
||||
channelCodes.push({
|
||||
@@ -176,7 +208,7 @@
|
||||
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands)
|
||||
uni.setStorageSync('filterData', this.menuList)
|
||||
uni.setStorageSync('productCodeList', res.data.productCodeList)
|
||||
console.log(res,'%c 这里是启动页调用的菜单列表','font-size:36px;color:red;')
|
||||
console.log(res, '%c 这里是启动页调用的菜单列表', 'font-size:36px;color:red;')
|
||||
// this.$refs.slFilter.resetMenuList(this.menuList)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<view class="">
|
||||
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular>
|
||||
<swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray" :key='index'>
|
||||
<image :src="item.src" style="width: 100%;" mode="widthFix"></image>
|
||||
<image :src="item.src" style="width: 100%;height: 100%;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -188,6 +188,10 @@
|
||||
src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2dwk.png',
|
||||
link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473'
|
||||
},
|
||||
{
|
||||
src:'https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/bannerindexs.png',
|
||||
JumpPage:'Financial'
|
||||
},
|
||||
|
||||
],
|
||||
siteInfo: {},
|
||||
@@ -352,7 +356,6 @@
|
||||
console.log('首页 非卡力 进入')
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e, '首页')
|
||||
let _that = this
|
||||
let IsOtherUser = _that.isOther
|
||||
console.log(IsOtherUser, '这里是判断是否为卡力')
|
||||
@@ -369,7 +372,17 @@
|
||||
return
|
||||
}
|
||||
console.log('首页 非卡力 进入测试++')
|
||||
this.reverseGeocoder(this.location)
|
||||
this.reverseGeocoder(this.location);
|
||||
setTimeout(()=>{
|
||||
let startParamsData = uni.getStorageSync('isJump')||null;
|
||||
if(startParamsData){
|
||||
this.shadoumeiyou(6)
|
||||
if(startParamsData?.disposable){
|
||||
uni.removeStorageSync('isJump');
|
||||
}
|
||||
|
||||
}
|
||||
},500)
|
||||
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
@@ -411,17 +424,22 @@
|
||||
},
|
||||
methods: {
|
||||
swiperClick(item,index) {
|
||||
if(!item?.link) return
|
||||
switch (Number(index)) {
|
||||
// case 0:
|
||||
// this.goCall()
|
||||
// break;
|
||||
default:
|
||||
console.log('item.link')
|
||||
uni.navigateTo({
|
||||
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
|
||||
})
|
||||
if(item?.JumpPage){
|
||||
switch(item.JumpPage){
|
||||
case "Financial":
|
||||
this.shadoumeiyou(6)
|
||||
break;
|
||||
}
|
||||
}else if(item?.link){
|
||||
switch (Number(index)) {
|
||||
default:
|
||||
console.log('item.link')
|
||||
uni.navigateTo({
|
||||
url: '/pages/tabbar/home/link?url=' + encodeURIComponent(JSON.stringify(item.link))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
gotoMap() {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
getSiteListTimer:null,
|
||||
TabCur: 0,
|
||||
TabCurUrea: 0,
|
||||
UreaTabCur:0,
|
||||
@@ -131,7 +132,7 @@
|
||||
ative:'', }
|
||||
},
|
||||
onShow() {
|
||||
this.getOrder('')
|
||||
// this.getOrder('')
|
||||
},
|
||||
onLoad() {
|
||||
this.getOrder('')
|
||||
@@ -177,6 +178,7 @@
|
||||
})
|
||||
},
|
||||
onChangeSearch() {
|
||||
console.log('%c 我闪','color:red;font-size:20px')
|
||||
setTimeout(() => {
|
||||
if(this.TabHead == 1){
|
||||
this.onSearch()
|
||||
@@ -202,34 +204,39 @@
|
||||
this.ative = value
|
||||
this.getOrder(value)
|
||||
},
|
||||
getOrder(status) {
|
||||
let postData = {
|
||||
currentPage: this.currentPage, //类型:Number 必有字段 备注:无
|
||||
pageSize: 10, //类型:Number 必有字段 备注:无
|
||||
params: { //类型:Object 必有字段 备注:无
|
||||
orderStatus: status, //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
|
||||
},
|
||||
}
|
||||
orderApi.getOrderInfoByPage(postData).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 20000) {
|
||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
this.list = this.list.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus= 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage++
|
||||
this.status.loadOrderStatus = 'load'
|
||||
}
|
||||
}
|
||||
}).finally(()=>{
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
getOrder(status) {
|
||||
clearTimeout(this.getSiteListTimer)
|
||||
this.getSiteListTimer = setTimeout(()=>{
|
||||
|
||||
let postData = {
|
||||
currentPage: this.currentPage, //类型:Number 必有字段 备注:无
|
||||
pageSize: 10, //类型:Number 必有字段 备注:无
|
||||
params: { //类型:Object 必有字段 备注:无
|
||||
orderStatus: status, //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
|
||||
},
|
||||
}
|
||||
orderApi.getOrderInfoByPage(postData).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 20000) {
|
||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
this.list = this.list.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus= 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage++
|
||||
this.status.loadOrderStatus = 'load'
|
||||
}
|
||||
}
|
||||
}).finally(()=>{
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
|
||||
},500)
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
getSiteListTimer:null,
|
||||
areaCodeList:[],
|
||||
loadText:'more',
|
||||
changeHs:true,
|
||||
@@ -677,20 +678,30 @@
|
||||
|
||||
},
|
||||
onInput() {
|
||||
setTimeout(() => {
|
||||
// setTimeout(() => {
|
||||
// this.currentPage = 1
|
||||
// this.siteList = []
|
||||
// this.getSiteList()
|
||||
// }, 100)
|
||||
clearTimeout(this.getSiteListTimer);
|
||||
this.getSiteListTimer = setTimeout(()=>{
|
||||
this.currentPage = 1
|
||||
this.siteList = []
|
||||
this.getSiteList()
|
||||
}, 100)
|
||||
},500);
|
||||
},
|
||||
onSearch() {
|
||||
this.currentPage = 1
|
||||
this.siteList = []
|
||||
if(this.TabHead == 0){
|
||||
this.getSiteList()
|
||||
}else if (this.TabHead == 1){
|
||||
this.getUreaList()
|
||||
}
|
||||
clearTimeout(this.getSiteListTimer);
|
||||
this.getSiteListTimer = setTimeout(()=>{
|
||||
this.currentPage = 1
|
||||
this.siteList = []
|
||||
if(this.TabHead == 0){
|
||||
this.getSiteList()
|
||||
}else if (this.TabHead == 1){
|
||||
this.getUreaList()
|
||||
}
|
||||
},500)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,27 +4,33 @@ import utils from '@/utils/encode'
|
||||
// const env = 'production'/* */
|
||||
// const env = 'test'
|
||||
const env = 'production'
|
||||
// 45
|
||||
const testUrl = 'http://192.168.0.45:38080'
|
||||
const productUrl = 'https://www.xingoil.com/adminapi'
|
||||
// 45
|
||||
const testUrl = 'http://192.168.0.23:38080'
|
||||
// const productUrl = 'https://www.xingoil.com/adminapi'
|
||||
|
||||
// const productUrl = 'http://uat.xingoil.com/adminapi'
|
||||
const productUrl = 'http://uat.xingoil.com/adminapi'
|
||||
// const productUrl = 'http://192.168.0.191:38080'
|
||||
// const productUrl = 'http://121.196.213.68/adminapi'
|
||||
const service = axios.create({
|
||||
baseURL: env == 'production' ? productUrl : testUrl,
|
||||
baseURL: env == 'production' ? productUrl : testUrl,
|
||||
// baseURL: testUrl,
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
let closeShowLoading
|
||||
var url = ''
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// 拦截请求
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask:true
|
||||
})
|
||||
// 拦截请求
|
||||
closeShowLoading = config?.closeShowLoading||false;
|
||||
console.log(closeShowLoading,'isLoadingisLoadingisLoading')
|
||||
if(!closeShowLoading){
|
||||
//判断是否自动开始请求loading
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
|
||||
const token = uni.getStorageSync('Authorization')
|
||||
const unionId = uni.getStorageSync('unionid')
|
||||
const openId = uni.getStorageSync('openid')
|
||||
@@ -52,7 +58,7 @@ service.interceptors.request.use(
|
||||
}
|
||||
// 要加密
|
||||
data.params = utils.encrypt(JSON.stringify(config.data))
|
||||
console.log('参数', config.url, '参数加密前',config.data,'加密:',data)
|
||||
console.log('参数', config.url, '参数加密前', config.data, '加密:', data)
|
||||
config.data = data
|
||||
// }
|
||||
} else {
|
||||
@@ -65,17 +71,20 @@ service.interceptors.request.use(
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
uni.hideLoading()
|
||||
if(!closeShowLoading){
|
||||
//判断是否自动开始请求loading
|
||||
uni.hideLoading()
|
||||
}
|
||||
uni.showToast({
|
||||
title: '网络超时',
|
||||
icon: "none"
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
)
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const res = response.data
|
||||
const res = response.data
|
||||
if (env === 'production') {
|
||||
// 生产环境,进行加密解密,不输出日志
|
||||
if (res.encrypt == 1) {
|
||||
@@ -89,10 +98,12 @@ service.interceptors.response.use(
|
||||
console.log('返回', response.config.url, '返回结果未加密', res)
|
||||
// console.log('-------------------------------------------\n\n')
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
|
||||
if(response.config.url.indexOf('/oil-site/oilSiteAppInfo/getSiteDetails') != -1){
|
||||
if(!closeShowLoading){
|
||||
//判断是否自动开始请求loading
|
||||
uni.hideLoading()
|
||||
}
|
||||
if (response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1) {
|
||||
if (response.config.url.indexOf('/oil-site/oilSiteAppInfo/getSiteDetails') != -1) {
|
||||
console.log('这里是getSiteDetails 拦截处')
|
||||
// if (res.code != 20000&&res.msg!='令牌为空,不允许操作'&&res.msg!='您的ip已经更改,请重新登录'&&res.msg!='登录与操作设备不同') {
|
||||
// uni.showToast({
|
||||
@@ -100,26 +111,30 @@ service.interceptors.response.use(
|
||||
// icon: "none"
|
||||
// })
|
||||
// }
|
||||
}else{
|
||||
if (res.code != 20000&&res.msg!='令牌为空,不允许操作'&&res.msg!='您的ip已经更改,请重新登录'&&res.msg!='登录与操作设备不同') {
|
||||
} else {
|
||||
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg !=
|
||||
'登录与操作设备不同') {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
});
|
||||
if(response.config.url.indexOf('/oil-user/oilCompanyInfo/getQrCodeType') != -1){
|
||||
setTimeout(()=>{
|
||||
if (response.config.url.indexOf('/oil-user/oilCompanyInfo/getQrCodeType') != -1) {
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: '/BagAuth/pages/login/oldLogin'
|
||||
})
|
||||
},2000)
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res
|
||||
},
|
||||
error => {
|
||||
uni.hideLoading()
|
||||
if(!closeShowLoading){
|
||||
//判断是否自动开始请求loading
|
||||
uni.hideLoading()
|
||||
}
|
||||
uni.getNetworkType({
|
||||
success: function(res) {
|
||||
console.log(res.networkType);
|
||||
@@ -170,4 +185,4 @@ service.defaults.adapter = function(config) {
|
||||
}
|
||||
// #endif
|
||||
|
||||
export default service
|
||||
export default service
|
||||
|
||||
@@ -41,6 +41,7 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
overallInterceptor(callBack) {
|
||||
uni.addInterceptor('redirectTo', {
|
||||
invoke(e) {
|
||||
|
||||
Reference in New Issue
Block a user