Browse Source

refactor(api): 移除接口路径中的/recycle-admin前缀

feat(recycle): 添加品牌切换按钮和衣物添加浮窗
style(recycle): 优化商品展示样式和弹窗布局
fix(recycle): 修复品牌选择后自动打开明细弹窗的逻辑

chore(config): 更新环境配置和API基础路径
master
前端-胡立永 2 weeks ago
parent
commit
0263f0affd
9 changed files with 178 additions and 98 deletions
  1. +6
    -6
      api/model/address.js
  2. +45
    -45
      api/model/index.js
  3. +5
    -5
      api/model/login.js
  4. +6
    -6
      api/model/recyclingDestination.js
  5. +2
    -1
      compoent/recycle/brand-selector.vue
  6. +38
    -4
      compoent/recycle/product-style-selector.vue
  7. +8
    -5
      config.js
  8. +64
    -19
      pages/component/recycle.vue
  9. +4
    -7
      pages/subcomponent/pickup.vue

+ 6
- 6
api/model/address.js View File

@ -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,
},


+ 45
- 45
api/model/index.js View File

@ -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,
},


+ 5
- 5
api/model/login.js View File

@ -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,
},


+ 6
- 6
api/model/recyclingDestination.js View File

@ -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,
},


+ 2
- 1
compoent/recycle/brand-selector.vue View File

@ -186,7 +186,8 @@ export default {
logo: brand.logo,
name: brand.name
}
this.showBrandConfirm = true
// this.showBrandConfirm = true
this.confirmBrand()
},
//


+ 38
- 4
compoent/recycle/product-style-selector.vue View File

@ -7,15 +7,20 @@
<text class="style-popup-title">选择回收款式</text>
</view>
<view class="style-popup-brand-info">
<image :src="brandInfo.logo" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{ brandInfo.name }}</text>
<view class="brand-info-center">
<image :src="brandInfo.logo" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{ brandInfo.name }}</text>
<button class="brand-switch-btn" @click="switchBrand">
切换
</button>
</view>
</view>
<scroll-view class="style-popup-list" scroll-y>
<view class="style-grid">
<view v-for="(item, index) in styleList" :key="item.id" class="style-item" @click="selectStyle(item, index)">
<view class="style-item-content">
<view class="image-container">
<image :src="item.image" class="style-image" mode="aspectFill" />
<image :src="item.image" class="style-image" mode="aspectFit" />
<view class="style-quantity">
<button class="btn-minus" @click.stop="updateQuantity(index, -1)">-</button>
<text class="quantity">{{ item.quantity || 0 }}</text>
@ -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;


+ 8
- 5
config.js View File

@ -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 = {


+ 64
- 19
pages/component/recycle.vue View File

@ -45,12 +45,12 @@
</view> -->
</view>
<view class="goods-info">
<!-- <view class="price-info">
<view class="price-info">
<text class="price-symbol">¥</text>
<text class="price-value" v-if="!item.maxPrice || item.maxPrice == item.price">{{ item.price }}</text>
<text class="price-value" v-else>{{ item.price }}-{{ item.maxPrice }}</text>
<text class="price-unit">/{{ item.unit || '件' }}</text>
</view> -->
</view>
<view class="quantity-control">
<button class="btn-minus" @click="updateQuantity(index, -1)">-</button>
<text class="quantity">{{ getItemTotalQuantity(item) }}</text>
@ -117,17 +117,19 @@
<text class="panel-title">已选商品明细</text>
</view>
<scroll-view class="panel-list popup-panel-list" scroll-y>
<view v-for="(item, idx) in selectedProducts" :key="item.uniqueKey || idx" class="panel-item" @click="openProductDetail(item)">
<!-- @click="openProductDetail(item)" -->
<view v-for="(item, idx) in selectedProducts" :key="item.uniqueKey || idx"
class="panel-item">
<view class="panel-img-container">
<image v-if="item.image" :src="item.image" class="panel-item-img" mode="aspectFit" />
<image v-if="item.styleImage || item.image" :src="item.styleImage || item.image" class="panel-item-img" mode="aspectFit" />
<!-- 品牌标签 -->
<view class="panel-brand-tag" v-if="item.brandId">品牌</view>
</view>
<view class="panel-item-info">
<text class="panel-item-name">{{ item.name }}</text>
<text class="panel-item-desc" v-if="item.brandName && item.styleName">品牌{{ item.brandName }} | 款式{{ item.styleName }}</text>
<text class="panel-item-desc" v-else-if="item.brandName">品牌{{ item.brandName }}</text>
<text class="panel-item-desc" v-else-if="item.styleName">款式{{ item.styleName }}</text>
<!-- <text class="panel-item-name">{{ item.name }}</text> -->
<!-- <text class="panel-item-desc" v-if="item.brandName && item.styleName">品牌{{ item.brandName }} | 款式{{ item.styleName }}</text> -->
<text class="panel-item-name">{{ item.brandName || item.name }}</text>
<text class="panel-item-desc" v-if="item.styleName">{{ item.styleName }}</text>
<text class="panel-item-desc" v-else>{{ item.service }}</text>
<text class="panel-item-price" v-if="!item.maxPrice || item.maxPrice == item.price">¥{{ item.price }}/{{
item.unit || '件' }}</text>
@ -158,6 +160,11 @@
</view>
<button class="submit-btn" @click="submitOrder">预约上门取件</button>
</view>
<!-- 添加衣物浮窗按钮 -->
<view class="floating-add-btn" @click="addMoreItems">
<text class="floating-btn-text">添加衣物</text>
</view>
</view>
</view>
@ -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;


+ 4
- 7
pages/subcomponent/pickup.vue View File

@ -53,18 +53,15 @@
<view class="order-item" v-for="(item, index) in showAllItems ? selectedItems : selectedItems.slice(0, 3)"
:key="index">
<view class="item-left">
<image :src="item.icon" mode="aspectFit"></image>
<image :src="item.styleImage || item.icon" mode="aspectFit"></image>
<image v-if="item.brandImage" :src="item.brandImage" class="brand-logo" mode="aspectFit"></image>
</view>
<view class="item-info">
<view class="name-brand-row">
<text class="name">{{ item.name }}</text>
<text v-if="item.brandName" class="brand-tag">{{ item.brandName }}</text>
<text class="name">{{ item.brandName || item.name }}</text>
<text v-if="item.brandName" class="brand-tag">品牌</text>
</view>
<view class="desc" v-if="item.brandName && item.styleName">品牌{{ item.brandName }} | 款式{{ item.styleName
}}</view>
<view class="desc" v-else-if="item.brandName">品牌{{ item.brandName }}</view>
<view class="desc" v-else-if="item.styleName">款式{{ item.styleName }}</view>
<view class="desc" v-if="item.styleName">{{ item.styleName }}</view>
<view class="desc" v-else>{{ item.desc }}</view>
<view class="price-row">
<text class="price" v-if="!item.maxPrice || item.maxPrice == (item.price || item.unitPrice)">{{


Loading…
Cancel
Save