首页工程选择
This commit is contained in:
parent
a585b87456
commit
d656dc9ad6
|
|
@ -254,6 +254,21 @@
|
||||||
</view>
|
</view>
|
||||||
</scroll-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>
|
<m-tabbar fixed fill :current="0" :tabbar="tabbar"></m-tabbar>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -278,7 +293,10 @@ export default {
|
||||||
return {
|
return {
|
||||||
userId: uni.getStorageSync('userId'),
|
userId: uni.getStorageSync('userId'),
|
||||||
tabbar: TabbarConfig,
|
tabbar: TabbarConfig,
|
||||||
|
type:uni.getStorageSync('realNameUser').type,
|
||||||
|
subId:uni.getStorageSync('realNameUser').subId,
|
||||||
|
showPopup:false,
|
||||||
|
proList:[],
|
||||||
msgList: [],
|
msgList: [],
|
||||||
dataOverviewList: [
|
dataOverviewList: [
|
||||||
{
|
{
|
||||||
|
|
@ -426,8 +444,18 @@ export default {
|
||||||
console.log('?? ~ mounted ~ mounted-index:')
|
console.log('?? ~ mounted ~ mounted-index:')
|
||||||
this.getLogin()
|
this.getLogin()
|
||||||
this.getHomePageListData()
|
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: {
|
methods: {
|
||||||
getLogin() {
|
getLogin() {
|
||||||
const realParams = {
|
const realParams = {
|
||||||
|
|
@ -467,49 +495,58 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取消息列表
|
|
||||||
async getMsgList() {
|
//监督端获取工程列表
|
||||||
|
getPro(){
|
||||||
|
let param={
|
||||||
|
id:-1,
|
||||||
|
subId:this.subId
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
uni.request({
|
uni.request({
|
||||||
url: config.bmwUrl + '/studentUsers/getNoticeList',
|
url: config.realAppUrl + '/offLine/getPro',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {},
|
data: param,
|
||||||
header: {
|
header: {
|
||||||
Authorization: uni.getStorageSync('access_token')
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
Authorization: uni.getStorageSync('realNameToken')
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log('?? ~ getMsgList ~ res:', res)
|
console.log(res)
|
||||||
this.msgList = res.data
|
res = res.data;
|
||||||
console.log('?? ~ getMsgList ~ this.msgList:', this.msgList)
|
if(res.code==200){
|
||||||
|
this.proList = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 点击消息
|
//展示工程选择弹窗
|
||||||
handleMsg() {
|
leftClick() {
|
||||||
uni.navigateTo({
|
console.log('返回')
|
||||||
url: '/pages/realName/my/myMsg'
|
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() {
|
openFaceScan() {
|
||||||
face.open(['a', 'c'], function (e) {
|
face.open(['a', 'c'], function (e) {
|
||||||
face.close()
|
face.close()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 返回
|
|
||||||
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'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/* 获取首页数据 */
|
/* 获取首页数据 */
|
||||||
async getHomePageListData() {
|
async getHomePageListData() {
|
||||||
const { data: res } = await getHomePageListApi({})
|
const { data: res } = await getHomePageListApi({})
|
||||||
|
|
@ -624,7 +661,6 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onShow() {}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue