|
|
@ -2,15 +2,15 @@ |
|
|
|
<view class="container"> |
|
|
|
<!-- 顶部banner --> |
|
|
|
<view class="banner"> |
|
|
|
<swiper |
|
|
|
<!-- <swiper |
|
|
|
:indicator-dots="false" |
|
|
|
:autoplay="true" |
|
|
|
:interval="3000" |
|
|
|
:duration="500" |
|
|
|
circular |
|
|
|
style="width: 100%; height: 400rpx;" |
|
|
|
> |
|
|
|
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index"> |
|
|
|
style="width: 100%; height: 320rpx;" |
|
|
|
> --> |
|
|
|
<!-- <swiper-item v-for="(item, index) in bannerList" :key="item.id || index"> |
|
|
|
<video |
|
|
|
v-if="item.type == 1" |
|
|
|
:src="item.voUrl" |
|
|
@ -25,8 +25,11 @@ |
|
|
|
></video> |
|
|
|
<image v-else :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" /> |
|
|
|
</swiper-item> |
|
|
|
</swiper> |
|
|
|
</swiper> --> |
|
|
|
|
|
|
|
<image v-if="recycle_banner" :src="recycle_banner" mode="aspectFill" style="width: 100%; height: 100%;" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 商品列表 --> |
|
|
|
<view class="goods-list"> |
|
|
@ -250,7 +253,7 @@ |
|
|
|
<view class="rule-popup"> |
|
|
|
<view class="rule-popup-title">回收规则</view> |
|
|
|
<scroll-view class="rule-popup-content" scroll-y> |
|
|
|
<rich-text :nodes="ruleHtml" /> |
|
|
|
<uv-parse :content="ruleHtml"></uv-parse> |
|
|
|
</scroll-view> |
|
|
|
<button class="rule-popup-btn" @click="closeRulePopup">我知道了</button> |
|
|
|
<!-- <view class="rule-popup-close" @tap="closeRulePopup"> |
|
|
@ -352,9 +355,15 @@ export default { |
|
|
|
reduceBrandList: [], // 可减少的品牌列表 |
|
|
|
viewedRuleItems: new Set(), // 已查看过规则的商品ID集合 |
|
|
|
loadOptions: null, // 保存options参数 |
|
|
|
userInfo: null, // 用户信息 |
|
|
|
isUserBlacklisted: false, // 用户是否被拉黑 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
recycle_banner() { |
|
|
|
const item = getApp().globalData.configData.find(i => i.keyName === 'recycle_banner') |
|
|
|
return item ? item.keyContent : '' |
|
|
|
}, |
|
|
|
// 当前分类的商品列表 |
|
|
|
recycleList() { |
|
|
|
const currentCategoryId = this.categories[this.currentCategory]?.id |
|
|
@ -625,6 +634,17 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitOrder() { |
|
|
|
// 检查用户是否被拉入黑名单 |
|
|
|
if (this.isUserBlacklisted) { |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '您的账户已被限制使用回收服务,如有疑问请联系客服。', |
|
|
|
showCancel: false, |
|
|
|
confirmText: '我知道了' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.totalCount < 3) { |
|
|
|
uni.showToast({ |
|
|
|
title: '各品类混合需要满3件才能回收哦', |
|
|
@ -740,6 +760,21 @@ export default { |
|
|
|
toggleDetailPanel() { |
|
|
|
this.showDetailPanel = !this.showDetailPanel |
|
|
|
}, |
|
|
|
fetchUserInfo() { |
|
|
|
if(uni.getStorageSync('token')){ |
|
|
|
this.login_status = getApp().globalData.login_status; |
|
|
|
this.$api("getUserByToken",{},(res)=>{ |
|
|
|
if(res.code == 200){ |
|
|
|
this.userInfo = res.result |
|
|
|
// 检查用户是否被拉入黑名单 |
|
|
|
this.isUserBlacklisted = res.result.isBlack === 'Y' |
|
|
|
// isTuiType 为0用户,1推广达人,2推广大使 |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.login_status = false; |
|
|
|
} |
|
|
|
}, |
|
|
|
updateQuantityByProduct(item, delta) { |
|
|
|
// 在明细弹窗中更新数量 |
|
|
|
if (item.brandId) { |
|
|
@ -984,6 +1019,9 @@ export default { |
|
|
|
uni.$off('clearRecycleOrderData') |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
// 获取用户信息,检查黑名单状态 |
|
|
|
this.fetchUserInfo() |
|
|
|
|
|
|
|
const id = getApp().globalData.targetRecycleCategoryId |
|
|
|
if (id) { |
|
|
|
const trySwitch = () => { |
|
|
@ -1083,7 +1121,7 @@ export default { |
|
|
|
// flex: 1; |
|
|
|
display: flex; |
|
|
|
position: relative; |
|
|
|
height: calc(100vh - 400rpx - 120rpx - env(safe-area-inset-bottom)); /* 减去banner和底部栏的高度 */ |
|
|
|
height: calc(100vh - 320rpx - 120rpx - env(safe-area-inset-bottom)); /* 减去banner和底部栏的高度 */ |
|
|
|
margin-top: -10rpx; |
|
|
|
z-index: 2; |
|
|
|
border-radius: 20rpx 20rpx 0 0; |
|
|
|