Task:村屋多加一级分类

This commit is contained in:
modendeveloper
2024-12-26 23:30:30 +08:00
parent 0ceb016e20
commit 8aa2454a1a
2 changed files with 63 additions and 2 deletions
+4
View File
@@ -99,3 +99,7 @@ export function getCountyFamousVillageNews(param) {
export function getShareImg(id) {
return request.get('/countyFamous/poster/' + id, {login: true})
}
export function getSaleList(params) {
return request.get('/countyFamous/village/category', params, {login: true})
}
+59 -2
View File
@@ -316,6 +316,7 @@
<goo-skeleton v-else />
</view>
<!-- 产业 -->
<view
v-if="activeIndex === 0"
class="industry-section"
@@ -470,6 +471,11 @@
</view>
</view>
<view class="village-wrap">
<view class="v12-pa-2 sale-wrap">
<view :class="{'saleActive' : saleActived === sale.id}" v-for="(sale, i) in saleList" :key="i" @click="handleSale(sale)">
{{ sale.name }}
</view>
</view>
<view v-if="villageList.length > 0" class="village-list">
<view
v-for="(village, villageIndex) in villageList"
@@ -644,7 +650,8 @@ import {
getCountyFamousInvestmentFile,
getCountyFamousVillage,
getCountyFamousCityDetail,
getShareImg
getShareImg,
getSaleList
} from '@/api/qianxian'
import {formatDateTime} from '@/utils'
import {getUrlParam} from '@/utils/common.js'
@@ -661,11 +668,13 @@ export default {
mixins: [pageListenMixins],
data() {
return {
saleActived: null,
webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false,
activeIndex: 0,
loading: false,
scrollData: {},
saleList: [],
inn: {
cityName: '',
pics: [],
@@ -744,8 +753,36 @@ export default {
this.getGuideReq()
// this.initPoster()
this.getListReq()
this.getsaleList()
},
methods: {
handleSale(e) {
if(this.saleActived === e.id) {
this.saleActived = null
} else {
this.saleActived = e.id
}
getCountyFamousVillage({
countyFamousDataId: this.id,
categoryId: this.saleActived,
page: 1,
limit: 9999
}).then(res => {
const { success, data } = res
if (success) {
this.villageList = data.records || []
}
})
},
getsaleList() {
const params = {
countyFamousDataId: this.id
}
getSaleList(params).then(res => {
this.saleList = res.data || []
})
},
goStore(item) {
if (item.farmerShopId === 0) {
uni.showToast({
@@ -770,7 +807,7 @@ export default {
}
})
},
getListReq() {
getListReq(id) {
// getPoster(this.id).then(({data}) => this.posterUrl = data)
getCountyFamousIndustry({
countyFamousDataId: this.id,
@@ -804,6 +841,7 @@ export default {
})
getCountyFamousVillage({
countyFamousDataId: this.id,
categoryId: id,
page: 1,
limit: 9999
}).then(res => {
@@ -1203,6 +1241,25 @@ export default {
<style scoped lang="less">
@import "@/assets/css/store.less";
.saleActive{
background: #C52733 !important;
color: #fff !important;
}
.sale-wrap{
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: flex-start;
view {
background: #f5f5f5;
border-radius: 6rpx;
padding: 4rpx 16rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
font-size: 24rpx;
white-space: nowrap;
}
}
.video-item {
width: 100%;
height: 400rpx;