feat(specialArea): 添加五折专区
This commit is contained in:
parent
44f10ffcb1
commit
6de0c3ea57
|
@ -1,11 +1,7 @@
|
|||
<template>
|
||||
<view class="goods-sort">
|
||||
<!-- 注册 -->
|
||||
<view
|
||||
key="regist"
|
||||
v-if="registList.length > 0 && !isZeroLevel"
|
||||
class="goods-flexs"
|
||||
>
|
||||
<view key="regist" v-if="registList.length > 0" class="goods-flexs">
|
||||
<view class="goods-view">
|
||||
<area-product-list
|
||||
:list="registList"
|
||||
|
@ -28,11 +24,7 @@
|
|||
</view>
|
||||
<!-- 复购 -->
|
||||
|
||||
<view
|
||||
key="repurchase"
|
||||
v-if="repurchaseList.length > 0 && !isZeroLevel"
|
||||
class="goods-flexs"
|
||||
>
|
||||
<view key="repurchase" v-if="repurchaseList.length > 0" class="goods-flexs">
|
||||
<view class="goods-view">
|
||||
<area-product-list
|
||||
:list="repurchaseList"
|
||||
|
@ -43,11 +35,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 重消 -->
|
||||
<view
|
||||
key="rescission"
|
||||
v-if="!isZeroLevel && rescissionList.length > 0"
|
||||
class="goods-flexs"
|
||||
>
|
||||
<view key="rescission" v-if="rescissionList.length > 0" class="goods-flexs">
|
||||
<view class="goods-view">
|
||||
<area-product-list
|
||||
:list="rescissionList"
|
||||
|
@ -57,6 +45,17 @@
|
|||
></area-product-list>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 半价 -->
|
||||
<view key="halfPrice" v-if="halfPriceList.length > 0" class="goods-flexs">
|
||||
<view class="goods-view">
|
||||
<area-product-list
|
||||
:list="halfPriceList"
|
||||
:title="halfPrice.name"
|
||||
@product-click="redirectList"
|
||||
:specialAreaId="halfPrice.id"
|
||||
></area-product-list>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -66,6 +65,7 @@ import {
|
|||
UPGRADE_AREA,
|
||||
REPURCHASE_AREA,
|
||||
REISSUE_AREA,
|
||||
HALF_PRICE_AREA,
|
||||
} from '@/util/specialAreaMap'
|
||||
import { MEMBER_SIGN } from '@/util/common'
|
||||
import areaProductList from '@/components/area-product-list/index.vue'
|
||||
|
@ -93,24 +93,20 @@ export default {
|
|||
upgradeList: [],
|
||||
repurchaseList: [],
|
||||
rescissionList: [],
|
||||
halfPriceList: [],
|
||||
regist: REGIEST_AREA,
|
||||
upgrade: UPGRADE_AREA,
|
||||
repurchase: REPURCHASE_AREA,
|
||||
rescission: REISSUE_AREA,
|
||||
halfPrice: HALF_PRICE_AREA,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isZeroLevel']),
|
||||
},
|
||||
created() {
|
||||
const userInfo = uni.getStorageSync('userInfo') || this.userInfo
|
||||
if (userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL) {
|
||||
this.upgrade.name = '会员专区'
|
||||
}
|
||||
this.getAreaListById(UPGRADE_AREA.id, this.upgradeList)
|
||||
this.getAreaListById(REISSUE_AREA.id, this.rescissionList)
|
||||
this.getAreaListById(REGIEST_AREA.id, this.registList)
|
||||
this.getAreaListById(REPURCHASE_AREA.id, this.repurchaseList)
|
||||
this.getAreaListById(HALF_PRICE_AREA.id, this.halfPriceList)
|
||||
},
|
||||
methods: {
|
||||
getAreaListById(areaId, list) {
|
||||
|
|
|
@ -385,6 +385,7 @@ import {
|
|||
UPGRADE_AREA,
|
||||
REPURCHASE_AREA,
|
||||
REISSUE_AREA,
|
||||
HALF_PRICE_AREA,
|
||||
} from '@/util/specialAreaMap'
|
||||
|
||||
export default {
|
||||
|
@ -576,6 +577,7 @@ export default {
|
|||
UPGRADE_AREA,
|
||||
REISSUE_AREA,
|
||||
REPURCHASE_AREA,
|
||||
HALF_PRICE_AREA,
|
||||
]
|
||||
const title = areaList.find(item => item.id == areaId)?.name
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
|
@ -188,6 +188,7 @@ import {
|
|||
UPGRADE_AREA,
|
||||
REPURCHASE_AREA,
|
||||
REISSUE_AREA,
|
||||
HALF_PRICE_AREA,
|
||||
} from '@/util/specialAreaMap'
|
||||
import { MEMBER_SIGN } from '@/util/common'
|
||||
import areaProductList from '@/components/area-product-list/index.vue'
|
||||
|
@ -271,12 +272,10 @@ export default {
|
|||
this.userInfo = uni.getStorageSync('User')
|
||||
const areaMap = {
|
||||
[REGIEST_AREA.id]: REGIEST_AREA.name,
|
||||
[UPGRADE_AREA.id]:
|
||||
this.userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL
|
||||
? '会员专区'
|
||||
: UPGRADE_AREA.name,
|
||||
[UPGRADE_AREA.id]: UPGRADE_AREA.name,
|
||||
[REPURCHASE_AREA.id]: REPURCHASE_AREA.name,
|
||||
[REISSUE_AREA.id]: REISSUE_AREA.name,
|
||||
[HALF_PRICE_AREA.id]: HALF_PRICE_AREA.name,
|
||||
}
|
||||
this.titLabel = areaMap[this.specialArea]
|
||||
uni.setNavigationBarTitle({
|
||||
|
@ -382,6 +381,7 @@ export default {
|
|||
})
|
||||
},
|
||||
getClassIfy() {
|
||||
console.log(this.specialArea, '...specialArea')
|
||||
api
|
||||
.classifyList({
|
||||
pkCountry: this.pkCountry,
|
||||
|
@ -393,6 +393,7 @@ export default {
|
|||
// classifyName: '全部',
|
||||
// pkId: '',
|
||||
// })
|
||||
console.log(res.data, '...res.data')
|
||||
this.oneList = res.data
|
||||
this.oneId = this.oneList[0] ? this.oneList[0].pkId : ''
|
||||
this.getClassIfyTwo(this.oneList[0].pkId)
|
||||
|
|
|
@ -17,3 +17,8 @@ export const REPURCHASE_AREA = {
|
|||
id: 43,
|
||||
name: '商城专区',
|
||||
}
|
||||
|
||||
export const HALF_PRICE_AREA = {
|
||||
id: 47,
|
||||
name: '半价专区',
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue