| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <view class="goods-sort"> | 
					
						
							|  |  |  |     <!-- 注册 --> | 
					
						
							| 
									
										
										
										
											2025-06-10 16:33:12 +08:00
										 |  |  |     <view | 
					
						
							|  |  |  |       key="regist" | 
					
						
							|  |  |  |       v-if="registList.length > 0 && !isZeroLevel" | 
					
						
							|  |  |  |       class="goods-flexs" | 
					
						
							|  |  |  |     > | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |       <view class="goods-view"> | 
					
						
							|  |  |  |         <area-product-list | 
					
						
							|  |  |  |           :list="registList" | 
					
						
							|  |  |  |           :title="regist.name" | 
					
						
							| 
									
										
										
										
											2025-06-10 09:21:43 +08:00
										 |  |  |           @product-click="redirectList" | 
					
						
							| 
									
										
										
										
											2025-06-11 15:21:36 +08:00
										 |  |  |           :specialAreaId="regist.id" | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |         ></area-product-list> | 
					
						
							|  |  |  |       </view> | 
					
						
							|  |  |  |     </view> | 
					
						
							|  |  |  |     <!-- 升级 --> | 
					
						
							| 
									
										
										
										
											2025-06-10 16:33:12 +08:00
										 |  |  |     <view key="upgrade" v-if="upgradeList.length > 0" class="goods-flexs"> | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |       <view class="goods-view"> | 
					
						
							|  |  |  |         <area-product-list | 
					
						
							|  |  |  |           :list="upgradeList" | 
					
						
							|  |  |  |           :title="upgrade.name" | 
					
						
							| 
									
										
										
										
											2025-06-10 09:21:43 +08:00
										 |  |  |           @product-click="redirectList" | 
					
						
							| 
									
										
										
										
											2025-06-11 15:21:36 +08:00
										 |  |  |           :specialAreaId="upgrade.id" | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |         ></area-product-list> | 
					
						
							|  |  |  |       </view> | 
					
						
							|  |  |  |     </view> | 
					
						
							|  |  |  |     <!-- 复购 --> | 
					
						
							| 
									
										
										
										
											2025-06-10 16:33:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-12 11:13:41 +08:00
										 |  |  |     <view | 
					
						
							|  |  |  |       key="repurchase" | 
					
						
							|  |  |  |       v-if="repurchaseList.length > 0 && !isZeroLevel" | 
					
						
							|  |  |  |       class="goods-flexs" | 
					
						
							|  |  |  |     > | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |       <view class="goods-view"> | 
					
						
							|  |  |  |         <area-product-list | 
					
						
							|  |  |  |           :list="repurchaseList" | 
					
						
							|  |  |  |           :title="repurchase.name" | 
					
						
							| 
									
										
										
										
											2025-06-10 09:21:43 +08:00
										 |  |  |           @product-click="redirectList" | 
					
						
							| 
									
										
										
										
											2025-06-11 15:21:36 +08:00
										 |  |  |           :specialAreaId="repurchase.id" | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |         ></area-product-list> | 
					
						
							|  |  |  |       </view> | 
					
						
							|  |  |  |     </view> | 
					
						
							|  |  |  |     <!-- 重消 --> | 
					
						
							| 
									
										
										
										
											2025-06-10 16:33:12 +08:00
										 |  |  |     <view | 
					
						
							|  |  |  |       key="rescission" | 
					
						
							|  |  |  |       v-if="!isZeroLevel && rescissionList.length > 0" | 
					
						
							|  |  |  |       class="goods-flexs" | 
					
						
							|  |  |  |     > | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |       <view class="goods-view"> | 
					
						
							|  |  |  |         <area-product-list | 
					
						
							|  |  |  |           :list="rescissionList" | 
					
						
							|  |  |  |           :title="rescission.name" | 
					
						
							| 
									
										
										
										
											2025-06-10 09:21:43 +08:00
										 |  |  |           @product-click="redirectList" | 
					
						
							| 
									
										
										
										
											2025-06-11 15:21:36 +08:00
										 |  |  |           :specialAreaId="rescission.id" | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |         ></area-product-list> | 
					
						
							|  |  |  |       </view> | 
					
						
							|  |  |  |     </view> | 
					
						
							|  |  |  |   </view> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script> | 
					
						
							|  |  |  | import { | 
					
						
							|  |  |  |   REGIEST_AREA, | 
					
						
							|  |  |  |   UPGRADE_AREA, | 
					
						
							|  |  |  |   REPURCHASE_AREA, | 
					
						
							|  |  |  |   REISSUE_AREA, | 
					
						
							|  |  |  | } from '@/util/specialAreaMap' | 
					
						
							|  |  |  | import { MEMBER_SIGN } from '@/util/common' | 
					
						
							|  |  |  | import areaProductList from '@/components/area-product-list/index.vue' | 
					
						
							|  |  |  | import { getAreaGoods } from '@/config/special-area' | 
					
						
							|  |  |  | import { mapGetters } from 'vuex' | 
					
						
							|  |  |  | export default { | 
					
						
							|  |  |  |   name: 'SpecialAreaWrapper', | 
					
						
							| 
									
										
										
										
											2025-06-10 17:03:15 +08:00
										 |  |  |   props: { | 
					
						
							|  |  |  |     size: { | 
					
						
							|  |  |  |       type: String, | 
					
						
							|  |  |  |       default: 'normal', // 'normal' or 'small'
 | 
					
						
							|  |  |  |       validator: value => ['normal', 'small'].includes(value), | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-07-12 11:13:41 +08:00
										 |  |  |     userInfo: { | 
					
						
							|  |  |  |       type: Object, | 
					
						
							|  |  |  |       default: () => {}, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-10 17:03:15 +08:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |   components: { | 
					
						
							|  |  |  |     'area-product-list': areaProductList, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   data() { | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       registList: [], | 
					
						
							|  |  |  |       upgradeList: [], | 
					
						
							|  |  |  |       repurchaseList: [], | 
					
						
							|  |  |  |       rescissionList: [], | 
					
						
							|  |  |  |       regist: REGIEST_AREA, | 
					
						
							|  |  |  |       upgrade: UPGRADE_AREA, | 
					
						
							|  |  |  |       repurchase: REPURCHASE_AREA, | 
					
						
							|  |  |  |       rescission: REISSUE_AREA, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   computed: { | 
					
						
							|  |  |  |     ...mapGetters(['isZeroLevel']), | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   created() { | 
					
						
							| 
									
										
										
										
											2025-08-22 15:51:27 +08:00
										 |  |  |     const userInfo = Object.keys(this.userInfo).length | 
					
						
							|  |  |  |       ? this.userInfo | 
					
						
							|  |  |  |       : uni.getStorageSync('userInfo') | 
					
						
							| 
									
										
										
										
											2025-07-12 11:13:41 +08:00
										 |  |  |     if (userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL) { | 
					
						
							|  |  |  |       this.upgrade.name = '会员专区' | 
					
						
							| 
									
										
										
										
											2025-08-22 15:51:27 +08:00
										 |  |  |     } else { | 
					
						
							|  |  |  |       this.getAreaListById(REISSUE_AREA.id, this.rescissionList) | 
					
						
							|  |  |  |       this.getAreaListById(REGIEST_AREA.id, this.registList) | 
					
						
							|  |  |  |       this.getAreaListById(REPURCHASE_AREA.id, this.repurchaseList) | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-06-10 16:33:12 +08:00
										 |  |  |     this.getAreaListById(UPGRADE_AREA.id, this.upgradeList) | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |   }, | 
					
						
							|  |  |  |   methods: { | 
					
						
							|  |  |  |     getAreaListById(areaId, list) { | 
					
						
							|  |  |  |       const params = { | 
					
						
							|  |  |  |         pageNum: 1, | 
					
						
							|  |  |  |         pageSize: 3, | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       getAreaGoods({ | 
					
						
							|  |  |  |         pageNum: 1, | 
					
						
							|  |  |  |         pageSize: 3, | 
					
						
							|  |  |  |         specialArea: areaId, | 
					
						
							|  |  |  |       }).then(res => { | 
					
						
							|  |  |  |         if (res.code == 200) { | 
					
						
							|  |  |  |           list.splice(0, list.length, ...(res.data || []).slice(0, 3)) | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-10 09:21:43 +08:00
										 |  |  |     redirectList(item) { | 
					
						
							|  |  |  |       uni.navigateTo({ | 
					
						
							|  |  |  |         url: `/pages/specialArea/list?specialArea=${item.specialArea}&id=${item.pkId}`, | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-09 17:22:32 +08:00
										 |  |  |   }, | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style lang="scss" scoped> | 
					
						
							|  |  |  | .goods-sort { | 
					
						
							|  |  |  |   padding-top: 20rpx; | 
					
						
							|  |  |  |   .goods-flexs { | 
					
						
							|  |  |  |     padding: 0 20rpx; | 
					
						
							|  |  |  |     position: relative; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | </style> |