This commit is contained in:
xiaozhiyong
2023-12-12 15:05:37 +08:00
parent 3bd60fe2bd
commit d2878369d4
6 changed files with 612 additions and 177 deletions

View File

@@ -82,7 +82,7 @@
<text>{{ cuIconList[0].name }}</text>
</view>
<view class="cu-item" v-for="(item,index) in menusList" :key="index" @tap="routerTo(item.path)"
v-if=' item.name != "星油云站超级管理员"'>
v-if='item.name != "星油云站超级管理员"'>
<view :class="['cuIcon-' + item.cuIcon, 'text-' + cuIconList[index+1].color]" class="text-sl">
<view class="cu-tag badge" v-if="item.badge != 0">
<block v-if="item.badge != 1">{{ item.badge > 99 ? '99+' : item.badge }}</block>
@@ -90,7 +90,7 @@
</view>
<text>{{ item.name }}</text>
</view>
<view class="cu-item" @tap="routerTo('/pages/station-price/station-price')">
<!-- <view class="cu-item" @tap="routerTo('/pages/station-price/station-price')">
<view :class="['cuIcon-' + cuIconList[1].cuIcon, 'text-' + cuIconList[1].color]" class="text-sl">
<view class="cu-tag badge" v-if="cuIconList[1].badge != 0">
<block v-if="cuIconList[1].badge != 1">
@@ -99,15 +99,10 @@
</view>
</view>
<text>{{ cuIconList[1].name }}</text>
</view>
</view> -->
<view style="height: 180rpx;display: flex;justify-content: flex-end;" class="cu-item"
@tap="routerTo('/pages/escalation/escalation')">
<!-- <view :class="['cuIcon-' + cuIconList[2].cuIcon, 'text-' + cuIconList[2].color]" class="text-sl">
<view class="cu-tag badge" v-if="cuIconList[2].badge != 0">
<block v-if="cuIconList[2].badge != 1">
{{ cuIconList[2].badge > 99 ? '99+' : cuIconList[2].badge }}</block>
</view>
</view> -->
<view>
<image style="width: 50rpx;height: 50rpx;" src="/static/img/dzsb.png"></image>
</view>
@@ -279,7 +274,6 @@
path: '/packageQr/pages/qrsite/QrCode_xy',
name: '油站二维码'
},
{
cuIcon: 'punch',
path: '/packageQr/pages/partnership/partnership',
@@ -301,16 +295,18 @@
badge: 0,
name: '交易统计'
},
]
};
},
onLoad() {
//console.log('这里是home')
const Menus = uni.getStorageSync('userMenu')
this.fistCheck()
// created() {
// let a = uni.getStorageSync('menusChangeList')
// console.log('aaaaaaaaa',a)
// },
created() {
let a = uni.getStorageSync('menusChangeList')
console.log('aaaaaaaaa',a)
this.checkInfo()
},
filters: {
numberFilter(value) {
@@ -346,6 +342,7 @@
changeMenuList(data) { //这里是切换处 更新权限menus处
const Menus = data
let menusList = []
// console.log('data',data)
Menus.forEach((item, index, Menus) => {
if (item.roleName != 'ROOT') {
menusList.push(this.Splicing(item)) //根据menus做处理
@@ -353,6 +350,7 @@
})
uni.setStorageSync('menusChangeList', menusList)
this.menusList = uni.getStorageSync('menusChangeList')
this.$emit('changMenus', this.menusList)
},
Splicing(list) {
let obj = {
@@ -374,6 +372,13 @@
obj.color = 'orange',
obj.badge = 0,
obj.name = list.roleName
} else if (list.roleName == '促销优惠') {
obj.cuIcon = 'moneybag',
obj.path = '',
// /pages/station-price/station-price
obj.color = 'orange',
obj.badge = 0,
obj.name = list.roleName
} else if (list.roleName == '加油订单') {
obj.cuIcon = 'form',
obj.path = '/packageOrders/pages/orderList/orderList',
@@ -410,6 +415,12 @@
obj.color = 'blue',
obj.badge = 0,
obj.name = list.roleName
} else if (list.roleName == '账单推送') {
obj.cuIcon = 'punch',
obj.path = '/packageBill/push/index',
obj.color = 'blue',
obj.badge = 0
obj.name = list.roleName
}
return obj
},
@@ -426,7 +437,7 @@
oliSiteApi.getSiteDetail(channelId).then(res => {
// //console.log(res)
if (res.code === 20000) {
console.log(res.data.oil)
// console.log(res.data.oil)
this.sitInfo = res.data.site
this.SiteOliInfo = res.data.oil
if (res.data.oil.length < 3) {
@@ -467,6 +478,9 @@
this.getSiteInfo(res.data.authTokenDTO.loginUser.channelId)
this.getUserInfo(id)
this.changeMenuList(res.data.authTokenDTO.loginUser.roleMenus)
} else if (res.code == 40000) {
uni.navigateTo({
url: '/pages/login/boforeLogin/boforeLogin'
@@ -513,8 +527,7 @@
})
},
scanQr() {
var scanUrl
scanUrl = '/pages/station-info/scan-camera/scan-camera'
let scanUrl = '/pages/station-info/scan-camera/scan-camera'
uni.navigateTo({
url: scanUrl,
fail: (err) => {
@@ -525,19 +538,7 @@
},
})
},
// 方便开发
// scanQr() {
// uni.setStorageSync('qrCode', 'XM&1299257961238990848')
// uni.navigateTo({
// url: '/pages/stationDetail/stationDetail',
// fail: (err) => {
// //console.log(err)
// },
// success: (res) => {
// //console.log('chengg', res)
// }
// })
// },
checkLogin() {
const token = uni.getStorageSync('Authorization')
if (!token) {
@@ -592,13 +593,6 @@
}
}
},
created() {
// 此页面onshow无法执行生命周期需要,需要走created
//console.log('这里是created')
//console.log(this.menusList)
this.checkInfo()
}
};