修改首页功能

This commit is contained in:
wangxiaowei
2026-04-23 10:41:27 +08:00
parent 7f8f15b809
commit a3edea96af
10 changed files with 45 additions and 37 deletions

View File

@ -61,7 +61,7 @@
<script>
import { mapGetters, mapActions } from 'vuex'
import { getShopGoodsCategory } from '@/api/shop'
import { getShopGoodsCategory, getCityGoodsCategory } from '@/api/shop'
import { getGoodsList } from '@/api/store'
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins.js'
@ -99,14 +99,15 @@
...mapActions(['getCartNum']),
onCityChange() {
console.log("🚀 ~ methods.onCityChange:", 'onCityChange')
this.active = -1
this.goodsList = []
this.getShopGoodsCategoryFun()
this.mescroll.resetUpScroll()
},
async getShopGoodsCategoryFun() {
const { data, code } = await getShopGoodsCategory({
shop_id: this.shopId
const { data, code } = await getCityGoodsCategory({
city_id: (this.cityInfo && this.cityInfo.id) || 0,
})
if (code == 1) {
this.category = data
@ -126,7 +127,8 @@
page_size: pageSize,
page_no: pageNum,
shop_id: this.shopId,
shop_cate_id: cateId
shop_cate_id: cateId,
city_id: (this.cityInfo && this.cityInfo.id) || 0,
}).then(({ data }) => {
let curPageData = data.lists
let curPageLen = curPageData.length