From 0263f0affdb3a1baee2172ca8dea73c509ca757d Mon Sep 17 00:00:00 2001 From: hly <2783385703@qq.com> Date: Wed, 27 Aug 2025 14:05:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E7=A7=BB=E9=99=A4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B7=AF=E5=BE=84=E4=B8=AD=E7=9A=84/recycle-admin?= =?UTF-8?q?=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(recycle): 添加品牌切换按钮和衣物添加浮窗 style(recycle): 优化商品展示样式和弹窗布局 fix(recycle): 修复品牌选择后自动打开明细弹窗的逻辑 chore(config): 更新环境配置和API基础路径 --- api/model/address.js | 12 ++-- api/model/index.js | 90 ++++++++++++++--------------- api/model/login.js | 10 ++-- api/model/recyclingDestination.js | 12 ++-- compoent/recycle/brand-selector.vue | 3 +- compoent/recycle/product-style-selector.vue | 42 ++++++++++++-- config.js | 13 +++-- pages/component/recycle.vue | 83 ++++++++++++++++++++------ pages/subcomponent/pickup.vue | 11 ++-- 9 files changed, 178 insertions(+), 98 deletions(-) diff --git a/api/model/address.js b/api/model/address.js index a3a1ef5..816ec90 100644 --- a/api/model/address.js +++ b/api/model/address.js @@ -5,20 +5,20 @@ const api = { // 获取地址列表 getAddressList: { - url: '/recycle-admin/applet/address/getAddressList', + url: '/applet/address/getAddressList', method: 'GET', limit : 500, showLoading : true, }, // 保存或修改地址 saveOrUpdateAddress: { - url: '/recycle-admin/applet/address/saveOrUpdateAddress', + url: '/applet/address/saveOrUpdateAddress', method: 'POST', auth: true, }, // 修改默认地址 updateDefaultAddress: { - url: '/recycle-admin/applet/address/updateDefaultAddress', + url: '/applet/address/updateDefaultAddress', method: 'POST', auth: true, limit : 500, @@ -26,19 +26,19 @@ const api = { }, // 获取地址详情 getAddressInfo: { - url: '/recycle-admin/applet/address/getAddressInfo', + url: '/applet/address/getAddressInfo', method: 'GET', auth: true, }, deleteAddress: { - url: '/recycle-admin/applet/address/deleteAddress', + url: '/applet/address/deleteAddress', method: 'POST', auth: true, }, getFreeCityList: { - url: '/recycle-admin/applet/index/getFreeCityList', + url: '/applet/index/getFreeCityList', method: 'GET', auth: true, }, diff --git a/api/model/index.js b/api/model/index.js index 68307c2..a7d1614 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -3,264 +3,264 @@ const api = { // 获取首页轮播图 getBanner: { - url: '/recycle-admin/applet/index/getBanner', + url: '/applet/index/getBanner', method: 'GET', auth : false, }, getHanHaiMemberUser: { - url: '/recycle-admin/applet/promotion/getHanHaiMemberUser', + url: '/applet/promotion/getHanHaiMemberUser', method: 'GET', auth: true, }, // 升级用户为推广官 upgrade: { - url: '/recycle-admin/applet/info_team/upgrade', + url: '/applet/info_team/upgrade', method: 'POST', auth: true, }, // 拉黑用户 blackUser: { - url: '/recycle-admin/applet/info_team/blackUser', + url: '/applet/info_team/blackUser', method: 'POST', auth: true, }, // 订单驳回 rejectOrder: { - url: '/recycle-admin/applet/info_team_order/rejectOrder', + url: '/applet/info_team_order/rejectOrder', method: 'POST', auth: true, }, // 订单通过 passOrder: { - url: '/recycle-admin/applet/info_team_order/passOrder', + url: '/applet/info_team_order/passOrder', method: 'POST', auth: true, }, // 解除员工 removeMember: { - url: '/recycle-admin/applet/member/removeMember', + url: '/applet/member/removeMember', method: 'POST', auth: true, }, // 查询员工列表 getMyTeamList: { - url: '/recycle-admin/applet/member/getMyTeamList', + url: '/applet/member/getMyTeamList', method: 'GET', auth: true, }, // 查询员工详情 getMemberInfo: { - url: '/recycle-admin/applet/member/getMemberInfo', + url: '/applet/member/getMemberInfo', method: 'GET', auth: true, }, // 拒绝推广官申请 rejectPromotionApply: { - url: '/recycle-admin/applet/promotion/rejectPromotionApply', + url: '/applet/promotion/rejectPromotionApply', method: 'POST', auth: true, }, // 同意推广官申请 passPromotionApply: { - url: '/recycle-admin/applet/promotion/passPromotionApply', + url: '/applet/promotion/passPromotionApply', method: 'POST', auth: true, }, // 获取推广表单申请列表带分页 getPromotionApplyListPage: { - url: '/recycle-admin/applet/promotion/getPromotionApplyListPage', + url: '/applet/promotion/getPromotionApplyListPage', method: 'GET', auth: true, }, // 获取推广员列表 getPromotionList: { - url: '/recycle-admin/applet/promotion/getPromotionList', + url: '/applet/promotion/getPromotionList', method: 'GET', auth: true, }, // 修改购物车信息数量 getUserOrderNum: { - url: '/recycle-admin/applet/info_team_order/getUserOrderNum', + url: '/applet/info_team_order/getUserOrderNum', method: 'GET', auth: true, }, // 获取管理员订单详情 getOrderDetail: { - url: '/recycle-admin/applet/info_team_order/getOrderDetail', + url: '/applet/info_team_order/getOrderDetail', method: 'GET', auth: true, }, // 获取管理员订单列表 getOrderList: { - url: '/recycle-admin/applet/info_team_order/getOrderList', + url: '/applet/info_team_order/getOrderList', method: 'GET', auth: true }, // 创建预约订单 createOrder: { - url: '/recycle-admin/applet/order/createOrder', + url: '/applet/order/createOrder', method: 'POST', auth: true, }, // 流水列表带分页 getMyMoneyLogPage: { - url: '/recycle-admin/applet/money/getMyMoneyLogPage', + url: '/applet/money/getMyMoneyLogPage', method: 'GET', auth: true, }, // 确认收货 apply: { - url: '/recycle-admin/applet/promotion/apply', + url: '/applet/promotion/apply', method: 'POST', auth: true, }, // 获取推广官信息 getMyPromotionInfo: { - url: '/recycle-admin/applet/promotion/getMyPromotionInfo', + url: '/applet/promotion/getMyPromotionInfo', method: 'GET', auth: true, }, // 获取首页广告列表 getRankList: { - url: '/recycle-admin/applet/promotion/getRankList', + url: '/applet/promotion/getRankList', method: 'GET', auth : true }, // 获取品牌列表 getGoodsBrandList: { - url: '/recycle-admin/applet/class/getGoodsBrandList', + url: '/applet/class/getGoodsBrandList', method: 'GET', auth : false }, //联系客服页面 getQuestionList: { - url: '/recycle-admin/applet/order/getQuestionList', + url: '/applet/order/getQuestionList', method: 'GET', auth : false }, //获取用户信息 getInfoTeamListPage: { - url: '/recycle-admin/applet/info_team/getInfoTeamListPage', + url: '/applet/info_team/getInfoTeamListPage', method: 'GET', auth : true }, //查看订单详情 getOrderDetail: { - url: '/recycle-admin/applet/order/getOrderDetail', + url: '/applet/order/getOrderDetail', method: 'GET', auth : true }, //查看最近回收质检报告 getQualityReport: { - url: '/recycle-admin/applet/index/getQualityReport', + url: '/applet/index/getQualityReport', method: 'GET', auth : false }, // 回收规则 getGoodsRecycleRule: { - url: '/recycle-admin/applet/class/getGoodsRecycleRule', + url: '/applet/class/getGoodsRecycleRule', method: 'GET', auth : false }, // 获取用户订单列表 getOrderListPage: { - url: '/recycle-admin/applet/order/getOrderListPage', + url: '/applet/order/getOrderListPage', method: 'GET', auth : true }, // 查询最近回收商品 getRecentGoodsList: { - url: '/recycle-admin/applet/index/getRecentGoodsList', + url: '/applet/index/getRecentGoodsList', method: 'GET', auth : false }, // 最近回收 getQualityReport: { - url: '/recycle-admin/applet/index/getQualityReport', + url: '/applet/index/getQualityReport', method: 'GET', auth : false, }, // 1.根据id获取对应商品列表 getGoodsBrandList: { - url: '/recycle-admin/applet/class/getGoodsBrandList', + url: '/applet/class/getGoodsBrandList', method: 'GET', auth : false }, // 根据商品标识查询商品品牌下的款式 getGoodsBrandProduct: { - url: '/recycle-admin/applet/class/getGoodsBrandProduct', + url: '/applet/class/getGoodsBrandProduct', method: 'GET', auth : false }, // 2.根据分类标识获取分类商品列表带分页 getClassGoodsList: { - url: '/recycle-admin/applet/class/getClassGoodsList', + url: '/applet/class/getClassGoodsList', method: 'GET', auth : false }, // 获取我的礼品订单 getPricePreviewClassList: { - url: '/recycle-admin/applet/class/getPricePreviewClassList', + url: '/applet/class/getPricePreviewClassList', method: 'GET', auth : false, }, // 获取我的礼品订单详情 getAreaList: { - url: '/recycle-admin/applet/index/getAreaList', + url: '/applet/index/getAreaList', method: 'GET', auth : true, }, getCumulativeRecoveryCount: { - url: '/recycle-admin/applet/order/getCumulativeRecoveryCount', + url: '/applet/order/getCumulativeRecoveryCount', method: 'GET', auth : true, }, getcheckoutReasons: { - url: '/recycle-admin/applet/order/getcheckoutReasons', + url: '/applet/order/getcheckoutReasons', method: 'GET', auth: true, }, submitQualityInfo: { - url: '/recycle-admin/applet/info_team_order/submitQualityInfo', + url: '/applet/info_team_order/submitQualityInfo', method: 'POST', auth: true, }, cancelOrder: { - url: '/recycle-admin/applet/order/cancelOrder', + url: '/applet/order/cancelOrder', method: 'POST', auth: true, }, getGoodsDetail: { - url: '/recycle-admin/applet/class/getGoodsDetail', + url: '/applet/class/getGoodsDetail', method: 'GET', auth: true, }, orderStatusStatistics: { - url: '/recycle-admin/applet/info_team_order/orderStatusStatistics', + url: '/applet/info_team_order/orderStatusStatistics', method: 'POST', auth: true, }, income: { - url: '/recycle-admin/applet/money/income', + url: '/applet/money/income', method: 'POST', auth: true, }, adminOrderBrowseRecord: { - url: '/recycle-admin/applet/info_team_order/adminOrderBrowseRecord', + url: '/applet/info_team_order/adminOrderBrowseRecord', method: 'GET', auth: true, }, getPromotionCount: { - url: '/recycle-admin/applet/promotion/getPromotionCount', + url: '/applet/promotion/getPromotionCount', method: 'GET', auth: true, }, queryTrace: { - url: '/recycle-admin/applet/order/queryTrace', + url: '/applet/order/queryTrace', method: 'GET', auth: true, }, diff --git a/api/model/login.js b/api/model/login.js index 0d23737..f77bb0b 100644 --- a/api/model/login.js +++ b/api/model/login.js @@ -5,20 +5,20 @@ const api = { // 微信登录接口 wxLogin: { - url: '/recycle-admin/applet/login/appletLogin', + url: '/applet/login/appletLogin', method: 'GET', limit : 500, showLoading : true, }, // 获取绑定手机号码 bindPhone: { - url: '/recycle-admin/applet/login/bindPhone', + url: '/applet/login/bindPhone', method: 'GET', auth: true, }, // 修改个人信息接口 updateInfo: { - url: '/recycle-admin/applet/login/updateUserInfo', + url: '/applet/login/updateUserInfo', method: 'POST', auth: true, limit : 500, @@ -26,13 +26,13 @@ const api = { }, // 获取个人信息 getUserByToken: { - url: '/recycle-admin/applet/login/getUserByToken', + url: '/applet/login/getUserByToken', method: 'GET', auth: true, }, // 获取配置 getConfig: { - url: '/recycle-admin/applet/login/getConfig', + url: '/applet/login/getConfig', method: 'GET', auth: false, }, diff --git a/api/model/recyclingDestination.js b/api/model/recyclingDestination.js index a221e6e..eaafd7c 100644 --- a/api/model/recyclingDestination.js +++ b/api/model/recyclingDestination.js @@ -2,25 +2,25 @@ const api = { // 获取回收去向 getRecyclingDestination: { - url: '/recycle-admin/applet/index/getRecyclingDestination', + url: '/applet/index/getRecyclingDestination', method: 'GET', auth : false, }, // 获取回收去向详情 getRecyclingDestinationDetail: { - url: '/recycle-admin/applet/index/getRecyclingDestinationDetail', + url: '/applet/index/getRecyclingDestinationDetail', method: 'GET', auth : false, }, // 联系客服问题相关详情 getQuestionListDetail: { - url: '/recycle-admin/applet/order/getQuestionListDetail', + url: '/applet/order/getQuestionListDetail', method: 'GET', auth : false, }, // 提现 withdraw: { - url: '/recycle-admin/applet/money/withdraw', + url: '/applet/money/withdraw', method: 'POST', auth : true, limit: 2000, @@ -28,13 +28,13 @@ const api = { }, // 提现领取成功 withdrawSUccess: { - url: '/recycle-admin/applet/money/withdrawSUccess', + url: '/applet/money/withdrawSUccess', method: 'POST', auth : true, }, // 根据快递单号查询订单号 getOrderIdBywliuNo: { - url: '/recycle-admin/applet/info_team_order/getOrderIdBywliuNo', + url: '/applet/info_team_order/getOrderIdBywliuNo', method: 'GET', auth : true, }, diff --git a/compoent/recycle/brand-selector.vue b/compoent/recycle/brand-selector.vue index fc38688..f2ede77 100644 --- a/compoent/recycle/brand-selector.vue +++ b/compoent/recycle/brand-selector.vue @@ -186,7 +186,8 @@ export default { logo: brand.logo, name: brand.name } - this.showBrandConfirm = true + // this.showBrandConfirm = true + this.confirmBrand() }, // 关闭品牌确认弹窗 diff --git a/compoent/recycle/product-style-selector.vue b/compoent/recycle/product-style-selector.vue index ef7a7d6..e2e0544 100644 --- a/compoent/recycle/product-style-selector.vue +++ b/compoent/recycle/product-style-selector.vue @@ -7,15 +7,20 @@ 选择回收款式 - - {{ brandInfo.name }} + + + {{ brandInfo.name }} + + - + {{ item.quantity || 0 }} @@ -126,6 +131,11 @@ export default { }) }, + // 切换品牌 + switchBrand() { + this.close() + }, + // 下一步 nextStep() { const selectedItems = this.styleList.filter(item => (item.quantity || 0) > 0) @@ -200,16 +210,22 @@ export default { .style-popup-brand-info { display: flex; + justify-content: center; align-items: center; padding: 20rpx 24rpx; border-bottom: 1px solid #f0f0f0; } +.brand-info-center { + display: flex; + align-items: center; + gap: 12rpx; +} + .brand-logo { width: 60rpx; height: 60rpx; border-radius: 8rpx; - margin-right: 20rpx; background: #f8f8f8; } @@ -219,6 +235,24 @@ export default { font-weight: bold; } +.brand-switch-btn { + padding: 4rpx 8rpx; + background: #eee; + color: #777; + font-size: 24rpx; + border-radius: 40rpx; + border: none; + margin: 0; + + &::after { + border: none; + } + + &:active { + opacity: 0.8; + } +} + .style-popup-list { flex: 1; overflow-y: auto; diff --git a/config.js b/config.js index a7176df..97f54ce 100644 --- a/config.js +++ b/config.js @@ -1,16 +1,19 @@ // config.js -const type = 'local' +const type = 'prod2' const config = { local: { - baseUrl: 'http://127.0.0.1:8002', + baseUrl: 'http://127.0.0.1:8002/recycle-admin', }, dev: { - baseUrl: 'http://h5.xzaiyp.top', + baseUrl: 'http://h5.xzaiyp.top/recycle-admin', }, prod: { - baseUrl: 'https://www.ddmhs.top', - } + baseUrl: 'https://www.ddmhs.top/recycle-admin', + }, + prod2: { + baseUrl: 'https://wwwv2.ddmhs.top/recycle-admin-v2', + }, } const defaultConfig = { diff --git a/pages/component/recycle.vue b/pages/component/recycle.vue index 00de95c..b13102c 100644 --- a/pages/component/recycle.vue +++ b/pages/component/recycle.vue @@ -45,12 +45,12 @@ --> - + {{ getItemTotalQuantity(item) }} @@ -117,17 +117,19 @@ 已选商品明细 - + + - + 品牌 - {{ item.name }} - 品牌:{{ item.brandName }} | 款式:{{ item.styleName }} - 品牌:{{ item.brandName }} - 款式:{{ item.styleName }} + + + {{ item.brandName || item.name }} + {{ item.styleName }} {{ item.service }} ¥{{ item.price }}/{{ item.unit || '件' }} @@ -158,6 +160,11 @@ + + + + 添加衣物 + @@ -681,6 +688,11 @@ export default { if (item.brandQuantities) { this.$set(item, 'brandQuantities', {}) } + + // 品牌选择完成后自动打开商品明细弹窗 + this.$nextTick(() => { + this.showDetailPanel = true + }) } this.pendingBrandIndex = null } @@ -1097,6 +1109,11 @@ export default { toggleDetailPanel() { this.showDetailPanel = !this.showDetailPanel }, + + // 添加更多衣物 + addMoreItems() { + this.showDetailPanel = false + }, fetchUserInfo() { if (uni.getStorageSync('token')) { this.login_status = getApp().globalData.login_status; @@ -1901,11 +1918,13 @@ export default { left: 0; right: 0; top: 0; - bottom: calc(120rpx + env(safe-area-inset-bottom)); + bottom: 0; + // padding-bottom: calc(env(safe-area-inset-bottom)); + // bottom: calc(120rpx + env(safe-area-inset-bottom)); // bottom: calc(90rpx + env(safe-area-inset-bottom)); /* tabbar高度+安全区 */ background: rgba(0, 0, 0, 0.35); - z-index: 8; + z-index: 9999; display: flex; align-items: flex-end; justify-content: center; @@ -1922,9 +1941,9 @@ export default { align-items: stretch; position: relative; padding: 0; + padding-bottom: calc(env(safe-area-inset-bottom)); overflow: hidden; - min-height: 520rpx; - max-height: 80vh; + min-height: 80vh; bottom: 0; } @@ -1966,10 +1985,10 @@ export default { } .popup-panel-list { - flex: 1; + // flex: 1; width: 710rpx; overflow-y: auto; - max-height: 36vh; + height: 70vh !important; padding: 0 24rpx; scrollbar-width: none; /* Firefox */ @@ -2033,7 +2052,7 @@ export default { } .panel-item-name { - font-size: 30rpx; + font-size: 28rpx; color: #222; font-weight: bold; margin-bottom: 4rpx; @@ -2170,9 +2189,35 @@ export default { } } - - - +/* 添加衣物浮窗按钮 */ +.floating-add-btn { + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: 210rpx; + width: 160rpx; + height: 80rpx; + background: linear-gradient(to right, #ffd01e, #ff8917); + border-radius: 40rpx; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 8rpx 24rpx rgba(255, 156, 0, 0.3); + z-index: 10; + + &:active { + opacity: 0.9; + transform: translateX(-50%) scale(0.95); + } + + .floating-btn-text { + color: #fff; + font-size: 28rpx; + font-weight: bold; + line-height: 1; + text-align: center; + } +} .uv-tabbar { z-index: 1000; @@ -2193,7 +2238,7 @@ export default { top: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); - z-index: 6000; + z-index: 996000; display: flex; align-items: center; justify-content: center; diff --git a/pages/subcomponent/pickup.vue b/pages/subcomponent/pickup.vue index 0a3470b..b36a605 100644 --- a/pages/subcomponent/pickup.vue +++ b/pages/subcomponent/pickup.vue @@ -53,18 +53,15 @@ - + - {{ item.name }} - {{ item.brandName }} + {{ item.brandName || item.name }} + 品牌 - 品牌:{{ item.brandName }} | 款式:{{ item.styleName - }} - 品牌:{{ item.brandName }} - 款式:{{ item.styleName }} + {{ item.styleName }} {{ item.desc }} ¥{{