商户分类

h5
fanfan 8 months ago
parent 01c32d3c7c
commit 81c6991c43
  1. 7
      api/category/index.js
  2. 2
      ext.json
  3. 8
      pages/shopList/shopPage.vue

@ -4,7 +4,8 @@ import request from '@/utils/request'
const api = { const api = {
list: 'category/list', list: 'category/list',
sonList:'goods/list', sonList:'goods/list',
listmerchant: 'category/listmerchant' listmerchant: 'category/listmerchant',
getShopCategory: 'merchant/getShopCategory'
} }
@ -23,4 +24,8 @@ export const childrenList = (param, option) => {
// 获取商户下商品分类列表 // 获取商户下商品分类列表
export const listmerchant = (param, option) => { export const listmerchant = (param, option) => {
return request.get(api.listmerchant, param, option) return request.get(api.listmerchant, param, option)
}
// 获取商户下商品分类列表
export const getShopCategory = (param, option) => {
return request.get(api.getShopCategory, param, option)
} }

@ -1,6 +1,6 @@
{ {
"extEnable": true, "extEnable": true,
"extAppid": "wx9f7e94fe11dc0c23", "extAppid": "wxa3127ed5c3542a28",
"ext": { "ext": {
"store_id": 10048 "store_id": 10048
} }

@ -45,13 +45,13 @@
</button> </button>
</view> </view>
<view v-if="firstCate" class="shop-goods"> <view v-if="firstCate" class="shop-goods">
<view v-if="goodsCate.filter(v => v.category_id === firstCate)[0].children.length > 0" class="second-cate"> <!-- <view v-if="goodsCate.filter(v => v.category_id === firstCate)[0].children.length > 0" class="second-cate">
<scroll-view class="second-cate-tabs" scroll-x> <scroll-view class="second-cate-tabs" scroll-x>
<view v-for="(item, index) in goodsCate.filter(v => v.category_id === firstCate)[0].children" :key="index" class="cate-item" :class="{active: secondCate === item.category_id}" @click="secondCate = item.category_id"> <view v-for="(item, index) in goodsCate.filter(v => v.category_id === firstCate)[0].children" :key="index" class="cate-item" :class="{active: secondCate === item.category_id}" @click="secondCate = item.category_id">
{{ item.name }} {{ item.name }}
</view> </view>
</scroll-view> </scroll-view>
</view> </view> -->
<view class="goods-content"> <view class="goods-content">
<view class="first-cate"> <view class="first-cate">
<scroll-view class="first-cate-tabs" scroll-y> <scroll-view class="first-cate-tabs" scroll-y>
@ -238,7 +238,7 @@
getGoodsTypeList() { getGoodsTypeList() {
const that = this; const that = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
cstegory.listmerchant({ cstegory.getShopCategory({
merchantId: this.id merchantId: this.id
}) })
.then(res => { .then(res => {
@ -460,7 +460,7 @@
margin-top: 30rpx; margin-top: 30rpx;
background: #F0F4F3; background: #F0F4F3;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
padding-top: 24rpx; // padding-top: 24rpx;
.second-cate { .second-cate {
padding: 0 24rpx; padding: 0 24rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;

Loading…
Cancel
Save