diff --git a/pages/realName/index/index.vue b/pages/realName/index/index.vue index 049de94..6ac45df 100644 --- a/pages/realName/index/index.vue +++ b/pages/realName/index/index.vue @@ -253,6 +253,21 @@ + + + + + + + + 选择工程 + + + + {{item.abbreviation}} + + + @@ -278,7 +293,10 @@ export default { return { userId: uni.getStorageSync('userId'), tabbar: TabbarConfig, - + type:uni.getStorageSync('realNameUser').type, + subId:uni.getStorageSync('realNameUser').subId, + showPopup:false, + proList:[], msgList: [], dataOverviewList: [ { @@ -426,8 +444,18 @@ export default { console.log('?? ~ mounted ~ mounted-index:') this.getLogin() this.getHomePageListData() + if(this.type.indexOf("4")>-1){//监督端 + this.getPro() + } + }, + onShow() { + if(this.type.indexOf("4")>-1){ //监督端 + let hasChosenPro=uni.getStorageSync('hasChosenPro') + if(!hasChosenPro){ + this.showPopup=true + } + } }, - methods: { getLogin() { const realParams = { @@ -467,48 +495,57 @@ export default { } }) }, - // 获取消息列表 - async getMsgList() { - uni.request({ - url: config.bmwUrl + '/studentUsers/getNoticeList', - method: 'post', - data: {}, - header: { - Authorization: uni.getStorageSync('access_token') - }, - success: res => { - console.log('?? ~ getMsgList ~ res:', res) - this.msgList = res.data - console.log('?? ~ getMsgList ~ this.msgList:', this.msgList) - } - }) - }, - // 点击消息 - handleMsg() { - uni.navigateTo({ - url: '/pages/realName/my/myMsg' - }) - }, - - openFaceScan() { - face.open(['a', 'c'], function (e) { - face.close() - }) - }, - - // 返回 + + //监督端获取工程列表 + getPro(){ + let param={ + id:-1, + subId:this.subId + } + console.log(param) + uni.request({ + url: config.realAppUrl + '/offLine/getPro', + method: 'post', + data: param, + header: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: uni.getStorageSync('realNameToken') + }, + success: res => { + console.log(res) + res = res.data; + if(res.code==200){ + this.proList = res.data; + } + }, + fail: err => { + console.log(err) + } + }) + }, + //展示工程选择弹窗 leftClick() { - console.log('返回') - // // 退出登录 - // uni.removeStorageSync('access_token') - // uni.removeStorageSync('userId') - // uni.removeStorageSync('userName') - // uni.removeStorageSync('className') - // uni.removeStorageSync('facePath') - uni.reLaunch({ - url: '/pages/gzt/index' - }) + console.log('返回') + if(this.type.indexOf("4")>-1){ + this.showPopup=true; + } }, + //选择工程 + chosenPro(item){ + let obj = uni.getStorageSync('realNameUser') + obj.proId=item.id + uni.setStorageSync('realNameUser', obj) + uni.setStorageSync('hasChosenPro', "1") + this.showPopup=false; + }, + closePopup() { + this.showPopup=false; + }, + openFaceScan() { + face.open(['a', 'c'], function (e) { + face.close() + }) + }, /* 获取首页数据 */ async getHomePageListData() { @@ -624,7 +661,6 @@ export default { }, }, - onShow() {} }