提交 e49c9a30 作者: 王定

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

上级 c8db9821
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
{ {
"path": "pages/nongjifuwu/nongjifuwu", "path": "pages/nongjifuwu/nongjifuwu",
"style": { "style": {
"navigationBarTitleText": "农机作业预约", "navigationBarTitleText": "农机服务",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#5DB66F", "navigationBarBackgroundColor": "#5DB66F",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
"titleSize": "20", "titleSize": "20",
"buttons": [ "buttons": [
{ {
"text": "重置", "text": "申请入驻",
"fontSrc": "/static/uni.ttf", "fontSrc": "/static/uni.ttf",
"color": "#fff", "color": "#fff",
"fontSize": "28rpx", "fontSize": "28rpx",
...@@ -720,6 +720,13 @@ ...@@ -720,6 +720,13 @@
{ {
"navigationBarTitleText" : "农贸入驻申请" "navigationBarTitleText" : "农贸入驻申请"
} }
},
{
"path" : "pages/nongjifuwu/shenqingruzhu",
"style" :
{
"navigationBarTitleText" : "农机服务入驻申请"
}
} }
], ],
"easycom": { "easycom": {
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
enterprise:{ enterprise:{
bizCategory:2, bizCategory:2
province:'湖南省'
} }
}, // 分页参数 }, // 分页参数
hasMore: true, // 是否还有更多数据 hasMore: true, // 是否还有更多数据
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import ApplyDialog from './components/apply-dialog.vue' import ApplyDialog from './components/apply-dialog.vue'
import * as NongjifuwuAPI from '@/api/model/nongjifuwu' import * as NongjifuwuAPI from '@/api/model/nongjifuwu'
import * as NongzhiAPI from '@/api/model/nongzhi'
import Navigate from '@/utils/page/navigate' import Navigate from '@/utils/page/navigate'
import { s } from 'vite/dist/node/types.d-aGj9QkWt' import { s } from 'vite/dist/node/types.d-aGj9QkWt'
import { getDictData, getText } from '@/utils/dict/area' import { getDictData, getText } from '@/utils/dict/area'
...@@ -37,6 +38,9 @@ ...@@ -37,6 +38,9 @@
pageSize: 10, pageSize: 10,
serviceType: 1, serviceType: 1,
scope: null, scope: null,
enterprise:{
bizCategory:3
}
}, },
farmMachineList: [], farmMachineList: [],
total: 0, total: 0,
...@@ -44,6 +48,19 @@ ...@@ -44,6 +48,19 @@
function getFarmMachineList() { function getFarmMachineList() {
pageData.loading = true pageData.loading = true
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) NongjifuwuAPI.farmMachineList(pageData.search)
.then((res) => { .then((res) => {
const { records, total } = res const { records, total } = res
...@@ -54,6 +71,7 @@ ...@@ -54,6 +71,7 @@
pageData.loading = false pageData.loading = false
}) })
} }
}
function search() { function search() {
pageData.loading = true pageData.loading = true
...@@ -114,12 +132,12 @@ ...@@ -114,12 +132,12 @@
} }
onNavigationBarButtonTap(() => { onNavigationBarButtonTap(() => {
pageData.search.scope = null /* pageData.search.scope = null
search() search() */
Navigate.to('/pages/nongjifuwu/shenqingruzhu')
}) })
onReachBottom(() => { onReachBottom(() => {
console.log('触底了')
if (pageData.total <= pageData.farmMachineList.length) return if (pageData.total <= pageData.farmMachineList.length) return
pageData.search.pageNo++ pageData.search.pageNo++
getFarmMachineList() getFarmMachineList()
...@@ -152,14 +170,25 @@ ...@@ -152,14 +170,25 @@
}}</text> }}</text>
</view> </view>
</view> </view>
<view <!-- <view
v-if="!pageData.farmMachineList || pageData.farmMachineList.length == 0" v-if="!pageData.farmMachineList || pageData.farmMachineList.length == 0"
class="codefun-flex-col codefun-relative section_4" class="codefun-flex-col codefun-relative section_4"
style="height: 700rpx" style="height: 700rpx"
> >
<fui-empty marginTop="100" src="/static/images/no-data.png" title="暂无数据" /> <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-col codefun-relative section_4">
<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"> <view class="codefun-flex-row group_6" v-for="item in pageData.farmMachineList" :key="item.id">
<image <image
class="codefun-shrink-0 codefun-self-center image_8" class="codefun-shrink-0 codefun-self-center image_8"
...@@ -191,6 +220,8 @@ ...@@ -191,6 +220,8 @@
</view> </view>
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -222,6 +253,62 @@ ...@@ -222,6 +253,62 @@
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
height: 100%; 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 { .section {
padding: 24rpx 24rpx 24rpx 32rpx; padding: 24rpx 24rpx 24rpx 32rpx;
background-color: #5db66f; background-color: #5db66f;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论