提交 e49c9a30 作者: 王定

feat: 完成农机服务列表页面和申请入驻功能

上级 c8db9821
......@@ -288,7 +288,7 @@
{
"path": "pages/nongjifuwu/nongjifuwu",
"style": {
"navigationBarTitleText": "农机作业预约",
"navigationBarTitleText": "农机服务",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#5DB66F",
"navigationBarTextStyle": "white",
......@@ -299,7 +299,7 @@
"titleSize": "20",
"buttons": [
{
"text": "重置",
"text": "申请入驻",
"fontSrc": "/static/uni.ttf",
"color": "#fff",
"fontSize": "28rpx",
......@@ -720,6 +720,13 @@
{
"navigationBarTitleText" : "农贸入驻申请"
}
},
{
"path" : "pages/nongjifuwu/shenqingruzhu",
"style" :
{
"navigationBarTitleText" : "农机服务入驻申请"
}
}
],
"easycom": {
......
......@@ -21,8 +21,7 @@
pageNo: 1,
pageSize: 10,
enterprise:{
bizCategory:2,
province:'湖南省'
bizCategory:2
}
}, // 分页参数
hasMore: true, // 是否还有更多数据
......
......@@ -4,6 +4,7 @@
import ApplyDialog from './components/apply-dialog.vue'
import * as NongjifuwuAPI from '@/api/model/nongjifuwu'
import * as NongzhiAPI from '@/api/model/nongzhi'
import Navigate from '@/utils/page/navigate'
import { s } from 'vite/dist/node/types.d-aGj9QkWt'
import { getDictData, getText } from '@/utils/dict/area'
......@@ -37,6 +38,9 @@
pageSize: 10,
serviceType: 1,
scope: null,
enterprise:{
bizCategory:3
}
},
farmMachineList: [],
total: 0,
......@@ -44,15 +48,29 @@
function getFarmMachineList() {
pageData.loading = true
NongjifuwuAPI.farmMachineList(pageData.search)
.then((res) => {
const { records, total } = res
pageData.farmMachineList = [...pageData.farmMachineList, ...records]
pageData.total = total
})
.finally(() => {
pageData.loading = false
})
if(pageData.search.serviceType == 1){
NongzhiAPI.getEnterpriseList(pageData.search)
.then((res) => {
console.log("猎取到了企业");
console.log(res);
const { records, total } = res
pageData.farmMachineList = [...pageData.farmMachineList, ...records]
pageData.total = total
})
.finally(() => {
pageData.loading = false
})
}else{
NongjifuwuAPI.farmMachineList(pageData.search)
.then((res) => {
const { records, total } = res
pageData.farmMachineList = [...pageData.farmMachineList, ...records]
pageData.total = total
})
.finally(() => {
pageData.loading = false
})
}
}
function search() {
......@@ -114,12 +132,12 @@
}
onNavigationBarButtonTap(() => {
pageData.search.scope = null
search()
/* pageData.search.scope = null
search() */
Navigate.to('/pages/nongjifuwu/shenqingruzhu')
})
onReachBottom(() => {
console.log('触底了')
if (pageData.total <= pageData.farmMachineList.length) return
pageData.search.pageNo++
getFarmMachineList()
......@@ -152,45 +170,58 @@
}}</text>
</view>
</view>
<view
<!-- <view
v-if="!pageData.farmMachineList || pageData.farmMachineList.length == 0"
class="codefun-flex-col codefun-relative section_4"
style="height: 700rpx"
>
<fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" />
</view>
</view> -->
<view class="codefun-flex-col codefun-relative section_4">
<view class="codefun-flex-row group_6" v-for="item in pageData.farmMachineList" :key="item.id">
<image
class="codefun-shrink-0 codefun-self-center image_8"
:src="item.picture"
@click="handleDetails(item)"
/>
<view style="width: 70%">
<view
class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center"
@click="handleDetails(item)"
>
<text class="font text_6">{{ item.name }}</text>
<text class="font_3 text_7 ellipsis" style="width: 100%; margin: 26rpx 0"
>服务范围:{{ getText(item.scope, ' / ') }}</text
>
</view>
<view class="flex justify-between" style="width: 100%">
<view class="group_5" @click="handleDetails(item)">
<text class="font_6">¥</text>
<text class="font_4 text_8">{{ item.price }}</text>
<text class="font_7">/亩</text>
</view>
<view
class="codefun-flex-col codefun-justify-start codefun-items-center codefun-shrink-0 codefun-self-start text-wrapper_2"
@click="handleApply(item)"
>
<text class="font_5">去预约</text>
</view>
</view>
</view>
</view>
<template v-if=" pageData.search.serviceType == 1">
<view class="yr-item" v-for="item in pageData.farmMachineList" :key="item.id">
<view class="text-ellipsis yr-item-name">{{item.enterpriseName}}</view>
<view class="text-ellipsis yr-item-product">公司主营: {{item.businessScope}}</view>
<view class="yr-item-info">
<view class="text-ellipsis yr-item-address">{{item.provinceName}}{{item.cityName}}{{item.districtName}}{{item.townName}}</view>
<view class="yr-item-detail">查看详情</view>
</view>
</view>
</template>
<template v-else>
<view class="codefun-flex-row group_6" v-for="item in pageData.farmMachineList" :key="item.id">
<image
class="codefun-shrink-0 codefun-self-center image_8"
:src="item.picture"
@click="handleDetails(item)"
/>
<view style="width: 70%">
<view
class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center"
@click="handleDetails(item)"
>
<text class="font text_6">{{ item.name }}</text>
<text class="font_3 text_7 ellipsis" style="width: 100%; margin: 26rpx 0"
>服务范围:{{ getText(item.scope, ' / ') }}</text
>
</view>
<view class="flex justify-between" style="width: 100%">
<view class="group_5" @click="handleDetails(item)">
<text class="font_6">¥</text>
<text class="font_4 text_8">{{ item.price }}</text>
<text class="font_7">/亩</text>
</view>
<view
class="codefun-flex-col codefun-justify-start codefun-items-center codefun-shrink-0 codefun-self-start text-wrapper_2"
@click="handleApply(item)"
>
<text class="font_5">去预约</text>
</view>
</view>
</view>
</view>
</template>
</view>
</view>
</view>
......@@ -222,6 +253,62 @@
overflow-y: auto;
overflow-x: hidden;
height: 100%;
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.yr-item{
margin-top: 24rpx;
border-bottom: 2rpx solid #EEEEEE;
padding-left: 8rpx;
padding-bottom: 20rpx;
.yr-item-name{
width: 640rpx;
height: 40rpx;
font-size: 32rpx;
line-height: 40rpx;
font-weight: 500;
color: #333333;
}
.yr-item-product{
margin-top: 12rpx;
width: 640rpx;
height: 32rpx;
font-size: 24rpx;
line-height: 32rpx;
font-weight: 500;
color: #555555;
}
.yr-item-info{
margin-top: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
.yr-item-address{
font-size: 24rpx;
color: #5DB66F;
width: 480rpx;
}
.yr-item-detail{
width: 136rpx;
height: 48rpx;
border-radius: 200rpx;
background: #5DB66F;
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx;
color: #FFFFFF;
font-size: 24rpx;
font-weight: 400;
}
}
}
.yr-item:last-child{
border-bottom:none
}
.section {
padding: 24rpx 24rpx 24rpx 32rpx;
background-color: #5db66f;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论