OfficeApp/subpkg/archives/archives.vue

238 lines
6.1 KiB
Vue
Raw Normal View History

<template>
<view class="">
2023-08-01 10:08:26 +08:00
<view class="personnel_list">
2023-08-02 09:57:46 +08:00
<view class="item" v-for="(item, index) in list" :key="item.id">
2023-08-01 10:08:26 +08:00
<view class="top">
2023-08-02 09:57:46 +08:00
<!-- <image class="avatar" :src="item.avatar||'../../static/img/public/man.png'"></image> -->
<!-- <u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'"
width="112.28rpx" height="112.28rpx" shape="circle">
</u--image> -->
<view class="text">
<view class="name">{{item.name}}</view>
<view class="mobile">
<uni-icons type="phone" color="#999999FF"></uni-icons><text
@click="copyPhone(item.phone)">{{item.phone}}</text>
</view>
<view class="mobile">
<uni-icons type="calendar" color="#999999FF"></uni-icons><text>{{item.create_time}}</text>
</view>
2023-08-01 10:08:26 +08:00
</view>
<view class="right">
2023-08-02 09:57:46 +08:00
<view class="top">
查看
2023-08-01 10:08:26 +08:00
</view>
2023-08-02 09:57:46 +08:00
<view class="bottom" @click="callUp(item.account)">
更新
2023-08-01 10:08:26 +08:00
</view>
</view>
</view>
2023-08-02 09:57:46 +08:00
<view class="bottom">
<view class="circle"></view>
<view class="green">所属片区</view>
<view>{{item.area_name+item.street_name}}</view>
2023-08-01 10:08:26 +08:00
</view>
</view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
2023-08-02 09:57:46 +08:00
<button class="new_btn" v-if="$store.state.app.userInfo.admin_id==0"
@click="navTo('/subpkg/newArchives/newArchives')">信息登记</button>
2023-08-01 10:08:26 +08:00
<!-- <button class="new_btn" @click="navTo('/subpkg/updateArchives/updateArchives')">信息更新(测试中)</button> -->
</view>
</template>
<script>
2023-08-01 10:08:26 +08:00
import { informationList } from "@/api/information.js"
import { Toast } from "../../libs/uniApi";
export default {
data() {
return {
user_id: 0,
2023-08-01 10:08:26 +08:00
list: [],
loadConfig: {
page: 1,
limit: 15,
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
}
},
2023-08-01 16:43:13 +08:00
onLoad(options) {
this.user_id = options.id
2023-08-01 16:43:13 +08:00
console.log(options);
2023-08-01 10:08:26 +08:00
},
onShow() {
this.initLoadconfig();
this.loadInformationList();
},
2023-08-02 09:57:46 +08:00
computed: {
2023-08-01 10:08:26 +08:00
// 是否显示查看和更新按钮
2023-08-02 09:57:46 +08:00
showView() {
return this.$store.state.app.userInfo.admin_id ? false : true;
}
},
2023-08-02 09:57:46 +08:00
onReachBottom() {
this.loadInformationList();
},
methods: {
navTo(url) {
url ?
uni.navigateTo({
url: url,
}) : Toast('暂未开放')
},
2023-08-02 09:57:46 +08:00
initLoadconfig() {
2023-08-01 10:08:26 +08:00
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
},
async loadInformationList() {
let that = this;
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading"
let res = await informationList({
page: this.loadConfig.page,
2023-08-02 09:59:38 +08:00
limit: this.loadConfig.limit,
user_id: that.user_id
2023-08-01 10:08:26 +08:00
})
this.loadConfig.status = "loadmore"
if (res.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data];
}
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script>
<style lang="scss">
.new_btn {
2023-08-01 10:08:26 +08:00
position: fixed;
bottom: 28rpx;
left: 50%;
transform: translate(-50%);
margin-top: 32rpx;
// margin-bottom: 40rpx;
width: 694rpx;
height: 84rpx;
background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff;
line-height: 80rpx;
text-align: center;
}
2023-08-01 10:08:26 +08:00
.personnel_list {
padding: 28rpx 0;
margin-bottom: 100rpx;
2023-08-02 09:57:46 +08:00
.item {
2023-08-01 10:08:26 +08:00
margin: 0 auto;
width: 694rpx;
2023-08-02 09:57:46 +08:00
// height: 201rpx;
2023-08-01 10:08:26 +08:00
background: #FFFFFF;
border-radius: 14rpx 14rpx 14rpx 14rpx;
2023-08-02 09:57:46 +08:00
opacity: 1;
margin-bottom: 21rpx;
box-sizing: border-box;
2023-08-01 10:08:26 +08:00
padding: 28rpx;
.top {
display: flex;
2023-08-02 09:57:46 +08:00
justify-content: space-between;
align-items: center;
width: 100%;
2023-08-02 09:57:46 +08:00
.avatar {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
margin-right: 18rpx;
}
2023-08-01 10:08:26 +08:00
2023-08-02 09:57:46 +08:00
.u_avatar {
margin-right: 18rpx;
}
2023-08-02 09:57:46 +08:00
.text {
2023-08-01 10:08:26 +08:00
display: flex;
justify-content: space-around;
2023-08-02 09:57:46 +08:00
flex-direction: column;
height: 100%;
2023-08-01 10:08:26 +08:00
2023-08-02 09:57:46 +08:00
.name {
font-size: 32rpx;
font-weight: 500;
color: #333333;
2023-08-01 10:08:26 +08:00
}
2023-08-02 09:57:46 +08:00
.mobile {
color: #999999;
font-size: 28rpx;
2023-08-01 10:08:26 +08:00
}
}
2023-08-02 09:57:46 +08:00
.right {
height: 100%;
2023-08-01 10:08:26 +08:00
display: flex;
2023-08-02 09:57:46 +08:00
flex-direction: column;
justify-content: center;
2023-08-01 10:08:26 +08:00
2023-08-02 09:57:46 +08:00
.top,
.bottom {
width: 158rpx;
height: 53rpx;
background: #FFFFFF;
border-radius: 26rpx 26rpx 26rpx 26rpx;
opacity: 1;
border: 2rpx solid #3274F9;
color: #3274F9;
display: flex;
align-items: center;
justify-content: center;
}
2023-08-01 10:08:26 +08:00
2023-08-02 09:57:46 +08:00
.bottom {
border: 2rpx solid #F9AA32;
color: #F9AA32;
margin-top: 18rpx;
}
2023-08-01 10:08:26 +08:00
}
}
.bottom {
display: flex;
2023-08-02 09:57:46 +08:00
justify-content: left;
align-items: center;
margin-top: 20rpx;
2023-08-01 10:08:26 +08:00
2023-08-02 09:57:46 +08:00
.circle {
width: 11rpx;
height: 11rpx;
2023-08-01 10:08:26 +08:00
opacity: 1;
2023-08-02 09:57:46 +08:00
border: 2rpx solid #34A853;
margin-right: 10rpx;
border-radius: 50%;
}
2023-08-02 09:57:46 +08:00
.green {
2023-08-01 10:08:26 +08:00
font-weight: 400;
2023-08-02 09:57:46 +08:00
color: #34A853;
line-height: 0rpx;
margin-right: 18rpx;
-webkit-background-clip: text;
2023-08-01 10:08:26 +08:00
}
}
2023-08-02 09:57:46 +08:00
2023-08-01 10:08:26 +08:00
}
2023-08-02 09:57:46 +08:00
2023-08-01 10:08:26 +08:00
}
</style>