联调接口
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
<img class="pic-img" :src="'static/images/userinfo/icon-userinfo.png'" />
|
||||
<view class="head-name">
|
||||
<view class="nick">
|
||||
<view class="nick-text">{{ userObj.name }}</view>
|
||||
<view class="nick-text">{{ userObj.realname }}</view>
|
||||
<img :src="`static/images/userinfo/num-${userObj.level}@2x.png`" class="level" />
|
||||
</view>
|
||||
<view class="dept">{{ userObj.deptName }} {{ userObj.jobName }}</view>
|
||||
<view class="dept">{{ userObj.deptName }} {{ userObj.postName }}</view>
|
||||
</view>
|
||||
<view class="head-right">
|
||||
<view class="font-ruzhi">已入职{{userObj.joinDay}}天</view>
|
||||
@@ -27,12 +27,12 @@
|
||||
</view>
|
||||
|
||||
<!-- 日常 -->
|
||||
<view class="backlog-bg">
|
||||
<view class="backlog-b-item">
|
||||
<img :src="'static/images/business/icon-rwjh.png'" />
|
||||
<view class="font-title">任务计划</view>
|
||||
</view>
|
||||
<view class="backlog-b-item">
|
||||
<!-- <view class="backlog-bg">
|
||||
<view class="backlog-b-item" v-for="(item,index) in bizListFavorite" :key="index">
|
||||
<img :src="'static/images/business/'+item.icon+'.png'" />
|
||||
<view class="font-title">{{item.bizName}}</view>
|
||||
</view> -->
|
||||
<!-- <view class="backlog-b-item">
|
||||
<img :src="'static/images/business/icon-rb.png'" />
|
||||
<view class="font-title">日报</view>
|
||||
</view>
|
||||
@@ -43,11 +43,11 @@
|
||||
<view class="backlog-b-item">
|
||||
<img :src="'static/images/business/icon-jxgl.png'" />
|
||||
<view class="font-title">绩效管理</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- </view> -->
|
||||
|
||||
<!-- 头像块 -->
|
||||
<view class="white-bg">
|
||||
<view class="white-bg" style="margin-top:20rpx;">
|
||||
<view class="list-item">
|
||||
<img :src="'static/images/userinfo/icon-tx@2x.png'" class="l-icon" />
|
||||
<text>头像</text>
|
||||
@@ -78,9 +78,9 @@
|
||||
<view class="item-border"></view>
|
||||
<view class="list-item item-padding" @click="handleVersion">
|
||||
<img :src="'static/images/userinfo/icon-bbgx@2x.png'" class="l-icon" />
|
||||
<view class="item-text">版本更新 <view class="dot"></view></view>
|
||||
<view class="item-text">版本更新 <view class="dot" v-if="isCurrent==2"></view></view>
|
||||
<view class="list-right">
|
||||
<text class="item-gray">Version 1.0.0</text>
|
||||
<text class="item-gray">Version {{ appVersion }}</text>
|
||||
<uni-icons type="right" size="20" color="#A0A0A0"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
@@ -99,21 +99,27 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
// import customHeader from '@/components/customHeader.vue'
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import { getNavBarPaddingTop } from '@/utils/system.js'
|
||||
import { getUserInfo } from '@/api/auth.js'
|
||||
import { getUserInfo,versionCheck } from '@/api/auth.js'
|
||||
import { formatIOS } from '@/utils/status.js'
|
||||
import { useUserStore } from '@/stores/user';
|
||||
const userStore = useUserStore()
|
||||
|
||||
onLoad(async(opt) => {
|
||||
uni.setStorageSync('page_cache',true);
|
||||
})
|
||||
|
||||
// 1.头部导航栏
|
||||
const navBarPaddingTop = ref(0);
|
||||
let appVersion = ref("1.0.0");//当前版本号
|
||||
|
||||
let isCurrent = ref(undefined);//是否是当前版本 1-是 2-否
|
||||
let systemInfo = uni.getSystemInfoSync();
|
||||
onLoad(async(opt) => {
|
||||
uni.setStorageSync('page_cache',true);
|
||||
// #ifdef APP-PLUS
|
||||
appVersion.value=systemInfo.appWgtVersion; //当前版本号
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
appVersion.value=systemInfo.appVersion;
|
||||
// #endif
|
||||
})
|
||||
|
||||
// 下拉刷新
|
||||
const mescrollRef = ref(null);
|
||||
@@ -127,26 +133,63 @@ const downOption = ref({
|
||||
textLoading: '刷新中...'
|
||||
});
|
||||
|
||||
// 2.获取用户基本信息
|
||||
let userObj = ref({});
|
||||
let bizListFavorite = ref([]);
|
||||
const selectUserInfo = async ()=>{
|
||||
let data = await getUserInfo({});
|
||||
|
||||
// 查询常用业务
|
||||
// let favoriteBizListStr = data.favoriteBizList || '';
|
||||
// let favoriteBizList = favoriteBizListStr.split(",");//常用业务
|
||||
// let list = [];
|
||||
// let bizList = data.bizList;//所有业务
|
||||
// bizList.forEach(item => {
|
||||
// favoriteBizList.forEach(item2=>{
|
||||
// if(item.bizId == item2){
|
||||
// list.push(item);
|
||||
// }
|
||||
// })
|
||||
// });
|
||||
// bizListFavorite.value = list;
|
||||
|
||||
// 岗位名称,取第0个显示
|
||||
let postName = data.postList[0]?data.postList[0].postName:'';
|
||||
userObj.value = {
|
||||
...data,
|
||||
postName,
|
||||
level:5,//默认搞个5
|
||||
joinDay:1000,//默认1000天
|
||||
};
|
||||
}
|
||||
|
||||
// 下拉刷新
|
||||
const downCallback = async (mescroll) => {
|
||||
try {
|
||||
setTimeout(async ()=>{
|
||||
// mescroll.resetUpScroll();
|
||||
},500);
|
||||
selectUserInfo();
|
||||
getVersion();
|
||||
} catch (error) {
|
||||
mescroll.endErr();
|
||||
} finally {
|
||||
setTimeout(async ()=>{
|
||||
mescroll.endSuccess();
|
||||
},500);
|
||||
mescroll.endSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
// 2.获取用户基本信息
|
||||
let userObj = ref({});
|
||||
const selectUserInfo = async ()=>{
|
||||
let data = await getUserInfo({});
|
||||
userObj.value = data;
|
||||
// 3.查询是否有更新的版本显示点
|
||||
const getVersion = async ()=>{
|
||||
let param = {
|
||||
// #ifdef APP-PLUS
|
||||
verNumber:systemInfo.appWgtVersion,//当前版本号
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
verNumber : systemInfo.appVersion,
|
||||
// #endif
|
||||
os: formatIOS(systemInfo.osName),//操作系统 Android IOS
|
||||
}
|
||||
// 当前手机版本
|
||||
appVersion.value = param.appVersion;
|
||||
let data = await versionCheck(param);
|
||||
isCurrent.value = data.isCurrent;
|
||||
}
|
||||
|
||||
// 3.退出登录
|
||||
@@ -164,16 +207,6 @@ const handleVersion=()=>{
|
||||
|
||||
onMounted(() => {
|
||||
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
|
||||
|
||||
let systemInfo = uni.getSystemInfoSync();
|
||||
// #ifdef APP-PLUS
|
||||
appVersion.value=systemInfo.appWgtVersion; //当前版本号
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
appVersion.value=systemInfo.appVersion;
|
||||
// #endif
|
||||
|
||||
selectUserInfo()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user