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