|
|
|
var api = require('../../api/common.js')
|
|
|
|
const config = require('../../utils/config')
|
|
|
|
import {
|
|
|
|
checkUpdateAvatar,
|
|
|
|
updateAvatar
|
|
|
|
} from '../../api/clerkOnline'
|
|
|
|
const app = getApp()
|
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
panel: [],
|
|
|
|
statistics: [],
|
|
|
|
curGridId: '',
|
|
|
|
curGridName: '全部网格',
|
|
|
|
notice: 0,
|
|
|
|
checkUpdateAvatar: false,
|
|
|
|
workCheckUpdateAvatar: false,
|
|
|
|
avatar: '',
|
|
|
|
userInfo: '',
|
|
|
|
propagation: true,
|
|
|
|
joinFlag: true,
|
|
|
|
buttonName:'', // 获取点击按钮的名字
|
|
|
|
qrCodeId: '',
|
|
|
|
floatButton: {}
|
|
|
|
},
|
|
|
|
onLoad: function() {
|
|
|
|
// this.checkUpdateAvatar()
|
|
|
|
this.workCheckUpdateAvatar()
|
|
|
|
let curGrid = wx.getStorageSync('currentGrid')
|
|
|
|
if (curGrid !== '') {
|
|
|
|
this.setData({
|
|
|
|
curGridId: curGrid.deptId,
|
|
|
|
curGridName: curGrid.deptName
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if (wx.getStorageSync('token')) {
|
|
|
|
this.refreshToken()
|
|
|
|
} else {
|
|
|
|
wx.redirectTo({
|
|
|
|
url: '/pages/login/login'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
onShow: function() {
|
|
|
|
if (wx.getStorageSync('token') !== '' && wx.getStorageSync('token') !== 'undefined') {
|
|
|
|
this.getIndexStatistics()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
getIndexPanel: function() {
|
|
|
|
let that = this
|
|
|
|
api.indexPanel().then(function(res) {
|
|
|
|
res.data.forEach(item => {
|
|
|
|
if (item.templateInfo.templateCode == 'dadangwei') {
|
|
|
|
that.data.floatButton.icon = item.childNav[0].icon,
|
|
|
|
that.data.floatButton.code = item.childNav[0].navCode,
|
|
|
|
that.data.floatButton.label = item.childNav[0].label
|
|
|
|
} else {
|
|
|
|
that.data.panel.push(item)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
that.setData({
|
|
|
|
floatButton: that.data.floatButton,
|
|
|
|
panel: that.data.panel
|
|
|
|
})
|
|
|
|
console.log('panel', res.data)
|
|
|
|
that.getIndexStatistics()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getIndexStatistics: function() {
|
|
|
|
wx.showLoading({
|
|
|
|
title: '加载中',
|
|
|
|
})
|
|
|
|
let that = this
|
|
|
|
let params = {
|
|
|
|
deptId: this.data.curGridId
|
|
|
|
}
|
|
|
|
api.getIndexStatistics(params).then(function(res) {
|
|
|
|
let resData = res.data
|
|
|
|
let notice = resData.filter(function(e) {
|
|
|
|
return e.menuCode == '10005'
|
|
|
|
})
|
|
|
|
console.log('notice', notice)
|
|
|
|
if (notice.length == 0) {
|
|
|
|
that.setData({
|
|
|
|
notice: 0
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
that.setData({
|
|
|
|
notice: notice[0].menuNum
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
let tempPanel = that.data.panel
|
|
|
|
for (let i = 0; i < tempPanel.length; i++) {
|
|
|
|
for (let j = 0; j < tempPanel[i].childNav.length; j++) {
|
|
|
|
let temp = resData.filter(function(e) {
|
|
|
|
return e.menuCode == tempPanel[i].childNav[j].navCode
|
|
|
|
})
|
|
|
|
if (temp.length > 0) {
|
|
|
|
tempPanel[i].childNav[j].num = temp[0].menuNum
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
that.setData({
|
|
|
|
panel: tempPanel
|
|
|
|
})
|
|
|
|
console.log(that.data.panel)
|
|
|
|
wx.hideLoading()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
refreshToken: function() {
|
|
|
|
let that = this
|
|
|
|
wx.login({
|
|
|
|
success(res) {
|
|
|
|
let code = res.code
|
|
|
|
if (code) {
|
|
|
|
api.getToken(code).then(function(res) {
|
|
|
|
if (res.data.registerState == '0') {
|
|
|
|
wx.redirectTo({
|
|
|
|
url: '/pages/login/login'
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
wx.setStorageSync('token', res.data.token)
|
|
|
|
wx.setStorageSync('userTagKey', res.data.userTagKey)
|
|
|
|
app.globalData.deptDataScopeList = res.data.deptDataScopeList
|
|
|
|
that.getIndexPanel()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toTabs: function(e) {
|
|
|
|
console.log('e', JSON.stringify(e))
|
|
|
|
let tmp = e.currentTarget.dataset.tmp
|
|
|
|
let state = e.currentTarget.dataset.state
|
|
|
|
let navCode = e.currentTarget.dataset.navcode
|
|
|
|
switch (tmp) {
|
|
|
|
case 'tmp-1':
|
|
|
|
let childNav = [];
|
|
|
|
for (let i = 0; i < this.data.panel.length; i++) {
|
|
|
|
if (this.data.panel[i].templateInfo !== null) {
|
|
|
|
if (this.data.panel[i].templateInfo.templateCode == 'tmp-1') { ///议题管理
|
|
|
|
childNav = this.data.panel[i].childNav
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/subject/subject?state=' + state + '&childNav=' + JSON.stringify(childNav)
|
|
|
|
})
|
|
|
|
break
|
|
|
|
|
|
|
|
case 'tmp-2':
|
|
|
|
let a_childNav = [];
|
|
|
|
for (let i = 0; i < this.data.panel.length; i++) {
|
|
|
|
if (this.data.panel[i].templateInfo !== null) {
|
|
|
|
if (this.data.panel[i].templateInfo.templateCode == 'tmp-2') { ///项目管理
|
|
|
|
a_childNav = this.data.panel[i].childNav
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/project/project?state=' + state + '&childNav=' + JSON.stringify(a_childNav)
|
|
|
|
})
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
case 'tmp-3':
|
|
|
|
let b_childNav = [];
|
|
|
|
for (let i = 0; i < this.data.panel.length; i++) {
|
|
|
|
if (this.data.panel[i].templateInfo !== null) {
|
|
|
|
if (this.data.panel[i].templateInfo.templateCode == 'tmp-3') { ///用户管理
|
|
|
|
b_childNav = this.data.panel[i].childNav
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/user_moudle/userManageList/userManageList?state=' + state + '&childNav=' + JSON.stringify(b_childNav)
|
|
|
|
})
|
|
|
|
break
|
|
|
|
|
|
|
|
case 'tmp-4':
|
|
|
|
// 书记在线
|
|
|
|
this.goclerkOnline();
|
|
|
|
// let d_childNav = [];
|
|
|
|
// for (let i = 0; i < this.data.panel.length; i++) {
|
|
|
|
// if (this.data.panel[i].templateInfo !== null) {
|
|
|
|
// if (this.data.panel[i].templateInfo.templateCode == 'tmp-4') { //书记在线
|
|
|
|
// d_childNav = this.data.panel[i].childNav
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
break
|
|
|
|
|
|
|
|
case 'tmp-5':
|
|
|
|
this.gotoWork(state);
|
|
|
|
// let e_childNav = [];
|
|
|
|
// for (let i = 0; i < this.data.panel.length; i++) {
|
|
|
|
// if (this.data.panel[i].templateInfo !== null) {
|
|
|
|
// if (this.data.panel[i].templateInfo.templateCode == 'tmp-5') { ///工作日志
|
|
|
|
// e_childNav = this.data.panel[i].childNav
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// console.log('state:' + state)
|
|
|
|
// if (state === 0) { //随手记
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: '/subpages/noteIndex/pages/noteIndex/noteIndex?noteType=publish'
|
|
|
|
// })
|
|
|
|
// } else if (state === 3) {
|
|
|
|
// wx.navigateTo({
|
|
|
|
// url: '/subpages/myFootPrint/pages/myFootPrintIndex/myFootPrintIndex'
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
break
|
|
|
|
case 'tmp-6':
|
|
|
|
if(navCode==10031){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/consult/pages/consultIndex/consultIndex',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(navCode==10032){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/conflictMediation/pages/index/index',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
break
|
|
|
|
case 'tmp-7':
|
|
|
|
// let f_childNav = [];
|
|
|
|
// for (let i = 0; i < this.data.panel.length; i++){
|
|
|
|
// if (this.data.panel[i].templateInfo.templateCode == 'tmp-7') {///
|
|
|
|
// f_childNav = this.data.panel[i].childNav
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
if (navCode == 'work_log_01') {
|
|
|
|
this.toPlugin()
|
|
|
|
} else if (navCode == 'wgy_02') {
|
|
|
|
this.toWanggeyuan()
|
|
|
|
} else if (navCode.indexOf('plugin-h5') != -1) { // 如果包含plugin-h5 说明是h5 页面
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/subpages/information/pages/index/index?url=`+encodeURIComponent(e.currentTarget.dataset.remark)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
break
|
|
|
|
case 'tmp-8':
|
|
|
|
if (navCode == '10081') {
|
|
|
|
this.toPointClear()
|
|
|
|
} else if (navCode == '10082') {
|
|
|
|
this.toPointList()
|
|
|
|
}
|
|
|
|
break
|
|
|
|
default:
|
|
|
|
let c_childNav = [];
|
|
|
|
for (let i = 0; i < this.data.panel.length; i++) {
|
|
|
|
if (this.data.panel[i].templateInfo !== null) {
|
|
|
|
if (this.data.panel[i].templateInfo.templateCode == 'tmp-3') { ///用户管理
|
|
|
|
c_childNav = this.data.panel[i].childNav
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/subject/subject?state=' + state + '&childNav=' + JSON.stringify(c_childNav)
|
|
|
|
})
|
|
|
|
break
|
|
|
|
}
|
|
|
|
},
|
|
|
|
gridChange: function(e) {
|
|
|
|
console.log("切换");
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/index/gridChange/gridChange'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toNotice: function() {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/index/projectProgress/projectProgress'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toSetUp: function() {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/index/setUp/setUp'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
async checkUpdateAvatar() {
|
|
|
|
let res = await checkUpdateAvatar()
|
|
|
|
this.setData({
|
|
|
|
checkUpdateAvatar: res.data.updateFlag,
|
|
|
|
joinFlag: res.data.joinFlag
|
|
|
|
})
|
|
|
|
},
|
|
|
|
async updateAvatar() {
|
|
|
|
let obj = {
|
|
|
|
avatar: this.data.avatar
|
|
|
|
}
|
|
|
|
let res = await updateAvatar(obj)
|
|
|
|
},
|
|
|
|
// 书记在线
|
|
|
|
async getInfo(e) {
|
|
|
|
if (e.detail.errMsg == 'getUserInfo:ok') {
|
|
|
|
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
|
|
|
wx.showLoading({
|
|
|
|
title: '加载中.....', //提示的内容,
|
|
|
|
mask: true, //显示透明蒙层,防止触摸穿透,
|
|
|
|
success: res => {}
|
|
|
|
});
|
|
|
|
this.setData({
|
|
|
|
avatar: e.detail.userInfo.avatarUrl,
|
|
|
|
})
|
|
|
|
await this.updateAvatar()
|
|
|
|
wx.setStorageSync('isBackOpen', false)
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/clerkOnline/pages/myGroup/myGroup'
|
|
|
|
});
|
|
|
|
wx.hideLoading();
|
|
|
|
} else {
|
|
|
|
wx.setStorageSync('isBackOpen', false)
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/clerkOnline/pages/myGroup/myGroup'
|
|
|
|
});
|
|
|
|
wx.hideLoading();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 不需要授权的情况下
|
|
|
|
goclerkOnline() {
|
|
|
|
if (this.data.joinFlag == false) {
|
|
|
|
wx.showModal({
|
|
|
|
title: '', //提示的标题,
|
|
|
|
content: '该用户未加入书记在线功能!', //提示的内容,
|
|
|
|
showCancel: false, //是否显示取消按钮,
|
|
|
|
confirmText: '确定', //确定按钮的文字,默认为取消,最多 4 个字符,
|
|
|
|
confirmColor: '#3CC51F', //确定按钮的文字颜色,
|
|
|
|
});
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (this.data.checkUpdateAvatar) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
wx.setStorageSync('isBackOpen', false)
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/clerkOnline/pages/myGroup/myGroup'
|
|
|
|
});
|
|
|
|
},
|
|
|
|
//工作日志 是否需要更新头像
|
|
|
|
async workCheckUpdateAvatar() {
|
|
|
|
let that = this;
|
|
|
|
api.checkUpdateAvatar().then(function(res) {
|
|
|
|
that.setData({
|
|
|
|
workCheckUpdateAvatar: res.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 更新头像
|
|
|
|
async updateAvatarWork(url) {
|
|
|
|
console.log(url)
|
|
|
|
// let obj = {
|
|
|
|
// avatar: url
|
|
|
|
// }
|
|
|
|
api.updateAvatar(url).then(function(res) {
|
|
|
|
console.log('头像更新:' + JSON.stringify(res))
|
|
|
|
})
|
|
|
|
},
|
|
|
|
navigateToUd(e){
|
|
|
|
this.setData({
|
|
|
|
buttonName: e.currentTarget.dataset.navcode
|
|
|
|
})
|
|
|
|
console.log('e',e)
|
|
|
|
},
|
|
|
|
//工作日志
|
|
|
|
async getInfoWork(e) {
|
|
|
|
let _this =this;
|
|
|
|
if (e.detail.errMsg == 'getUserInfo:ok') {
|
|
|
|
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
|
|
|
// wx.showLoading({
|
|
|
|
// title: '加载中.....', //提示的内容,
|
|
|
|
// mask: true, //显示透明蒙层,防止触摸穿透,
|
|
|
|
// success: res => {}
|
|
|
|
// });
|
|
|
|
wx.request({
|
|
|
|
url: `${config.CLERKONLINE()}oss/file/saveWeChatFaceImg?avatarUrl=` + e.detail.userInfo.avatarUrl,
|
|
|
|
method: 'GET',
|
|
|
|
header: {
|
|
|
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
|
|
'Authorization': wx.getStorageSync('token')
|
|
|
|
},
|
|
|
|
success(response) {
|
|
|
|
console.log('000000000000:'+ response.data.data.url)
|
|
|
|
// _this.setData({
|
|
|
|
// avatar: response.data.data.url,
|
|
|
|
// })
|
|
|
|
_this.updateAvatarWork(response.data.data.url)
|
|
|
|
// } else {
|
|
|
|
// wx.showToast({
|
|
|
|
// title: '接口请求失败',
|
|
|
|
// icon: 'none',
|
|
|
|
// duration: 2000
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
fail(error) {
|
|
|
|
console.log(error.data)
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
avatar: e.detail.userInfo.avatarUrl,
|
|
|
|
})
|
|
|
|
|
|
|
|
// 保存成功以后跳转新的页面
|
|
|
|
if (this.data.buttonName == '10021'){//随手记
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/noteIndex/pages/noteIndex/noteIndex?noteType=publish'
|
|
|
|
})
|
|
|
|
} else if (this.data.buttonName == '10024'){//我的足迹
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/myFootPrint/pages/myFootPrintIndex/myFootPrintIndex'
|
|
|
|
})
|
|
|
|
} else if (this.data.buttonName == '10022'){//周报告
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/weeklyReport/pages/weeklyReportIndex/weeklyReportIndex?weeklyType=publish'
|
|
|
|
})
|
|
|
|
}else if (this.data.buttonName == '10023'){//月总结
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/monthlyReport/pages/monthlyIndex/monthlyIndex?monthlyType=publish'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
wx.hideLoading();
|
|
|
|
} else {
|
|
|
|
// 如果点击拒绝就直接跳转新的页面
|
|
|
|
if (this.data.buttonName == '10021') {//随手记
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/noteIndex/pages/noteIndex/noteIndex?noteType=publish'
|
|
|
|
})
|
|
|
|
} else if (this.data.buttonName == '10024') {//我的足迹
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/myFootPrint/pages/myFootPrintIndex/myFootPrintIndex'
|
|
|
|
})
|
|
|
|
}else if (this.data.buttonName == '10022'){//周报告
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/weeklyReport/pages/weeklyReportIndex/weeklyReportIndex?weeklyType=publish'
|
|
|
|
})
|
|
|
|
}else if (this.data.buttonName == '10023'){//月总结
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/monthlyReport/pages/monthlyIndex/monthlyIndex?monthlyType=publish'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
wx.hideLoading();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 不需要授权的时候跳转
|
|
|
|
gotoWork(state) {
|
|
|
|
console.log('state',state)
|
|
|
|
if (state === 0) { //随手记
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/noteIndex/pages/noteIndex/noteIndex?noteType=publish'
|
|
|
|
})
|
|
|
|
} else if (state === 3) {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/myFootPrint/pages/myFootPrintIndex/myFootPrintIndex'
|
|
|
|
})
|
|
|
|
}else if (state === 1) {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/weeklyReport/pages/weeklyReportIndex/weeklyReportIndex?weeklyType=publish'
|
|
|
|
})
|
|
|
|
}else if (state === 2){//月总结
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/monthlyReport/pages/monthlyIndex/monthlyIndex?monthlyType=publish'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
logout(){
|
|
|
|
api.logout().then(function (res) {
|
|
|
|
// $wuxToast().show({
|
|
|
|
// type: 'text',
|
|
|
|
// duration: 3000,
|
|
|
|
// color: '#fff',
|
|
|
|
// text: '退出成功',
|
|
|
|
// success: () => console.log('')
|
|
|
|
// })
|
|
|
|
console.log(wx.getStorageSync('token') + "************" + wx.getStorageSync('userTagKey'))
|
|
|
|
wx.setStorageSync('token', '')
|
|
|
|
wx.setStorageSync('userTagKey', '')
|
|
|
|
wx.setStorageSync('currentGrid', '')
|
|
|
|
console.log(wx.getStorageSync('token') + "************" + wx.getStorageSync('userTagKey'))
|
|
|
|
wx.reLaunch({
|
|
|
|
url: '../../pages/login/login'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toPlugin () {
|
|
|
|
let token = wx.getStorageSync('token')
|
|
|
|
api.getCustomId().then(res => {
|
|
|
|
if (res.code == 0 && res.msg == 'success') {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `plugin://work-plugin/main?token=${token}&customerId=${res.data}`,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}).catch(err => {
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 前往 网格员 小程序
|
|
|
|
toWanggeyuan () {
|
|
|
|
wx.navigateToMiniProgram({
|
|
|
|
appId: 'wx2b75d556ba867750',
|
|
|
|
path: `/subpages/find/pages/logRecord/reviewDetail/reviewDetail`,
|
|
|
|
extraData: {
|
|
|
|
scrip: ''
|
|
|
|
},
|
|
|
|
envVersion: 'release', //trial //develop
|
|
|
|
success(res) {
|
|
|
|
console.log(res)
|
|
|
|
},
|
|
|
|
fail(err) {
|
|
|
|
console.log(err)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 前往 积分核销
|
|
|
|
toPointClear () {
|
|
|
|
wx.scanCode({
|
|
|
|
onlyFromCamera: false,
|
|
|
|
scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
|
|
|
|
success: res => {
|
|
|
|
if (res.errMsg == 'scanCode:ok') {
|
|
|
|
this.setData({
|
|
|
|
qrCodeId: res.result
|
|
|
|
})
|
|
|
|
this.getUserinfobycode()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fail: res => {
|
|
|
|
// 接口调用失败
|
|
|
|
// wx.showToast({
|
|
|
|
// icon: 'none',
|
|
|
|
// title: '接口调用失败!'
|
|
|
|
// })
|
|
|
|
},
|
|
|
|
complete: res => {
|
|
|
|
// 接口调用结束
|
|
|
|
console.log(res)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getUserinfobycode() {
|
|
|
|
let para = {
|
|
|
|
qrCodeId: this.data.qrCodeId
|
|
|
|
}
|
|
|
|
api.getUserinfobycode(para).then(function (res) {
|
|
|
|
let {
|
|
|
|
faceImg,
|
|
|
|
points,
|
|
|
|
realName,
|
|
|
|
userId
|
|
|
|
} = res.data
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/subpages/pointManagement/pages/pointClear/pointClear?faceImg=${faceImg}&points=${points}&realName=${realName}&userId=${userId}`
|
|
|
|
})
|
|
|
|
}).catch(err => {
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 前往 核销记录
|
|
|
|
toPointList () {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/subpages/pointManagement/pages/pointList/pointList'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 一户一码 前往 家庭
|
|
|
|
toFamily () {
|
|
|
|
wx.scanCode({
|
|
|
|
onlyFromCamera: false,
|
|
|
|
scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
|
|
|
|
success: res => {
|
|
|
|
if (res.errMsg == 'scanCode:ok') {
|
|
|
|
if (res.result) {
|
|
|
|
const arr = decodeURIComponent(res.result).split('/')
|
|
|
|
const roomCode = arr[arr.length - 1]
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/subpages/family/pages/index/index?roomCode=${roomCode}`
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fail: res => {
|
|
|
|
// 接口调用失败
|
|
|
|
// wx.showToast({
|
|
|
|
// icon: 'none',
|
|
|
|
// title: '接口调用失败!'
|
|
|
|
// })
|
|
|
|
},
|
|
|
|
complete: res => {
|
|
|
|
// 接口调用结束
|
|
|
|
console.log(res)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 点击悬浮按钮 大党委
|
|
|
|
clickMoveButton () {
|
|
|
|
const tabMenu = [
|
|
|
|
{
|
|
|
|
label: '待处理'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '已结案'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '已关闭'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/project/project?state=0&childNav=' + JSON.stringify(tabMenu) + '&isPartyFlag=1'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|