Fix:4971 【商城小程序】体验券详情页—店铺分类无数据时隐藏分类
This commit is contained in:
@@ -173,6 +173,10 @@ export function getExperienceCouponItems(params) {
|
|||||||
return request.get('/experienceCoupon/items', params, {login: true})
|
return request.get('/experienceCoupon/items', params, {login: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getExperienceCouponCategoryList(params) {
|
||||||
|
return request.get('/experienceCoupon/categoryList', params, {login: true})
|
||||||
|
}
|
||||||
|
|
||||||
export function createExperienceCouponOrder(data) {
|
export function createExperienceCouponOrder(data) {
|
||||||
return request.post('/experienceCoupon/order/create', data, {login: true})
|
return request.post('/experienceCoupon/order/create', data, {login: true})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { getLatestExperienceCoupon, getExperienceCouponList, getExperienceCouponItems, createExperienceCouponOrder } from '@/api/product'
|
import { getLatestExperienceCoupon, getExperienceCouponList, getExperienceCouponItems, createExperienceCouponOrder, getExperienceCouponCategoryList } from '@/api/product'
|
||||||
import { getExperienceStoreCategoryList } from '@/api/join'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -119,6 +118,7 @@ export default {
|
|||||||
this.endTime = coupon.endTime || ''
|
this.endTime = coupon.endTime || ''
|
||||||
this.expireDate = this.endTime || this.expireDate
|
this.expireDate = this.endTime || this.expireDate
|
||||||
this.headerImage = coupon.experienceCouponImage || (this.webUrl + '/experienceCoupon/header.png')
|
this.headerImage = coupon.experienceCouponImage || (this.webUrl + '/experienceCoupon/header.png')
|
||||||
|
this.fetchCategoryList()
|
||||||
this.fetchExperienceItems()
|
this.fetchExperienceItems()
|
||||||
},
|
},
|
||||||
fetchExperienceCoupon() {
|
fetchExperienceCoupon() {
|
||||||
@@ -151,7 +151,12 @@ export default {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
fetchCategoryList() {
|
fetchCategoryList() {
|
||||||
getExperienceStoreCategoryList().then(({ data }) => {
|
if (!this.activeCouponId) {
|
||||||
|
this.categoryList = [{ id: 'all', name: '全部体验' }]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const params = { couponId: this.activeCouponId }
|
||||||
|
getExperienceCouponCategoryList(params).then(({ data }) => {
|
||||||
const list = data || []
|
const list = data || []
|
||||||
this.categoryList = [
|
this.categoryList = [
|
||||||
{ id: 'all', name: '全部体验' },
|
{ id: 'all', name: '全部体验' },
|
||||||
@@ -160,7 +165,9 @@ export default {
|
|||||||
name: item.name
|
name: item.name
|
||||||
}))
|
}))
|
||||||
]
|
]
|
||||||
}).catch(() => {})
|
}).catch(() => {
|
||||||
|
this.categoryList = [{ id: 'all', name: '全部体验' }]
|
||||||
|
})
|
||||||
},
|
},
|
||||||
fetchExperienceItems() {
|
fetchExperienceItems() {
|
||||||
if (!this.activeCouponId) {
|
if (!this.activeCouponId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user