首页工程选择

This commit is contained in:
zzyuan 2024-10-18 09:27:21 +08:00
parent a585b87456
commit d656dc9ad6
1 changed files with 79 additions and 43 deletions

View File

@ -253,6 +253,21 @@
</view>
</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>
@ -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>