This commit is contained in:
caolc
2023-07-05 18:19:02 +08:00
parent e883da3fff
commit cf253870a3
17 changed files with 861 additions and 343 deletions

View File

@@ -0,0 +1,132 @@
<template>
<view class="Activity_body">
<scroll-view @refresherrefresh='refresherrefresh' :refresher-enabled='true'
:refresher-triggered='refresherTriggered' style="height: 100%;" scroll-y="true"
@scrolltolower='scrolltolower'>
<view v-for="(item,index) in siteList" :key="item.id">
<site-item @tap="toDetail(item)" :site-item="item" class="cu-list menu-avatar cu-item" />
<view class="activityContent">{{item.activityContent}}</view>
</view>
</scroll-view>
</view>
</template>
<script>
import oilSiteApi from '@/api/oil-site.js'
export default {
data() {
return {
refresherTriggered: false,
page: {
currentPage: 1,
pageSize: 10,
params: { //类型Object 必有字段 备注:// 筛选对象
// sort: "juli", //类型String 必有字段 备注:// 智能排序 ( price价格最低 juli距离最近 ) 默认距离排序
siteName: '',
...uni.getStorageSync('location'),
// ...this.filterData
// siteBrand: this.siteName ? '' : this.filterDatas
siteBrand: '', // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 )
// channelCode: this.siteName ? '' : this.filterDatas
channelCode: '', // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
// oilProductCode: this.siteName ? '' : this.filterDatas
oilProductCode: '', // 备注:// 油号选择 ( 0# 92# 92#)
siteLevel: '',
sort: 'juli',
provinceCode: '',
cityCode: '',
areaCode: '',
distance: ''
}
},
siteList: []
}
},
created() {
this.init()
},
methods: {
toDetail(item){
let itemS = JSON.stringify(item)
if (uni.getStorageSync('user')) {
if (item.channelCode === 'TY') {
uni.setStorageSync('OtherSiteInfo', item)
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
})
return
}
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
})
} else {
uni.showModal({
title: '请您登录',
content: "登录星油加油才可以加油 |˛˙꒳​˙)♡",
confirmText: '去登陆',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '../../../BagAuth/pages/login/login'
})
}
}
})
}
},
refresherrefresh() {
this.page.currentPage =1;
this.refresherTriggered = true;
this.getSiteList()
},
init(){
this.getSiteList();
},
getSiteList() {
let location = uni.getStorageSync('location');
oilSiteApi.getBSitesByActivity(this.page).then(res => {
if(this.page.currentPage>1){
this.siteList = this.siteList.concat(res.data.list)
}else{
this.siteList = res.data.list
}
}).finally(()=>{
this.refresherTriggered = false;
})
},
scrolltolower() {
this.page.currentPage += 1;
this.getSiteList()
},
}
}
</script>
<style scoped lang="scss">
.activityContent{
background: #ff670026;
border-radius: 10rpx;
margin: 10rpx 30rpx;
box-sizing: border-box;
padding: 20rpx 30rpx;
color: #FF6700;
font-size: 22rpx;
}
.Activity_body {
width: 100vw;
height: 100vh;
overflow: hidden;
}
</style>

View File

