提交 9608305b 作者: wk

问题修复优化

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