提交 11a58797 作者: wk

新闻和操作权限接口调试

父级 e3d01697
......@@ -12,7 +12,7 @@ if (ENV == "dev") {
labourAppNo: "appletlabourboard",
jzgrAppNo: "", //建筑工人沟通日
jyxyAppNo: "", //教育学院
jfscAppNo: ""
jfscAppNo: "63f05e5dc9d53f743030fa92"
}
} else {
if (ENV == 'test') {
......@@ -41,7 +41,7 @@ if (ENV == "dev") {
labourAppNo: "20230207002", //劳务看板
jzgrAppNo: "63e1e639e7025e13c471a9d2", //建筑工人沟通日
jyxyAppNo: "63e1f98420836820ca5e3c02", //教育学院
jfscAppNo: "63f05e5dc9d53f743030fa92" //积分商城
jfscAppNo: "" //积分商城
}
}
}
......
......@@ -440,7 +440,7 @@
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有删除权限,如需要请联系管理员',
content: '您没有删除权限,如需要请联系管理员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
......@@ -546,7 +546,7 @@
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有新增权限,如需要请联系管理员',
content: '您没有新增权限,如需要请联系管理员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
......@@ -591,7 +591,7 @@
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有编辑权限,如需要请联系管理员',
content: '您没有编辑权限,如需要请联系管理员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
......@@ -624,7 +624,7 @@
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有编辑权限,如需要请联系管理人员',
content: '您没有查看权限,如需要请联系管理员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
......@@ -651,7 +651,7 @@
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有删除权限,如需要请联系管理员',
content: '您没有删除权限,如需要请联系管理员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
......@@ -704,7 +704,7 @@
if (!isAuth) {
uni.showModal({
title: '提示',
content: '您没有查看权限,如需要请联系管理员',
content: '您没有查看权限,如需要请联系管理员',
showCancel: false,
confirmText: "知道了",
confirmColor: '#3B73FE',
......
......@@ -111,7 +111,7 @@
this.getMessages()
this.getNeedDo()
this.getAppGroup()
uni.$once("refreshOrg", res => {
uni.$on("refreshOrg", res => {
this.orgName = uni.getStorageSync("org_name")
})
if (!uni.getStorageSync("org_name")) {
......@@ -122,6 +122,9 @@
}
this.getMostUsed()
},
onUnload() {
uni.$off("refreshOrg")
},
onPageScroll(e) {
//#ifdef H5
this.isFix = true
......
......@@ -163,7 +163,6 @@
onLoad() {
getApp().globalData.isInit = true
const info = uni.getSystemInfoSync()
console.log("系统", info);
if (info.platform == 'windows') {
this.statusBarHeight = info.safeArea.top
} else {
......@@ -183,6 +182,19 @@
this.getRecentlyApp()
}
})
uni.$on("refreshOrg", res => { //组织切换了
this.project_id = uni.getStorageSync("project_id")
if (!this.project_id) {
this.getCompanyBanners()
this.getCompanyNews()
} else {
this.getNews()
this.getBanners()
}
})
},
onUnload() {
uni.$off("refreshOrg")
},
methods: {
toJoinOrg() {
......@@ -242,7 +254,6 @@
}
}).then(res => {
let result = res.data
console.log("项目列表:", result);
if (result.code === 0) {
if (result.data.list.length > 0) {
this.project = result.data.list[0]
......@@ -328,8 +339,14 @@
if (this.role == 'VISITOR' || this.banners.length == 0) {
return
}
this.project_id = uni.getStorageSync("project_id")
var isComp = 0
if (!this.project_id) { //企业级
isComp = 1
}
uni.navigateTo({
url: `/pages/index/siteNewList/siteNewList?clientId=1&projectId=` + this.project_id
url: `/pages/index/siteNewList/siteNewList?clientId=1&projectId=` + this.project_id +
"&isComp=" + isComp
})
},
toLinkOther() {
......@@ -446,7 +463,7 @@
})
},
getCompanyNews() {
Api.getNews({
Api.getCompanyNews({
data: {
pageNum: 1,
pageSize: 10,
......@@ -464,7 +481,7 @@
})
},
getCompanyBanners() {
Api.getNews({
Api.getCompanyNews({
data: {
pageNum: 1,
pageSize: 5,
......@@ -531,8 +548,15 @@
})
},
toLinkNew() {
this.project_id = uni.getStorageSync("project_id")
var isComp = 0
console.log("项目Id", this.project_id);
if (!this.project_id) { //企业级
isComp = 1
}
uni.navigateTo({
url: `/pages/index/siteNewList/siteNewList?clientId=2&projectId=` + this.project_id
url: `/pages/index/siteNewList/siteNewList?clientId=2&projectId=` + this.project_id +
"&isComp=" + isComp
})
},
getMyScore() {
......@@ -624,13 +648,10 @@
var app = this.menus.find(item => item.object_no == 'gdydt')
if (app) {
var mainAuthMenus = app.children_list
// console.log("mainAuthMenus", mainAuthMenus);
if (mainAuthMenus && mainAuthMenus.length > 0) {
var mineMenus = mainAuthMenus.find(item => item.object_no == 'ydtsy')
// 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) {
......@@ -664,12 +685,14 @@
this.getDeptProject()
} else {
uni.setStorageSync("org_name", currentJob.org_name)
uni.setStorageSync("project_id", "")
this.initData()
}
} else {
uni.setStorageSync("org_no", "")
uni.setStorageSync("org_id", "")
uni.setStorageSync("org_name", "")
uni.setStorageSync("project_id", "")
this.initData()
}
getApp().globalData.isInit = false
......
......@@ -44,12 +44,14 @@
},
id: "",
text: "",
clientId: ""
clientId: "",
isComp: 0
}
},
onLoad(options) {
this.id = options.id
this.clientId = options.clientId
this.isComp = options.isComp
this.getNewDetail()
},
methods: {
......@@ -64,7 +66,7 @@
toLinkDetail(item) {
uni.navigateTo({
url: "/pages/index/newDetail/newDetail?id=" + item.articleLibraryId + "&clientId=" + this
.clientId
.clientId + "&isComp=" + this.isComp
})
},
onEditorReady(content) {
......@@ -95,12 +97,20 @@
return text
},
getNewDetail() {
Api.getNewDetail({
data: {
var data = {
articleLibraryId: this.id,
projectId: uni.getStorageSync("project_id") || "",
clientId: this.clientId
}
if (this.isComp == 1) {
data = {
articleLibraryId: this.id,
projectId: uni.getStorageSync("project_id") || "",
orgId: uni.getStorageSync("org_id") || "",
clientId: this.clientId
}
}
Api.getNewDetail({
data: data
}).then((result) => {
if (result.code == 0) {
this.list = []
......
......@@ -33,12 +33,15 @@
clientId: 2,
key: "",
projectId: "",
title: "工地头条"
title: "工地头条",
isComp: 0
}
},
onLoad(option) {
this.clientId = option.clientId
this.projectId = option.projectId
this.isComp = option.isComp
console.log("是否企业级", this.isComp);
this.getNews()
if (this.clientId == 1) {
this.title = "新闻公告"
......@@ -84,7 +87,7 @@
toLinkDetail(item) {
uni.navigateTo({
url: "/pages/index/newDetail/newDetail?id=" + item.articleLibraryId + "&clientId=" + this
.clientId
.clientId + "&isComp=" + this.isComp
})
},
search(e) {
......@@ -93,31 +96,59 @@
this.getNews()
},
getNews() {
Api.getNews({
data: {
pageNum: this.page,
pageSize: this.pageSize,
clientId: this.clientId,
title: this.key,
projectId: this.projectId
}
}).then((result) => {
uni.stopPullDownRefresh()
if (result.code == 0) {
let list = result.data.list
if (list.length == this.pageSize) {
this.isHasMore = true
if (this.isComp == 1) {
Api.getCompanyNews({
data: {
pageNum: this.page,
pageSize: this.pageSize,
clientId: this.clientId,
title: this.key,
orgId: uni.getStorageSync("org_id")
}
}).then((result) => {
uni.stopPullDownRefresh()
if (result.code == 0) {
let list = result.data.list
if (list.length == this.pageSize) {
this.isHasMore = true
} else {
this.isHasMore = false
}
if (this.page == 1) {
this.list = []
}
this.list = this.list.concat(list)
} else {
this.isHasMore = false
this.$toast.showToast(result.msg)
}
if (this.page == 1) {
this.list = []
})
} else {
Api.getNews({
data: {
pageNum: this.page,
pageSize: this.pageSize,
clientId: this.clientId,
title: this.key,
projectId: this.projectId
}
this.list = this.list.concat(list)
} else {
this.$toast.showToast(result.msg)
}
})
}).then((result) => {
uni.stopPullDownRefresh()
if (result.code == 0) {
let list = result.data.list
if (list.length == this.pageSize) {
this.isHasMore = true
} else {
this.isHasMore = false
}
if (this.page == 1) {
this.list = []
}
this.list = this.list.concat(list)
} else {
this.$toast.showToast(result.msg)
}
})
}
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment