web-retail-h5/pages/specialArea/index.vue

145 lines
3.2 KiB
Vue
Raw Normal View History

2025-03-23 09:29:40 +08:00
<!--
2025-06-09 14:39:09 +08:00
* @Descripttion:
* @version:
2025-03-23 09:29:40 +08:00
* @Author: kBank
* @Date: 2022-11-21 15:11:22
-->
<template>
<view class="content">
<view class="goods-sort">
2025-06-09 14:39:09 +08:00
<!-- 注册 -->
<view
v-if="registList.length > 0 && user.memberSign !== 1"
class="goods-flexs"
>
<view class="goods-view">
<area-product-list
:list="registList"
:title="regist.name"
></area-product-list>
</view>
</view>
<!-- 升级 -->
<view
v-if="upgradeList.length > 0 && user.memberSign === 1"
class="goods-flexs"
>
<view class="goods-view">
<area-product-list
:list="upgradeList"
:title="upgrade.name"
></area-product-list>
</view>
</view>
<!-- 复购 -->
<view
v-if="repurchaseList.length > 0 && user.memberSign === 1"
class="goods-flexs"
>
<view class="goods-view">
<area-product-list
:list="repurchaseList"
:title="repurchase.name"
></area-product-list>
2025-03-23 09:29:40 +08:00
</view>
</view>
</view>
2025-06-09 14:39:09 +08:00
<!-- 重消 -->
<view
v-if="rescissionList.length > 0 && user.memberSign === 1"
class="goods-flexs"
>
<view class="goods-view">
<area-product-list
:list="rescissionList"
:title="rescission.name"
></area-product-list>
</view>
</view>
2025-03-23 09:29:40 +08:00
<cl-tabbar :current="2"></cl-tabbar>
</view>
</template>
<script>
import * as api from '@/config/goods'
import { getAreaGoods } from '@/config/special-area'
2025-03-23 09:29:40 +08:00
import * as apis from '@/config/index.js'
import clTabbar from '@/components/cl-tabbar.vue'
import * as ban from '@/config/balance.js'
import areaProductList from '@/components/area-product-list/index.vue'
2025-06-09 14:39:09 +08:00
import { mapGetters } from 'vuex'
import {
REGIEST_AREA,
UPGRADE_AREA,
REPURCHASE_AREA,
REISSUE_AREA,
} from '@/util/specialAreaMap'
2025-03-23 09:29:40 +08:00
export default {
components: {
'cl-tabbar': clTabbar,
'area-product-list': areaProductList,
2025-03-23 09:29:40 +08:00
},
2025-06-09 14:39:09 +08:00
computed: {
...mapGetters(['user']),
},
2025-03-23 09:29:40 +08:00
data() {
return {
goodsList: [],
specialImg: require('@/static/images/two2.jpg'),
2025-06-09 14:39:09 +08:00
registList: [],
upgradeList: [],
repurchaseList: [],
rescissionList: [],
regist: REGIEST_AREA,
upgrade: UPGRADE_AREA,
repurchase: REPURCHASE_AREA,
rescission: REISSUE_AREA,
2025-03-23 09:29:40 +08:00
}
},
onLoad() {
this.getGoodsInfo()
},
2025-06-09 14:39:09 +08:00
2025-03-23 09:29:40 +08:00
methods: {
getGoodsInfo() {
2025-06-09 14:39:09 +08:00
const params = {
pageNum: 1,
pageSize: 3,
}
const queryArea = [
REGIEST_AREA.id,
UPGRADE_AREA.id,
REPURCHASE_AREA.id,
REISSUE_AREA.id,
]
if (this.user.memberSign === 1) {
queryArea.shift()
}
const queryList = queryArea.map(areaId => {
return getAreaGoods({
pageNum: 1,
pageSize: 3,
specialArea: areaId,
2025-03-23 09:29:40 +08:00
})
})
},
},
}
</script>
<style lang="scss" scoped>
.content {
background: #f2f2f2;
// padding: 0 20rpx;
min-height: 94vh;
}
.goods-sort {
padding-bottom: 130rpx;
.goods-flexs {
padding: 30rpx 20rpx 20rpx;
2025-03-23 09:29:40 +08:00
position: relative;
}
}
</style>