提交 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,15 +48,29 @@ ...@@ -44,15 +48,29 @@
function getFarmMachineList() { function getFarmMachineList() {
pageData.loading = true pageData.loading = true
NongjifuwuAPI.farmMachineList(pageData.search) if(pageData.search.serviceType == 1){
.then((res) => { NongzhiAPI.getEnterpriseList(pageData.search)
const { records, total } = res .then((res) => {
pageData.farmMachineList = [...pageData.farmMachineList, ...records] console.log("猎取到了企业");
pageData.total = total console.log(res);
}) const { records, total } = res
.finally(() => { pageData.farmMachineList = [...pageData.farmMachineList, ...records]
pageData.loading = false 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() { function search() {
...@@ -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,45 +170,58 @@ ...@@ -152,45 +170,58 @@
}}</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">
<view class="codefun-flex-row group_6" v-for="item in pageData.farmMachineList" :key="item.id"> <template v-if=" pageData.search.serviceType == 1">
<image <view class="yr-item" v-for="item in pageData.farmMachineList" :key="item.id">
class="codefun-shrink-0 codefun-self-center image_8" <view class="text-ellipsis yr-item-name">{{item.enterpriseName}}</view>
:src="item.picture" <view class="text-ellipsis yr-item-product">公司主营: {{item.businessScope}}</view>
@click="handleDetails(item)" <view class="yr-item-info">
/> <view class="text-ellipsis yr-item-address">{{item.provinceName}}{{item.cityName}}{{item.districtName}}{{item.townName}}</view>
<view style="width: 70%"> <view class="yr-item-detail">查看详情</view>
<view </view>
class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center" </view>
@click="handleDetails(item)" </template>
> <template v-else>
<text class="font text_6">{{ item.name }}</text> <view class="codefun-flex-row group_6" v-for="item in pageData.farmMachineList" :key="item.id">
<text class="font_3 text_7 ellipsis" style="width: 100%; margin: 26rpx 0" <image
>服务范围:{{ getText(item.scope, ' / ') }}</text class="codefun-shrink-0 codefun-self-center image_8"
> :src="item.picture"
</view> @click="handleDetails(item)"
<view class="flex justify-between" style="width: 100%"> />
<view class="group_5" @click="handleDetails(item)"> <view style="width: 70%">
<text class="font_6">¥</text> <view
<text class="font_4 text_8">{{ item.price }}</text> class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center"
<text class="font_7">/亩</text> @click="handleDetails(item)"
</view> >
<view <text class="font text_6">{{ item.name }}</text>
class="codefun-flex-col codefun-justify-start codefun-items-center codefun-shrink-0 codefun-self-start text-wrapper_2" <text class="font_3 text_7 ellipsis" style="width: 100%; margin: 26rpx 0"
@click="handleApply(item)" >服务范围:{{ getText(item.scope, ' / ') }}</text
> >
<text class="font_5">去预约</text> </view>
</view> <view class="flex justify-between" style="width: 100%">
</view> <view class="group_5" @click="handleDetails(item)">
</view> <text class="font_6">¥</text>
</view> <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> </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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论