master
Tuzki 2 years ago
parent a14471c713
commit ceccb873b4
  1. 178
      pages/index/index.vue
  2. 2
      pages/login.vue
  3. 27
      pages/mine/index.vue

@ -1,7 +1,32 @@
<template>
<view>
<uni-search-bar class="uni-mt-10" radius="100" placeholder="请输入姓名" cancelButton="auto" @confirm="search" />
<uni-mall-list ref='nameList' :dataList="dataList" :defaultHeadList="defaultHeadList" @change="handleChange"></uni-mall-list>
<uni-search-bar class="uni-mt-10" radius="100" placeholder="请输入姓名" cancelButton="auto" @confirm="search" @cancel="getAddressBookData" />
<uni-mall-list v-if="show" ref='nameList' :dataList="dataList" :defaultHeadList="defaultHeadList" @change="handleChange"></uni-mall-list>
<view class="box-list" v-if="!show">
<template v-for="item in currentData">
<view
class="box-list-item"
@click="handleChanges(item.userId)"
>
<view class="box-list-item-department-pic" v-if="item.type === 'department'"><image src="../../static/department-icon.png"></image></view>
<view class="box-list-item-user-pic" v-else>
<image v-if="item.pic" :src="item.pic"></image>
<text v-else>{{ getUserName(item.name) }}</text>
</view>
<view class="box-list-item-right">
<view class="box-list-item-text">{{ item.name }} {{ item.children && item.children.length > 0 ? `${item.children.length}` : '' }}</view>
<view class="box-list-item-phone" v-if="!item.children">电话{{item.phone || '暂无'}}</view>
<!-- <view class="box-list-item-user-tag" v-if="item.type === 'user' && item.tag && item.type.length > 0">-->
<!-- <text v-for="(tag, tagIndex) in item.tag">{{ tag }}</text>-->
<!-- </view>-->
</view>
</view>
</template>
</view>
</view>
</template>
@ -19,11 +44,19 @@
defaultHeadList: {
name: '组织架构'
},
dataList: []
dataList: [],
currentData:[
],
show:true
};
},
onShow() {
this.getAddressBookData();
if(this.show){
this.getAddressBookData();
}else{
}
},
onLoad() {},
mounted() {
@ -39,26 +72,48 @@
});
}
},
handleChanges(item) {
console.log(item)
uni.navigateTo({
url: '/subPackIndex/addressBook/datails?userId=' + item
});
},
search(res) {
// uni.showToast({
// title: '' + res.value,
// icon: 'none'
// })
let this_ = this
this_.defaultHeadList ={}
searchName(res.value).then(res =>{
this.$nextTick(()=>{
this_.dataList = res.data
// this_.$refs.nameList.tabChange()
this_.show = false
this_.currentData = JSON.parse(JSON.stringify(res.data))
console.log(this_.currentData)
})
})
},
getAddressBookData() {
let this_ = this
getAddressBookData().then(res => {
this_.show = true
this.dataList = res.data
this_.$refs.nameList.tabChange(this_.defaultHeadList)
})
},
handelClickItem(item) {
console.log(item)
if (item.type === 'department') {
if (item.children && item.children.length > 0) {
this.currentData = item.children;
}
}
this.$emit('change', item);
},
getUserName(name) {
if (name.length === 0) {
return '';
} else if (name.length <= 2) {
return name;
} else if (name.length >= 3) {
return name.substring(name.length - 2);
}
},
},
};
@ -68,4 +123,103 @@
::v-deep .uni-searchbar {
background-color: #fff;
}
.box-list {
.box-list-item {
position: relative;
height: 60px;
display: flex;
align-items: center;
padding: 0 14px;
box-sizing: border-box;
background: #ffffff;
margin-bottom: 1px;
&:active {
background: #f2f3f4;
}
&:last-child {
margin-bottom: 0px;
}
.box-list-item-department-pic {
width: 40px;
height: 40px;
background: rgba(55, 127, 255, 0.1);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
overflow: hidden;
image {
width: 20px;
height: 20px;
}
}
.box-list-item-user-pic {
width: 40px;
height: 40px;
background: #377fff;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
overflow: hidden;
image {
width: 40px;
height: 40px;
}
text {
color: #ffffff;
font-size: 12px;
}
}
.box-list-item-right {
display: flex;
justify-content: space-between;
flex-direction: column;
font-size: 24rpx;
}
.box-list-item-text {
color: #333333;
font-size: 16px;
}
.box-list-item-user-tag {
text {
box-sizing: border-box;
border-radius: 8px;
padding: 4px 8px;
font-size: 10px;
margin-left: 5px;
&:first-child {
margin-left: 0px;
}
&:nth-child(1) {
background: rgba(49, 210, 144, 0.05);
border: 1px solid #31d290;
color: #31d290;
}
&:nth-child(2) {
background: rgba(55, 127, 255, 0.05);
border: 1px solid #377fff;
color: #377fff;
}
}
}
&.box-list-item-department-icon {
&::after {
content: '';
position: absolute;
width: 5px;
height: 10px;
top: 26px;
right: 15px;
background: url(../../static/more.png) no-repeat;
}
}
}
.box-list-item-department + .box-list-item-user {
margin-top: 10px;
}
}
</style>

@ -3,7 +3,7 @@
<view class="logo-content align-center justify-center flex">
<!-- <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix"> -->
</image>
<text class="title">动端登录</text>
<text class="title">景区管控移动端</text>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">

@ -18,10 +18,10 @@
</view>
</view>
</view>
<view @click="handleToInfo" class="flex align-center">
<!-- <view @click="handleToInfo" class="flex align-center">
<text>个人信息</text>
<view class="iconfont icon-right"></view>
</view>
</view> -->
</view>
</view>
@ -46,10 +46,10 @@
<!-- </view>-->
<view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToEditInfo">
<view class="list-cell list-cell-arrow" @click="handleToInfo">
<view class="menu-item-box">
<view class="iconfont icon-user menu-icon"></view>
<view>编辑资料</view>
<view>个人信息</view>
</view>
</view>
<!-- <view class="list-cell list-cell-arrow" @click="handleHelp">-->
@ -70,6 +70,12 @@
<view>修改密码</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleToLogin">
<view class="menu-item-box">
<view class="iconfont icon-password menu-icon"></view>
<view>退出登录</view>
</view>
</view>
</view>
</view>
@ -108,7 +114,18 @@
this.$tab.navigateTo('/subPackMine/setting/index')
},
handleToLogin() {
this.$tab.reLaunch('/pages/login')
let this_ =this
uni.showModal({
title:'退出登录',
content:'确定要退出登录吗',
success: function (res) {
if (res.confirm) {
this_.$tab.reLaunch('/pages/login')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
},
handleToAvatar() {
this.$tab.navigateTo('/subPackMineine/avatar/index')

Loading…
Cancel
Save