@@ -1,36 +1,12 @@
<template>
<view class="login-page bg-white">
<view class="image login-bg">
<image :src="yellowURL+'login-bg.png'" mode="widthFix"></image>
</view>
<scroll-view scroll-x class=" bg-white nav padding">
<view class="flex text-center padding-bottom">
<!-- <view class="cu-item flex-sub" :class="0==TabCur?'text-red cur':''" @tap="tabSelect(0)">
个人账号
</view>
-->
<view class="cu-item text-bold text-lg flex-sub">
@@ -59,26 +35,30 @@
<button class="cu-btn margin-top round lg" @tap="refuseEmpower">
输入手机号码登录
</button>
<button v-if="isShow" class="cu-btn margin-top bg-0 round lg" @tap="refuseLogin">
<button class="cu-btn margin-top bg-0 round lg" @tap="refuseLogin">
跳过
</button>
</view>
<view class="isKLUser" v-if='otherUser'>
<view class="isKLUser">卡力用户仅支持跳转登录</view>
</view>
<SwitchEnterprises @logout='logout' @submit='goHome' :is-show.sync="isSwitchEnterprises"></SwitchEnterprises>
</view>
</template>
<script>
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import loginBottom from './components/loginBottom.vue'
import oilIdentityApi from '@/api/oil-identity'
import accountApi from '@/api/account.js'
export default {
components: {
loginBottom
loginBottom,
SwitchEnterprises
},
data() {
return {
isSwitchEnterprises:false,
value:'123',
userHandle: false,
TabCur: 1,
@@ -95,21 +75,32 @@
loginRes: {},
sessionKey: '',
nickName: '',
loginOut: uni.getStorageSync('loginOut') ? true : false,
isShow:true
loginOut: uni.getStorageSync('loginOut') ? true : false
}
},
onLoad(option) {
this.init(option);
console.log('onLoad')
},
onShow() {
console.log('show');
},
watch:{
isSwitchEnterprises(n,o){ }
},
methods: {
init(option){
if(option){
if(option.companyId === '1460872936910831616'){
this.otherUser = true
uni.clearStorageSync()
this.weChatLogin(option)
// console.log('当前为卡力用户')
console.log('当前为卡力用户')
return
}
}
let IsOtherUser = uni.getStorageSync('isOther')
// console.log('这里是onload',IsOtherUser)
if(IsOtherUser){
uni.showToast({
title:'卡力用户仅支持跳转登录',
@@ -118,26 +109,32 @@
this.otherUser = true
return
} else{
this.weChatLogin()
}
// console.log('小程序跳转参数接收onLoad----')
// console.log('姓名:',option.driverName)
// console.log('公司ID:',option.companyId)
// console.log('车牌号:',option.plateNumber)
// console.log('油站Id:',option.siteId)
// console.log('--------------------------')
// console.log('这里是登录')
},
methods: {
logout(){
let that = this
accountApi.logout('authSystem').then(res => {
if (res.code == '20000') {
uni.showToast({
title: res.msg
})
uni.clearStorageSync();
this.isSwitchEnterprises = false;
this.init()
}
})
},
goHome(){
uni.switchTab({
url: '/pages/tabbar/home/home'
})
},
weChatLogin(option){
let isJump = uni.getStorageSync('isJump');
let siteId = uni.getStorageSync('siteId')
uni.clearStorageSync();
if(isJump) uni.setStorageSync('isJump',isJump)
if(siteId) {
this.isShow = false
uni.setStorageSync('siteId',siteId)
if(isJump){
uni.setStorageSync('isJump',isJump)
}
this.refreshLocation()
let _that = this
@@ -146,15 +143,14 @@
success: (loginRes) => {
const code = loginRes.code
this.onceCode = code
// console.log('这里是code')
// console.log(this.onceCode)
console.log('这里是code')
console.log(this.onceCode)
oilIdentityApi.sendCode(this.onceCode).then(res => {
if (res.code === 20000) {
// console.log('这里是sendCode',res)
console.log('这里是sendCode',res)
this.sessionKey = res.data.sessionKey
uni.setStorageSync('openid', res.data.openId)
uni.setStorageSync('unionid', res.data.unionId)
// console.log('这里是213','++++++')
if(option){
if(option.companyId == '1460872936910831616'){
let sysCustomerInfos = {
@@ -171,17 +167,17 @@
}
uni.setStorageSync('isOther',_that.otherUser)
uni.setStorageSync('otherUserInfo',sysCustomerInfos)
// console.log('此处为data参数',data)
// console.log('当前为卡利用户companyId 为',sysCustomerInfos.companyId)
console.log('此处为data参数',data)
console.log('当前为卡利用户companyId 为',sysCustomerInfos.companyId)
oilIdentityApi.wechatLogin(data).then(res=>{
// console.log('这里是wechatLogin',res)
console.log('这里是wechatLogin',res)
this.OtherloginSuccess(res)
// console.log(res)
console.log(res)
})
return
}
}else{
// console.log('这里是213','----')
console.log('这里是213','----')
this.autoLogin()
}
// uni.setStorageSync('isOther',_that.otherUser)
@@ -209,7 +205,7 @@
})
},
refuseLogin(){
uni.setStorageSync('refuseLogin',true)
uni.clearStorageSync()
uni.switchTab({
url: '/pages/tabbar/home/home'
})
@@ -228,7 +224,7 @@
// let url = 'loginPersonal'
oilIdentityApi.autoLogin({
unionId: uni.getStorageSync('unionid')
}, url).then(res => {
}, url,{closePrompt:true}).then(res => {
if (res.code == 20000) {
this.loginSuccess(res)
}
@@ -262,9 +258,8 @@
},
bindLoginByPhone(data, url) {
if (this.count < 1) {
oilIdentityApi.bindLoginByPhone(data, url).then(res => {
oilIdentityApi.bindLoginByPhone(data,url,{closePrompt:true}).then(res => {
if (res.code == 20000) {
this.loginSuccess(res)
}
})
@@ -284,13 +279,6 @@
let user = resData.authTokenDTO.loginUser
uni.setStorageSync('user', user)
setTimeout(() => {
uni.showToast({
title: res.msg,
icon: 'none',
complete: (err) => {
// console.log(err)
}
})
}, 1000);
// 这里有问题
uni.redirectTo({
@@ -305,26 +293,11 @@
uni.setStorageSync('accountStatus', resData.isCompanyAccount)
let user = resData.authTokenDTO.loginUser
uni.setStorageSync('user', user)
setTimeout(() => {
uni.showToast({
title: res.msg,
icon: 'none',
complete: (err) => {
// console.log(err)
}
})
}, 1000);
let siteId = uni.getStorageSync('siteId')
if(siteId) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${siteId}`
})
return
}
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'
})
this.isSwitchEnterprises = true
// // 这里有问题
// uni.switchTab({
// url: '/pages/tabbar/home/home'
// })
}
},
}

View File

@@ -1,9 +1,10 @@
<!-- 验证码登录 账密登录 -->
<template>
<view class="login-page bg-white">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-white">
<cu-custom :callBack='backPage' class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-white">
</cu-custom>
<view class="bg-img bg-mask flex align-center" :style="'background-image: url('+imgURL+'login-bg-top.png);height: 480upx;'">
<view class="bg-img bg-mask flex align-center"
:style="'background-image: url('+imgURL+'login-bg-top.png);height: 480upx;'">
<view class="padding-xl ">
<view class="image login-bg">
<image :src="imgURL+'new-logo.png'" mode="widthFix"></image>
@@ -19,19 +20,15 @@
<scroll-view class="bg-white nav padding login-shadow">
<view class="flex text-center padding-bottom">
<view class="cu-item text-bold text-lg flex-sub">
</view>
<view class="cu-item text-bold text-lg flex-sub " :class="[1==TabCur?'text-red cur':'',(animation=='animation-fades'&&1==TabCur)?'animation-fade':'']"
<view class="cu-item text-bold text-lg flex-sub "
:class="[1==TabCur?'text-red cur':'',(animation=='animation-fades'&&1==TabCur)?'animation-fade':'']"
@tap="tabSelect(1)">
企业账号
</view>
<view class="cu-item text-bold text-lg flex-sub">
</view>
</view>
<form v-if="1==TabCur">
<view class="cu-form-group yu-input padding-top" v-if="!next">
<input name="手机号" label="手机号" type="number" placeholder="请输入企业下绑定手机号" v-model="driver.username" />
@@ -77,20 +74,24 @@
<view class="cu-load load-modal" v-if="loadModal">
</view>
<loginBottom @onCheck="checkAgree" />
<SwitchEnterprises @submit='goHome' @logout='logout' :is-show.sync="isSwitchEnterprises"></SwitchEnterprises>
</view>
</template>
<script>
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import loginBottom from './components/loginBottom.vue'
import authApi from '@/api/auth.js'
import md5 from 'js-md5'
import accountApi from '@/api/account.js'
export default {
components: {
loginBottom
loginBottom,
SwitchEnterprises
},
data() {
return {
isSwitchEnterprises: false,
showRandom: true,
animation: '',
hasPhone: false,
@@ -130,8 +131,44 @@
},
onShow() {},
methods: {
backPage() {
uni.reLaunch({
url: '/BagAuth/pages/login/login'
})
},
logout() {
let that = this
accountApi.logout('authSystem').then(res => {
if (res.code == '20000') {
uni.showToast({
title: res.msg
});
uni.clearStorageSync();
this.isSwitchEnterprises = false;
uni.reLaunch({
url: '/BagAuth/pages/login/login'
})
}
})
},
goHome() {
let siteId = uni.getStorageSync('siteId');
if (siteId) {
uni.reLaunch({
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${siteId}`
})
return
}
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'
})
},
moreLogin() {
uni.redirectTo({url:'/BagAuth/pages/login/login'})
uni.reLaunch({
url: '/BagAuth/pages/login/login'
})
},
checkAgree(val) {
this.checked = val
@@ -290,9 +327,11 @@
password: this.TabCur == 0 ? md5(this.person.password) : md5(this.company.password),
unionId: uni.getStorageSync('unionid')
}
let type = this.TabCur == 0 ? 'Personal' : 'Company'
let type = this.TabCur == 0 ? 'Personal' : 'Company';
authApi.loginPwd(data, type).then(res => {
this.loginSuccess(res)
}).catch(err => {
this.logout()
})
},
loginRandom() {
@@ -314,6 +353,8 @@
if (res.code == 20000) {
this.loginSuccess(res)
}
}).catch(err => {
this.logout()
})
},
checkPersonal() {
@@ -338,30 +379,14 @@
uni.setStorageSync('Authorization', resData.authTokenDTO.accessToken)
uni.setStorageSync('accountStatus', resData.isCompanyAccount)
uni.getUserProfile({
desc: '登录',
success: (res) => {
uni.setStorageSync('wxInfo', JSON.parse(res.rawData))
}
})
let user = resData.authTokenDTO.loginUser
uni.setStorageSync('user', user)
setTimeout(() => {
uni.showToast({
title: res.msg,
icon: 'none'
})
}, 1000);
let siteId = uni.getStorageSync('siteId')
if(siteId) {
uni.redirectTo({
url: `/BagStation/pages/stationDetail/stationDetail?siteId=${siteId}`
})
return
}
// 这里有问题
uni.switchTab({
url: '/pages/tabbar/home/home'
})
this.isSwitchEnterprises = true
}
},
checkCompany() {
@@ -520,6 +545,7 @@
justify-content: center;
align-items: center;
}
.login-bg {
width: 100%;
}

View File

@@ -10,4 +10,19 @@ export default {
data: data
})
},
//获取所有油卡
getLoginCustomerId(customerId) {
return request({
url: `/oil-finance/oilCustomerCompanyAccount/getLoginCustomerId/${customerId}`,
method: 'GET',
})
},
//确认切换油卡
chooseCompanyCard(data) {
return request({
url: `/oil-identity/operationUser/chooseCompanyCard`,
method: 'post',
data:data
})
},
}

View File

@@ -3,11 +3,12 @@ const service_name = "oil-identity"
const group_name = "weChatAuthorization"
const Wchat_id = 'wx7a939c19b270cc3d'
export default {
autoLogin (data,url) {
autoLogin (data,url,requestParameter={}) {
return request({
url: `/${service_name}/${group_name}/${url}`,
method: 'post',
data:data
data:data,
...requestParameter
})
},
wechatLogin(data) { //卡力小程序跳转登录
@@ -27,11 +28,12 @@ export default {
}
})
},
bindLoginByPhone (data,url) {
bindLoginByPhone (data,url,requestParameter={}) {
return request({
url: `/${service_name}/${group_name}/${url}`,
method: 'post',
data:data
data:data,
...requestParameter
})
},

View File

@@ -6,7 +6,7 @@ export default {
// 下单
createOrder(data) {
return request({
url: `/${service_name}/${group_name}/createOrder`,
url: `/${service_name}/${group_name}/createBOrder`,
method: 'post',
data: data
})

View File

@@ -5,7 +5,7 @@ const order_name = 'oilSiteOrderInfo'
export default {
getOrderDiscountInfo(data) {
return request({
url: `/${service_name}/${order_name}/getOrderDiscountInfo`,
url: `/${service_name}/${order_name}/getBOrderDiscountInfo`,
method: 'post',
data: data
})
@@ -50,14 +50,22 @@ export default {
getSiteList(data) {
// debugger
return request({
url: `/${service_name}/${group_name}/findSiteInfoByPage`,
url: `/${service_name}/${group_name}/findBSiteInfoByPage`,
method: 'post',
data: data
})
},
getBSitesByActivity(data) {
// debugger
return request({
url: `/${service_name}/${group_name}/getBSitesByActivity`,
method: 'post',
data: data
})
},
getSiteDetails(data) {
return request({
url: `/${service_name}/${group_name}/getSiteDetails`,
url: `/${service_name}/${group_name}/getBSiteDetails`,
method: 'post',
data: data
})
@@ -87,7 +95,7 @@ export default {
//下单 -- 获取最新油站价格、司机、加油员相关信息
getNewSitePrice(channelId) {
return request({
url: `/${service_name}/${group_name}/getNewSitePrice/${channelId} `,
url: `/${service_name}/${group_name}/getBNewSitePrice/${channelId} `,
method: 'get'
})
}, // 获取订单核销码
@@ -99,7 +107,7 @@ export default {
},
wholeStationMap(data) {
return request({
url: `/oil-site/oilSiteInfo/wholeStationMap`,
url: `/oil-site/oilSiteInfo/wholeStationMapB`,
method: 'post',
data: data
})
@@ -125,7 +133,7 @@ export default {
// 路径规划
getSiteByGeoHashNew(points) {
return request({
url: `/${service_name}/oilSiteInfo/getSiteByGeoHashNewA`,
url: `/${service_name}/oilSiteInfo/getSiteByGeoHashNewB`,
method: 'post',
data: points,
})
@@ -167,5 +175,11 @@ export default {
}
})
},
//检测在线状态
isLoginSuccess() {
return request({
url: `/oil-identity/operationUser/isLoginSuccess`,
method: 'POST',
})
},
}

View File

@@ -45,6 +45,10 @@
type: String,
default: ''
},
callBack:{
type:Function,
default:()=>null
},
isBack: {
type: [Boolean, String],
default: false
@@ -60,6 +64,9 @@
},
methods: {
BackPage() {
if(this.callBack){
this.callBack()
}else{
if(this.backCard == true){
uni.redirectTo({
url:'/BagMoney/pages/oilCards/oilCards'
@@ -72,8 +79,9 @@
})
return
}
console.log('++++++++++++')
uni.navigateBack({})
}
// uni.navigateBack({
// delta: 1
// });

View File

@@ -0,0 +1,249 @@
<template>
<view>
<uni-popup :isMaskClick="false" ref="SwitchEnterprises">
<view class="SwitchEnterprises_body">
<view class="SwitchEnterprises_title">选择登录企业/油卡</view>
<view class="card_container">
<view @click="selectIndex=index" v-for="(item,index) in cardList" :key="index" class="card_item">
<image :src="selectIndex==index? '../static/img/wx-bg.png ' : '../static/img/wx-bg@2x.png'">
</image>
<view class="card_item_container">
<text class="card_item_text">{{item.name}}</text>
<view class="card_item_label">{{item.companyNature==0?'外请':'自营'}}</view>
</view>
<view class="card_item_footer">
<view class="card_item_footer_balance">
<view v-if="item.shareCompanyQuota==1" class="isShared_tag">共享</view>
<view>
总余额
<text>{{item.balance}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="SwitchEnterprises_footer">
<view @click="logOut" class="SwitchEnterprises_footer_button">退出</view>
<view @click="submit" class="SwitchEnterprises_footer_button">确定登录</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import accountApi from '@/api/account.js'
import finance from '@/api/oil-finance.js'
export default {
name: "SwitchEnterprises",
props: {
isShow: {
type: Boolean,
default: false
}
},
data() {
return {
cardList: [],
selectIndex: 0
};
},
watch: {
isShow(n, o) {
if (n) {
this.init()
} else {
this.$refs.SwitchEnterprises.close()
}
}
},
created() {},
methods: {
async init() {
let user = uni.getStorageSync('user');
await this.getLoginCustomers(user.id);
let companyCard = uni.getStorageSync('companyCard');
if (companyCard) {
try {
companyCard = JSON.parse(companyCard);
let isSelectCard = this.cardList.findIndex(item => item.id == companyCard.id);
console.log(isSelectCard)
this.selectIndex = isSelectCard;
} catch (e) {
//TODO handle the exception
}
};
this.$refs.SwitchEnterprises.open('center')
},
logOut() {
this.$emit('logout')
},
closePopUp() {
this.$emit('update:isShow', false)
},
submit() {
let that = this
let {
companyId
} = this.cardList[this.selectIndex];
finance.chooseCompanyCard({
companyId
}).then(res => {
if (res.code == 20000) {
uni.showToast({
title: '登陆成功',
icon: 'none',
success() {
uni.setStorageSync('companyCard', JSON.stringify(that.cardList[that.selectIndex]))
that.closePopUp();
that.$emit('submit');
}
})
}
}).catch(err => {
this.logOut()
})
},
async getLoginCustomers(id) {
await finance.getLoginCustomerId(id).then(res => {
this.cardList = res.data;
})
}
}
}
</script>
<style lang="scss" scoped>
.isShared_tag {
width: 62rpx;
height: 30rpx;
border-radius: 10rpx 3rpx 10rpx 3rpx;
opacity: 1;
border: 1rpx solid #FF6700;
font-size: 22rpx;
color: #FF6700;
display: flex;
justify-content: center;
align-items: center;
margin-right: 20rpx;
}
.SwitchEnterprises_footer_button {
width: 200rpx;
height: 67rpx;
border-radius: 10rpx 10rpx 10rpx 10rpx;
border: 1rpx solid #A4A4A4;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
color: #262626;
box-sizing: border-box;
}
.SwitchEnterprises_footer_button:nth-child(2) {
background: #FF6700;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
color: #FFFFFF;
border: 0px;
margin-left: 40rpx;
}
.SwitchEnterprises_footer {
display: flex;
width: 100%;
justify-content: center;
margin-top: 35rpx;
}
.card_container {
flex: 1;
width: 100%;
margin-top: 30rpx;
overflow-y: auto;
.card_item {
.card_item_footer {
position: relative;
z-index: 1;
width: 100%;
margin-top: 20rpx;
font-size: 22rpx;
.card_item_footer_balance {
display: flex;
color: rgba(102, 102, 102, 1);
text {
color: rgba(0, 0, 0, 1);
}
}
}
.card_item_container {
display: flex;
z-index: 1;
position: relative;
overflow: hidden;
.card_item_text {
flex: 1;
font-size: 28rpx;
color: #000000;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.card_item_label {
color: #FFFFFF;
padding: 5rpx 10rpx;
font-size: 22rpx;
background: #FF6700;
border-radius: 10rpx 3rpx 10rpx 3rpx;
opacity: 1;
}
}
image {
width: 100%;
height: 172rpx;
position: absolute;
z-index: 0;
left: 0;
top: 0;
}
box-sizing: border-box;
padding: 40rpx 25rpx;
width: 100%;
height: 163rpx;
position: relative;
margin-bottom: 30rpx;
}
}
.SwitchEnterprises_title {
font-size: 28rpx;
font-weight: 600;
color: #000000;
width: 100%;
text-align: center;
line-height: 39rpx;
}
.SwitchEnterprises_body {
display: flex;
flex-direction: column;
width: 602rpx;
height: 880rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
box-sizing: border-box;
padding: 35rpx;
}
</style>

View File

@@ -5,8 +5,9 @@
</view>
<view class="content">
<view>
<view class="text-cut text-black text-lg padding-right-sm "> {{siteItem.siteName}}</view>
<view style="display: flex;">
<view style="flex-shrink:1" class="text-cut text-black text-lg padding-right-sm "> {{siteItem.siteName}}</view>
<view v-if="siteItem.siteLevel" class="siteName_tag">{{siteItem.siteLevel}}</view>
</view>
<view style="display: flex;" class="listTages">
<view :style="{background:siteItem.siteType==1?'#FF6700':'#00c15e'}" class=" cu-tag round bg-self--dark-yellow yu-tag text-xs">{{siteItem.siteType==1?'加油站':'加气站'}}</view>
@@ -30,8 +31,7 @@
{{siteItem.sitePrice|moneyFormat}}
</view>
<view class="">
<text class="cu-tag oil-tag radius text-xs"
v-if="siteItem.oilSitePrice - siteItem.sitePrice>0">{{(siteItem.oilSitePrice - siteItem.sitePrice)|moneyFormat}}</text>
<text class="cu-tag oil-tag radius text-xs" v-if="siteItem.oilSitePrice - siteItem.sitePrice>0">{{(siteItem.oilSitePrice - siteItem.sitePrice)|moneyFormat}}</text>
</view>
<view class="text-cut padding-left-sm text-lg">
<text class="text-delete color-333 text-sm padding-right-xs">
@@ -169,6 +169,19 @@
</script>
<style scoped>
.siteName_tag{
background-color: #FF6700;
border-radius: 50rpx;
width: 20px ;
height: 20px;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
font-size: 24rpx;
box-sizing: border-box;
flex-shrink: 0;
}
.site-item {
margin-bottom: 1.8rem;
align-items: flex-start !important;

View File

@@ -49,8 +49,7 @@
, {
"path": "pages/tabbar/home/link",
"style" :
{
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
@@ -85,8 +84,7 @@
, {
"path": "pages/agreeMent/OperationGuide",
"style" :
{
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
@@ -112,6 +110,22 @@
]
},
{
"root": "Activity",
"pages": [{
"path" : "pages/index/index",
"style" :
{
"navigationBarTitleText": "活动列表",
"enablePullDownRefresh": false,
"navigationStyle": "default",
"navigationBarBackgroundColor": "#FF6700",
"navigationBarTextStyle": "white"
}
}
]
},
{
"root": "Financial",
"pages": [{
@@ -120,30 +134,25 @@
}, {
"path": "pages/estimate/index",
"style": {}
}
,{
}, {
"path": "pages/details/index",
"style" :
{
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}]
},
{
"root": "AppletCode",
"pages": [{
"path": "pages/index/index",
"style" :
{
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}]
},
{
"root": "BagStation",
@@ -278,11 +287,9 @@
"enablePullDownRefresh": false
}
}
,{
}, {
"path": "pages/newRoutePlanning/newRoutePlanning",
"style" :
{
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": {
@@ -290,11 +297,9 @@
}
}
}
,{
}, {
"path": "pages/newRoutePlanning/chooseLocation",
"style" :
{
"style": {
"navigationBarTitleText": "选择位置",
"enablePullDownRefresh": false,
"navigationStyle": "default",
@@ -303,11 +308,9 @@
}
}
,{
}, {
"path": "pages/overviewMap/overviewMap",
"style" :
{
"style": {
"navigationBarTitleText": "全站地图",
"enablePullDownRefresh": false
}

View File

@@ -53,7 +53,7 @@
}
},
mounted() {
// console.log('mounted')
console.log('mounted')
},
onLoad(option) {
this.option = option;
@@ -62,7 +62,7 @@
onReady(option) {},
methods: {
versionUpdate() {
// console.log('versionUpdate')
console.log('versionUpdate')
let that = this
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
@@ -87,19 +87,25 @@
},
});
});
updateManager.onUpdateFailed(function(res) {
console.log('新的版本下载失败')
// 新的版本下载失败
});
},
initFn(option) {
// console.log(option, '启动页');
// console.log(`%c 二维码进入 ${option.scene}`, 'color:red;font-size:50px')
async 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 = '';
let isOnline = false;
if(token){
await oilSiteApi.isLoginSuccess().then(res=>{
if(res.code==20000) isOnline = true
}).catch(err=>{})
}
console.log(isOnline,'isOnline')
if (isOnline) {
this.key = '在线'
} else {
this.key = '离线'

View File

@@ -132,7 +132,7 @@
</view>
</view>
<!-- 广告图片开始 -->
<!-- <view class=" padding" style=" background-color: #f1f1f1;">
<view class=" padding" style=" background-color: #f1f1f1;">
<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'>
@@ -140,7 +140,7 @@
</swiper-item>
</swiper>
</view>
</view> -->
</view>
<!-- 筛选开始 -->
<view class="screentop bg-white " @tap="scrollScreen">
<!-- <view class="">
@@ -163,6 +163,7 @@
</template>
<script>
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import msgModels from '../../components/showModels.vue'
import accountApi from '@/api/account.js'
import Financial from '@/api/Financial.js'
@@ -174,7 +175,8 @@
components: {
siteItem,
threeSites,
msgModels
msgModels,
SwitchEnterprises
// slFilter
},
data() {
@@ -184,13 +186,17 @@
// src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2etc.png',
// // link: 'https://h5.51etr.com/pro/onlineApply/?type=20220831103626200101811'
// },
// {
// src: 'https://xoil-public.oss-cn-beijing.aliyuncs.com/WMP-IMG/banner-2dwk.png',
// link: 'https://tengxun.hkzj168.com/?ChannelId=20220831152210221048473'
// }, Activity
// {
// src:'https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/bannerindexs.png',
// JumpPage:'Financial'
// },
{
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'
src:'https://xoil-public.oss-cn-beijing.aliyuncs.com/baichuan_MP/banner_baichuan.png',
JumpPage:'Activity'
},
],
@@ -317,6 +323,11 @@
]
};
},
watch:{
showAuthFrror(n,o){
console.log(n,o,'=================')
}
},
created() {},
onReady() {
let _that = this
@@ -417,7 +428,8 @@
// url:'/BagStation/pages/makeOrder/payResult?status=success'
this.getSiteList();
},
mounted() {},
mounted() {
},
beforeCreate() {},
onReady() {
// this.getSiteList()
@@ -429,6 +441,12 @@
case "Financial":
this.shadoumeiyou(6)
break;
case "Activity":
uni.navigateTo({
url:'/Activity/pages/index/index'
})
console.log('Activity')
break;
}
}else if(item?.link){
switch (Number(index)) {

View File

@@ -32,13 +32,15 @@
</view>
</view>
</view>
<view class="xu-content margin">
<view style="position: relative;" class="xu-content margin">
<view @click="isSwitchEnterprises=true" class="switch">切换企业</view>
<view class="bg-white self-card person-card radius my-shadow" v-if="isCompany">
<view class="flex solid-bottom padding-xs justify-between company-vip">
<view class="radius padding-xs text-xs">
<view style="display: flex;" class="radius padding-xs text-xs">
<!-- <text class="icon-company cuIcon-crownfill padding-right-xs"></text> -->
<my-icon iconName="wd-qy-hy.png" class="padding-right-xs"></my-icon>
<text class="icon-company text-xs">企业会员</text>
<!-- <my-icon iconName="wd-qy-hy.png" class="padding-right-xs"></my-icon> -->
<text class="icon-company text-xs">{{companyCard.name}}</text>
<view :class="company_tag===1?'company_tag company_tag_SelfOperated':'company_tag company_tag_externalOperated'">{{companyCard.companyNature===1?'自营':'外请'}}</view>
</view>
</view>
@@ -57,7 +59,7 @@
<view class="text-center">
<text class="text-sm">您一共有
<text
class="oil-main-color padding-left-xs padding-right-xs">{{cardSum.length}}</text>
class="oil-main-color padding-left-xs padding-right-xs">{{userTotal.oilCardNumber}}</text>
张油卡</text>
</view>
</view>
@@ -126,19 +128,26 @@
</view>
</view>
</view>
<SwitchEnterprises @submit='upadteCompanyCard' @logout='logout' :is-show.sync="isSwitchEnterprises"></SwitchEnterprises>
</view>
</template>
<script>
import oilSiteApi from '@/api/oil-site.js'
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
import accountApi from '@/api/account.js'
export default {
components: {
SwitchEnterprises
},
props: {
},
data() {
return {
companyCard: null,
isSwitchEnterprises: false,
showCard: [],
hideCard: [],
cardSum: [],
@@ -152,10 +161,20 @@
};
},
onShow() {
this.getAuthInfo()
this.getAmount()
this.getAmount();
this.upadteCompanyCard()
},
methods: {
logout(){
this.isSwitchEnterprises = false
},
upadteCompanyCard() {
if (uni.getStorageSync('companyCard')) {
this.companyCard = JSON.parse(uni.getStorageSync('companyCard'))
}
},
goToPage(url) {
if (!url) return;
uni.navigateTo({
@@ -286,6 +305,46 @@
</script>
<style scoped>
.company_tag_externalOperated {
background: #FDDBDB;
color: #FE0505;
}
.company_tag_SelfOperated {
background: #FDE9DB;
color: #FF6700;
}
.company_tag {
width: 62rpx;
font-size: 22rpx;
height: 30rpx;
border-radius: 10rpx 3rpx 10rpx 3rpx;
opacity: 1;
margin-left: 20rpx;
display: flex;
justify-content: center;
align-items: center;
}
.switch {
width: 143rpx;
font-size: 24rpx;
padding: 15rpx 0;
color: #FFFFFF;
background: linear-gradient(90deg, rgba(255, 110, 11, 0.85) 0%, #FFBA8B 100%);
box-shadow: 0rpx 2rpx 7rpx 2rpx rgba(191, 191, 191, 0.2);
border-radius: 40rpx 0rpx 0rpx 40rpx;
opacity: 1;
position: absolute;
z-index: 1;
right: 0;
top: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.content {
height: 100%;
}

BIN
static/img/wx-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
static/img/wx-bg@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -5,7 +5,7 @@ import utils from '@/utils/encode'
// const env = 'test'
const env = 'production'
// 45
const testUrl = 'http://192.168.1.83:38080'
const testUrl = 'http://192.168.0.254:38080'
// const productUrl = 'https://www.xingoil.com/adminapi'
const productUrl = 'http://uat.xingoil.com/adminapi'
@@ -84,6 +84,7 @@ service.interceptors.request.use(
)
service.interceptors.response.use(
response => {
// console.log(response.config?.closePrompt,'response.config?.closePrompt')
const res = response.data
if (env === 'production') {
// 生产环境,进行加密解密,不输出日志
@@ -103,8 +104,8 @@ service.interceptors.response.use(
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 (response.config.url.indexOf('/oil-site/oilSiteAppInfo/getBSiteDetails') != -1) {
// console.log('这里是getBSiteDetails 拦截处')
// if (res.code != 20000&&res.msg!='令牌为空,不允许操作'&&res.msg!='您的ip已经更改请重新登录'&&res.msg!='登录与操作设备不同') {
// uni.showToast({
// title: res.msg,
@@ -112,8 +113,7 @@ service.interceptors.response.use(
// })
// }
} else {
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改请重新登录' && res.msg !=
'登录与操作设备不同') {
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改请重新登录' && res.msg != '登录与操作设备不同') {
uni.showToast({
title: res.msg,
icon: "none"