Browse Source

‘修改暂存bug’

master
Lj 2 weeks ago
parent
commit
0284006853
13 changed files with 158 additions and 88 deletions
  1. +1
    -2
      api/http.js
  2. +7
    -0
      api/model/index.js
  3. +1
    -1
      config.js
  4. +1
    -1
      libs/request/index.js
  5. +10
    -0
      pages.json
  6. +4
    -4
      pages/component/my.vue
  7. +55
    -30
      pages/component/recycle.vue
  8. +3
    -3
      pages/manager/inspect-result.vue
  9. +37
    -11
      pages/manager/inspect.vue
  10. +32
    -31
      pages/manager/order.vue
  11. +5
    -4
      pages/subcomponent/promotion.vue
  12. +1
    -0
      uni_modules/uni-data-checkbox/components/uni-data-checkbox/clientdb.js
  13. +1
    -1
      uni_modules/vk-uview-ui/libs/request/index.js

+ 1
- 2
api/http.js View File

@ -4,7 +4,7 @@ import config from '../config.js' // 新增,导入全局配置
function http(uri, data, callback, method = 'GET', showLoading, title) {
if (showLoading) {
uni.showLoading({
title: title || '加载中...'
title: typeof title === 'string' ? title : '加载中...'
})
}
@ -49,7 +49,6 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
},
fail: () => {
reject('api fail')
uni.showLoading({})
setTimeout(() => {
uni.hideLoading()
uni.showToast({ icon: 'none', title: '网络异常' })


+ 7
- 0
api/model/index.js View File

@ -243,6 +243,13 @@ const api = {
method: 'POST',
auth: true,
},
adminOrderBrowseRecord: {
url: '/recycle-admin/applet/info_team_order/adminOrderBrowseRecord',
method: 'GET',
auth: true,
},
}
export default api

+ 1
- 1
config.js View File

@ -1,5 +1,5 @@
// config.js
const type = 'local'
const type = 'dev'
const config = {
local: {


+ 1
- 1
libs/request/index.js View File

@ -84,7 +84,7 @@ class Request {
if(this.config.showLoading && !this.config.timer) {
this.config.timer = setTimeout(() => {
uni.showLoading({
title: this.config.loadingText,
title: typeof this.config.loadingText === 'string' ? this.config.loadingText : '加载中...',
mask: this.config.loadingMask
})
this.config.timer = null;


+ 10
- 0
pages.json View File

@ -380,5 +380,15 @@
"custom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
},
"preloadRule": {
"pages/manager/inspect": {
"network": "all",
"packages": ["pages/subcomponent"]
},
"pages/manager/inspect-result": {
"network": "all",
"packages": ["pages/subcomponent"]
}
}
}

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

@ -55,13 +55,13 @@
</view>
<!-- 分享赚佣金模块 -->
<view class="share-commission-card" @tap="onShareCommission" v-if="login_status && userInfo.isUser === 'Y'">
<view class="share-commission-card" @tap="onShareCommission" v-if="login_status">
<text class="share-commission-text">分享赚佣金</text>
</view>
<view class="share-commission-card" @tap="onShareCommission" v-if="login_status && userInfo.isUser === 'N'">
<!-- <view class="share-commission-card" @tap="onShareCommission" v-if="login_status && userInfo.isUser === 'N'">
<text class="share-commission-text">申请成为推广官</text>
</view>
</view> -->
<!-- 订单区域 -->
@ -373,7 +373,7 @@ export default {
return item ? item.keyContent : ''
},
userTypeText() {
return this.userInfo.isTuiTypeTitle || '用户'
return this.userInfo.isTuiTypeTitle || '推广官'
},
userTypeBadgeClass() {
//


+ 55
- 30
pages/component/recycle.vue View File

@ -119,12 +119,14 @@
<!-- 不可回收商品 -->
<view class="other-unrecycle-card">
<image class="other-unrecycle-img" src="/static/回收/衣物.png" mode="aspectFit" />
<!-- 使用商品分类数据中的icon -->
<image class="other-unrecycle-img" :src="categories[currentCategory]?.icon" mode="aspectFit" />
<view class="other-unrecycle-info">
<view class="other-unrecycle-title">其他上衣需咨询顾问暂不回收</view>
<view class="other-unrecycle-desc">需连线回收顾问筛选</view>
<!-- 主标题和副标题用接口返回的otherTitle和otherSubTitle -->
<view class="other-unrecycle-title">{{ categories[currentCategory]?.otherTitle }}</view>
<view class="other-unrecycle-desc">{{ categories[currentCategory]?.otherSubTitle }}</view>
<view class="other-unrecycle-price-row">
<text class="other-unrecycle-price">¥ /</text>
<text class="other-unrecycle-price">¥ /{{ categories[currentCategory]?.unit || '' }}</text>
</view>
</view>
<button class="other-unrecycle-btn" open-type="contact">+</button>
@ -288,12 +290,12 @@
<view v-if="showRulePopup" class="rule-popup-mask" @click.self="handleRulePopupMaskClick">
<view class="rule-popup">
<view class="rule-popup-title">回收规则</view>
<scroll-view class="rule-popup-content" scroll-y @scroll="onRuleContentScroll">
<uv-parse :content="ruleHtml"></uv-parse>
<scroll-view class="rule-popup-content" scroll-y @scroll="onRuleContentScroll" @scrolltolower="onRuleScrollToLower">
<uv-parse :content="ruleHtml" @ready="onRuleContentReady"></uv-parse>
<view class="rule-content-bottom-indicator"></view>
</scroll-view>
<view v-if="!hasScrolledToBottom" class="scroll-tip">请滚动到底部阅读完整内容</view>
<button class="rule-popup-btn" :class="{ disabled: !hasScrolledToBottom }" @click="closeRulePopup">我知道了</button>
<button class="rule-popup-btn" :class="{ disabled: !hasScrolledToBottom }" :disabled="!hasScrolledToBottom" @click.stop="closeRulePopup">我知道了</button>
</view>
</view>
@ -581,13 +583,18 @@ export default {
},
//
brandIndexList() {
const set = new Set()
const letters = new Set()
let hasSharp = false
this.brandList.forEach(b => {
if (b.letter && /^[A-Z]$/.test(b.letter)) set.add(b.letter)
if (b.letter && /^[A-Z]$/.test(b.letter)) {
letters.add(b.letter)
} else {
letters.add('#')
hasSharp = true
}
})
const arr = Array.from(set).sort()
// A-Z#
if (arr.length === 0 && this.brandList.length > 0) return ['#']
const arr = Array.from(letters).filter(l => l !== '#').sort()
if (hasSharp) arr.push('#')
return arr
},
},
@ -990,9 +997,17 @@ export default {
},
openRulePopup() {
this.showRulePopup = true
//
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this)
query.select('.rule-popup-content').boundingClientRect(rect => {
if (rect && rect.height && rect.scrollHeight && rect.scrollHeight <= rect.height + 10) {
this.hasScrolledToBottom = true
}
}).exec()
})
},
closeRulePopup() {
//
if (!this.hasScrolledToBottom) {
uni.showToast({
title: '请阅读完整回收规则',
@ -1000,19 +1015,15 @@ export default {
})
return
}
this.showRulePopup = false;
this.hasScrolledToBottom = false; //
//
if (this.isWaitingForBrandSelection) {
this.isWaitingForBrandSelection = false; //
const categoryId = this.categories[this.currentCategory]?.id;
const item = this.allProducts[categoryId]?.[this.pendingBrandIndex];
//
this.viewedRuleItems.add(item.id);
this.getGoodsBrandList(item.id);
this.showBrandPopup = true; //
} else if (this.pendingBrandIndex !== null) {
@ -1041,11 +1052,14 @@ export default {
//
onRuleContentScroll(e) {
const { scrollTop, scrollHeight, deltaY } = e.detail
const containerHeight = 500 // rpxpx
//
if (scrollTop + containerHeight >= scrollHeight - 20) {
const { scrollTop, scrollHeight, clientHeight, height } = e.detail
const h = clientHeight || height
//
if (scrollHeight <= h + 10) {
this.hasScrolledToBottom = true
return
}
if (scrollTop + h >= scrollHeight - 20) {
this.hasScrolledToBottom = true
}
},
@ -1111,7 +1125,6 @@ export default {
if (searchName.trim()) {
params.name = searchName.trim()
}
this.$api('getGoodsBrandList', params, res => {
// console.log(res,'res')
if (res && res.success && res.result && res.result.records) {
@ -1126,14 +1139,10 @@ export default {
isPin: item.isPin
}
})
//
this.$set(this.brandCache, productId, brandList)
// brandList
this.brandList = brandList
// console.log(this.brandList,'this.brandList')
this.brandList = [...brandList]
}
})
},
@ -1259,6 +1268,22 @@ export default {
getApp().globalData.shouldClearRecycle = false
}
},
onRuleContentReady() {
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this)
query.select('.rule-popup-content').boundingClientRect(rect => {
query.select('.rule-popup-content').scrollOffset(scroll => {
//
if (scroll.scrollHeight <= rect.height + 1) {
this.hasScrolledToBottom = true
}
})
}).exec()
})
},
onRuleScrollToLower() {
this.hasScrolledToBottom = true
},
},
created() {
this.currentCategory = 0
@ -1583,8 +1608,8 @@ export default {
border-bottom: 1rpx solid #f5f5f5;
.goods-item-img {
width: 120rpx;
height: 120rpx;
width: 180rpx;
height: 180rpx;
border-radius: 24rpx;
background: #f8f8f8;
margin-right: 28rpx;


+ 3
- 3
pages/manager/inspect-result.vue View File

@ -82,8 +82,8 @@
<view class="reason-select" @tap="selectReason(commonItem)">
<text class="reason-placeholder" :class="{ 'selected': hasSelectedReason(commonItem) }">
{{ hasSelectedReason(commonItem) ? '已选择' : '请选择理由' }}
</text>
<uni-icons type="right" size="18" color="#bbb" />
</text>
<uni-icons type="right" size="18" color="#bbb" />
</view>
</view>
</view>
@ -330,7 +330,7 @@ export default {
type = 1 //
} else if (item.testingStatus === 2) {
type = 2 //
}
}
this.currentReasonItem = popupItem
//


+ 37
- 11
pages/manager/inspect.vue View File

@ -71,7 +71,7 @@
</view>
<scroll-view class="brand-popup-list" scroll-y>
<view v-for="letter in brandIndexList" :key="letter" :id="'brand-letter-' + letter">
<view class="brand-letter">{{letter}}</view>
<view class="brand-letter" :style="letter === '#' ? 'color:red' : ''">{{letter}}</view>
<view v-for="brand in brandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @click="openBrandConfirm(brand)">
<image :src="brand.logo" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{brand.name}}</text>
@ -125,7 +125,7 @@ export default {
showBrandConfirm: false,
searchTimer: null,
brandIndexList: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
// brandIndexList computed
}
},
computed: {
@ -155,7 +155,27 @@ export default {
const result = [...categoriesWithCount, ...extra]
console.log('categories计算 - 最终结果:', result.map(c => ({ id: c.id, title: c.title, badge: c.badge })))
return result
}
},
// brandIndexList computed
brandIndexList() {
// #
const letters = new Set()
let hasSharp = false
this.brandList.forEach(b => {
if (b.letter && /^[A-Z]$/.test(b.letter)) {
letters.add(b.letter)
} else {
letters.add('#')
hasSharp = true
}
})
const arr = Array.from(letters).filter(l => l !== '#').sort()
if (hasSharp) arr.push('#')
console.log('brandIndexList for render:', arr)
// brandListletter#arr#['#']
if (this.brandList.some(b => b.letter === '#') && !arr.includes('#')) return ['#']
return arr
},
},
methods: {
initInspectResult() {
@ -404,7 +424,7 @@ export default {
if (key === 'qualified') {
const currentCategoryId = this.categories[this.currentCategory]?.id
//
if (item.id === 'unrecyclable-1' || item.id === 'quality-issue-1') {
if (item.id === 'unrecyclable-1' || item.id === 'unrecyclable') {
const newQualified = Math.max(0, (item.qualified || 0) + delta)
this.$set(item, 'qualified', newQualified)
this.updateInspectResult(item, 'qualified', delta, currentCategoryId)
@ -659,10 +679,10 @@ export default {
if (searchName.trim()) {
params.name = searchName.trim()
}
this.$api('getGoodsBrandList', params, res => {
if (res && res.success && res.result && res.result.records) {
this.brandList = res.result.records.map(item => {
//
const newList = res.result.records.map(item => {
//
const firstChar = this.getPinyinFirstLetter(item.name)
return {
@ -672,6 +692,14 @@ export default {
letter: firstChar
}
})
// nameletter
newList.forEach(b => console.log('品牌:', b.name, 'letter:', b.letter))
this.brandList = [...newList]
// brandListbrandIndexList
this.$nextTick(() => {
console.log('brandList:', this.brandList)
console.log('brandIndexList:', this.brandIndexList)
})
}
})
},
@ -680,12 +708,10 @@ export default {
getPinyinFirstLetter(str) {
if (!str) return '#'
const firstChar = str.charAt(0)
let index = this.brandIndexList.indexOf(firstChar.toUpperCase())
if (index != -1) {
return this.brandIndexList[index]
// A-Z#
if (/^[A-Za-z]$/.test(firstChar)) {
return firstChar.toUpperCase()
}
return '#'
},


+ 32
- 31
pages/manager/order.vue View File

@ -160,11 +160,13 @@ export default {
navBarHeight: 44,
navBarRealHeight: 44,
tabs: [
{ label: '全部', value: -1, count: 0 },
{ label: '已预约', value: 0, count: 0 },
{ label: '待质检', value: 1, count: 0 },
{ label: '已结款', value: 2, count: 0 },
{ label: '已驳回', value: 3, count: 0 }
{ label: '全部', value: '' , count: 0 },
{ label: '待审核', value: 0, count: 0 },
{ label: '已预约', value: 1, count: 0 },
{ label: '待质检', value: 2, count: 0 },
{ label: '已结款', value: 3, count: 0 },
{ label: '已驳回', value: 4, count: 0 },
{ label: '已取消', value: 5, count: 0 },
],
currentTab: 0,
orderList: [],
@ -199,6 +201,9 @@ export default {
this.fetchOrderList()
this.fetchOrderStatusStatistics()
},
onShow() {
this.fetchOrderStatusStatistics()
},
computed: {
filteredOrders() {
if (this.searchText) {
@ -240,6 +245,11 @@ export default {
this.searchMode = false;
},
goToOrderDetail(order) {
//
this.$api && this.$api('adminOrderBrowseRecord', { orderIds: order.id }, res => {
//
})
uni.navigateTo({
url: '/pages/manager/order-detail?id=' + order.id
})
@ -263,24 +273,7 @@ export default {
// Tabstatus
const tabValue = this.tabs[this.currentTab].value
let statusParam = 0 //
if (tabValue === -1) {
// status = 0
statusParam = 0
} else if (tabValue === 0) {
// status = 1
statusParam = 1
} else if (tabValue === 1) {
// status = 2
statusParam = 2
} else if (tabValue === 2) {
// status = 3
statusParam = 3
} else if (tabValue === 3) {
// status = 4
statusParam = 4
}
let statusParam = tabValue // tabValuestatus
const params = {
pageNo: isLoadMore ? this.pageNo + 1 : 1,
@ -345,14 +338,18 @@ export default {
// if (state === 3) {
// return { label: '', class: 'gray' }
// }
if ((status === 1||status === 0) && state != 3 && state != 4) {
if ((status === 1&&state === 0) && state != 3 && state != 4) {
return { label: '已预约', class: 'green' }
} else if (state === 1) {
} else if (state === 1 && status === 2) {
return { label: '待质检', class: 'orange' }
} else if (status === 3) {
} else if (status === 3&& state === 2) {
return { label: '已结款', class: 'blue' }
} else if (state === 4) {
return { label: '已驳回', class: 'red' }
}else if (state === 3) {
return { label: '已取消', class: 'Turquoise2' }
}else if (state === 0 && status === 0) {
return { label: '待审核', class: 'blue' }
}
return { label: '未知状态', class: 'gray' }
},
@ -415,11 +412,13 @@ export default {
this.$api && this.$api('orderStatusStatistics', { token }, res => {
if (res.code === 200 && res.result) {
const stat = res.result;
this.tabs[1].count = stat.appointed || 0;
this.tabs[2].count = stat.waitingInspection || 0;
this.tabs[3].count = stat.completed || 0;
this.tabs[4].count = stat.rejected || 0;
this.tabs[0].count = (stat.appointed || 0) + (stat.waitingInspection || 0) + (stat.completed || 0) + (stat.rejected || 0);
this.tabs[1].count = stat.pendingAudit || 0; //
this.tabs[2].count = stat.appointed || 0; //
this.tabs[3].count = stat.waitingInspection || 0; //
this.tabs[4].count = stat.completed || 0; //
this.tabs[5].count = stat.rejected || 0; //
this.tabs[6].count = stat.cancelled || 0; //
this.tabs[0].count = (stat.pendingAudit || 0) + (stat.appointed || 0) + (stat.waitingInspection || 0) + (stat.completed || 0) + (stat.rejected || 0) + (stat.cancelled || 0);
}
});
},
@ -604,6 +603,7 @@ export default {
&.orange { background: #fff7e6; color: #ffb400; }
&.blue { background: #e6f0ff; color: #409eff; }
&.gray { background: #f5f5f5; color: #999; }
&.Turquoise2 { background: #e0f7fa; color: #009fa8; } /* 新增已取消 */
}
}
.order-info-wrapper {
@ -620,6 +620,7 @@ export default {
&.orange { background: #fff7e6; color: #ffb400; }
&.blue { background: #e6f0ff; color: #409eff; }
&.gray { background: #f5f5f5; color: #999; }
&.Turquoise2 { background: #e0f7fa; color: #009fa8; } /* 新增已取消 */
}
}
.order-info {


+ 5
- 4
pages/subcomponent/promotion.vue View File

@ -93,9 +93,10 @@
</view>
<!-- 底部按钮区 -->
<view class="bottom-btns">
<button class="btn gray" @tap="goQrcode">我的二维码</button>
<button class="btn green" @tap="goUpgrade" v-if="status== 3">立即升级推广官</button>
<button class="btn gray" v-if="status==0" @tap="showProgressModal = true">查看申请进度</button>
<button class="btn gray" @tap="goQrcode">我的推广码</button>
<!-- <button class="btn green" @tap="goUpgrade" v-if="status== 3">立即升级推广官</button> -->
<!-- <button class="btn gray" v-if="status==0" @tap="showProgressModal = true">查看申请进度</button> -->
<!-- 以上按钮已注释仅保留我的二维码按钮 -->
</view>
<!-- 申请进度弹窗 -->
<view v-if="showProgressModal" class="progress-modal-mask">
@ -200,7 +201,7 @@ export default {
return item ? item.keyContent : ''
},
userTypeText() {
return this.userInfo.isTuiTypeTitle || '用户'
return this.userInfo.isTuiTypeTitle || '推广官'
},
userTypeBadgeClass() {
switch (this.userInfo.isTuiTypeTitle) {


+ 1
- 0
uni_modules/uni-data-checkbox/components/uni-data-checkbox/clientdb.js View File

@ -268,6 +268,7 @@ export default {
}
uni.showLoading({
title: '加载中...',
mask: true
})


+ 1
- 1
uni_modules/vk-uview-ui/libs/request/index.js View File

@ -84,7 +84,7 @@ class Request {
if(this.config.showLoading && !this.config.timer) {
this.config.timer = setTimeout(() => {
uni.showLoading({
title: this.config.loadingText,
title: typeof this.config.loadingText === 'string' ? this.config.loadingText : '加载中...',
mask: this.config.loadingMask
})
this.config.timer = null;


Loading…
Cancel
Save