flying-monkey/pagesA/dataQuery/projectQuery.vue

344 lines
9.5 KiB
Vue
Raw Normal View History

2022-03-22 10:10:39 +00:00
<template>
<view class="content">
2022-03-28 07:33:10 +00:00
<statusNav returnColor="#c2c2c2" navBarTitle="(项目)查询结果"></statusNav>
2022-03-25 10:33:33 +00:00
<container-subgroup-two>
<view slot="content" style="margin: 0 -30rpx;">
2022-03-22 10:10:39 +00:00
<view class="project-list">
<view class="li animated fadeIn" @click="projectDetailsFun(item.id)" v-for="(item,index) in projectQuery" :key="index">
2022-04-01 10:16:43 +00:00
<view class="message pad-s10">
<!-- 项目图片 -->
<image class="img" :src="item.img" mode="aspectFill" lazy-load></image>
2022-03-22 10:10:39 +00:00
<view class="text">
2022-03-31 02:38:37 +00:00
<view class="title">{{item.name}}</view>
<view class="serial-number">项目编号{{item.code}}</view>
<view class="specification" v-if="item.model">{{item.model}}</view>
<view class="specification" v-if="item.size">{{item.size}}</view>
<view class="installation-site" v-if="item.installationSite">{{item.installationSite}}</view>
2022-03-22 10:10:39 +00:00
</view>
</view>
<view class="project-list-address disjbac">
2022-03-22 10:10:39 +00:00
<view class="address">
<image class="img flexs" src="../../static/iocn/im.png" mode="" lazy-load></image>
<!-- 地址 -->
2022-03-31 02:38:37 +00:00
<view class="text">{{item.address}}</view>
2022-03-22 10:10:39 +00:00
</view>
<!-- 时间 -->
<view class="date col6">{{item.date}}</view>
2022-03-22 10:10:39 +00:00
</view>
<!-- 状态 -->
<view class="icon" :style="{backgroundColor: item.statusStyle.color}">
<view class="posir disac" style="width: 135rpx;height: 40rpx;">
<span class="posia" :style="{border: `6rpx solid ${item.statusStyle.color}`,borderBottom: `6rpx solid transparent`,borderRight: `6rpx solid transparent`}" style="display: block;width: 0;height: 0;transform: rotate(45deg);right: -4rpx;top: 2rpx;"></span>
<span class="posia width100">{{item.statusStyle.text}}</span>
</view>
</view>
<!-- <view class="icon iconBer" v-if="item.state==0"></view>
<view class="icon iconBera" v-if="item.state==1"></view>
<view class="icon iconBerb" v-if="item.state==2"></view> -->
2022-03-22 10:10:39 +00:00
</view>
<pitera v-if="total==projectQuery.length && !ifLoading" textStr="查询数据加载完毕~" textFontSize="30rpx" textColor="#b5b2b2"></pitera>
2022-03-22 10:10:39 +00:00
</view>
2022-03-25 10:33:33 +00:00
</view>
</container-subgroup-two>
2022-03-22 10:10:39 +00:00
</view>
</template>
<script>
import statusNav from '../../components/status-nav.vue';
2022-04-13 12:36:32 +00:00
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
import {queryFun} from '../../jsFile/public-api.js';
import pitera from '@/components/nothing/pitera.vue';
2022-03-22 10:10:39 +00:00
export default {
components:{
2022-04-13 12:36:32 +00:00
containerSubgroupTwo,
statusNav,
pitera
2022-03-22 10:10:39 +00:00
},
data() {
return {
projectQuery: [
// {
// id:1,
// name: "湖南工业大学化工学院会议室P2.5全彩LED显示屏",
// img: "../../static/del/img001.png",
// code: "20220108-1001",
// model: "DS-CK25FI/H",
// size: "3.94*2.02",
// installationSite: "xxx综合楼2楼会议室",
// address: "湖南省长沙市高新开发区谷园路109号像素大厦1205",
// date: "2022/01/08",
// state: 1
// }
],
list_rows:20,
page:1,
total:0,
key_word:'',//关键词
ifLoading:true
2022-03-22 10:10:39 +00:00
}
},
onReachBottom() {
if(this.total!=this.projectQuery.length) {
this.page++;
this.queryFunEv();
}
},
2022-04-13 12:36:32 +00:00
onLoad(op) {
if(op.key_word!=undefined) {
this.key_word = op.key_word;
// 调用查询(项目)列表事件
this.queryFunEv();
}
2022-04-13 12:36:32 +00:00
},
2022-03-22 10:10:39 +00:00
methods: {
projectDetailsFun(id){
2022-03-22 10:10:39 +00:00
uni.navigateTo({
url:`/pagesA/dataQuery/projectDetails?id=${id}`
2022-03-22 10:10:39 +00:00
})
},
// 查询(项目)列表事件
2022-04-13 12:36:32 +00:00
queryFunEv(){
uni.showLoading({
title:'加载中...',
mask:true
})
let params = {
type_id:2,
keyword:this.key_word,
list_rows:this.list_rows,
page:this.page
}
queryFun(params).then(res=>{
2022-04-13 12:36:32 +00:00
if(res.code) {
this.total = res.data.total;//设置总条数
if(this.page==1) this.projectQuery = [];
if(res.data.data.length) {
res.data.data.forEach(item=>{
let newTime = item.joint_starting_times.slice(0,10).split('-');
newTime = newTime.join('/');
let obj = {
id:item.project_id,
name: item.project_name,//项目名称
img: item.completed_img,//项目图片
code: item.project_number,//项目编号
model: item.product_model,//规格型号
size: item.product_size,//产品尺寸
installationSite: item.installation_location,//安装位置
address: item.address,//详细地址
date: newTime,
state: 1,
statusStyle:item.attributes//状态颜色和文字
}
this.projectQuery.push(obj);
})
}
} else {
this.$toolAll.tools.showToast(res.msg);
}
uni.hideLoading();
this.ifLoading = false;
2022-04-13 12:36:32 +00:00
})
2022-03-31 02:38:37 +00:00
},
2022-03-22 10:10:39 +00:00
bindPickerChange(data){
console.log(data)
},
bindDateChange(date){
console.log(date)
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
console.log(year,month,day)
return `${year}-${month}-${day}`;
}
}
}
</script>
<style scoped>
page {
background-color: #F7F7F7;
}
.content{
}
.project-list-input {
width: 100%;
height: 114rpx;
position: relative;
padding: 20rpx 16rpx;
box-sizing: border-box;
2022-03-25 10:33:33 +00:00
background-color: #FFFFFF;
2022-03-22 10:10:39 +00:00
}
.project-list-input .int {
width: 100%;
height: 100%;
background-color: #F7F7F7;
padding: 0 25rpx;
box-sizing: border-box;
border-radius: 36rpx;
}
.project-list-input .search {
width: 28rpx;
height: 28rpx;
position: absolute;
right: 43rpx;
top: 50%;
margin-top: -14rpx;
}
.screen {
display: flex;
justify-content: space-around;
padding: 46rpx 20rpx;
}
.screen .li {
display: flex;
align-items: center;
}
.screen .li .text {
font-size: 32rpx;
color: #333333;
margin-right: 10rpx;
}
.screen .li .img {
width: 14rpx;
height: 8rpx;
}
.screen .li .imgA {
width: 24rpx;
height: 23rpx;
}
.project-list .li {
2022-04-01 10:16:43 +00:00
width: 100%;
2022-03-22 10:10:39 +00:00
box-sizing: border-box;
background-color: #FFFFFF;
position: relative;
margin: auto;
margin-bottom: 20rpx;
2022-04-01 10:16:43 +00:00
padding: 40rpx;
2022-03-22 10:10:39 +00:00
}
.project-list .li .icon {
width: 135rpx;
height: 40rpx;
position: absolute;
font-size: 24rpx;
color: #FFFFFF;
right: 23rpx;
line-height: 40rpx;
text-align: center;
background-size: 100% 100%;
2022-04-01 10:16:43 +00:00
top: 0rpx;
border-radius: 6rpx 0 6rpx 6rpx;
2022-03-22 10:10:39 +00:00
}
.project-list .li .message {
display: flex;
2022-04-01 10:16:43 +00:00
2022-03-22 10:10:39 +00:00
}
.project-list .li .message .img {
width: 230rpx;
2022-04-01 10:16:43 +00:00
margin-right: 16rpx;
height: 190rpx;
2022-03-22 10:10:39 +00:00
}
.project-list .li .message .text {
flex: 1;
}
.project-list .li .message .text .title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
word-break: break-all;
margin-bottom: 15rpx;
font-size: 28rpx;
2022-03-28 07:33:10 +00:00
line-height: 30rpx;
2022-03-22 10:10:39 +00:00
color: #333333;
font-weight: bold;
}
.project-list .li .message .serial-number {
color: #ff8800;
font-size: 24rpx;
margin-bottom: 15rpx;
line-height: 24rpx;
}
.project-list .li .message .specification {
color: #00b1ff;
font-size: 24rpx;
margin-bottom: 15rpx;
line-height: 24rpx;
}
.project-list .li .message .installation-site {
color: #6b6a6a;
font-size: 24rpx;
margin-bottom: 15rpx;
line-height: 24rpx;
}
.project-list-address {
display: flex;
2022-03-24 09:04:24 +00:00
margin-top: 10rpx;
2022-03-22 10:10:39 +00:00
/* justify-content: space-between; */
}
.project-list-address .text {
font-size: 24rpx;
}
.project-list-address .date {
font-size: 24rpx;
text-align: right;
}
.project-list-address .img {
width: 23rpx;
height: 28rpx;
margin-right: 10rpx;
}
.project-list-address .address {
display: flex;
2022-03-25 03:41:31 +00:00
color: #666666;
2022-03-22 10:10:39 +00:00
align-items: center;
}
.pickerDate {
width: 300rpx;
height: 300rpx;
}
</style>