首页等问题修复
This commit is contained in:
parent
89f2ab9a0b
commit
dde2f506b2
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
"
|
||||
>
|
||||
{{ activeTypeName }}
|
||||
{{ props.activeTypeName }}
|
||||
<van-icon name="arrow-down" />
|
||||
|
||||
<view class="check-item" v-if="isSelectShow">
|
||||
|
|
@ -17,6 +17,8 @@
|
|||
@click.stop="
|
||||
() => {
|
||||
activeTypeName = '机具'
|
||||
|
||||
// emits('update:activeTypeName', '机具')
|
||||
isSelectShow = !isSelectShow
|
||||
}
|
||||
"
|
||||
|
|
@ -27,6 +29,7 @@
|
|||
@click.stop="
|
||||
() => {
|
||||
activeTypeName = '需求'
|
||||
// emits('update:activeTypeName', '需求')
|
||||
isSelectShow = !isSelectShow
|
||||
}
|
||||
"
|
||||
|
|
@ -35,20 +38,52 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-field v-model="searchModelValue" />
|
||||
<van-field :modelValue="searchModelValue" @update:modelValue="onInputChange" />
|
||||
<van-button square type="primary" icon="search" @click="onSearchBtn" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
const isSelectShow = ref(false)
|
||||
const activeTypeName = ref('机具')
|
||||
const searchModelValue = ref('')
|
||||
const emits = defineEmits(['onSearchByType'])
|
||||
// const activeTypeName = ref('机具')
|
||||
// const searchModelValue = ref('')
|
||||
const emits = defineEmits(['onSearchByType', 'update:activeTypeName', 'update:searchModelValue'])
|
||||
const onSearchBtn = () => {
|
||||
emits('onSearchByType', searchModelValue.value, activeTypeName.value === '机具' ? 1 : 2)
|
||||
}
|
||||
const props = defineProps({
|
||||
activeTypeName: {
|
||||
type: String,
|
||||
default: () => '机具',
|
||||
},
|
||||
searchModelValue: {
|
||||
type: String,
|
||||
default: () => '',
|
||||
},
|
||||
})
|
||||
|
||||
const activeTypeName = computed({
|
||||
get: () => {
|
||||
return props.activeTypeName
|
||||
},
|
||||
set: (val) => {
|
||||
emits('update:activeTypeName', val)
|
||||
},
|
||||
})
|
||||
|
||||
const searchModelValue = computed({
|
||||
get: () => {
|
||||
return props.searchModelValue
|
||||
},
|
||||
set: (val) => {
|
||||
emits('update:searchModelValue', val)
|
||||
},
|
||||
})
|
||||
|
||||
const onInputChange = (value) => {
|
||||
searchModelValue.value = value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
"vueVersion": "3",
|
||||
"h5": {
|
||||
"router": {
|
||||
"base": "/h5/",
|
||||
"base": "/h5portal/",
|
||||
"mode": "history"
|
||||
},
|
||||
"title": "安徽机具租赁商城"
|
||||
|
|
|
|||
|
|
@ -134,9 +134,8 @@
|
|||
line-height: 30px;
|
||||
"
|
||||
>
|
||||
<text> 总金额: </text>
|
||||
|
||||
<text style="font-weight: bold; color: var(--van-submit-bar-price-color)">
|
||||
¥
|
||||
{{ goods.num * goods.dayLeasePrice * goods.days }}
|
||||
</text>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@
|
|||
color="#22ab9b"
|
||||
@click="onReceivingOrders"
|
||||
:disabled="memberStore.userInfo.companyId == demandDetails.publishCompany"
|
||||
v-if="memberStore.userType === 1"
|
||||
/>
|
||||
</van-action-bar>
|
||||
</scroll-view>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
</view>
|
||||
</view>
|
||||
<view style="padding: 10px">
|
||||
<SearchIpt @onSearchByType="onSearchByType" />
|
||||
<SearchIpt
|
||||
@onSearchByType="onSearchByType"
|
||||
v-model:activeTypeName="activeTypeName"
|
||||
v-model:searchModelValue="searchModelValue"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="goods-items">
|
||||
|
|
@ -36,13 +40,21 @@
|
|||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.dayLeasePriceOrderBy === 'ASC' ? '#00a288' : ''"
|
||||
@click="onClickPrice('ASC')"
|
||||
@click="
|
||||
onClickPrice(
|
||||
searchParams.dayLeasePriceOrderBy === 'ASC' ? '' : 'ASC',
|
||||
)
|
||||
"
|
||||
size="12"
|
||||
/>
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.dayLeasePriceOrderBy === 'DESC' ? '#00a288' : ''"
|
||||
@click="onClickPrice('DESC')"
|
||||
@click="
|
||||
onClickPrice(
|
||||
searchParams.dayLeasePriceOrderBy === 'DESC' ? '' : 'DESC',
|
||||
)
|
||||
"
|
||||
size="12"
|
||||
/>
|
||||
</view>
|
||||
|
|
@ -53,13 +65,17 @@
|
|||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.updateTimeOrderBy === 'ASC' ? '#00a288' : ''"
|
||||
@click="onClickTime('ASC')"
|
||||
@click="
|
||||
onClickTime(searchParams.updateTimeOrderBy === 'ASC' ? '' : 'ASC')
|
||||
"
|
||||
size="12"
|
||||
/>
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.updateTimeOrderBy === 'DESC' ? '#00a288' : ''"
|
||||
@click="onClickTime('DESC')"
|
||||
@click="
|
||||
onClickTime(searchParams.updateTimeOrderBy === 'DESC' ? '' : 'DESC')
|
||||
"
|
||||
size="12"
|
||||
/>
|
||||
</view>
|
||||
|
|
@ -146,15 +162,17 @@ import GoodsItems from '@/components/GoodsItems'
|
|||
import SearchIpt from '@/components/SearchIpt/index'
|
||||
import { getDeviceListAPI } from '@/services/index/index.js'
|
||||
import { getTypeListAPI } from '@/services/common/index.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { ref, computed } from 'vue'
|
||||
import { useMemberStore } from '@/stores/index.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
const memberStore = useMemberStore()
|
||||
const activeSelect = ref(0)
|
||||
const showBottom = ref(false)
|
||||
const deviceList = ref([])
|
||||
const total = ref(0)
|
||||
import { debounce } from 'lodash-es'
|
||||
const activeTypeName = ref('')
|
||||
const searchModelValue = ref('')
|
||||
const searchParams = ref({
|
||||
keyWord: '',
|
||||
ageMin: '',
|
||||
|
|
@ -355,8 +373,9 @@ const onSearchByType = (value, type) => {
|
|||
* @value 搜索框值
|
||||
*/
|
||||
if (type === 2) {
|
||||
uni.setStorageSync('myParam', { value: searchModelValue.value, type: 2 })
|
||||
uni.switchTab({
|
||||
url: `/pages/lease-demand/index?value=${value}`,
|
||||
url: `/pages/lease-demand/index`,
|
||||
})
|
||||
} else {
|
||||
searchParams.value.keyWord = value
|
||||
|
|
@ -372,7 +391,12 @@ const onClickLeft = () => {
|
|||
const onFilter = () => {
|
||||
showBottom.value = true
|
||||
}
|
||||
onLoad(() => {
|
||||
onLoad((options) => {
|
||||
if (options.type == 1) {
|
||||
activeTypeName.value = '机具'
|
||||
}
|
||||
searchParams.value.keyWord = options.value
|
||||
searchModelValue.value = options.value
|
||||
getDeviceListData(true)
|
||||
getTypeListData()
|
||||
const companyList = memberStore.companyList.map((e) => {
|
||||
|
|
@ -380,6 +404,8 @@ onLoad(() => {
|
|||
})
|
||||
selectList.value[3].val_list.push(...companyList)
|
||||
})
|
||||
|
||||
onShow(() => {})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -22,15 +22,33 @@
|
|||
<view class="notice-box">
|
||||
<van-image height="0.8rem" width="4rem" :src="noticeImg" />
|
||||
<view>
|
||||
<van-notice-bar color="#00a288" background="transparent" left-icon="volume-o">
|
||||
最新通知···
|
||||
<van-notice-bar
|
||||
background="transparent"
|
||||
color="#00a288"
|
||||
left-icon="volume-o"
|
||||
:scrollable="false"
|
||||
>
|
||||
<van-swipe
|
||||
vertical
|
||||
:autoplay="3000"
|
||||
:touchable="false"
|
||||
:show-indicators="false"
|
||||
class="notice-swipe"
|
||||
>
|
||||
<van-swipe-item :key="item.noticeId" v-for="item in noticeListMessage">
|
||||
<van-text-ellipsis :content="item.noticeTitle" />
|
||||
</van-swipe-item>
|
||||
</van-swipe>
|
||||
</van-notice-bar>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="search-ipt">
|
||||
<!-- <van-field placeholder="搜索" /> -->
|
||||
<SearchIpt @onSearchByType="onSearchByType" />
|
||||
<SearchIpt
|
||||
@onSearchByType="onSearchByType"
|
||||
v-model:activeTypeName="activeTypeName"
|
||||
v-model:searchModelValue="searchModelValue"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -47,18 +65,12 @@
|
|||
</view>
|
||||
|
||||
<view class="to-do-list">
|
||||
<!-- <van-image height="0.8rem" width="4rem" :src="toDoList" /> -->
|
||||
<TitleTip :title="`待办事项`" />
|
||||
<van-list
|
||||
v-model:loading="loading"
|
||||
:finished="finished"
|
||||
finished-text="没有更多了"
|
||||
@load="onLoad"
|
||||
>
|
||||
<van-cell v-for="item in 4" :key="item">
|
||||
<van-list>
|
||||
<van-cell v-for="item in toDoListMessage" :key="item.taskId">
|
||||
<view class="items-info">
|
||||
您有一条费用待确认
|
||||
<text>查看更多</text>
|
||||
您有一条订单消息
|
||||
<text @click="onViewMore">查看更多</text>
|
||||
</view>
|
||||
</van-cell>
|
||||
</van-list>
|
||||
|
|
@ -75,25 +87,36 @@ import orderIcon_4 from '@/static/index/order_icon4.png'
|
|||
import orderIcon_5 from '@/static/index/order_icon5.png'
|
||||
import orderIcon_6 from '@/static/index/order_icon6.png'
|
||||
import noticeImg from '@/static/index/notice.png'
|
||||
import toDoList from '@/static/index/to_do_list.png'
|
||||
import SearchIpt from '@/components/SearchIpt/index'
|
||||
import TitleTip from '@/components/TitleTip/index'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useMemberStore } from '@/stores/index.js'
|
||||
import { getOrderStatusCountAPI } from '@/services/index/index.js'
|
||||
import {
|
||||
getOrderStatusCountAPI,
|
||||
getToDoListAPI,
|
||||
getNoticeLListAPI,
|
||||
} from '@/services/index/index.js'
|
||||
const activeTypeName = ref('机具')
|
||||
const searchModelValue = ref('')
|
||||
const memberStore = useMemberStore()
|
||||
const userCompanyName = ref()
|
||||
const showPopover = ref(false)
|
||||
const activeUser = ref(1)
|
||||
const loading = ref(false)
|
||||
const finished = ref(false)
|
||||
const toDoListMessage = ref([])
|
||||
const noticeListMessage = ref([])
|
||||
const orderData = ref([
|
||||
{ order_title: '我的订单', order_count: 20, order_icon: orderIcon_1 },
|
||||
{ order_title: '待出库', order_count: 6, order_icon: orderIcon_2 },
|
||||
{ order_title: '待收货', order_count: 8, order_icon: orderIcon_3 },
|
||||
{ order_title: '租赁中', order_count: 12, order_icon: orderIcon_4 },
|
||||
{ order_title: '已退租', order_count: 7, order_icon: orderIcon_5 },
|
||||
{ order_title: '已完成', order_count: 3, order_icon: orderIcon_6 },
|
||||
{ order_title: '我的订单', order_count: 0, order_status: 0, order_icon: orderIcon_1 },
|
||||
{
|
||||
order_title: '待出库',
|
||||
order_status: 2,
|
||||
order_count: 0,
|
||||
order_icon: orderIcon_2,
|
||||
},
|
||||
{ order_title: '待收货', order_status: 3, order_count: 0, order_icon: orderIcon_3 },
|
||||
{ order_title: '租赁中', order_status: 4, order_count: 0, order_icon: orderIcon_4 },
|
||||
{ order_title: '已退租', order_status: 5, order_count: 0, order_icon: orderIcon_5 },
|
||||
{ order_title: '已完成', order_status: 20, order_count: 0, order_icon: orderIcon_6 },
|
||||
])
|
||||
const userActions = ref([
|
||||
{ text: '出租方', userType: 1 },
|
||||
|
|
@ -114,24 +137,38 @@ const onSearchByType = (value, type) => {
|
|||
* @value 搜索框值
|
||||
*/
|
||||
if (type === 2) {
|
||||
uni.setStorageSync('myParam', { value: searchModelValue.value, type: 2 })
|
||||
uni.switchTab({
|
||||
url: `/pages/lease-demand/index?value=${value}`,
|
||||
url: `/pages/lease-demand/index`,
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods-list/index',
|
||||
url: `/pages/goods-list/index?value=${value}&type=1`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const getOrderStatusCountData = async () => {
|
||||
const res = await getOrderStatusCountAPI()
|
||||
// console.log(res, '数量')
|
||||
const { data: res } = await getOrderStatusCountAPI()
|
||||
orderData.value[0].order_count = res.length
|
||||
orderData.value[1].order_count = res.filter((e) => e.orderStatus == 2).length
|
||||
orderData.value[2].order_count = res.filter((e) => e.orderStatus == 3).length
|
||||
orderData.value[3].order_count = res.filter((e) => e.orderStatus == 4).length
|
||||
orderData.value[4].order_count = res.filter((e) => e.orderStatus == 5).length
|
||||
orderData.value[5].order_count = res.filter((e) => e.orderStatus == 20).length
|
||||
|
||||
console.log(res, '数量')
|
||||
}
|
||||
|
||||
const onViewMyOrder = (order) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order-details/index?type=${activeUser.value}`,
|
||||
url: `/pages/order-details/index?type=${activeUser.value}&status=${order.order_status}`,
|
||||
})
|
||||
}
|
||||
|
||||
const onViewMore = () => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order-details/index`,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +177,7 @@ onLoad(() => {
|
|||
userCompanyName.value = memberStore?.userCompanyName
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
onShow(async () => {
|
||||
activeUser.value = memberStore.userType
|
||||
|
||||
if (activeUser.value === 2) {
|
||||
|
|
@ -151,6 +188,11 @@ onShow(() => {
|
|||
}
|
||||
|
||||
getOrderStatusCountData()
|
||||
|
||||
const res = await getToDoListAPI()
|
||||
const { data: result } = await getNoticeLListAPI()
|
||||
toDoListMessage.value = res.rows
|
||||
noticeListMessage.value = result.rows
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -179,6 +221,10 @@ onShow(() => {
|
|||
view {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.notice-swipe {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-ipt {
|
||||
|
|
@ -231,4 +277,8 @@ onShow(() => {
|
|||
:deep(.van-notice-bar__right-icon) {
|
||||
color: #df3939;
|
||||
}
|
||||
:deep(.van-text-ellipsis) {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
</view>
|
||||
<view class="demand-header">
|
||||
<view>
|
||||
<SearchIpt @onSearchByType="onSearchByType" />
|
||||
<SearchIpt
|
||||
v-model:activeTypeName="activeTypeName"
|
||||
v-model:searchModelValue="searchModelValue"
|
||||
@onSearchByType="onSearchByType"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<navigator
|
||||
|
|
@ -39,18 +43,81 @@
|
|||
|
||||
<view class="goods-items">
|
||||
<view class="filter-box">
|
||||
<view>
|
||||
使用年限
|
||||
<van-icon name="sort" />
|
||||
<view class="filter-items">
|
||||
发布时间
|
||||
<view class="filter-type">
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.startTime === 'ASC' ? '#00a288' : ''"
|
||||
@click="onClickStartTime(searchParams.startTime === 'ASC' ? '' : 'ASC')"
|
||||
size="12"
|
||||
/>
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.startTime === 'DESC' ? '#00a288' : ''"
|
||||
@click="
|
||||
onClickStartTime(searchParams.startTime === 'DESC' ? '' : 'DESC')
|
||||
"
|
||||
size="12"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
租金
|
||||
<van-icon name="sort" />
|
||||
<view class="filter-items">
|
||||
租期
|
||||
<view class="filter-type">
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.rentDay === 'ASC' ? '#00a288' : ''"
|
||||
@click="onClickRentDay(searchParams.rentDay === 'ASC' ? '' : 'ASC')"
|
||||
size="12"
|
||||
/>
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.rentDay === 'DESC' ? '#00a288' : ''"
|
||||
@click="onClickRentDay(searchParams.rentDay === 'DESC' ? '' : 'DESC')"
|
||||
size="12"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
上架时间
|
||||
<van-icon name="sort" />
|
||||
<view class="filter-items">
|
||||
截止时间
|
||||
<view class="filter-type">
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.endTime === 'ASC' ? '#00a288' : ''"
|
||||
@click="onClickEndTime(searchParams.endTime === 'ASC' ? '' : 'ASC')"
|
||||
size="12"
|
||||
/>
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.endTime === 'DESC' ? '#00a288' : ''"
|
||||
@click="onClickEndTime(searchParams.endTime === 'DESC' ? '' : 'DESC')"
|
||||
size="12"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter-items">
|
||||
租赁数量
|
||||
<view class="filter-type">
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.rentNum === 'ASC' ? '#00a288' : ''"
|
||||
@click="onClickRentNum(searchParams.rentNum === 'ASC' ? '' : 'ASC')"
|
||||
size="12"
|
||||
/>
|
||||
<van-icon
|
||||
name="play"
|
||||
:color="searchParams.rentNum === 'DESC' ? '#00a288' : ''"
|
||||
@click="onClickRentNum(searchParams.rentNum === 'DESC' ? '' : 'DESC')"
|
||||
size="12"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view @click="onFilter">
|
||||
筛选
|
||||
<van-icon name="filter-o" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -120,6 +187,7 @@
|
|||
style="margin-left: 10px"
|
||||
:disabled="userCompanyId == d.publishCompany"
|
||||
@click="onReceivingOrders(d.id)"
|
||||
v-if="memberStore.userType === 1"
|
||||
>
|
||||
接单
|
||||
</van-button>
|
||||
|
|
@ -127,7 +195,62 @@
|
|||
</view>
|
||||
</van-grid-item>
|
||||
</van-grid>
|
||||
|
||||
<view class="loading-text">
|
||||
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<van-popup position="bottom" v-model:show="showBottom" :style="{ height: '60%' }">
|
||||
<view class="filter-bottom">
|
||||
<view
|
||||
style="text-align: right; padding: 4px 8px"
|
||||
@click="
|
||||
() => {
|
||||
showBottom = false
|
||||
}
|
||||
"
|
||||
>
|
||||
<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: item.isChecked }"
|
||||
v-for="(item, index) in selectList[activeSelect].val_list"
|
||||
:key="index"
|
||||
@click="onClickTags(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -135,39 +258,124 @@
|
|||
import SearchIpt from '@/components/SearchIpt/index'
|
||||
import { getLeaseDemandListAPI } from '@/services/demand/index.js'
|
||||
import { acceptLeaseDemandOrderAPI } from '@/services/demand/index.js'
|
||||
import { getTypeListAPI, getAreaAPI } from '@/services/common/index.js'
|
||||
import { ref, computed } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useMemberStore } from '@/stores/index.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
import moment from 'moment'
|
||||
const memberStore = useMemberStore()
|
||||
const userCompanyId = ref()
|
||||
import moment from 'moment'
|
||||
import { ref } from 'vue'
|
||||
const keywords = ref('发布')
|
||||
const leaseDemandLis = ref([])
|
||||
const showBottom = ref(false)
|
||||
const activeSelect = ref(0)
|
||||
const total = ref(0)
|
||||
const activeTypeName = ref('')
|
||||
const searchModelValue = ref('')
|
||||
const searchParams = ref({
|
||||
keyWord: '',
|
||||
companyId: '',
|
||||
typeId: '',
|
||||
level: '',
|
||||
cityCode: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
startTime: '',
|
||||
rentDay: '',
|
||||
endTime: '',
|
||||
rentNum: '',
|
||||
})
|
||||
const selectList = ref([
|
||||
{
|
||||
selectName: '装备分类',
|
||||
val_list: [
|
||||
{
|
||||
name: '全部',
|
||||
value: '',
|
||||
isChecked: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
selectName: '项目所在地',
|
||||
val_list: [
|
||||
{
|
||||
name: '全部',
|
||||
value: '',
|
||||
isChecked: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
selectName: '需求单位',
|
||||
val_list: [
|
||||
{
|
||||
name: '全部',
|
||||
value: '',
|
||||
isChecked: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const onScrollTolower = () => {
|
||||
console.log('滚动触底')
|
||||
// 获取装备分类
|
||||
const getTypeListData = async () => {
|
||||
const { data: res } = await getTypeListAPI()
|
||||
const typeList = res.map((e) => {
|
||||
return { ...e, name: e.typeName, value: e.typeId, isChecked: false }
|
||||
})
|
||||
selectList.value[0].val_list.push(...typeList)
|
||||
}
|
||||
|
||||
const onScrollTolower = debounce(() => {
|
||||
if (total.value > leaseDemandLis.value.length) {
|
||||
searchParams.value.pageNum++
|
||||
getLeaseDemandListData()
|
||||
}
|
||||
}, 500)
|
||||
|
||||
const onSearchByType = (value, type) => {
|
||||
/**
|
||||
* @type 1 查询机具 2 查询需求
|
||||
* @value 搜索框值
|
||||
*/
|
||||
if (type === 2) {
|
||||
getLeaseDemandListData()
|
||||
searchParams.value.keyWord = value
|
||||
getLeaseDemandListData(true)
|
||||
} else {
|
||||
uni.navigateTo({ url: '/pages/goods-list/index' })
|
||||
// uni.navigateTo({ url: '/pages/goods-list/index' })
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods-list/index?value=${value}&type=1`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 判断数据是否加载完毕
|
||||
const finish = computed(() => {
|
||||
if (total.value === leaseDemandLis.value.length) return true
|
||||
})
|
||||
|
||||
// 获取需求列表
|
||||
const getLeaseDemandListData = async () => {
|
||||
const { data: res } = await getLeaseDemandListAPI({})
|
||||
leaseDemandLis.value = res.rows
|
||||
const getLeaseDemandListData = async (isTap = false) => {
|
||||
if (isTap) searchParams.value.pageNum = 1
|
||||
const { data: res } = await getLeaseDemandListAPI(searchParams.value)
|
||||
total.value = res.total
|
||||
|
||||
if (isTap) {
|
||||
leaseDemandLis.value = res.rows
|
||||
} else {
|
||||
if (res.rows.length == 0) {
|
||||
leaseDemandLis.value = []
|
||||
} else {
|
||||
leaseDemandLis.value.push(...res.rows)
|
||||
}
|
||||
}
|
||||
const nowTime = moment()
|
||||
leaseDemandLis.value.forEach((e) => {
|
||||
e.countDownTime =
|
||||
|
|
@ -198,11 +406,69 @@ const onDemandDetails = (id) => {
|
|||
url: `/pages/demand-details/index?id=${id}`,
|
||||
})
|
||||
}
|
||||
onLoad(() => {
|
||||
|
||||
const onClickStartTime = (type) => {
|
||||
searchParams.value.startTime = type
|
||||
getLeaseDemandListData(true)
|
||||
}
|
||||
const onClickRentDay = (type) => {
|
||||
searchParams.value.rentDay = type
|
||||
getLeaseDemandListData(true)
|
||||
}
|
||||
const onClickEndTime = (type) => {
|
||||
searchParams.value.endTime = type
|
||||
getLeaseDemandListData(true)
|
||||
}
|
||||
const onClickRentNum = (type) => {
|
||||
searchParams.value.rentNum = type
|
||||
getLeaseDemandListData(true)
|
||||
}
|
||||
|
||||
const onFilter = () => {
|
||||
showBottom.value = true
|
||||
}
|
||||
|
||||
// 标签点击
|
||||
const onClickTags = (item) => {
|
||||
selectList.value[activeSelect.value].val_list.forEach((e) => {
|
||||
e.isChecked = false
|
||||
})
|
||||
item.isChecked = true
|
||||
|
||||
if (activeSelect.value == 0) {
|
||||
searchParams.value.typeId = item.value
|
||||
searchParams.value.level = item.value ? 1 : ''
|
||||
}
|
||||
if (activeSelect.value == 1) {
|
||||
searchParams.value.cityCode = item.value
|
||||
}
|
||||
if (activeSelect.value == 2) {
|
||||
searchParams.value.companyId = item.value
|
||||
}
|
||||
getLeaseDemandListData(true)
|
||||
}
|
||||
onLoad(async () => {
|
||||
getTypeListData()
|
||||
const { data: res } = await getAreaAPI(34)
|
||||
const addressList = res.map((e) => {
|
||||
return { ...e, name: e.areaName, value: e.areaCode, isChecked: false, index: 1 }
|
||||
})
|
||||
const companyList = memberStore.companyList.map((e) => {
|
||||
return { ...e, name: e.companyName, value: e.companyId, isChecked: false, index: 2 }
|
||||
})
|
||||
selectList.value[1].val_list.push(...addressList)
|
||||
selectList.value[2].val_list.push(...companyList)
|
||||
userCompanyId.value = memberStore.userInfo.companyId
|
||||
})
|
||||
onShow(() => {
|
||||
getLeaseDemandListData()
|
||||
const params = uni.getStorageSync('myParam')
|
||||
// console.log(params, 'params---')
|
||||
if (params.type == 2) {
|
||||
activeTypeName.value = '需求'
|
||||
}
|
||||
searchParams.value.keyWord = params.value
|
||||
searchModelValue.value = params.value
|
||||
getLeaseDemandListData(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -240,9 +506,42 @@ onShow(() => {
|
|||
}
|
||||
}
|
||||
|
||||
.filter-box {
|
||||
.goods-items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
border-top-left-radius: 20px;
|
||||
border-top-right-radius: 20px;
|
||||
// background: $uni-bg-color;
|
||||
|
||||
.filter-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.filter-items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
|
||||
.filter-type {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0 4px;
|
||||
|
||||
& .van-icon:first-child {
|
||||
transform: rotateZ(-90deg);
|
||||
margin-bottom: -3px;
|
||||
}
|
||||
& .van-icon:last-child {
|
||||
transform: rotateZ(90deg);
|
||||
margin-top: -3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-item {
|
||||
|
|
@ -287,4 +586,48 @@ onShow(() => {
|
|||
:deep(.van-nav-bar__title) {
|
||||
color: #333;
|
||||
}
|
||||
.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 {
|
||||
min-width: calc((100% - 20px) / 3);
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 10px;
|
||||
min-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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -421,6 +421,7 @@ const orderQueryParams = ref({
|
|||
pageSize: 20,
|
||||
pageNum: 1,
|
||||
flag: true,
|
||||
orderStatus: '',
|
||||
})
|
||||
|
||||
const submitParams = ref({
|
||||
|
|
@ -453,13 +454,13 @@ const orderType = (status) => {
|
|||
}
|
||||
|
||||
const tabList = ref([
|
||||
{ tab_name: '全部' },
|
||||
{ tab_name: '待出库' },
|
||||
{ tab_name: '带收货' },
|
||||
{ tab_name: '租赁中' },
|
||||
{ tab_name: '已退租' },
|
||||
{ tab_name: '已完成' },
|
||||
{ tab_name: '已取消' },
|
||||
{ tab_name: '全部', order_status: 0 },
|
||||
{ tab_name: '待出库', order_status: 2 },
|
||||
{ tab_name: '待收货', order_status: 3 },
|
||||
{ tab_name: '租赁中', order_status: 4 },
|
||||
{ tab_name: '已退租', order_status: 5 },
|
||||
{ tab_name: '已完成', order_status: 20 },
|
||||
{ tab_name: '已取消', order_status: 99 },
|
||||
])
|
||||
|
||||
//
|
||||
|
|
@ -786,6 +787,10 @@ const onSubmitRepairResult = () => {
|
|||
|
||||
onLoad((options) => {
|
||||
orderQueryParams.value.flag = options?.type == 1 ? true : false
|
||||
// console.log(options?.status, '状态')
|
||||
const tabIndex = tabList.value.findIndex((e) => e.order_status == options?.status)
|
||||
activeTabs.value = tabIndex
|
||||
orderQueryParams.value.orderStatus = options?.status == 0 ? '' : options?.status
|
||||
getOrderListData()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -29,3 +29,12 @@ export const getTypeListAPI = () => {
|
|||
url: `/material-mall/maType/getTypeList`,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 装备 获取分类
|
||||
*/
|
||||
export const getAreaAPI = (areaCode) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: `/material-mall/maType/getArea?areaCode=${areaCode}`,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,3 +19,21 @@ export const getOrderStatusCountAPI = (data) => {
|
|||
url: '/material-mall/order/getOrderStatusCount',
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 首页 获取待办数据
|
||||
*/
|
||||
export const getToDoListAPI = () => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material-mall/todo/getToDoList',
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 首页 获取通知公告
|
||||
*/
|
||||
export const getNoticeLListAPI = () => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material-mall/notice/list',
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ export default defineConfig({
|
|||
proxy: {
|
||||
// 在此处编写代理规则
|
||||
'/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.122:28080',
|
||||
// target: 'http://192.168.0.244:28580', // 测试服务
|
||||
target: 'http://192.168.0.244:28580', // 测试服务
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => {
|
||||
return path.replace(/\/api/, '')
|
||||
|
|
|
|||
Loading…
Reference in New Issue