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) { export function getShareImg(id) {
return request.get('/countyFamous/poster/' + id, {login: true}) 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 /> <goo-skeleton v-else />
</view> </view>
<!-- 产业 --> <!-- 产业 -->
<view <view
v-if="activeIndex === 0" v-if="activeIndex === 0"
class="industry-section" class="industry-section"
@@ -470,6 +471,11 @@
</view> </view>
</view> </view>
<view class="village-wrap"> <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-if="villageList.length > 0" class="village-list">
<view <view
v-for="(village, villageIndex) in villageList" v-for="(village, villageIndex) in villageList"
@@ -644,7 +650,8 @@ import {
getCountyFamousInvestmentFile, getCountyFamousInvestmentFile,
getCountyFamousVillage, getCountyFamousVillage,
getCountyFamousCityDetail, getCountyFamousCityDetail,
getShareImg getShareImg,
getSaleList
} from '@/api/qianxian' } from '@/api/qianxian'
import {formatDateTime} from '@/utils' import {formatDateTime} from '@/utils'
import {getUrlParam} from '@/utils/common.js' import {getUrlParam} from '@/utils/common.js'
@@ -661,11 +668,13 @@ export default {
mixins: [pageListenMixins], mixins: [pageListenMixins],
data() { data() {
return { return {
saleActived: null,
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false, isLoad: false,
activeIndex: 0, activeIndex: 0,
loading: false, loading: false,
scrollData: {}, scrollData: {},
saleList: [],
inn: { inn: {
cityName: '', cityName: '',
pics: [], pics: [],
@@ -744,8 +753,36 @@ export default {
this.getGuideReq() this.getGuideReq()
// this.initPoster() // this.initPoster()
this.getListReq() this.getListReq()
this.getsaleList()
}, },
methods: { 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) { goStore(item) {
if (item.farmerShopId === 0) { if (item.farmerShopId === 0) {
uni.showToast({ uni.showToast({
@@ -770,7 +807,7 @@ export default {
} }
}) })
}, },
getListReq() { getListReq(id) {
// getPoster(this.id).then(({data}) => this.posterUrl = data) // getPoster(this.id).then(({data}) => this.posterUrl = data)
getCountyFamousIndustry({ getCountyFamousIndustry({
countyFamousDataId: this.id, countyFamousDataId: this.id,
@@ -804,6 +841,7 @@ export default {
}) })
getCountyFamousVillage({ getCountyFamousVillage({
countyFamousDataId: this.id, countyFamousDataId: this.id,
categoryId: id,
page: 1, page: 1,
limit: 9999 limit: 9999
}).then(res => { }).then(res => {
@@ -1203,6 +1241,25 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
@import "@/assets/css/store.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 { .video-item {
width: 100%; width: 100%;
height: 400rpx; height: 400rpx;