Browse Source

feat: 首页用户身份判断

develop
song 4 years ago
parent
commit
ac81030815
  1. 1
      CHANGELOG.md
  2. 3
      src/apis/yanyuan.js
  3. 101
      src/components/Upload/Upload.vue

1
CHANGELOG.md

@ -248,6 +248,7 @@
范围|描述|commitId
--|--|--
- | 1.时间轴筛选相同的时间替换数据 2.整理代码 | [e082ccb](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/e082ccb)
- | 1.显示首页顶部导航栏 2.放大个人信息文字 | [a72c89c](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/a72c89c)
- | 修改代码格式 | [14123d7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/14123d7)
- | 修改定期任务骨架屏高度 | [909a734](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/909a734)
- | 修改时间轴自动滚动到当天任务的时间 | [20bbf6a](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/20bbf6a)

3
src/apis/yanyuan.js

@ -17,6 +17,9 @@ const install = (Vue, vm) => {
// 查询所有关联的用户信息
vm.$u.api.queryRelation = param => vm.$u.post(`${yanyuan}/trainee/queryRelation`, param);
// 首页用户身份判断
vm.$u.api.homeIdentity = param => vm.$u.post(`${yanyuan}/userPower/homeIdentity`, param);
// 绑定工具箱
vm.$u.api.bindTool = param => vm.$u.post(`${yanyuan}/tool/bind`, param);
// 查询工具箱列表

101
src/components/Upload/Upload.vue

@ -4,30 +4,39 @@
<u-icon name="plus" size="24px" class="plus" @click="openMenu"></u-icon>
<!-- 弹出菜单 -->
<view v-if="showMenu">
<view
v-if="showMenu"
:class="
identityInfo.isMax === 0 && identityInfo.personNumber > 1
? 'icons4'
: identityInfo.isMax === 1 && identityInfo.personNumber <= 1
? 'icons2'
: 'icons3'
"
>
<u-icon
class="icons icon1"
size="76"
class="icons"
size="88"
name="https://www.tall.wiki/staticrec/yanyuan/icon1.png"
@click="openPage('/pagesYanyuan/scan-code/scan-code')"
></u-icon>
<u-icon
class="icons icon2"
size="76"
v-if="identityInfo.isMax === 0"
class="icons"
size="88"
name="https://www.tall.wiki/staticrec/yanyuan/icon2.png"
v-if="showAddInfo"
@click="openPage('/pagesYanyuan/add-info/add-info')"
></u-icon>
<u-icon
class="icons icon3"
size="76"
:class="showAddInfo ? '' : 'icon3-top'"
v-if="identityInfo.personNumber > 1"
class="icons"
size="88"
name="https://www.tall.wiki/staticrec/yanyuan/icon3.png"
@click="openPage('/pagesYanyuan/ascription/ascription')"
></u-icon>
<u-icon
class="icons icon4"
size="76"
class="icons"
size="88"
name="https://www.tall.wiki/staticrec/yanyuan/icon4.png"
@click="openPage('/pagesYanyuan/hold-all/hold-all')"
></u-icon>
@ -40,9 +49,15 @@ import { mapGetters } from 'vuex';
export default {
data() {
return { showMenu: false, showAddInfo: true };
return { showMenu: false, identityInfo: null };
},
computed: mapGetters('user', ['userId']),
async mounted() {
await this.homeIdentity();
},
methods: {
// wbs
async handleUpload() {
@ -85,6 +100,18 @@ export default {
},
});
},
/**
* 首页用户身份判断
*/
async homeIdentity() {
try {
const data = await this.$u.api.homeIdentity();
this.identityInfo = data;
} catch (error) {
console.log('error: ', error);
}
},
},
};
</script>
@ -110,20 +137,6 @@ export default {
background-color: rgba(219, 234, 254, var(--tw-bg-opacity));
}
.icons-box {
width: 50px;
top: -60px;
left: -60px;
z-index: 9999;
}
.icons-box1 {
width: 50px;
top: -40px;
left: -60px;
z-index: 9999;
}
.icons {
position: absolute;
z-index: 9999;
@ -132,28 +145,42 @@ export default {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.icon1 {
.icons4 u-icon:nth-child(1) {
top: -60px;
left: 0px;
}
.icon2 {
top: -20px;
.icons4 u-icon:nth-child(2) {
top: -30px;
left: -60px;
}
.icon3 {
.icons4 u-icon:nth-child(3) {
top: 35px;
left: -60px;
}
.icons4 u-icon:nth-child(4) {
top: 65px;
left: 0px;
}
.icon3-top {
top: 5px;
.icons3 u-icon:nth-child(1) {
top: -60px;
left: -20px;
}
.icons3 u-icon:nth-child(2) {
top: 0px;
left: -60px;
}
.icons3 u-icon:nth-child(3) {
top: 60px;
left: -20px;
}
.icon4 {
top: 70px;
left: 0px;
.icons2 u-icon:nth-child(1) {
top: -40px;
left: -55px;
}
.icons2 u-icon:nth-child(2) {
top: 40px;
left: -55px;
}
</style>

Loading…
Cancel
Save