1212
This commit is contained in:
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)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user