提交 9608305b 作者: wk

问题修复优化

父级 88e1270e
......@@ -2,7 +2,8 @@
export default {
globalData: {
userInfo: {},
isReject: false
isReject: false,
authMenus: []
},
onLaunch: function() {
console.log('App Launch')
......
......@@ -19,7 +19,7 @@ const http = (params) => {
resolve(result)
} else if (result.code == 10201) { //token失效
uni.navigateTo({
url: "/pages/wxLogin/wxLogin"
url: "/pages/login/authLogin/authLogin"
})
} else if (result.code == 33199) {
resolve(result)
......
......@@ -10,10 +10,10 @@ const $imageUtils = {
newPath = url
}
}
if (newPath.indexOf(',') != -1) {
var urls = newPath.split(",")
return urls[0]
}
// if (newPath.indexOf(',') != -1) {
// var urls = newPath.split(",")
// return urls[0]
// }
return newPath
}
}
......
......@@ -92,6 +92,19 @@
}
},
scanToForm() {
var role = getApp().globalData.userInfo.identity.code
if (role == 'VISITOR') {
uni.showModal({
title: '提示',
content: "您暂无权限使用该功能",
showCancel: true,
confirmText: "知道了",
confirmColor: '#3B73FE',
showCancel: false,
success: res => {}
})
return
}
let that = this
uni.scanCode({
success(res) {
......
<template>
<view class="content">
<titleBar title="业务名称"></titleBar>
<titleBar :title="title"></titleBar>
<view class="search-content">
<view class="search">
<image class="image" src="../../../static/ic-search.png"></image>
......@@ -37,13 +37,15 @@
isDownFinish: true,
search_field: "",
field_name: "",
timer: {}
timer: {},
title: ""
}
},
onLoad(options) {
this.bus_id = options.bus_id
this.field_name = options.field_name
this.search_field = options.field
this.title = options.title
this.getQrcodeList()
},
onPullDownRefresh() {
......@@ -369,6 +371,8 @@
width: 128rpx;
height: 60rpx;
border-radius: 30rpx;
align-items: center;
justify-content: center;
background: #fff;
border: 2rpx solid #3B73FE;
......
......@@ -3,11 +3,21 @@
<titleBar title="数据智管"></titleBar>
<view class="list-content">
<view class="left-content">
<view v-for="(item,index) in bussinessList" :key="index" :class="leftIndex==index?'item-sel':'item'"
@click="itemSel(index)">
<view v-for="(item,index) in bussinessList" :key="index" class="item" @click="itemSel(index)">
<view v-if="leftIndex != index" class="nor-item">
<text class="text">{{item.cate_name}}</text>
</view>
<view v-if="index == 0 && leftIndex == index" class="item-sel-top">
<text class="text">{{item.cate_name}}</text>
</view>
<view v-if="index == endIndex&&leftIndex == index" class="item-sel-bottom">
<text class="text">{{item.cate_name}}</text>
</view>
<view class="item-sel" v-if="index>0&&index<endIndex&&leftIndex == index">
<text class="text">{{item.cate_name}}</text>
</view>
</view>
</view>
<view class="right-content">
<view v-for="(item,index) in codeList" :key="index" class="item-content">
<view class="name" @click="toCode(index)">{{item.bus_name}}</view>
......@@ -27,7 +37,8 @@
project_id: "",
bussinessList: [],
leftIndex: 0,
codeList: []
codeList: [],
endIndex: 0
}
},
onLoad(options) {
......@@ -35,6 +46,14 @@
this.getBussinessList()
},
methods: {
itemClass(index) {
return {
// "item": this.leftIndex != index,
'item-sel-top': index == 0 && this.leftIndex == index,
'item-sel-bottom': index == this.bussinessList.length - 1 && this.leftIndex == index,
'item-sel': this.leftIndex == index
}
},
itemSel(index) {
this.leftIndex = index
this.codeList = this.bussinessList[index].children
......@@ -52,7 +71,7 @@
field = bus.search_field.field || ""
}
uni.navigateTo({
url: `/pages/gallery/bussData/bussData?bus_id=${bus.bus_id}&field_name=${field_name}&field=${field}`
url: `/pages/gallery/bussData/bussData?bus_id=${bus.bus_id}&field_name=${field_name}&field=${field}&title=${bus.bus_name}`
})
},
getDownUrl(bus_id) {
......@@ -138,6 +157,7 @@
console.log("分类列表", result);
if (result.code == 0) {
this.bussinessList = result.data.list
this.endIndex = this.bussinessList.length - 1
if (this.bussinessList.length > 0) {
this.codeList = this.bussinessList[0].children
}
......@@ -177,6 +197,15 @@
align-items: center;
justify-content: center;
.nor-item {
height: 104rpx;
width: 230rpx;
background-color: #EBF2FF;
display: flex;
border-radius: 30rpx 0 0 0;
align-items: center;
justify-content: center;
text {
color: #656565;
font-family: "PingFang SC Medium";
......@@ -271,6 +300,9 @@
text-align: center;
}
}
}
}
.right-content {
......
......@@ -75,11 +75,11 @@
list: []
}],
current: 0,
tabs: ["生活服务", "综合办公", "岗位工作"],
tabs: ["岗位工作", "综合办公", "生活服务"],
requestParam: {
page: 1,
per_page: 500,
authed: 1,
authed: 0,
showed: 1,
app_endpoint: 2,
is_publish: 1,
......@@ -246,9 +246,22 @@
})
},
linkToData() {
var role = getApp().globalData.userInfo.identity.code
if (role == 'VISITOR') {
uni.showModal({
title: '提示',
content: "您暂无权限使用该功能",
showCancel: true,
confirmText: "知道了",
confirmColor: '#3B73FE',
showCancel: false,
success: res => {}
})
} else {
uni.navigateTo({
url: "/pages/gallery/dataManager/dataManager"
})
}
},
getMessages() {
Api.getMessages({
......
......@@ -5,7 +5,7 @@
<navbar :title="title" :showBack="false"></navbar>
<!-- 天气 -->
<view class="weather-content" :style="{top:statusBarHeight+36+'px'}"
v-if="isCompShow('onepoint-weather','tq')">
v-if="isCompShow('onepoint-weather','ydt-tq')">
<view class="temp-content" @click="toLinkOther">
<view class="temp">{{weather.temp}}</view>
<view class="weather">{{weather.weather}}</view>
......@@ -22,11 +22,11 @@
</view>
<!-- <view class="banner-content" :style="{top:statusBarHeight+116+'px'}"> -->
<ls-swiper :list="banners" imgKey="coverImg" :loop="true" :dots='true' :autoplay='true' height='142'
@clickItem="clickItem()" v-if="isCompShow('OnePointBanner','lbt')" />
@clickItem="clickItem()" v-if="isCompShow('OnePointBanner','ydt-lbt')" />
<!-- </view> -->
</view>
<!-- 工地头条 -->
<view class=" top-new-content" @click="toLinkNew" v-if="isCompShow('OnePointNews','gdtt')&&role!='VISITOR'">
<view class=" top-new-content" @click="toLinkNew" v-if="isCompShow('OnePointNews','ydt-gdtt')&&role!='VISITOR'">
<image src="../../static/notice.png" class="image"></image>
<view class="title">工地头条</view>
<swiper circular="true" :autoplay="true" class="swiper" :vertical="true">
......@@ -37,7 +37,7 @@
<image src="../../static/right-arrow.png" class="right-arrow"></image>
</view>
<!-- 常用应用 -->
<view class="bus-content" v-if="isCompShow('OnePointBusiness','cyyy')">
<view class="bus-content" v-if="isCompShow('OnePointBusiness','ydt-cyyy')">
<view class="tab-content">
<view class="tab-item" @click="select(0)">
<view :class="isCommonSel?'tab-text-sel':'tab-text'">常用业务</view>
......@@ -74,7 +74,7 @@
</view>
</view>
<!-- 积分兑换 -->
<view class="score-content" v-if="isCompShow('OnePointScore','jfdh')&&role=='WORKER'">
<view class="score-content" v-if="isCompShow('OnePointScore','ydt-jfdh')&&role=='WORKER'">
<view class="title-content">
<view class="title">积分兑换</view>
<view class="more" @click="toLinkScore">更多</view>
......@@ -215,7 +215,6 @@
that.getUserInfo()
that.getSetting()
that.getHomeComp()
that.getWeather()
if (that.isCommonSel) {
that.getCommonApp()
} else {
......@@ -460,7 +459,7 @@
Api.getExchangeList({
data: {
project_id: this.project_id,
type: 1,
type: 2,
is_page: 1,
page: 1,
page_size: 10,
......@@ -568,16 +567,19 @@
}
this.getNews()
this.getBanners()
this.getWeather()
this.getAuthMenu()
},
getAuthMenu() {
Api.getAuthMenu({
data: {
user_id: this.userInfo.user.user_id
user_id: this.userInfo.user.user_id,
system_no: this.$config.systemCode
}
}).then((result) => {
console.log("权限菜单", result);
this.menus = result.data.list
getApp().globalData.authMenus = this.menus
})
},
toLogin: function() {
......
......@@ -136,7 +136,7 @@
font-weight: 600;
font-size: 28rpx;
width: 420rpx;
text-align: left;
text-align: center;
color: #333;
}
}
......
......@@ -9,9 +9,9 @@
<view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)">
<view class="new-content">
<view class="title">{{item.title}}</view>
<view class="user">{{item.updateUserName}} {{item.articleTime}}</view>
<view class="user">{{item.createdUserName}} {{item.articleTime}}</view>
</view>
<image class="image" :src="dealImage(item.coverImg)"></image>
<image class="image" :src="httpToHttps(item.coverImg)"></image>
</view>
</view>
</view>
......@@ -57,6 +57,9 @@
}
},
methods: {
httpToHttps(url) {
return this.$imageUtils.httpToHttps(url)
},
dealImage(url) {
var newPath = ""
if (url) {
......
......@@ -38,6 +38,8 @@
return '../../../static/sun-cloudy-ic.png'
} else if (img == 7) {
return '../../../static/light-rain-ic.png'
} else if (img == 21) {
return '../../../static/moderate-rain-ic.png'
}
}
}
......
......@@ -9,8 +9,8 @@
</view>
</picker>
<view
style="display: flex;flex-direction: row;align-self:flex-end;color: #1890FF;font-size: 14px;margin-top: 10px;"
@click="createProject">
style="display: flex;flex-direction: row;align-self:flex-end;color: #3B73FE;font-size: 14px;margin-top: 10px;"
@click="createProject" v-if="false">
创建项目部</view>
</view>
<view class="item-content">
......
......@@ -28,7 +28,9 @@
scanType: ['qrcode'],
success: (res) => {
console.log("扫码结果", res);
try {
let result = JSON.parse(res.result)
if (result && typeof result == 'object') {
let type = result.type
if (type == "company") {
this.code = result.text
......@@ -48,6 +50,12 @@
} else {
this.$toast.showToast("二维码格式不正确")
}
} else {
this.$toast.showToast("二维码格式不正确")
}
} catch (e) {
this.$toast.showToast("二维码格式不正确")
}
},
fail: (res) => {
console.log("扫码结果", res);
......@@ -76,7 +84,7 @@
content: err.msg,
showCancel: true,
confirmText: "知道了",
confirmColor: '#1890FF',
confirmColor: '#3B73FE',
showCancel: false,
success: res => {}
})
......
......@@ -40,7 +40,7 @@
<view class="version-content">
<text class="text">当前版本:v1.0.0</text>
</view>
<view class="btn-org" @click="linkTo('/pages/mine/changeCompany/changeCompany')">
<view class="btn-org" @click="linkTo('/pages/mine/changeCompany/changeCompany')" v-if="role!='VISITOR'">
<text class="text">切换组织</text>
</view>
<view class="btn-logout" @click="toLinkLogin">
......@@ -61,7 +61,9 @@
identity: {
code: "WORKER"
}
}
},
menus: [],
role: "VISITOR"
}
},
onLoad() {
......@@ -80,27 +82,72 @@
)
console.log("当前岗位", job);
this.currentJob = job
this.menus = getApp().globalData.authMenus
this.role = this.userInfo.identity.code
},
methods: {
isShow(name) {
if (name == '项目信息' || name == '项目过往') {
return this.userInfo.identity.code == 'PM' || this.userInfo.identity.code == 'WORKER'
if (name == '加入组织') {
return this.role == 'VISITOR'
}
if (name == '项目信息') {
if (this.role == 'PM') {
return true
} else if (this.role == 'WORKER') {
return this.isWorkerHasAuth('ydt-xmxx')
}
return false
}
if (name == '我的审批') {
return this.userInfo.identity.code == 'PM'
return this.role == 'PM'
}
if (name == '我的积分') {
return this.userInfo.identity.code == 'WORKER'
return this.role == 'WORKER' && this.isWorkerHasAuth('ydt-wdjf')
}
},
isWorkerHasAuth(obj) {
if (this.menus && this.menus.length > 0) {
//是否有小程序权限
var app = this.menus.find(item => item.object_no == 'gdydt')
console.log("app");
if (app) {
var mainAuthMenus = app.children_list
console.log("mainAuthMenus", mainAuthMenus);
if (mainAuthMenus && mainAuthMenus.length > 0) {
var mineMenus = mainAuthMenus.find(item => item.object_no == 'ydt-wd')
console.log("mineMenus", mineMenus);
if (mineMenus) {
var childMenus = mineMenus.children_list
console.log("childMenus", childMenus);
if (childMenus && childMenus.length > 0) {
var child = childMenus.find(item => item.object_no == obj)
if (child) {
return true
}
if (name == '加入组织') {
return this.userInfo.identity.code == 'VISITOR'
}
}
}
}
}
return false
},
toLinkLogin() {
uni.showModal({
title: '提示',
content: `确定退出登录?`,
confirmColor: "#3B73FE",
success: (res) => {
if (res.confirm) {
uni.clearStorageSync()
uni.reLaunch({
url: "/pages/user/login/login"
})
} else if (res.cancel) {
}
}
})
},
linkTo(router) {
console.log("跳转路由", router);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment