更新优化页面,优化页面样式,开启下拉刷新

This commit is contained in:
weipengfei 2023-08-10 11:48:01 +08:00
parent a23219c863
commit 5fe5efabc5
11 changed files with 141 additions and 93 deletions

View File

@ -11,14 +11,14 @@
<view class="text"> <view class="text">
<view class="name">{{company.company_name}}</view> <view class="name">{{company.company_name}}</view>
<view class="right">{{company.company_type_name||company.company_type}}</view> <view class="right">{{company.company_type_name||company.company_type}}</view>
<view class="code">社会代码{{company.organization_code}}</view> <view class="code">社会代码<text @click="copyPhone(company.master_email, '社会代码')">{{company.organization_code}}</text></view>
</view> </view>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="left"> <view class="left">
<uni-icons type="location" color="#666666" size="14"></uni-icons> <uni-icons type="location" color="#666666" size="14"></uni-icons>
<view class="location">区域:</view> <view class="location">区域</view>
</view> </view>
<view style="flex: 1;">{{company.address}}</view> <view style="flex: 1;">{{company.address}}</view>
</view> </view>
@ -69,7 +69,7 @@
<view class="card"> <view class="card">
<view class="one"> <view class="one">
<view class="linkman"> <view class="linkman">
<view style="height: 30rpx;width: 6rpx;background-color: #3175f9;border-radius: 3rpx;margin-right: 8rpx;"> <view style="height: 30rpx;width: 6rpx;background-color: #3175f9;border-radius: 8rpx;margin-right: 8rpx;">
</view> </view>
主要联系人 主要联系人
</view> </view>
@ -80,22 +80,19 @@
<view class="info_item" @click="copyPhone(company.master_email, '邮箱')">邮箱{{company.master_email}}</view> <view class="info_item" @click="copyPhone(company.master_email, '邮箱')">邮箱{{company.master_email}}</view>
</view> </view>
</view> </view>
<view style="height: 32rpx;"></view> <view class="one" v-for="(other, index) in company.other_contacts" v-if="other.name!=''" :key="index">
<view class="one" v-for="(other, index) in company.other_contacts" :key="index"> <view class="linkman">
<block v-if="other.name!=''"> <view
<view class="linkman"> style="height: 30rpx;width: 6rpx;background-color: #3175f9;border-radius: 8rpx;margin-right: 8rpx;">
<view
style="height: 30rpx;width: 6rpx;background-color: #3175f9;border-radius: 3rpx;margin-right: 8rpx;">
</view>
其他联系人
</view> </view>
<view class="info"> 其他联系人
<view class="info_item">姓名{{other.name}}</view> </view>
<view class="info_item">职位{{other.position}}</view> <view class="info">
<view class="info_item" @click="copyPhone(other.phone)">联系电话{{other.phone}}</view> <view class="info_item">姓名{{other.name}}</view>
<view class="info_item" @click="copyPhone(other.email, '邮箱')">邮箱{{other.email}}</view> <view class="info_item">职位{{other.position}}</view>
</view> <view class="info_item" @click="copyPhone(other.phone)">联系电话{{other.phone}}</view>
</block> <view class="info_item" @click="copyPhone(other.email, '邮箱')">邮箱{{other.email}}</view>
</view>
</view> </view>
</view> </view>
</block> </block>
@ -252,7 +249,11 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.item { .item {
padding: 31.5rpx 28rpx; padding: 32rpx 28rpx;
padding-top: 0;
&:nth-child(1){
padding-top: 32rpx;
}
.title { .title {
margin-bottom: 21rpx; margin-bottom: 21rpx;
@ -279,8 +280,10 @@
.left { .left {
display: flex; display: flex;
align-items: center;
image { image {
flex-shrink: 0;
width: 142rpx; width: 142rpx;
height: 142rpx; height: 142rpx;
margin-right: 28rpx; margin-right: 28rpx;
@ -335,6 +338,10 @@
} }
.one { .one {
margin-top: 32rpx;
&:nth-child(1){
margin-top: 0;
}
.linkman { .linkman {
// height: 44rpx; // height: 44rpx;
font-size: 32rpx; font-size: 32rpx;

View File

@ -35,6 +35,7 @@
</template> </template>
<script> <script>
import { Toast } from '../../libs/uniApi';
export default { export default {
name: "task", name: "task",
props: { props: {

View File

@ -51,6 +51,7 @@
"path": "pages/oaTask/oaTask", "path": "pages/oaTask/oaTask",
"style": { "style": {
"navigationBarTitleText": "今日任务", "navigationBarTitleText": "今日任务",
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3175f9", "navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
@ -227,7 +228,7 @@
"path": "contract/contract", "path": "contract/contract",
"style": { "style": {
"navigationBarTitleText": "合同管理", "navigationBarTitleText": "合同管理",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3175f9", "navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
@ -407,7 +408,7 @@
"path": "captain/captain", "path": "captain/captain",
"style": { "style": {
"navigationBarTitleText": "队长列表", "navigationBarTitleText": "队长列表",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3175f9", "navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }

View File

@ -47,11 +47,10 @@
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.close() this.loadList();
uni.stopPullDownRefresh() this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()});
}, },
onReachBottom() { onReachBottom() {
}, },
} }
</script> </script>

View File

@ -115,6 +115,7 @@
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.list = []; this.list = [];
this.loadList(); this.loadList();
uni.stopPullDownRefresh();
}, },
async loadList() { async loadList() {
if (this.loadConfig.status == "nomore") return; if (this.loadConfig.status == "nomore") return;
@ -135,7 +136,7 @@
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() this.initLoad();
} }
} }
</script> </script>

View File

@ -21,10 +21,16 @@
<view class="bottom"> <view class="bottom">
<image src="../../static/img/contract/company.png"></image> <image src="../../static/img/contract/company.png"></image>
<view class="text"> <view class="text">
<view>主要联系人{{item.master_name}}</view> <view class="text_item">
<view @click="copyPhone(item.master_phone)">联系方式{{item.master_phone}}</view> <view class="left_text">主要联系人</view>
<view style="display: flex;"> <view>{{item.master_name}}</view>
<view class="">区县乡镇</view> </view>
<view class="text_item" @click="copyPhone(item.master_phone)">
<view class="left_text">联系方式</view>
<view>{{item.master_phone}}</view>
</view>
<view class="text_item">
<view class="left_text">区县乡镇</view>
<view>{{item.city_name+'/'+item.area_name+'/'+item.street_name}}</view> <view>{{item.city_name+'/'+item.area_name+'/'+item.street_name}}</view>
</view> </view>
<!-- <view>片区经理</view> --> <!-- <view>片区经理</view> -->
@ -96,7 +102,6 @@
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.companyList = []; this.companyList = [];
await this.loadCompanyList(); await this.loadCompanyList();
uni.stopPullDownRefresh()
}, },
// //
async loadCompanyList() { async loadCompanyList() {
@ -139,7 +144,9 @@
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.initLoad() if(this.current==1) this.initLoad();
this.$u.sleep(500).then(()=>{uni.stopPullDownRefresh()})
} }
} }
</script> </script>
@ -281,6 +288,12 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
.text_item{
display: flex;
.left_text{
flex-shrink: 0;
}
}
} }
} }
} }

View File

@ -21,10 +21,18 @@
</view> </view>
<view class="date"> <view class="date">
<!-- <text class="time">2023-04-27 2024-04-28 </text> --> <!-- <text class="time">2023-04-27 2024-04-28 </text> -->
<view class="number">合同编号:{{item.contract_no}}</view> <view class="number">
<view class="number">合同类型:{{item.company.contract_type_name}}</view> <view class="num_left">合同编号:</view>
<text>{{item.contract_no}}</text>
<text class="time">修改时间:{{item.update_time}}</text> </view>
<view class="number">
<view class="num_left">合同类型:</view>
<view>{{item.company.contract_type_name}}</view>
</view>
<view class="time">
<view class="num_left">修改时间:</view>
<view>{{item.update_time}}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -36,8 +44,10 @@
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="loadConfig.status=='nomore'&& list.length==0" text="暂无合同" icon="/static/img/empty/data.png"></u-empty> <u-empty v-if="loadConfig.status=='nomore'&& list.length==0" text="暂无合同"
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> icon="/static/img/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view> </view>
</template> </template>
@ -48,7 +58,7 @@
return { return {
changeType: 0, changeType: 0,
list: [], list: [],
loadConfig:{ loadConfig: {
page: 1, page: 1,
limit: 15, limit: 15,
loadingText: '努力加载中', loadingText: '努力加载中',
@ -60,8 +70,7 @@
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
this.initLoadConfig() this.initLoadConfig();
this.initContractList()
}, },
onReady() { onReady() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
@ -76,34 +85,36 @@
url: url url: url
}) : Toast('暂未开放') }) : Toast('暂未开放')
}, },
initLoadConfig(){ initLoadConfig() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.list = []; this.list = [];
this.initContractList();
uni.stopPullDownRefresh();
}, },
async initContractList() { async initContractList() {
try{ try {
if(this.loadConfig.status=="nomore")return; if (this.loadConfig.status == "nomore") return;
this.loadConfig.status="loading" this.loadConfig.status = "loading"
let res = await contractList({ let res = await contractList({
page: this.loadConfig.page, page: this.loadConfig.page,
limit: this.loadConfig.limit limit: this.loadConfig.limit
}) })
this.loadConfig.status="loadmore" this.loadConfig.status = "loadmore"
if(res.data.data.length<this.loadConfig.limit){ if (res.data.data.length < this.loadConfig.limit) {
this.loadConfig.status="nomore" this.loadConfig.status = "nomore"
}else { } else {
this.loadConfig.page++; this.loadConfig.page++;
} }
this.list = [...this.list, ...res.data?.data] this.list = [...this.list, ...res.data?.data]
}catch(e){ } catch (e) {
this.initLoadConfig(); this.initLoadConfig();
this.loadConfig.status = "nomore" this.loadConfig.status = "nomore"
} }
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() this.initLoadConfig();
} }
} }
</script> </script>
@ -144,7 +155,6 @@
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
line-height: 0rpx; line-height: 0rpx;
-webkit-background-clip: text;
} }
} }
@ -168,7 +178,8 @@
.top { .top {
display: flex; display: flex;
margin-bottom: 10rpx; margin-bottom: 28rpx;
image { image {
width: 87.6rpx; width: 87.6rpx;
height: 87.6rpx; height: 87.6rpx;
@ -177,33 +188,33 @@
} }
.text { .text {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
.name { .name {
display: flex;
justify-content: space-between;
align-items: flex-end;
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
margin-right: 17.5rpx; margin-right: 17.5rpx;
} }
.number {
font-size: 25rpx;
font-weight: 400;
color: #3274F9;
}
} }
.date { .date {
font-size: 25rpx; font-size: 25rpx;
font-weight: 400; font-weight: 400;
color: #F9AA32; color: #F9AA32;
line-height: 36rpx;
.number, .time{
display: flex;
justify-content: left;
flex-wrap: wrap;
.num_left{
margin-right: 18rpx;
}
}
.time { .time {
color: #CCCCCCFF; color: #CCCCCCFF;
@ -217,7 +228,8 @@
.bottom { .bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 10rpx; margin-top: 28rpx;
.left { .left {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
@ -230,14 +242,15 @@
.right { .right {
width: 158rpx; width: 158rpx;
height: 53rpx; // height: 53rpx;
display: flex; // border-radius: 26rpx 26rpx 26rpx 26rpx;
justify-content: center; // border: 2rpx solid #3274F9;
align-items: center; // display: flex;
// justify-content: center;
// align-items: center;
text-align: right;
background: #FFFFFF; background: #FFFFFF;
border-radius: 26rpx 26rpx 26rpx 26rpx;
opacity: 1; opacity: 1;
border: 2rpx solid #3274F9;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #3274F9; color: #3274F9;

View File

@ -330,8 +330,18 @@
}, },
// //
async initCategoryBusinessList() { async initCategoryBusinessList() {
let res = await categoryBusinessList(); try{
this.demandList = res.data; uni.showLoading({
title:'加载中',
mask:true
})
let res = await categoryBusinessList();
this.demandList = res.data;
}catch(e){
console.log(e);
}finally{
uni.hideLoading()
}
}, },
initBrigadeList(){ initBrigadeList(){
try{ try{

View File

@ -228,6 +228,7 @@
title: "添加成功", title: "添加成功",
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
uni.$emit('initPersonnel');
uni.navigateBack() uni.navigateBack()
}, 1000) }, 1000)
} }

View File

@ -79,8 +79,9 @@
} }
}, },
onLoad() { onLoad() {
this.loadUserList() this.loadUserList();
}, uni.$on('initPersonnel', this.initLoad);
},
methods: { methods: {
navTo(url) { navTo(url) {
url ? url ?
@ -88,13 +89,13 @@
url: url, url: url,
}) : Toast('暂未开放') }) : Toast('暂未开放')
}, },
async initLoad() { async initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.userList = []; this.userList = [];
await this.loadUserList(); await this.loadUserList();
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
async loadUserList() { async loadUserList() {
let that = this; let that = this;
if (this.loadConfig.status == "nomore") return; if (this.loadConfig.status == "nomore") return;

View File

@ -37,7 +37,7 @@
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
负责区域:<text>{{userInfo.street_name+(userInfo.village_name||'')}}</text> 负责区域:<text>{{(userInfo.street_name||'')+(userInfo.village_name||'')}}</text>
<text v-for="(item, index) in userInfo.brigade_name">{{item.brigade_name}}</text> <text v-for="(item, index) in userInfo.brigade_name">{{item.brigade_name}}</text>
</view> </view>
<u-popup :show="show" :round="10" mode="center"> <u-popup :show="show" :round="10" mode="center">
@ -78,6 +78,18 @@
</image> </image>
</view> </view>
</view> </view>
<view class="c_item">
<uni-section style="background-color: transparent;" title="银行卡照片" titleFontSize="32rpx" type="line">
</uni-section>
<view class="card_box">
<image :src="userInfo.qualification&&userInfo.qualification.bank_account"
@click="previewImg([userInfo.qualification&&userInfo.qualification.bank_account,userInfo.qualification&&userInfo.qualification.bank_account_b], 0)">
</image>
<image :src="userInfo.qualification&&userInfo.qualification.bank_account_b"
@click="previewImg([userInfo.qualification&&userInfo.qualification.bank_account,userInfo.qualification&&userInfo.qualification.bank_account_b], 1)">
</image>
</view>
</view>
<view class="c_item"> <view class="c_item">
<uni-section style="background-color: transparent;" title="驾驶证" titleFontSize="32rpx" type="line"> <uni-section style="background-color: transparent;" title="驾驶证" titleFontSize="32rpx" type="line">
</uni-section> </uni-section>
@ -90,18 +102,7 @@
</image> </image>
</view> </view>
</view> </view>
<view class="c_item">
<uni-section style="background-color: transparent;" title="银行卡照片" titleFontSize="32rpx" type="line">
</uni-section>
<view class="card_box">
<image :src="userInfo.qualification&&userInfo.qualification.bank_account"
@click="previewImg([userInfo.qualification&&userInfo.qualification.bank_account,userInfo.qualification&&userInfo.qualification.bank_account_b], 0)">
</image>
<image :src="userInfo.qualification&&userInfo.qualification.bank_account_b"
@click="previewImg([userInfo.qualification&&userInfo.qualification.bank_account,userInfo.qualification&&userInfo.qualification.bank_account_b], 1)">
</image>
</view>
</view>
</block> </block>
</view> </view>
<view class="contract"> <view class="contract">