From 9cf9055d0e9c94b176eb3c6a3dfda7e05ea61dff Mon Sep 17 00:00:00 2001
From: Lj <1095098147@qq.com>
Date: Wed, 4 Jun 2025 04:02:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2=E5=92=8C?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 29 ++-
api/model/index.js | 37 +--
pages.json | 7 +
pages/component/home.vue | 191 ++++++++------
pages/component/my.vue | 68 +++--
pages/component/recycle.vue | 403 +++++++++++++++++++++++-------
pages/index/index.vue | 33 ++-
pages/subcomponent/admin_customer.vue | 2 +-
pages/subcomponent/admin_edit_profile.vue | 2 +-
pages/subcomponent/admin_faq.vue | 2 +-
pages/subcomponent/apply.vue | 2 +-
pages/subcomponent/brand.vue | 2 +-
pages/subcomponent/detail.vue | 2 +-
pages/subcomponent/edit_profile.vue | 64 +++--
pages/subcomponent/faq.vue | 2 +-
pages/subcomponent/inspection-detail.vue | 390 +++++++++++++++++++++++++++++
pages/subcomponent/inspection-report.vue | 171 ++++++++++---
pages/subcomponent/inspection.vue | 2 +-
pages/subcomponent/order.vue | 28 ++-
pages/subcomponent/order_edit.vue | 2 +-
pages/subcomponent/orders.vue | 2 +-
pages/subcomponent/pickup.vue | 71 ++----
pages/subcomponent/promo-qrcode.vue | 2 +-
pages/subcomponent/promotion.vue | 2 +-
pages/subcomponent/promotion_info.vue | 2 +-
pages/subcomponent/recycle_rules.vue | 2 +-
pages/subcomponent/select.vue | 94 ++++---
pages/subcomponent/upgrad.vue | 2 +-
pages/subcomponent/wallet.vue | 2 +-
pages/subcomponent/withdraw.vue | 2 +-
pages/wxUserInfo.vue | 11 +-
utils/router-interception.js | 2 +
32 files changed, 1269 insertions(+), 364 deletions(-)
create mode 100644 pages/subcomponent/inspection-detail.vue
diff --git a/App.vue b/App.vue
index ea700e1..9b0e1a3 100644
--- a/App.vue
+++ b/App.vue
@@ -4,18 +4,43 @@
globalData: {
flag: 1,
login_status:true,
- phone:null
+ phone:null,
+ bannerList: [],
+ pricePreviewList: []
},
onLaunch: function() {
routerInterception()
+ this.getBannerList()
+ this.getPricePreviewList()
// console.log(this.$utils)
console.log('App Launch')
},
- onShow: function() {
+ onLoad: function() {
+ this.getBannerList()
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
+ },
+ methods: {
+ getBannerList() {
+ // 假设 this.$api 可用
+ this.$api && this.$api('getBanner', {}, res => {
+ if (res && res.code === 200 && Array.isArray(res.result)) {
+ getApp().globalData.bannerList = res.result
+ console.log(getApp().globalData.bannerList,'bannerList')
+ uni.$emit('bannerListUpdated')
+ }
+ })
+ },
+ getPricePreviewList() {
+ this.$api && this.$api('getPricePreviewClassList', {}, res => {
+ if (res && res.success && Array.isArray(res.result)) {
+ getApp().globalData.pricePreviewList = res.result
+ uni.$emit('pricePreviewListUpdated')
+ }
+ })
+ }
}
}
diff --git a/api/model/index.js b/api/model/index.js
index e08f203..b6934e3 100644
--- a/api/model/index.js
+++ b/api/model/index.js
@@ -2,9 +2,10 @@
const api = {
// 获取首页轮播图
- getRiceBanner: {
+ getBanner: {
url: '/recycle-admin/applet/index/getBanner',
method: 'GET',
+ auth : false,
},
getRiceIconList: {
@@ -152,20 +153,23 @@ const api = {
url: '/index_common/getCommonUser',
method: 'GET'
},
- //提交反馈信息
- addFeedback: {
- url: '/info_common/addFeedback',
- method: 'POST'
+ //查看最近回收质检报告
+ getQualityReport: {
+ url: '/recycle-admin/applet/index/getQualityReport',
+ method: 'GET',
+ auth : false
},
- // 获取我的直接推荐间接推荐用户列表带分页
- getHanHaiMemberUser: {
- url: '/info_common/getHanHaiMemberUser',
- method: 'GET'
+ // 回收规则
+ getGoodsRecycleRule: {
+ url: '/recycle-admin/applet/class/getGoodsRecycleRule',
+ method: 'GET',
+ auth : false
},
- // 获取祝福背景图
- getRiceBlessing: {
- url: '/index_common/getRiceBlessing',
- method: 'GET'
+ // 获取用户订单列表
+ getOrderListPage: {
+ url: '/recycle-admin/applet/order/getOrderListPage',
+ method: 'GET',
+ auth : true
},
// 查询最近回收商品
getRecentGoodsList: {
@@ -178,21 +182,18 @@ const api = {
url: '/recycle-admin/applet/index/getQualityReport',
method: 'GET',
auth : false,
- limit : 1000,
},
// 1.根据id获取对应商品列表
getGoodsBrandList: {
url: '/recycle-admin/applet/class/getGoodsBrandList',
method: 'GET',
- auth : false,
- limit : 1000,
+ auth : false
},
// 2.根据分类标识获取分类商品列表带分页
getClassGoodsList: {
url: '/recycle-admin/applet/class/getClassGoodsList',
method: 'GET',
- auth : false,
- limit : 1000,
+ auth : false
},
// 获取我的礼品订单
getPricePreviewClassList: {
diff --git a/pages.json b/pages.json
index 29f787e..44b9b8b 100644
--- a/pages.json
+++ b/pages.json
@@ -208,6 +208,13 @@
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
+ },
+ {
+ "path": "inspection-detail",
+ "style": {
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true
+ }
}
]
},
diff --git a/pages/component/home.vue b/pages/component/home.vue
index a49a632..11265fe 100644
--- a/pages/component/home.vue
+++ b/pages/component/home.vue
@@ -2,7 +2,18 @@
-
+
+
+
+
+
@@ -76,7 +87,7 @@
-
+
{{item.name}}
@@ -99,11 +110,11 @@
:key="index"
@tap="goToInspectionReport(item)"
>
-
- {{item.location}}
- ****{{item.userId}}
+
+ {{item.name}}
+ ****{{item.phone ? item.phone.slice(-4) : ''}}
成功完成衣物回收已到账
- + ¥{{item.amount}}
+ + ¥{{item.price}}
@@ -183,11 +194,7 @@ export default {
{ icon: '/static/home/羽绒裤.png', name: '羽绒裤', price: '3-10', unit: '件' },
{ icon: '/static/home/儿童羽绒服.png', name: '儿童羽绒服', price: '3-10', unit: '件' }
],
- records: Array(6).fill().map(() => ({
- location: '天津市',
- amount: '50',
- userId: '5513'
- })),
+ records: [],
destinations: [
{
icon: '/static/home/爱心援乡.png',
@@ -209,7 +216,9 @@ export default {
title: '碳循再生',
desc: '减碳从出发生系统'
}
- ]
+ ],
+ bannerList: [],
+ pricePreviewList: []
}
},
methods: {
@@ -237,8 +246,8 @@ export default {
})
},
getPickupto(){
- uni.navigateTo({
- url: '/pages/subcomponent/pickup'
+ uni.switchTab({
+ url: '/pages/component/recycle'
})
},
async onRefresh() {
@@ -251,6 +260,7 @@ export default {
// 按sort升序排序
const sorted = res.result.slice().sort((a, b) => a.sort - b.sort)
this.processes = sorted.map(item => ({
+ // id: item.id,
icon: item.image,
text: item.title
}))
@@ -262,49 +272,49 @@ export default {
url: '/pages/subcomponent/admin_faq'
})
},
+ goToRecycleCategory(id) {
+ getApp().globalData.targetRecycleCategoryId = id
+ console.log(getApp().globalData.targetRecycleCategoryId,'getApp().globalData.targetRecycleCategoryId')
+ uni.switchTab({
+ url: '/pages/component/recycle'
+ })
+ },
getPricePreview() {
- this.$api('getPricePreviewClassList', {}, res => {
- if (res && res.success && Array.isArray(res.result)) {
- console.log(res,'getPricePreview');
- // 只取一级分类,按sort升序
- const firstLevel = res.result.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
- this.priceList = firstLevel.map(item => {
- // 从静态表中找图片和价格
- const staticItem = this.priceListStatic.find(s => s.name.replace(/\s/g, '') === item.title.replace(/\s/g, ''))
- console.log({
- icon: staticItem ? staticItem.icon : '',
- name: item.title,
- price: staticItem ? staticItem.price : '',
- unit: '件'
- });
- return {
- icon: staticItem ? staticItem.icon : '',
- name: item.title,
- price: staticItem ? staticItem.price : '',
- unit: '件'
- }
- })
- }
- })
+ const resList = this.pricePreviewList || []
+ if (Array.isArray(resList)) {
+ // 只取一级分类,按sort升序
+ const firstLevel = resList.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
+ this.priceList = firstLevel.map(item => {
+ // 从静态表中找图片和价格
+ const staticItem = this.priceListStatic.find(s => s.name.replace(/\s/g, '') === item.title.replace(/\s/g, ''))
+ return {
+ id: item.id, // 保证有id
+ icon: staticItem ? staticItem.icon : '',
+ name: item.title,
+ price: staticItem ? staticItem.price : '',
+ unit: '件'
+ }
+ })
+ }
},
getRecentGoods() {
this.$api('getRecentGoodsList', {}, res => {
- if (res && res.success && Array.isArray(res.result) && res.result.length > 0) {
- // 假设接口字段与records一致
- this.records = res.result
- } else {
- // 无数据时用模拟数据兜底
- this.records = Array(6).fill().map(() => ({
- location: '天津市',
- amount: '50',
- userId: '5513'
+ if (res && res.code === 200 && Array.isArray(res.result) && res.result.length > 0) {
+ this.records = res.result.map(item => ({
+ id: item.id,
+ image: item.image,
+ name: item.name,
+ phone: item.phone,
+ price: item.price
}))
+ } else {
+ this.records = []
}
})
},
goToInspectionReport(item) {
uni.navigateTo({
- url: '/pages/subcomponent/inspection-report'
+ url: `/pages/subcomponent/inspection-report?id=${item.id}`
})
}
},
@@ -312,9 +322,24 @@ export default {
this.getAreaList();
this.getPricePreview();
this.getRecentGoods();
- // console.log(this.processes,'222')
- }
-
+ this.pricePreviewList = getApp().globalData.pricePreviewList || []
+ this.bannerList = getApp().globalData.bannerList || []
+ uni.$on('pricePreviewListUpdated', () => {
+ this.pricePreviewList = getApp().globalData.pricePreviewList || []
+ this.getPricePreview()
+ })
+ uni.$on('bannerListUpdated', () => {
+ this.bannerList = getApp().globalData.bannerList || []
+ })
+ },
+ onUnload() {
+ uni.$off('pricePreviewListUpdated')
+ uni.$off('bannerListUpdated')
+ },
+ onShow() {
+ // 移除自动下拉刷新
+ // uni.startPullDownRefresh()
+ }
}
@@ -439,6 +464,7 @@ export default {
grid-template-columns: repeat(4, 1fr);
gap: 20rpx;
margin: 30rpx 0;
+ border: none;
}
@@ -469,14 +495,14 @@ export default {
color: #999;
}
}
-
+
.submit-btn {
background: linear-gradient(to right, #ffd01e, #ff8917);
border-radius: 70rpx;
- // padding: 20rpx;
+ padding: 20rpx;
text-align: center;
position: relative;
- // border: none;
+ border: none;
display: flex;
flex-direction: column;
overflow: visible;
@@ -484,7 +510,7 @@ export default {
color: #ffffff;
font-size: 32rpx;
font-weight: bold;
- line-height: 55rpx;
+ line-height: 40rpx;
// display: block;
}
@@ -514,6 +540,9 @@ export default {
// z-index: 4;
}
}
+ .submit-btn::after{
+ border: none !important;
+ }
}
.city-section {
@@ -616,42 +645,43 @@ export default {
align-items: center;
background: linear-gradient(to top, #e8ffe0 0%,#fffefb 100%);
border-radius: 16rpx;
- padding: 30rpx;
+ padding: 10rpx;
background-color: #fff8ea;
- image{
- width: 60rpx;
- height: 60rpx;
- }
+ image{
+ width: 60rpx;
+ height: 60rpx;
+ }
.location {
- font-size: 24rpx;
- color: #666;
+ font-size: 28rpx;
+ color: #333;
+ font-weight: bold;
}
.amount {
- font-size: 28rpx;
+ font-size: 30rpx;
color: #13ac47;
font-weight: bold;
- margin: 4rpx 0;
+ margin: 6rpx 0;
}
.user-id {
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 12rpx;
- line-height: 140%;
- letter-spacing: 0%;
- text-align: center;
- color: #183c5c;
+ font-family: PingFang SC;
+ font-weight: 500;
+ font-size: 24rpx;
+ line-height: 140%;
+ letter-spacing: 0%;
+ text-align: center;
+ color: #183c5c;
+ }
+ .user-id-f{
+ font-family: PingFang SC;
+ font-weight: 400;
+ font-size: 22rpx;
+ line-height: 140%;
+ letter-spacing: 0%;
+ text-align: center;
+ color: #9b9b9b;
}
- .user-id-f{
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 12rpx;
- line-height: 140%;
- letter-spacing: 0%;
- text-align: center;
- color: #9b9b9b;
- }
}
}
@@ -821,4 +851,7 @@ export default {
transform: scale(1);
}
}
+
+
+
\ No newline at end of file
diff --git a/pages/component/my.vue b/pages/component/my.vue
index 2281267..1d15e14 100644
--- a/pages/component/my.vue
+++ b/pages/component/my.vue
@@ -2,8 +2,18 @@
-
-
+
+
+
+
+
@@ -86,27 +96,26 @@
-
+
-
+
- 8 件
- ¥3-10 /件
+ {{order.num || 1}} 件
+ ¥{{order.onePrice || 0}} /件
- 预估 ¥76-80
+ 预估 ¥ {{order.price}}
@@ -230,7 +239,8 @@ export default {
{ name: '联系客服', icon: '/static/my/客服.png' },
{ name: '修改信息', icon: '/static/my/修改信息.png' },
{ name: '退出登录', icon: '/static/my/退出登录.png' }
- ]
+ ],
+ orderList: []
}
},
methods: {
@@ -270,6 +280,7 @@ export default {
},
switchTab(index) {
this.currentTab = index
+ this.fetchOrderList()
},
handleFunction(index) {
const pages = [
@@ -332,6 +343,20 @@ export default {
this.login_status = false;
}
},
+ fetchOrderList() {
+ let status = ''
+ if (this.currentTab === 1) status = 0 // 进行中
+ if (this.currentTab === 2) status = 3 // 已完成
+ const params = { pageSize: 1, current: 1 }
+ if (status !== '') params.status = status
+ this.$api && this.$api('getOrderListPage', params, res => {
+ if (res && res.code === 200 && res.result && Array.isArray(res.result.records)) {
+ this.orderList = res.result.records
+ } else {
+ this.orderList = []
+ }
+ })
+ },
},
computed: {
customStyle() {
@@ -339,15 +364,25 @@ export default {
// height: '80rpx',
width: '70%',
}
- }
+ },
+ bannerList() {
+ return getApp().globalData.bannerList || []
+ }
},
onLoad() {
- // 启用下拉刷新
- uni.startPullDownRefresh()
+ // 移除自动下拉刷新
+ // uni.startPullDownRefresh()
uni.$on('refreshUserInfo', () => {
this.fetchUserInfo()
})
this.fetchUserInfo()
+ this.fetchOrderList()
+ uni.$on('bannerListUpdated', () => {
+ this.$forceUpdate && this.$forceUpdate()
+ })
+ if (getApp().globalData.bannerList && getApp().globalData.bannerList.length > 0) {
+ this.$forceUpdate && this.$forceUpdate()
+ }
},
onShow() {
this.fetchUserInfo()
@@ -363,6 +398,9 @@ export default {
})
}, 1000)
},
+ onUnload() {
+ uni.$off('bannerListUpdated')
+ },
}
diff --git a/pages/component/recycle.vue b/pages/component/recycle.vue
index 6fccdf2..1bffb55 100644
--- a/pages/component/recycle.vue
+++ b/pages/component/recycle.vue
@@ -2,7 +2,18 @@
-
+
+
+
+
+
@@ -11,21 +22,21 @@
- {{ category.name }}
+ {{ category.title }}
-
+
-
+
-
+
查看品牌
@@ -69,6 +80,8 @@
+ 加载中...
+ 没有更多了
@@ -107,7 +120,7 @@