市北党建引领小程序初始化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

280 lines
8.0 KiB

Component({
properties: {
sudokuState: {
type: Object,
value: {
consultAvailable: "0",
appraiseAvailable: "0",
talkAndNeedAndPartyAvaliable: "0"
},
},
userInfo: {
type: Object,
},
},
observers: {
sudokuState: function (value) {
this.updateList()
}
},
data: {
isShowAll: false, // 是否显示全部菜单 默认最多显示8个(2行)
consultAvailableList: [
{
title: "网格专员",
icon: "../../../../images/home/consult.png",
triggerEvent: "navigatetoConsultion",
sort: 7
}
],
appraiseAvailableList: [
{
title: "清廉市北",
icon: "../../../../images/home/appramise.png",
triggerEvent: "navigatetoAppraise",
sort: 9
}
],
talkAndNeedAndPartyAvaliableList: [
// {
// title: "随时讲",
// icon: "../../../../images/home/suishijiang.png",
// triggerEvent: "navigateToAnytimeSay",
// sort: 1
// },
{
title: "需求清单",
icon: "../../../../images/home/xuqiuqingdan.png",
triggerEvent: "navigateToDemand",
sort: 3
},
{
title: "党群服务中心",
icon: "../../../../images/home/party-masses.png",
triggerEvent: "navigateToPartyMasses",
sort: 8
},
{
title: "问卷调查",
icon: "../../../../images/home/wenjuandiaocha.png",
triggerEvent: "navigateToQuestionnaire",
sort: 6
},
{
title: "办事指南",
icon: "../../../../images/home/banshizhinan.png",
triggerEvent: "navigateToServiceGuide",
sort: 4
}
],
commonList: [
// {
// title: "有奖举报",
// icon: "../../../../images/home/chuangC.png",
// triggerEvent: "navigateToAnytimeSay_cc",
// sort: 1
// },
// {
// title: "随时报",
// icon: "../../../../images/home/suishibao.png",
// triggerEvent: "navigateToAddIssue",
// sort: 2
// },
{
title: "通知公告",
icon: "../../../../images/home/notice.png",
triggerEvent: "navigateToNotice",
sort: 5
},
{
title: "人才赋能",
icon: "../../../../images/home/talents.png",
triggerEvent: "navigatetoTalents",
sort: 10
},
{
title: "党员风采",
icon: "../../../../images/home/partyElegant.png",
triggerEvent: "navigatetoPartyElegant",
sort: 11
},
{
title: "联建活动",
icon: "../../../../images/home/dyfc.png",
triggerEvent: "navigatetoUnionBuild",
sort: 11
},
// { **********************************暂时屏蔽这期功能不上线2022/3/31********************************************
// title: "行程上报",
// icon: "../../../../images/home/xingchengshangbao.png",
// triggerEvent: "navigateToTripReport",
// sort: 11
// },
], // 通用的菜单
menuList: []
},
lifetimes:{
attached () {
this.updateList()
}
},
methods: {
updateList () {
let list1 = []
let list2 = []
let list3 = []
if (this.data.sudokuState.consultAvailable && this.data.sudokuState.consultAvailable == "1") {
list1 = this.data.consultAvailableList
}
if (this.data.sudokuState.appraiseAvailable && this.data.sudokuState.appraiseAvailable == "1") {
list2 = this.data.appraiseAvailableList
}
if (this.data.sudokuState.talkAndNeedAndPartyAvaliable && this.data.sudokuState.talkAndNeedAndPartyAvaliable == "1") {
list3 = this.data.talkAndNeedAndPartyAvaliableList
}
const menuList = [ ...this.data.commonList, ...list1, ...list2, ...list3 ]
menuList.sort((a, b) => a.sort - b.sort)
this.setData({
menuList
})
// console.log(this.data.sudokuState, this.data.menuList)
},
navigateTo (e) {
let to = e.currentTarget.dataset.to
if (to == "navigateToTripReport") { // 行程上报
// wx.navigateTo({
// url: "/subpages/extend/pages/tripReport/tripReport"
// })
this.triggerEvent("navigateToTripReport")
} else if (to == "navigateToPartyMasses") { // 党群服务中心
this.triggerEvent("navigateToPartyMasses")
// wx.navigateTo({
// url: "/subpages/partyMassesServiceCenter/pages/partyMassesMap/partyMassesMap"
// })
} else if (to == "navigateToQuestionnaire") { // 问卷调查
this.triggerEvent("navigateToQuestionnaire")
// wx.navigateTo({
// url: "/subpages/questionnaire/pages/index/index"
// })
} else if (to == "navigateToServiceGuide") { // 办事指南
this.triggerEvent("navigateToServiceGuide")
// wx.navigateTo({
// url: "/subpages/workguide/pages/index/index"
// })
} else if (to == "navigatetoPartyElegant") { // 党员风采
this.triggerEvent("navigatetoPartyElegant")
// wx.navigateTo({
// url: "/subpages/workguide/pages/index/index"
// })
}else if (to == "navigatetoUnionBuild") { // 联建活动
this.triggerEvent("navigatetoUnionBuild")
} else if (to == "navigatetoTalents") { // 人才赋能
this.navigatetoTalents()
} else {
this.triggerEvent(to)
}
},
changeMenu () {
this.data.isShowAll = !this.data.isShowAll
this.setData({
isShowAll: this.data.isShowAll
})
},
// 跳转到需求清单
navigateToDemand () {
this.triggerEvent("navigateToDemand")
},
// 跳转到随时讲
navigateToAnytimeSay() {
this.triggerEvent("navigateToAnytimeSay")
},
// 跳转到随时讲
navigateToAnytimeSay_cc() {
this.triggerEvent("navigateToAnytimeSay_cc")
},
// 跳转到我要报事
navigateToAddIssue() {
this.triggerEvent("navigateToAddIssue")
},
// 跳转到网格专员
navigatetoConsultion() {
this.triggerEvent("navigatetoConsultion")
},
// 跳转到通知公告
navigateToNotice() {
this.triggerEvent("navigateToNotice")
},
// 跳转到请您监督
navigatetoAppraise() {
this.triggerEvent("navigatetoAppraise")
},
// 工商联
navigatetoAssociatio() {
wx.navigateToMiniProgram({
appId: "wx2e9510d76f23fff6",
path: "",
envVersion: "release", // 打开正式版ß
// envVersion: "develop",// 打开正式版ß
success() {
// 打开成功
console.log("点击允许")
},
fail: function (err) {
console.log(err)
},
})
},
// 人才赋能
navigatetoTalents() {
let { faceImg, mobile, nickname } = this.data.userInfo
console.log("", this.data.userInfo)
wx.navigateToMiniProgram({
appId: "wx8f4ebf5537cf4962",
path: "",
envVersion: "release", // 打开正式版ß
// envVersion: "develop",
success() {
// 打开成功
console.log("点击允许")
},
extraData: {
nickname,
mobile,
faceImg,
},
fail: function (err) {
console.log(err)
},
})
},
// 党史学习
navigateToPartyHistory() {
wx.navigateToMiniProgram({
appId: "wx2aed548e27e28de9",
path: "/pages/detail/detail?qid=606fc907e17b4a1a960591ca",
envVersion: "release", // 打开正式版ß
success() {
// 打开成功
console.log("点击允许")
},
fail: function (err) {
console.log(err)
},
})
},
// APP跳转
navigatetoApp() {
// console.log("111", wx.getLaunchOptionsSync())
wx.navigateTo({
url: "/pages/navigatetoApp/navigatetoApp",
})
},
launchAppError(e) {
console.log(e.detail.errMsg)
},
handleContact(e) {
console.log(e.detail.path)
console.log(e.detail.query)
},
},
})