2024-12-19 18:25:30 +08:00
|
|
|
<template>
|
|
|
|
|
<!-- 装备共享大厅 -->
|
2024-12-26 18:17:45 +08:00
|
|
|
<view class="h5-container goods-list">
|
2024-12-20 16:38:30 +08:00
|
|
|
<!-- <Navbar :navTitle="`装备共享大厅`" /> -->
|
2024-12-26 18:17:45 +08:00
|
|
|
<!-- <van-nav-bar title="装备共享大厅" left-text="返回" left-arrow @click-left="onClickLeft" /> -->
|
|
|
|
|
|
2024-12-20 14:23:43 +08:00
|
|
|
<view
|
2024-12-26 18:17:45 +08:00
|
|
|
style="
|
|
|
|
|
padding: 15px 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
"
|
2024-12-20 14:23:43 +08:00
|
|
|
>
|
2024-12-26 18:17:45 +08:00
|
|
|
<view>
|
|
|
|
|
<van-icon name="arrow-left" @click="onClickLeft" />
|
|
|
|
|
<text style="color: #000"> 装备共享大厅 </text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="padding: 10px">
|
2024-12-19 18:25:30 +08:00
|
|
|
<SearchIpt @onSearchByType="onSearchByType" />
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="goods-items">
|
|
|
|
|
<view class="filter-box">
|
2024-12-23 18:21:01 +08:00
|
|
|
<view class="filter-items">
|
|
|
|
|
使用年限
|
|
|
|
|
<view class="filter-type">
|
|
|
|
|
<van-icon name="play" size="12" />
|
|
|
|
|
<van-icon name="play" size="12" />
|
2024-12-19 18:25:30 +08:00
|
|
|
</view>
|
2024-12-23 18:21:01 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="filter-items">
|
|
|
|
|
租金
|
|
|
|
|
<view class="filter-type">
|
|
|
|
|
<van-icon name="play" size="12" />
|
|
|
|
|
<van-icon name="play" size="12" />
|
2024-12-19 18:25:30 +08:00
|
|
|
</view>
|
2024-12-23 18:21:01 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="filter-items">
|
|
|
|
|
上架时间
|
|
|
|
|
<view class="filter-type">
|
|
|
|
|
<van-icon name="play" size="12" />
|
|
|
|
|
<van-icon name="play" size="12" />
|
2024-12-19 18:25:30 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-12-23 18:21:01 +08:00
|
|
|
|
|
|
|
|
<view @click="onFilter">
|
|
|
|
|
筛选
|
|
|
|
|
<van-icon name="filter-o" />
|
|
|
|
|
</view>
|
2024-12-19 18:25:30 +08:00
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<scroll-view scroll-y class="scroll-item" @scrolltolower="onScrollTolower">
|
2024-12-26 18:17:45 +08:00
|
|
|
<van-grid :column-num="2" :border="false" :gutter="4">
|
2024-12-19 18:25:30 +08:00
|
|
|
<van-grid-item
|
|
|
|
|
v-for="(item, index) in deviceList"
|
|
|
|
|
:key="index"
|
|
|
|
|
@click="onViewGoodsDetails(item)"
|
|
|
|
|
>
|
|
|
|
|
<GoodsItems :goodsInfo="item" />
|
|
|
|
|
</van-grid-item>
|
|
|
|
|
</van-grid>
|
|
|
|
|
</scroll-view>
|
2024-12-23 18:21:01 +08:00
|
|
|
|
|
|
|
|
<van-popup position="bottom" v-model:show="showBottom" :style="{ height: '60%' }">
|
|
|
|
|
<view class="filter-bottom">
|
|
|
|
|
<view style="text-align: right; padding: 4px 8px">
|
|
|
|
|
<van-icon name="close" color="#575B66" size="20" />
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
style="
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #333333;
|
|
|
|
|
font-family: PingFangSC, PingFang SC;
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
全部筛选
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="filter-content">
|
|
|
|
|
<van-sidebar v-model="activeSelect">
|
|
|
|
|
<van-sidebar-item
|
|
|
|
|
:key="index"
|
|
|
|
|
:title="item.selectName"
|
|
|
|
|
v-for="(item, index) in selectList"
|
|
|
|
|
/>
|
|
|
|
|
</van-sidebar>
|
|
|
|
|
|
|
|
|
|
<scroll-view scroll-y class="right-btns">
|
|
|
|
|
<view>
|
|
|
|
|
<view> {{ selectList[activeSelect].selectName }} </view>
|
|
|
|
|
<view class="btns">
|
|
|
|
|
<view
|
|
|
|
|
class="active_btn"
|
|
|
|
|
v-for="(item, index) in selectList[activeSelect].val_list"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</van-popup>
|
2024-12-19 18:25:30 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import GoodsItems from '@/components/GoodsItems'
|
|
|
|
|
import SearchIpt from '@/components/SearchIpt/index'
|
2024-12-20 14:23:43 +08:00
|
|
|
import Navbar from '@/components/Navbar/index'
|
2024-12-19 18:25:30 +08:00
|
|
|
import { getDeviceListAPI } from '@/services/index/index.js'
|
|
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
|
|
import { ref } from 'vue'
|
2024-12-23 18:21:01 +08:00
|
|
|
const activeSelect = ref(0)
|
|
|
|
|
const showBottom = ref(false)
|
2024-12-19 18:25:30 +08:00
|
|
|
const deviceList = ref([])
|
2024-12-23 18:21:01 +08:00
|
|
|
const selectList = ref([
|
|
|
|
|
{
|
|
|
|
|
selectName: '使用年限',
|
|
|
|
|
val_list: [
|
|
|
|
|
{
|
|
|
|
|
name: '全部',
|
|
|
|
|
value: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '0-1年',
|
|
|
|
|
value: [0, 1],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
selectName: '设备类型',
|
|
|
|
|
val_list: [
|
|
|
|
|
{
|
|
|
|
|
name: '全部',
|
|
|
|
|
value: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '0-1年',
|
|
|
|
|
value: [0, 1],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
selectName: '下级分类',
|
|
|
|
|
val_list: [
|
|
|
|
|
{
|
|
|
|
|
name: '全部',
|
|
|
|
|
value: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '0-1年',
|
|
|
|
|
value: [0, 1],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
selectName: '价格区间',
|
|
|
|
|
val_list: [
|
|
|
|
|
{
|
|
|
|
|
name: '全部',
|
|
|
|
|
value: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '0-1年',
|
|
|
|
|
value: [0, 1],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
selectName: '设备所属公司',
|
|
|
|
|
val_list: [
|
|
|
|
|
{
|
|
|
|
|
name: '全部',
|
|
|
|
|
value: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '0-1年',
|
|
|
|
|
value: [0, 1],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
])
|
2024-12-19 18:25:30 +08:00
|
|
|
const onScrollTolower = () => {
|
|
|
|
|
console.log('滚动触底')
|
|
|
|
|
}
|
|
|
|
|
const getDeviceListData = async () => {
|
|
|
|
|
const { data: result } = await getDeviceListAPI({})
|
|
|
|
|
deviceList.value = result.rows
|
|
|
|
|
}
|
|
|
|
|
const onViewGoodsDetails = (item) => {
|
|
|
|
|
uni.navigateTo({ url: `/pages/goods-details/index?id=${item.maId}` })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onSearchByType = (value, type) => {
|
|
|
|
|
/**
|
|
|
|
|
* @type 1 查询机具 2 查询需求
|
|
|
|
|
* @value 搜索框值
|
|
|
|
|
*/
|
|
|
|
|
if (type === 2) {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: `/pages/lease-demand/index?value=${value}`,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
getDeviceListData()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const onClickLeft = () => {
|
2024-12-20 16:38:30 +08:00
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/index/index',
|
|
|
|
|
})
|
2024-12-19 18:25:30 +08:00
|
|
|
}
|
2024-12-23 18:21:01 +08:00
|
|
|
|
|
|
|
|
const onFilter = () => {
|
|
|
|
|
showBottom.value = true
|
|
|
|
|
}
|
2024-12-19 18:25:30 +08:00
|
|
|
onLoad(() => {
|
|
|
|
|
getDeviceListData()
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2024-12-26 18:17:45 +08:00
|
|
|
.goods-list {
|
|
|
|
|
padding: 10px;
|
|
|
|
|
color: #333;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
background: linear-gradient(to bottom, #c0e9ce, #e4f2f2, #f9f9f9);
|
|
|
|
|
}
|
2024-12-19 18:25:30 +08:00
|
|
|
.search-index {
|
|
|
|
|
height: 80px;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.van-field {
|
|
|
|
|
width: 65%;
|
|
|
|
|
padding: 0;
|
|
|
|
|
height: 36px;
|
|
|
|
|
line-height: 36px;
|
|
|
|
|
border: 1px solid #22ab9b;
|
|
|
|
|
border-top-left-radius: 18px;
|
|
|
|
|
border-bottom-left-radius: 18px;
|
|
|
|
|
padding-left: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.van-button {
|
|
|
|
|
height: 36px;
|
|
|
|
|
width: 70px;
|
|
|
|
|
line-height: 36px;
|
|
|
|
|
background: #22ab9b;
|
|
|
|
|
border: none;
|
|
|
|
|
border-top-right-radius: 18px;
|
|
|
|
|
border-bottom-right-radius: 18px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.goods-items {
|
2024-12-23 18:21:01 +08:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2024-12-19 18:25:30 +08:00
|
|
|
padding: 10px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
border-top-left-radius: 20px;
|
|
|
|
|
border-top-right-radius: 20px;
|
2024-12-26 18:17:45 +08:00
|
|
|
// background: $uni-bg-color;
|
2024-12-19 18:25:30 +08:00
|
|
|
|
2024-12-23 18:21:01 +08:00
|
|
|
.filter-box {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.filter-items {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.filter-type {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 0 6px;
|
|
|
|
|
|
|
|
|
|
& .van-icon:first-child {
|
|
|
|
|
transform: rotateZ(-90deg);
|
|
|
|
|
margin-bottom: -3px;
|
|
|
|
|
}
|
|
|
|
|
& .van-icon:last-child {
|
|
|
|
|
transform: rotateZ(90deg);
|
|
|
|
|
margin-top: -3px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-19 18:25:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.van-tabbar {
|
|
|
|
|
height: 70px;
|
|
|
|
|
}
|
|
|
|
|
.scroll-item {
|
|
|
|
|
background-color: $uni-bg-color;
|
|
|
|
|
.van-grid-item {
|
|
|
|
|
border: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-20 14:23:43 +08:00
|
|
|
|
|
|
|
|
:deep(.van-nav-bar .van-icon),
|
|
|
|
|
:deep(.van-nav-bar__title) {
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
2024-12-23 18:21:01 +08:00
|
|
|
|
|
|
|
|
.filter-bottom {
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
overflow-y: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-content {
|
|
|
|
|
flex: 1;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
.right-btns {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
.btns {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
view {
|
|
|
|
|
width: calc((100% - 20px) / 3);
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
height: 28px;
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.active_btn {
|
|
|
|
|
color: #22ab9b;
|
|
|
|
|
background-color: #d1eae7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
& view:nth-child(3n) {
|
|
|
|
|
margin-right: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-26 18:17:45 +08:00
|
|
|
|
|
|
|
|
:deep(.van-grid-item__content) {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
2024-12-19 18:25:30 +08:00
|
|
|
</style>
|