自主产品,供应链食堂系统。将两个端拆开了。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

152 lines
3.5 KiB

<template>
<view>
<view class="lf-row-center lf-flex-column head" v-if="$isRight(supplier)">
<image :src="supplier.avatar" v-if="supplier.avatar"></image>
<image src="../../static/images/default_avatar.png" v-else></image>
<view class="lf-m-t-20 lf-font-32 lf-font-bold lf-color-black">{{ supplier.name }}</view>
<view class="lf-font-28 lf-color-555 lf-m-t-10">{{ supplier.role }}</view>
</view>
<view class="list">
<view class="lf-row-between list-item" hover-class="lf-opacity"
v-for="(item, index) in block_list" :key="index"
@click="$url(item.path)">
<view class="lf-row-center">
<image class="icon-img" :src="item.icon"></image>
<text class="lf-text-vertical lf-m-l-20 lf-font-28 lf-color-black">{{ item.name }}</text>
</view>
<view class="lf-flex">
<view v-if="item.unread">
<view class="message-tag" v-if="item.unread < 99">{{item.unread}}</view>
<view class="message-tag" v-else>99+</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
<view style="height: 170rpx;"></view>
<view class="btn-bottom exit" v-if="$isRight(supplier)">
<button class="lf-w-100" @click="loginOut">退出登录</button>
</view>
</view>
</template>
<script>
export default {
data(){
return {
supplier: {},
block_list: []
}
},
onShow() {
// todo 优化:显示订单角标
this.getData();
},
onReady(){
// #ifndef MP
var a = document.getElementsByClassName('uni-page-head-hd')[0];
a.style.display = 'none'; // 去掉返回按钮
// #endif
},
methods: {
// 退出登录
loginOut(){
uni.showModal({
title: '温馨提示',
content: '确定退出登录吗?',
confirmColor: '#1833F2',
success: result => {
if(result.confirm){
uni.removeStorageSync('supply_token');
this.$redirectToLogin('您已退出登录, 即将跳转...');
}
}
})
},
// 获取数据
getData(){
this.$http(this.API.API_SUPPLIER_INDEX).then(res => {
this.supplier = res.data.supplier;
this.block_list = res.data.block;
// 不用存supplier_id
// getApp().globalData.supplier_id = res.data.supplier.id;
uni.setNavigationBarTitle({
  title: this.supplier.user.supplier.supplier_name
})
});
}
}
}
</script>
<style>
page{
background-color: #F6F6F6;
}
</style>
<style lang="scss" scoped="scoped">
.message-tag {
width: 52rpx;
height: 52rpx;
font-size: 16rpx;
background-color: red;
border-radius: 50%;
margin-right: 10rpx;
text-align: center;
align-items: center;
color: white;
display: flex;
justify-content: space-around;
}
.head{
height: 374rpx;
width: 750rpx;
background-color: #FFFFFF;
image{
width: 200rpx;
height: 200rpx;
border: 2rpx solid #FFFFFF;
border-radius: 50%;
}
}
.list{
margin-top: 20rpx;
padding: 0 32rpx;
background-color: #FFFFFF;
width: 100%;
height: auto;
}
.list-item{
border-bottom: 1rpx solid #EEEEEE;
height: 110rpx;
box-sizing: border-box;
position: relative;
.icon-img{
width: 50rpx;
height: 50rpx;
}
.feedback-btn{
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
background: transparent;
}
&:last-child{
border-bottom: none;
}
}
.exit{
padding: 0 32rpx;
// bottom: 50rpx;
padding-top: 10rpx;
padding-bottom: 50rpx;
box-sizing: border-box;
background-color: #F6F6F6;
button{
background-color: #f0f0f0;
color: #777777;
}
}
</style>