首页工程选择
This commit is contained in:
parent
a585b87456
commit
d656dc9ad6
|
|
@ -254,6 +254,21 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
|
||||
<!-- 选择工程弹窗 -->
|
||||
<u-popup :show="showPopup" mode="center" @close="closePopup">
|
||||
<view style="width:500rpx;height: auto%;position: relative;background-color: #fff;">
|
||||
<view style="width: 100%;height: 70rpx;margin: 0 auto;display: flex;justify-content: space-between;align-items: center;background-color: #fff;">
|
||||
<view style="width: 50%;height: 70rpx;line-height: 70rpx;font-weight: bold;margin-left: 40rpx;">选择工程</view>
|
||||
<u-icon style="width: 10%;" name="close" color="#000" size="24" @click="closePopup"></u-icon>
|
||||
</view>
|
||||
<scroll-view style="width: 100%;height: 50vh;background-color: #fff;" scroll-y="true">
|
||||
<view v-for="(item,index) in proList" :key="index" style="padding: 20rpx;" v-if="item.isActive==1" @click="chosenPro(item)">{{item.abbreviation}}</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<m-tabbar fixed fill :current="0" :tabbar="tabbar"></m-tabbar>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -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() {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue