问题修复

This commit is contained in:
BianLzhaoMin 2025-01-03 21:53:56 +08:00
parent 20c447122a
commit 0238efb16f
12 changed files with 330 additions and 91 deletions

View File

@ -23,10 +23,11 @@ const props = defineProps({
padding: 8px 0; padding: 8px 0;
} }
.title-tip view:first-child { .title-tip view:first-child {
width: 5px; width: 4px;
height: 18px; height: 16px;
background-color: $el-color-primary; background-color: $el-color-primary;
margin-right: 6px; margin-right: 6px;
border-radius: 2px;
} }
.title-tip view { .title-tip view {

View File

@ -167,6 +167,13 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
//
{
"path": "pages/class-page/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"tabBar": { "tabBar": {

View File

@ -0,0 +1,210 @@
<template>
<!-- 分类 -->
<view class="h5-container my-setting">
<view style="padding: 15px">
<van-icon name="arrow-left" @click="onClickLeft" />
<text style="color: #000"> 分类 </text>
</view>
<scroll-view scroll-y>
<van-tabs
animated
color="#22AB9B"
v-model:active="activeClass"
title-active-color="#22AB9B"
>
<van-tab title="装备分类">
<van-sidebar v-model="activeLevel1">
<van-sidebar-item
:title="item.name"
:key="item.id"
v-for="item in classDeviceList"
/>
</van-sidebar>
<van-sidebar v-model="activeLevel2">
<van-sidebar-item
:title="item.name"
:key="item.id"
v-for="item in classDeviceList[activeLevel1]?.children"
/>
</van-sidebar>
<view style="flex: 1" class="deviceClass">
<view
class="van-ellipsis"
:key="item.id"
v-for="item in classDeviceList3"
@click="onClickDevice(item)"
>
{{ item.name }} ({{ item.maCount ? item.maCount : 0 }})
</view>
</view>
</van-tab>
<van-tab title="公司分类">
<view style="flex: 1" class="companyClass">
<view
class="van-ellipsis"
:key="item.companyId"
v-for="item in memberStore.companyList"
@click="onClickCompany(item)"
>
{{ item.companyName }}({{ item.maCount ? item.maCount : 0 }})
</view>
</view>
</van-tab>
</van-tabs>
</scroll-view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue'
import { useMemberStore } from '@/stores/index.js'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getEquipmentTypeAPI } from '@/services/common/index.js'
const activeClass = ref(0)
const activeLevel1 = ref(0)
const activeLevel2 = ref(0)
const classDeviceList = ref([])
const memberStore = useMemberStore()
const onClickLeft = () => {
uni.navigateBack()
}
const classDeviceList3 = computed(() => {
return classDeviceList.value[activeLevel1.value]?.children[activeLevel2.value].children
})
const onClickDevice = (item) => {
uni.navigateTo({
url: `/pages/goods-list/index?typeId=${item.id}`,
})
}
const onClickCompany = (item) => {
uni.navigateTo({
url: `/pages/goods-list/index?companyId=${item.companyId}`,
})
}
const getEquipmentTypeData = async () => {
const { data: result } = await getEquipmentTypeAPI()
classDeviceList.value = result
// classDeviceList3.value =
// classDeviceList.value[activeLevel1.value].children[activeLevel2.value].children
}
onLoad((options) => {
activeClass.value = options?.type * 1
})
onShow(() => {
getEquipmentTypeData()
})
</script>
<style lang="scss" scoped>
.my-setting {
padding: 10px 0;
color: #333;
box-sizing: border-box;
background: linear-gradient(to bottom, #c0e9ce, #e4f2f2, #f9f9f9);
}
:deep(.van-cell-group--inset) {
padding: 15px 0;
}
.companyClass {
display: flex;
flex-wrap: wrap;
view {
width: calc((100% - 20px) / 3);
margin-right: 10px;
margin-top: 10px;
padding: 0 6px;
height: 32px;
line-height: 32px;
text-align: center;
border-radius: 16px;
box-sizing: border-box;
color: #999999;
background-color: #e9e9e9;
font-size: 14px;
}
& view:nth-child(3n) {
margin-right: 0;
}
& view:hover {
background-color: #22ab9b !important;
color: #fff !important;
}
}
.deviceClass {
height: 100%;
display: flex;
flex-wrap: wrap;
padding-left: 10px;
view {
width: 100%;
margin-top: 10px;
padding: 0 6px;
height: 32px;
line-height: 32px;
text-align: center;
border-radius: 16px;
box-sizing: border-box;
color: #999999;
background-color: #e9e9e9;
font-size: 14px;
}
& view:nth-child(2n) {
margin-right: 0;
}
& view:hover {
background-color: #22ab9b !important;
color: #fff !important;
}
}
:deep(.van-tabs__content--animated) {
padding: 0 10px;
}
:deep(.van-tab__panel) {
// max-height: 40vh;
display: flex;
overflow-y: auto;
}
:deep(.van-sidebar-item--select:before) {
display: none;
}
:deep(.van-sidebar-item__text) {
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出的内容 */
text-overflow: ellipsis; /* 显示省略号 */
max-width: 100%; /* 最大宽度,根据需要设置 */
display: block; /* 确保是块级元素 */
}
:deep(.van-tabs__nav) {
background-color: #c5ead3;
padding: 0 8px;
}
:deep(.van-sidebar-item) {
padding: 0 8px;
background-color: #daefe8;
color: #333333;
font-size: 14px;
height: 32px;
line-height: 32px;
}
:deep(.van-sidebar-item--select, .van-sidebar-item--select:active) {
background-color: #22ab9b;
color: #fff;
border-radius: 16px;
}
:deep(.van-sidebar) {
padding: 0 4px;
}
:deep(.van-tabs__line) {
bottom: 5px;
}
</style>

View File

@ -1,9 +1,30 @@
<template> <template>
<!-- 首页 --> <!-- 首页 -->
<view class="index-container h5-container"> <view class="index-container">
<view class="index-header"> <view class="index-header">
<view class="flex-row-start"> <view class="flex-row-start" style="margin-top: 10px">
<van-icon name="manager" style="margin-right: 6px" /> <!-- <van-icon name="manager" style="margin-right: 6px" /> -->
<!-- <van-image
round
fit="cover"
width="26px"
height="26px"
:src="memberStore.userInfo.avatar"
/> -->
<view
style="
width: 28px;
height: 28px;
text-align: center;
line-height: 28px;
border-radius: 14px;
margin-right: 6px;
background-color: #c5e3df;
"
>
<van-icon name="manager" color="#7e8576" size="18" />
</view>
<van-popover <van-popover
size="small" size="small"
:show-arrow="false" :show-arrow="false"
@ -52,52 +73,23 @@
</view> </view>
</view> </view>
<van-tabs <view class="order-data class-filter">
animated <TitleTip :title="`分类筛选`" />
color="#22AB9B" <van-grid :column-num="2" :border="false">
v-model:active="activeClass" <van-grid-item @click="onJumpClassFilter(0)">
title-active-color="#22AB9B" <view class="class-box">
> <view class="left-img"> </view>
<van-tab title="装备分类"> 装备分类
<van-sidebar v-model="activeLevel1">
<van-sidebar-item
:title="item.name"
:key="item.id"
v-for="item in classDeviceList"
/>
</van-sidebar>
<van-sidebar v-model="activeLevel2">
<van-sidebar-item
:title="item.name"
:key="item.id"
v-for="item in classDeviceList[activeLevel1]?.children"
/>
</van-sidebar>
<view style="flex: 1" class="deviceClass">
<view
class="van-ellipsis"
:key="item.id"
v-for="item in classDeviceList3"
@click="onClickDevice(item)"
>
{{ item.name }} ({{ item.maCount ? item.maCount : 0 }})
</view> </view>
</van-grid-item>
<van-grid-item @click="onJumpClassFilter(1)">
<view class="class-box">
<view class="right-img"> </view>
公司分类
</view> </view>
</van-tab> </van-grid-item>
<van-tab title="公司分类"> </van-grid>
<view style="flex: 1" class="companyClass">
<view
class="van-ellipsis"
:key="item.companyId"
v-for="item in memberStore.companyList"
@click="onClickCompany(item)"
>
{{ item.companyName }}({{ item.maCount ? item.maCount : 0 }})
</view> </view>
</view>
</van-tab>
</van-tabs>
<view class="order-data"> <view class="order-data">
<TitleTip /> <TitleTip />
<van-cell-group inset> <van-cell-group inset>
@ -145,7 +137,7 @@ import {
getNoticeLListAPI, getNoticeLListAPI,
getOrderStatusCountAPI, getOrderStatusCountAPI,
} from '@/services/index/index.js' } from '@/services/index/index.js'
import { getEquipmentTypeAPI } from '@/services/common/index.js'
const activeTypeName = ref('机具') const activeTypeName = ref('机具')
const searchModelValue = ref('') const searchModelValue = ref('')
const memberStore = useMemberStore() const memberStore = useMemberStore()
@ -155,10 +147,7 @@ const activeUser = ref(1)
const finished = ref(false) const finished = ref(false)
const toDoListMessage = ref([]) const toDoListMessage = ref([])
const noticeListMessage = ref([]) const noticeListMessage = ref([])
const activeClass = ref(0)
const activeLevel1 = ref(0)
const activeLevel2 = ref(0)
const classDeviceList = ref([])
const orderData = ref([ const orderData = ref([
{ order_title: '我的订单', order_count: 0, order_status: 0, order_icon: orderIcon_1 }, { order_title: '我的订单', order_count: 0, order_status: 0, order_icon: orderIcon_1 },
{ {
@ -242,25 +231,9 @@ const onViewMore = (item) => {
}) })
} }
const getEquipmentTypeData = async () => { const onJumpClassFilter = (type) => {
const { data: result } = await getEquipmentTypeAPI()
classDeviceList.value = result
// classDeviceList3.value =
// classDeviceList.value[activeLevel1.value].children[activeLevel2.value].children
}
const classDeviceList3 = computed(() => {
return classDeviceList.value[activeLevel1.value]?.children[activeLevel2.value].children
})
const onClickDevice = (item) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/goods-list/index?typeId=${item.id}`, url: `/pages/class-page/index?type=${type}`,
})
}
const onClickCompany = (item) => {
uni.navigateTo({
url: `/pages/goods-list/index?companyId=${item.companyId}`,
}) })
} }
@ -282,7 +255,7 @@ onShow(async () => {
visible: false, visible: false,
}) })
} }
getEquipmentTypeData()
getOrderStatusCountData() getOrderStatusCountData()
const res = await getToDoListAPI() const res = await getToDoListAPI()
@ -297,21 +270,24 @@ onShow(async () => {
.index-header { .index-header {
padding: 5px 20px 30px; padding: 5px 20px 30px;
box-sizing: border-box; box-sizing: border-box;
background: linear-gradient(to bottom, #6caf97, #78b0a9, #b8d0cf); background: linear-gradient(to bottom, #99dbc4, #aeded9, #daf4f3);
border-bottom-left-radius: 40px; border-bottom-left-radius: 40px;
border-bottom-right-radius: 40px; border-bottom-right-radius: 40px;
.user-name { .user-name {
margin-bottom: 10px;
text-align: center; text-align: center;
padding: 16px 0; padding: 10px 0;
font-size: 16px; font-size: 17px;
font-weight: bold;
letter-spacing: 3px;
} }
.notice-box { .notice-box {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 4px; padding: 0 4px;
background-color: #bcd7d4; background-color: #daf2f1;
border-radius: 6px; border-radius: 6px;
view { view {
@ -324,7 +300,7 @@ onShow(async () => {
} }
.search-ipt { .search-ipt {
margin-top: 10px; margin-top: 20px;
.van-field { .van-field {
width: 100%; width: 100%;
padding: 0; padding: 0;
@ -455,4 +431,33 @@ onShow(async () => {
max-width: 100%; /* 最大宽度,根据需要设置 */ max-width: 100%; /* 最大宽度,根据需要设置 */
display: block; /* 确保是块级元素 */ display: block; /* 确保是块级元素 */
} }
.class-box {
width: 95%;
min-height: 100px;
background-color: #e8f3f0;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
color: #777777;
font-size: 15px;
.left-img {
background: url('@/static/index/class-left.png') no-repeat;
background-size: 100% 100%;
width: 60px;
height: 70%;
}
.right-img {
background: url('@/static/index/class-right.png') no-repeat;
background-size: 100% 100%;
width: 60px;
height: 70%;
}
}
.class-filter :deep(.van-grid-item__content) {
padding: 0;
background-color: #f8f8f8;
}
</style> </style>

View File

@ -30,22 +30,22 @@
<van-grid clickable :column-num="2" :gutter="10"> <van-grid clickable :column-num="2" :gutter="10">
<van-grid-item v-if="memberStore.userType === 1"> <van-grid-item v-if="memberStore.userType === 1">
<navigator url="/pages/order-list/index?type=1"> <view @click="onJumpMyOrder(1)">
<van-icon name="cart" /> <van-icon name="cart" />
<text>出租订单</text> <text>出租订单</text>
</navigator> </view>
</van-grid-item> </van-grid-item>
<van-grid-item v-if="memberStore.userType === 1"> <van-grid-item v-if="memberStore.userType === 1">
<navigator url="/pages/my-demand/index"> <view @click="onJumpMyDemand">
<van-icon name="cart" /> <van-icon name="cart" />
<text>我的需求</text> <text>我的需求</text>
</navigator> </view>
</van-grid-item> </van-grid-item>
<van-grid-item v-if="memberStore.userType === 2"> <van-grid-item v-if="memberStore.userType === 2" @click="onJumpMyOrder(2)">
<navigator url="/pages/order-list/index?type=2"> <view>
<van-icon name="cart" /> <van-icon name="cart" />
<text>承租订单</text> <text>承租订单</text>
</navigator> </view>
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
</van-cell-group> </van-cell-group>
@ -68,6 +68,17 @@ const onJumpToMySetting = () => {
uni.navigateTo({ url: '/pages/my-setting/index' }) uni.navigateTo({ url: '/pages/my-setting/index' })
} }
const onJumpMyOrder = (type) => {
if (type === 1) {
uni.navigateTo({ url: '/pages/order-list/index?type=1' })
} else {
uni.navigateTo({ url: '/pages/order-list/index?type=2' })
}
}
const onJumpMyDemand = () => {
uni.navigateTo({ url: '/pages/my-demand/index' })
}
onLoad(() => { onLoad(() => {
userInfo.value = memberStore.userInfo userInfo.value = memberStore.userInfo
userCompanyName.value = memberStore.userCompanyName userCompanyName.value = memberStore.userCompanyName
@ -130,7 +141,7 @@ onLoad(() => {
padding: 0; padding: 0;
} }
navigator { view {
width: 100%; width: 100%;
padding: 30px 0; padding: 30px 0;
display: flex; display: flex;

View File

@ -247,9 +247,14 @@ const scrapRecordList = ref([])
const lossRecordList = ref([]) const lossRecordList = ref([])
const fileListAll = ref([]) const fileListAll = ref([])
const onClickLeft = () => { const onClickLeft = () => {
uni.reLaunch({ // uni.reLaunch({
url: '/pages/order-list/index', // url: '/pages/order-list/index',
}) // })
// uni.navigateTo({
// url: '/pages/order-list/index',
// })
uni.navigateBack()
} }
const getOverhaulData = async (orderId) => { const getOverhaulData = async (orderId) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

View File

@ -33,10 +33,10 @@ export default defineConfig({
proxy: { proxy: {
// 在此处编写代理规则 // 在此处编写代理规则
'/api': { '/api': {
// target: 'http://36.33.26.201:17788/proxyApi', target: 'http://36.33.26.201:17788/proxyApi',
// target: 'http://192.168.2.123:28080', // target: 'http://192.168.2.123:28080',
// target: 'http://192.168.2.122:28080', // target: 'http://192.168.2.122:28080',
target: 'http://192.168.0.244:28580', // 测试服务 // target: 'http://192.168.0.244:28580', // 测试服务
changeOrigin: true, changeOrigin: true,
rewrite: (path) => { rewrite: (path) => {
return path.replace(/\/api/, '') return path.replace(/\/api/, '')