Browse Source

feat: 新增回收去向和客服问题页面及相关功能

- 在pages.json中添加mine子包,包含recyclingDestination和questionDetail页面
- 修改questionDetail页面标题和API调用
- 更新回收规则显示组件为uv-parse
- 优化首页和回收页的banner显示逻辑和高度
- 为回收去向和客服问题添加点击跳转功能
- 添加用户黑名单检查逻辑
- 统一描述字段为description
master
前端-胡立永 1 month ago
parent
commit
d1fd6baf6d
7 changed files with 91 additions and 23 deletions
  1. +17
    -0
      pages.json
  2. +18
    -8
      pages/component/home.vue
  3. +3
    -3
      pages/component/my.vue
  4. +1
    -1
      pages/component/recycle copy.vue
  5. +45
    -7
      pages/component/recycle.vue
  6. +2
    -2
      pages/mine/questionDetail.vue
  7. +5
    -2
      pages/subcomponent/admin_faq.vue

+ 17
- 0
pages.json View File

@ -31,6 +31,23 @@
} }
], ],
"subPackages": [ "subPackages": [
{
"root": "pages/mine",
"pages": [
{
"path": "recyclingDestination",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "questionDetail",
"style": {
"navigationStyle": "custom"
}
}
]
},
{ {
"root": "pages/subcomponent", "root": "pages/subcomponent",
"pages": [ "pages": [


+ 18
- 8
pages/component/home.vue View File

@ -8,7 +8,7 @@
:interval="3000" :interval="3000"
:duration="500" :duration="500"
circular circular
style="width: 100%; height: 380rpx;"
style="width: 100%; height: 320rpx;"
> >
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index"> <swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<video <video
@ -137,11 +137,14 @@
<text class="title">回收去向</text> <text class="title">回收去向</text>
</view> </view>
<view class="destination-grid"> <view class="destination-grid">
<view class="destination-item " :class="`destination-item${index + 1}`" v-for="(item, index) in destinations" :key="index">
<view class="destination-item "
@click="$utils.navigateTo('/pages/mine/recyclingDestination?id=' + item.id)"
:class="`destination-item${index + 1}`"
v-for="(item, index) in destinations" :key="index">
<image :src="item.icon" mode="aspectFit" class="dest-icon"></image> <image :src="item.icon" mode="aspectFit" class="dest-icon"></image>
<view class="dest-info"> <view class="dest-info">
<text class="dest-title">{{item.title}}</text> <text class="dest-title">{{item.title}}</text>
<text class="dest-desc">{{item.desc}}</text>
<text class="dest-desc">{{item.description}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -197,22 +200,22 @@ export default {
{ {
icon: '/static/home/爱心援乡.png', icon: '/static/home/爱心援乡.png',
title: '爱心援乡', title: '爱心援乡',
desc: '精准帮扶贫困群体'
description: '精准帮扶贫困群体'
}, },
{ {
icon: '/static/home/回塑新源.png', icon: '/static/home/回塑新源.png',
title: '回塑新源', title: '回塑新源',
desc: '塑料的第二次成型'
description: '塑料的第二次成型'
}, },
{ {
icon: '/static/home/织物出海.png', icon: '/static/home/织物出海.png',
title: '织物出海', title: '织物出海',
desc: '分拣出最高价值'
description: '分拣出最高价值'
}, },
{ {
icon: '/static/home/碳循再生.png', icon: '/static/home/碳循再生.png',
title: '碳循再生', title: '碳循再生',
desc: '减碳从出发生系统'
description: '减碳从出发生系统'
} }
], ],
bannerList: [], bannerList: [],
@ -336,6 +339,12 @@ export default {
} }
}) })
}, },
getRecyclingDestination() {
this.$api('getRecyclingDestination')
.then(res => {
this.destinations = res.result
})
},
goToInspectionReport(item) { goToInspectionReport(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subcomponent/inspection-report?id=${item.id}` url: `/pages/subcomponent/inspection-report?id=${item.id}`
@ -415,6 +424,7 @@ export default {
// //
uni.$on('configDataUpdated', this.updateCionData); uni.$on('configDataUpdated', this.updateCionData);
this.getPricePreview(); this.getPricePreview();
this.getRecyclingDestination()
}, },
} }
</script> </script>
@ -435,7 +445,7 @@ export default {
.banner { .banner {
width: 100%; width: 100%;
height: 390rpx;
height: 330rpx;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border-radius: 0 0 30rpx 30rpx; border-radius: 0 0 30rpx 30rpx;


+ 3
- 3
pages/component/my.vue View File

@ -393,8 +393,8 @@ export default {
return getApp().globalData.bannerList || [] return getApp().globalData.bannerList || []
}, },
myBannerImage() { myBannerImage() {
const banner = (getApp().globalData.bannerList || []).find(item => item.title === '我的-轮播图');
return banner ? banner.image : '';
const item = getApp().globalData.configData.find(i => i.keyName === 'user_banner')
return item ? item.keyContent : ''
}, },
userTypeText() { userTypeText() {
// 0 , 1 广, 2 广使 // 0 , 1 广, 2 广使
@ -452,7 +452,7 @@ export default {
} }
.banner { .banner {
height: 400rpx;
height: 320rpx;
background: #ff6b35; background: #ff6b35;
position: relative; position: relative;
overflow: hidden; overflow: hidden;


+ 1
- 1
pages/component/recycle copy.vue View File

@ -249,7 +249,7 @@
<view class="rule-popup"> <view class="rule-popup">
<view class="rule-popup-title">回收规则</view> <view class="rule-popup-title">回收规则</view>
<scroll-view class="rule-popup-content" scroll-y> <scroll-view class="rule-popup-content" scroll-y>
<rich-text :nodes="ruleHtml" />
<uv-parse :nodes="ruleHtml" />
</scroll-view> </scroll-view>
<button class="rule-popup-btn" @click="closeRulePopup">我知道了</button> <button class="rule-popup-btn" @click="closeRulePopup">我知道了</button>
<!-- <view class="rule-popup-close" @tap="closeRulePopup"> <!-- <view class="rule-popup-close" @tap="closeRulePopup">


+ 45
- 7
pages/component/recycle.vue View File

@ -2,15 +2,15 @@
<view class="container"> <view class="container">
<!-- 顶部banner --> <!-- 顶部banner -->
<view class="banner"> <view class="banner">
<swiper
<!-- <swiper
:indicator-dots="false" :indicator-dots="false"
:autoplay="true" :autoplay="true"
:interval="3000" :interval="3000"
:duration="500" :duration="500"
circular 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 <video
v-if="item.type == 1" v-if="item.type == 1"
:src="item.voUrl" :src="item.voUrl"
@ -25,8 +25,11 @@
></video> ></video>
<image v-else :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" /> <image v-else :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
</swiper-item> </swiper-item>
</swiper>
</swiper> -->
<image v-if="recycle_banner" :src="recycle_banner" mode="aspectFill" style="width: 100%; height: 100%;" />
</view> </view>
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="goods-list"> <view class="goods-list">
@ -250,7 +253,7 @@
<view class="rule-popup"> <view class="rule-popup">
<view class="rule-popup-title">回收规则</view> <view class="rule-popup-title">回收规则</view>
<scroll-view class="rule-popup-content" scroll-y> <scroll-view class="rule-popup-content" scroll-y>
<rich-text :nodes="ruleHtml" />
<uv-parse :content="ruleHtml"></uv-parse>
</scroll-view> </scroll-view>
<button class="rule-popup-btn" @click="closeRulePopup">我知道了</button> <button class="rule-popup-btn" @click="closeRulePopup">我知道了</button>
<!-- <view class="rule-popup-close" @tap="closeRulePopup"> <!-- <view class="rule-popup-close" @tap="closeRulePopup">
@ -352,9 +355,15 @@ export default {
reduceBrandList: [], // reduceBrandList: [], //
viewedRuleItems: new Set(), // ID viewedRuleItems: new Set(), // ID
loadOptions: null, // options loadOptions: null, // options
userInfo: null, //
isUserBlacklisted: false, //
} }
}, },
computed: { computed: {
recycle_banner() {
const item = getApp().globalData.configData.find(i => i.keyName === 'recycle_banner')
return item ? item.keyContent : ''
},
// //
recycleList() { recycleList() {
const currentCategoryId = this.categories[this.currentCategory]?.id const currentCategoryId = this.categories[this.currentCategory]?.id
@ -625,6 +634,17 @@ export default {
}) })
}, },
submitOrder() { submitOrder() {
//
if (this.isUserBlacklisted) {
uni.showModal({
title: '提示',
content: '您的账户已被限制使用回收服务,如有疑问请联系客服。',
showCancel: false,
confirmText: '我知道了'
})
return
}
if (this.totalCount < 3) { if (this.totalCount < 3) {
uni.showToast({ uni.showToast({
title: '各品类混合需要满3件才能回收哦', title: '各品类混合需要满3件才能回收哦',
@ -740,6 +760,21 @@ export default {
toggleDetailPanel() { toggleDetailPanel() {
this.showDetailPanel = !this.showDetailPanel 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) { updateQuantityByProduct(item, delta) {
// //
if (item.brandId) { if (item.brandId) {
@ -984,6 +1019,9 @@ export default {
uni.$off('clearRecycleOrderData') uni.$off('clearRecycleOrderData')
}, },
onShow() { onShow() {
//
this.fetchUserInfo()
const id = getApp().globalData.targetRecycleCategoryId const id = getApp().globalData.targetRecycleCategoryId
if (id) { if (id) {
const trySwitch = () => { const trySwitch = () => {
@ -1083,7 +1121,7 @@ export default {
// flex: 1; // flex: 1;
display: flex; display: flex;
position: relative; 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; margin-top: -10rpx;
z-index: 2; z-index: 2;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;


+ 2
- 2
pages/mine/questionDetail.vue View File

@ -25,12 +25,12 @@
return { return {
id : 0, id : 0,
detail : {}, detail : {},
title : '回收去向',
title : '客服问题',
} }
}, },
methods: { methods: {
getDetail(){ getDetail(){
this.$api('getRecyclingDestinationDetail', {
this.$api('getQuestionListDetail', {
id : this.id id : this.id
}).then(res => { }).then(res => {
this.detail = res.result this.detail = res.result


+ 5
- 2
pages/subcomponent/admin_faq.vue View File

@ -10,7 +10,9 @@
<view class="main-content"> <view class="main-content">
<view class="content-card"> <view class="content-card">
<view class="qa-list"> <view class="qa-list">
<view class="qa-item" v-for="(item, idx) in faqList" :key="idx">
<view class="qa-item"
@click="$utils.navigateTo('/pages/mine/questionDetail?id=' + item.id)"
v-for="(item, idx) in faqList" :key="idx">
<view class="question-row"> <view class="question-row">
<text class="q-icon">Q</text> <text class="q-icon">Q</text>
<text class="question">{{item.q}}</text> <text class="question">{{item.q}}</text>
@ -111,7 +113,8 @@ export default {
if (res && res.success && res.result && res.result.records) { if (res && res.success && res.result && res.result.records) {
this.faqList = res.result.records.map(item => ({ this.faqList = res.result.records.map(item => ({
q: item.title, q: item.title,
a: item.titleText
a: item.titleText,
id : item.id
})) }))
} }
}) })


Loading…
Cancel
Save