Browse Source

fix: 修复分类排序和显示问题,优化弹窗滚动行为

- 移除分类列表的pid过滤,保留排序功能
- 为金额显示添加默认值0防止undefined
- 将@tap事件统一改为@click
- 修复弹窗关闭后滚动位置恢复问题
- 添加订单号复制功能
v1
前端-胡立永 1 month ago
parent
commit
9a8b01bc0f
4 changed files with 27 additions and 11 deletions
  1. +2
    -1
      pages/component/home.vue
  2. +2
    -1
      pages/component/recycle.vue
  3. +21
    -7
      pages/manager/inspect-result.vue
  4. +2
    -2
      pages/subcomponent/promotion.vue

+ 2
- 1
pages/component/home.vue View File

@ -375,7 +375,8 @@
const resList = this.pricePreviewList || [] const resList = this.pricePreviewList || []
if (Array.isArray(resList)) { if (Array.isArray(resList)) {
// sort // sort
const firstLevel = resList.filter(item => item.pid == '0').sort((a, b) => a.sort - b.sort)
const firstLevel = resList.sort((a, b) => a.sort - b.sort)
// const firstLevel = resList.filter(item => item.pid == '0').sort((a, b) => a.sort - b.sort)
// console.log(firstLevel,'firstLevel'); // console.log(firstLevel,'firstLevel');
this.priceList = firstLevel.map(item => { this.priceList = firstLevel.map(item => {
// //


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

@ -539,7 +539,8 @@ export default {
}, },
categories() { categories() {
const list = getApp().globalData.pricePreviewList || [] const list = getApp().globalData.pricePreviewList || []
return list.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
return list.sort((a, b) => a.sort - b.sort)
// return list.filter(item => item.pid === '0').sort((a, b) => a.sort - b.sort)
}, },
minMoney() { minMoney() {
const config = getApp().globalData.configData || []; const config = getApp().globalData.configData || [];


+ 21
- 7
pages/manager/inspect-result.vue View File

@ -26,7 +26,7 @@
</view> </view>
<view class="row-reason"> <view class="row-reason">
<text class="reason-label">{{ getGoodsName(item.shopId) }}</text> <text class="reason-label">{{ getGoodsName(item.shopId) }}</text>
<view class="reason-select" @tap="selectReasonForQualified(item)">
<view class="reason-select" @click="selectReasonForQualified(item)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }"> <text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }">
{{ hasSelectedReason(item) ? '已选择' : '请选择理由(选填)' }} {{ hasSelectedReason(item) ? '已选择' : '请选择理由(选填)' }}
</text> </text>
@ -52,7 +52,7 @@
<view v-for="(item, index) in (inspectData.list.find(i => i.id === 'quality_issue')?.commonOrderList || [])" <view v-for="(item, index) in (inspectData.list.find(i => i.id === 'quality_issue')?.commonOrderList || [])"
:key="item.id || item.testingStatus" class="row-reason"> :key="item.id || item.testingStatus" class="row-reason">
<text class="reason-label">质量问题{{ index + 1 }}</text> <text class="reason-label">质量问题{{ index + 1 }}</text>
<view class="reason-select" @tap="selectReason(item)">
<view class="reason-select" @click="selectReason(item)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }"> <text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(item) }">
{{ hasSelectedReason(item) ? '已选择' : '请选择理由' }} {{ hasSelectedReason(item) ? '已选择' : '请选择理由' }}
</text> </text>
@ -79,7 +79,7 @@
<view v-for="(commonItem,index) in (inspectData.list.find(i => i.id === 'unrecyclable')?.commonOrderList || [])" <view v-for="(commonItem,index) in (inspectData.list.find(i => i.id === 'unrecyclable')?.commonOrderList || [])"
:key="commonItem.id || commonItem.testingStatus" class="row-reason"> :key="commonItem.id || commonItem.testingStatus" class="row-reason">
<text class="reason-label">不可回收{{ index +1 }}</text> <text class="reason-label">不可回收{{ index +1 }}</text>
<view class="reason-select" @tap="selectReason(commonItem)">
<view class="reason-select" @click="selectReason(commonItem)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(commonItem) }"> <text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(commonItem) }">
{{ hasSelectedReason(commonItem) ? '已选择' : '请选择理由' }} {{ hasSelectedReason(commonItem) ? '已选择' : '请选择理由' }}
</text> </text>
@ -97,7 +97,9 @@
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="info-label">订单编号</text> <text class="info-label">订单编号</text>
<text class="info-value copy-btn">{{ order?.ordeNo || 'RE82738127861525' }} 复制</text>
<text class="info-value copy-btn"
@click="$utils.copyText(order?.ordeNo)"
>{{ order?.ordeNo }} 复制</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="info-label">取件时间</text> <text class="info-label">取件时间</text>
@ -164,7 +166,8 @@ export default {
reasonOptions: [], reasonOptions: [],
reasonChecked: [], reasonChecked: [],
currentReasonItem: null, currentReasonItem: null,
isPopupOpen: false //
isPopupOpen: false, //
scrollTop: 0 //
} }
}, },
computed: { computed: {
@ -514,12 +517,25 @@ export default {
lockScroll() { lockScroll() {
//
uni.createSelectorQuery().selectViewport().scrollOffset((res) => {
this.scrollTop = res.scrollTop
}).exec()
// //
this.isPopupOpen = true this.isPopupOpen = true
}, },
unlockScroll() { unlockScroll() {
// //
this.isPopupOpen = false this.isPopupOpen = false
//
this.$nextTick(() => {
if (this.scrollTop > 0) {
uni.pageScrollTo({
scrollTop: this.scrollTop,
duration: 0
})
}
})
}, },
async onRefresh() { async onRefresh() {
await this.refreshData && this.refreshData() await this.refreshData && this.refreshData()
@ -557,8 +573,6 @@ export default {
&.popup-open { &.popup-open {
overflow: hidden; overflow: hidden;
position: fixed;
width: 100%;
height: 100vh; height: 100vh;
} }
} }


+ 2
- 2
pages/subcomponent/promotion.vue View File

@ -42,13 +42,13 @@
<view class="user-stats-row"> <view class="user-stats-row">
<view class="stat-block"> <view class="stat-block">
<view class="stat-label">可提现佣金()</view> <view class="stat-label">可提现佣金()</view>
<view class="stat-value main">{{userInfo.money}}</view>
<view class="stat-value main">{{userInfo.money || 0}}</view>
<button class="withdraw-btn" @click="goWithdraw">提现</button> <button class="withdraw-btn" @click="goWithdraw">提现</button>
</view> </view>
<view class="stat-divider"></view> <view class="stat-divider"></view>
<view class="stat-block"> <view class="stat-block">
<view class="stat-label">累计提现()</view> <view class="stat-label">累计提现()</view>
<view class="stat-value">{{userInfo.integerPrice}}</view>
<view class="stat-value">{{userInfo.integerPrice || 0}}</view>
<button class="record-btn" @click="goWithdrawRecord">提现记录</button> <button class="record-btn" @click="goWithdrawRecord">提现记录</button>
</view> </view>
</view> </view>


Loading…
Cancel
Save