|
@@ -16,15 +16,27 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <scroll-view scroll-y class="content">
|
|
|
|
|
|
|
+ <!-- 资源/线索切换标签 -->
|
|
|
|
|
+ <view class="tab-switcher">
|
|
|
|
|
+ <view class="tab-item" :class="{ active: currentTab === 'resource' }" @click="switchToResource">
|
|
|
|
|
+ <text class="tab-text">资源</text>
|
|
|
|
|
+ <text class="tab-count">({{ registeredTotal }})</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="tab-item" :class="{ active: currentTab === 'clue' }" @click="switchToClue">
|
|
|
|
|
+ <text class="tab-text">线索</text>
|
|
|
|
|
+ <text class="tab-count">({{ unregisteredTotal }})</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <scroll-view scroll-y class="content" @scrolltolower="handleScrollToLower" :lower-threshold="100">
|
|
|
<!-- 资源部分(已注册用户) -->
|
|
<!-- 资源部分(已注册用户) -->
|
|
|
- <view class="resource-section" v-if="registeredResources.length > 0">
|
|
|
|
|
- <view class="section-header">
|
|
|
|
|
|
|
+ <view class="resource-section" v-if="currentTab === 'resource'">
|
|
|
|
|
+ <view class="section-header" v-if="registeredResources.length > 0">
|
|
|
<text class="section-title">资源</text>
|
|
<text class="section-title">资源</text>
|
|
|
<text class="section-count">({{ registeredTotal }})</text>
|
|
<text class="section-count">({{ registeredTotal }})</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="resource-list-container">
|
|
<view class="resource-list-container">
|
|
|
- <view class="resource-item" v-for="(item, index) in getRegisteredPageData" :key="item.id" v-if="item" @click="handleResourceClick(item)">
|
|
|
|
|
|
|
+ <view class="resource-item" v-for="(item, index) in getRegisteredDisplayData" :key="getRegisteredItemKey(item, index)" @click="handleResourceClick(item)">
|
|
|
<!-- 右上角选中图标 -->
|
|
<!-- 右上角选中图标 -->
|
|
|
<view class="select-icon">✓-</view>
|
|
<view class="select-icon">✓-</view>
|
|
|
|
|
|
|
@@ -68,8 +80,8 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="action-buttons">
|
|
<view class="action-buttons">
|
|
|
- <view class="delete-btn" @click.stop="handleDelete(item.id)">删除</view>
|
|
|
|
|
- <view class="match-btn" @click.stop="handleMatch(item.id)">精准匹配</view>
|
|
|
|
|
|
|
+ <view class="delete-btn" @click.stop="handleDelete(item.id || item.resourceId || item.resource_id)">删除</view>
|
|
|
|
|
+ <view class="match-btn" @click.stop="handleMatch(item.id || item.resourceId || item.resource_id)">精准匹配</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -79,29 +91,25 @@
|
|
|
<text class="quality-text">优质资源</text>
|
|
<text class="quality-text">优质资源</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 占位元素,确保数据不足3条时也保持固定高度 -->
|
|
|
|
|
- <view class="resource-placeholder" v-for="(key, index) in getRegisteredPlaceholderKeys" :key="key"></view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 资源分页控件 -->
|
|
|
|
|
- <view class="pagination" v-if="registeredTotal > registeredPageSize">
|
|
|
|
|
- <view class="pagination-btn" :class="{ disabled: registeredPageNum <= 1 }" @click="prevRegisteredPage">
|
|
|
|
|
- <text>上一页</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <text class="pagination-info">{{ registeredPageNum }} / {{ getRegisteredTotalPages }}</text>
|
|
|
|
|
- <view class="pagination-btn" :class="{ disabled: registeredPageNum >= getRegisteredTotalPages }" @click="nextRegisteredPage">
|
|
|
|
|
- <text>下一页</text>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <!-- 加载更多提示 -->
|
|
|
|
|
+ <view class="load-more-tip" v-if="registeredResources.length < registeredTotal && currentTab === 'resource'">
|
|
|
|
|
+ <text class="load-more-text">下拉加载更多</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- 没有更多数据提示 -->
|
|
|
|
|
+ <view class="no-more-tip" v-if="registeredResources.length >= registeredTotal && registeredTotal > 0 && currentTab === 'resource'">
|
|
|
|
|
+ <text class="no-more-text">已加载全部数据</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 线索部分(未注册用户) -->
|
|
<!-- 线索部分(未注册用户) -->
|
|
|
- <view class="resource-section" v-if="unregisteredResources.length > 0">
|
|
|
|
|
- <view class="section-header">
|
|
|
|
|
|
|
+ <view class="resource-section" v-if="currentTab === 'clue'">
|
|
|
|
|
+ <view class="section-header" v-if="unregisteredResources.length > 0">
|
|
|
<text class="section-title">线索</text>
|
|
<text class="section-title">线索</text>
|
|
|
<text class="section-count">({{ unregisteredTotal }})</text>
|
|
<text class="section-count">({{ unregisteredTotal }})</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="resource-list-container">
|
|
<view class="resource-list-container">
|
|
|
- <view class="resource-item" v-for="(item, index) in getUnregisteredPageData" :key="item.id" v-if="item" @click="handleResourceClick(item)">
|
|
|
|
|
|
|
+ <view class="resource-item" v-for="(item, index) in getUnregisteredDisplayData" :key="getUnregisteredItemKey(item, index)" @click="handleResourceClick(item)">
|
|
|
<!-- 右上角选中图标 -->
|
|
<!-- 右上角选中图标 -->
|
|
|
<view class="select-icon">✓-</view>
|
|
<view class="select-icon">✓-</view>
|
|
|
|
|
|
|
@@ -120,7 +128,11 @@
|
|
|
<text class="resource-gender gender-tag">{{ item.gender }}</text>
|
|
<text class="resource-gender gender-tag">{{ item.gender }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="status-tag-wrapper">
|
|
<view class="status-tag-wrapper">
|
|
|
- <text class="status-tag register-tag unregistered">未注册</text>
|
|
|
|
|
|
|
+ <text class="status-tag register-tag unregistered">未注册</text>
|
|
|
|
|
+ <!-- 审核状态标签(仅线索列表显示) -->
|
|
|
|
|
+ <text class="status-tag audit-tag" :class="{ 'audit-pending': item.status === 0 || item.status === null || item.status === undefined, 'audit-approved': item.status === 1, 'audit-rejected': item.status === 2 }">
|
|
|
|
|
+ {{ item.status === 0 || item.status === null || item.status === undefined ? '待审核' : (item.status === 1 ? '审核通过' : (item.status === 2 ? '审核未通过' : '待审核')) }}
|
|
|
|
|
+ </text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -142,8 +154,8 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="action-buttons">
|
|
<view class="action-buttons">
|
|
|
- <view class="delete-btn" @click.stop="handleDelete(item.id)">删除</view>
|
|
|
|
|
- <view class="match-btn" @click.stop="handleMatch(item.id)">精准匹配</view>
|
|
|
|
|
|
|
+ <view class="delete-btn" @click.stop="handleDelete(item.id || item.resourceId || item.resource_id)">删除</view>
|
|
|
|
|
+ <view class="match-btn" @click.stop="handleMatch(item.id || item.resourceId || item.resource_id)">精准匹配</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -153,24 +165,20 @@
|
|
|
<text class="quality-text">优质资源</text>
|
|
<text class="quality-text">优质资源</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 占位元素,确保数据不足3条时也保持固定高度 -->
|
|
|
|
|
- <view class="resource-placeholder" v-for="(key, index) in getUnregisteredPlaceholderKeys" :key="key"></view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- 线索分页控件 -->
|
|
|
|
|
- <view class="pagination" v-if="unregisteredTotal > unregisteredPageSize">
|
|
|
|
|
- <view class="pagination-btn" :class="{ disabled: unregisteredPageNum <= 1 }" @click="prevUnregisteredPage">
|
|
|
|
|
- <text>上一页</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <text class="pagination-info">{{ unregisteredPageNum }} / {{ getUnregisteredTotalPages }}</text>
|
|
|
|
|
- <view class="pagination-btn" :class="{ disabled: unregisteredPageNum >= getUnregisteredTotalPages }" @click="nextUnregisteredPage">
|
|
|
|
|
- <text>下一页</text>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <!-- 加载更多提示 -->
|
|
|
|
|
+ <view class="load-more-tip" v-if="unregisteredResources.length < unregisteredTotal && currentTab === 'clue'">
|
|
|
|
|
+ <text class="load-more-text">下拉加载更多</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- 没有更多数据提示 -->
|
|
|
|
|
+ <view class="no-more-tip" v-if="unregisteredResources.length >= unregisteredTotal && unregisteredTotal > 0 && currentTab === 'clue'">
|
|
|
|
|
+ <text class="no-more-text">已加载全部数据</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 空状态 -->
|
|
<!-- 空状态 -->
|
|
|
- <view class="empty-state" v-if="registeredTotal === 0 && unregisteredTotal === 0">
|
|
|
|
|
- <text class="empty-text">暂无资源</text>
|
|
|
|
|
|
|
+ <view class="empty-state" v-if="(currentTab === 'resource' && registeredTotal === 0 && registeredResources.length === 0) || (currentTab === 'clue' && unregisteredTotal === 0 && unregisteredResources.length === 0)">
|
|
|
|
|
+ <text class="empty-text">{{ currentTab === 'resource' ? '暂无资源' : '暂无线索' }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
|
|
|
|
@@ -215,18 +223,23 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
searchKeyword: '',
|
|
searchKeyword: '',
|
|
|
isFirstLoad: true, // 标记是否为首次加载
|
|
isFirstLoad: true, // 标记是否为首次加载
|
|
|
|
|
+ currentTab: 'resource', // 当前选中的标签:'resource' 或 'clue'
|
|
|
resources: [], // 保留用于兼容
|
|
resources: [], // 保留用于兼容
|
|
|
- registeredResources: [], // 已注册用户(资源部分)- 全部数据
|
|
|
|
|
- unregisteredResources: [], // 未注册用户(线索部分)- 全部数据
|
|
|
|
|
|
|
+ registeredResources: [], // 已注册用户(资源部分)- 已加载的数据
|
|
|
|
|
+ unregisteredResources: [], // 未注册用户(线索部分)- 已加载的数据
|
|
|
|
|
+ allRegisteredResources: [], // 已注册用户(资源部分)- 全部数据(从后端获取)
|
|
|
|
|
+ allUnregisteredResources: [], // 未注册用户(线索部分)- 全部数据(从后端获取)
|
|
|
refreshTimer: null, // 定时刷新器
|
|
refreshTimer: null, // 定时刷新器
|
|
|
// 资源分页
|
|
// 资源分页
|
|
|
registeredPageNum: 1, // 资源当前页码
|
|
registeredPageNum: 1, // 资源当前页码
|
|
|
- registeredPageSize: 3, // 资源每页显示数量
|
|
|
|
|
|
|
+ registeredPageSize: 5, // 资源每页显示数量
|
|
|
registeredTotal: 0, // 资源总数
|
|
registeredTotal: 0, // 资源总数
|
|
|
|
|
+ registeredLoading: false, // 资源加载中标志
|
|
|
// 线索分页
|
|
// 线索分页
|
|
|
unregisteredPageNum: 1, // 线索当前页码
|
|
unregisteredPageNum: 1, // 线索当前页码
|
|
|
- unregisteredPageSize: 3, // 线索每页显示数量
|
|
|
|
|
- unregisteredTotal: 0 // 线索总数
|
|
|
|
|
|
|
+ unregisteredPageSize: 5, // 线索每页显示数量
|
|
|
|
|
+ unregisteredTotal: 0, // 线索总数
|
|
|
|
|
+ unregisteredLoading: false // 线索加载中标志
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -234,47 +247,29 @@ export default {
|
|
|
unreadCount() {
|
|
unreadCount() {
|
|
|
return this.$store.getters.getTotalUnread || 0
|
|
return this.$store.getters.getTotalUnread || 0
|
|
|
},
|
|
},
|
|
|
- // 获取资源当前页数据(确保始终返回3条,不足的用null占位)
|
|
|
|
|
- getRegisteredPageData() {
|
|
|
|
|
- const start = (this.registeredPageNum - 1) * this.registeredPageSize
|
|
|
|
|
- const end = start + this.registeredPageSize
|
|
|
|
|
- const pageData = this.registeredResources.slice(start, end)
|
|
|
|
|
- // 如果数据不足3条,用null填充到3条
|
|
|
|
|
- while (pageData.length < this.registeredPageSize) {
|
|
|
|
|
- pageData.push(null)
|
|
|
|
|
- }
|
|
|
|
|
- return pageData
|
|
|
|
|
- },
|
|
|
|
|
- // 获取线索当前页数据(确保始终返回3条,不足的用null占位)
|
|
|
|
|
- getUnregisteredPageData() {
|
|
|
|
|
- const start = (this.unregisteredPageNum - 1) * this.unregisteredPageSize
|
|
|
|
|
- const end = start + this.unregisteredPageSize
|
|
|
|
|
- const pageData = this.unregisteredResources.slice(start, end)
|
|
|
|
|
- // 如果数据不足3条,用null填充到3条
|
|
|
|
|
- while (pageData.length < this.unregisteredPageSize) {
|
|
|
|
|
- pageData.push(null)
|
|
|
|
|
- }
|
|
|
|
|
- return pageData
|
|
|
|
|
- },
|
|
|
|
|
- // 获取资源占位元素的key列表
|
|
|
|
|
- getRegisteredPlaceholderKeys() {
|
|
|
|
|
- return this.getRegisteredPageData.map((item, index) => {
|
|
|
|
|
- return item ? null : 'registered-placeholder-' + index
|
|
|
|
|
- }).filter(key => key !== null)
|
|
|
|
|
- },
|
|
|
|
|
- // 获取线索占位元素的key列表
|
|
|
|
|
- getUnregisteredPlaceholderKeys() {
|
|
|
|
|
- return this.getUnregisteredPageData.map((item, index) => {
|
|
|
|
|
- return item ? null : 'unregistered-placeholder-' + index
|
|
|
|
|
- }).filter(key => key !== null)
|
|
|
|
|
- },
|
|
|
|
|
- // 资源总页数
|
|
|
|
|
- getRegisteredTotalPages() {
|
|
|
|
|
- return Math.ceil(this.registeredTotal / this.registeredPageSize)
|
|
|
|
|
|
|
+ // 获取资源已加载的数据(用于显示)
|
|
|
|
|
+ getRegisteredDisplayData() {
|
|
|
|
|
+ const data = (this.registeredResources || []).filter(item => {
|
|
|
|
|
+ const isValid = item && item.id !== undefined && item.id !== null
|
|
|
|
|
+ if (!isValid) {
|
|
|
|
|
+ console.warn('getRegisteredDisplayData - 过滤掉无效数据:', item)
|
|
|
|
|
+ }
|
|
|
|
|
+ return isValid
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('getRegisteredDisplayData - 返回数据长度:', data.length, '数据:', data.map(item => ({ id: item.id, name: item.name })))
|
|
|
|
|
+ return data
|
|
|
},
|
|
},
|
|
|
- // 线索总页数
|
|
|
|
|
- getUnregisteredTotalPages() {
|
|
|
|
|
- return Math.ceil(this.unregisteredTotal / this.unregisteredPageSize)
|
|
|
|
|
|
|
+ // 获取线索已加载的数据(用于显示)
|
|
|
|
|
+ getUnregisteredDisplayData() {
|
|
|
|
|
+ const data = (this.unregisteredResources || []).filter(item => {
|
|
|
|
|
+ const isValid = item && item.id !== undefined && item.id !== null
|
|
|
|
|
+ if (!isValid) {
|
|
|
|
|
+ console.warn('getUnregisteredDisplayData - 过滤掉无效数据:', item)
|
|
|
|
|
+ }
|
|
|
|
|
+ return isValid
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('getUnregisteredDisplayData - 返回数据长度:', data.length, '数据:', data.map(item => ({ id: item.id, name: item.name })))
|
|
|
|
|
+ return data
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -309,6 +304,130 @@ export default {
|
|
|
this.stopAutoRefresh()
|
|
this.stopAutoRefresh()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 获取审核状态文本
|
|
|
|
|
+ getAuditStatusText(status) {
|
|
|
|
|
+ if (status === null || status === undefined) {
|
|
|
|
|
+ return '待审核'
|
|
|
|
|
+ }
|
|
|
|
|
+ switch (status) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ return '待审核'
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ return '审核通过'
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ return '审核未通过'
|
|
|
|
|
+ default:
|
|
|
|
|
+ return '待审核'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取审核状态样式类(返回对象,用于:class绑定)
|
|
|
|
|
+ getAuditStatusClass(status) {
|
|
|
|
|
+ if (status === null || status === undefined) {
|
|
|
|
|
+ return { 'audit-pending': true }
|
|
|
|
|
+ }
|
|
|
|
|
+ switch (status) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ return { 'audit-pending': true }
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ return { 'audit-approved': true }
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ return { 'audit-rejected': true }
|
|
|
|
|
+ default:
|
|
|
|
|
+ return { 'audit-pending': true }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取资源项的key
|
|
|
|
|
+ getRegisteredItemKey(item, index) {
|
|
|
|
|
+ if (item && item.id) {
|
|
|
|
|
+ return 'registered-' + item.id
|
|
|
|
|
+ }
|
|
|
|
|
+ return 'registered-placeholder-' + index
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取线索项的key
|
|
|
|
|
+ getUnregisteredItemKey(item, index) {
|
|
|
|
|
+ if (item && item.id) {
|
|
|
|
|
+ return 'unregistered-' + item.id
|
|
|
|
|
+ }
|
|
|
|
|
+ return 'unregistered-placeholder-' + index
|
|
|
|
|
+ },
|
|
|
|
|
+ // 切换到资源标签
|
|
|
|
|
+ switchToResource() {
|
|
|
|
|
+ this.currentTab = 'resource'
|
|
|
|
|
+ // 切换标签时重置已加载数据
|
|
|
|
|
+ this.registeredPageNum = 1
|
|
|
|
|
+ this.loadRegisteredPage(1)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 切换到线索标签
|
|
|
|
|
+ switchToClue() {
|
|
|
|
|
+ this.currentTab = 'clue'
|
|
|
|
|
+ // 切换标签时重置已加载数据
|
|
|
|
|
+ this.unregisteredPageNum = 1
|
|
|
|
|
+ this.loadUnregisteredPage(1)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 滚动到底部触发加载更多
|
|
|
|
|
+ handleScrollToLower() {
|
|
|
|
|
+ if (this.currentTab === 'resource') {
|
|
|
|
|
+ // 资源列表加载更多
|
|
|
|
|
+ if (!this.registeredLoading && this.registeredResources.length < this.registeredTotal) {
|
|
|
|
|
+ this.loadMoreRegistered()
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 线索列表加载更多
|
|
|
|
|
+ if (!this.unregisteredLoading && this.unregisteredResources.length < this.unregisteredTotal) {
|
|
|
|
|
+ this.loadMoreUnregistered()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 加载资源指定页数据
|
|
|
|
|
+ loadRegisteredPage(pageNum) {
|
|
|
|
|
+ if (!this.allRegisteredResources || this.allRegisteredResources.length === 0) {
|
|
|
|
|
+ console.warn('loadRegisteredPage: allRegisteredResources为空')
|
|
|
|
|
+ this.registeredResources = []
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const start = (pageNum - 1) * this.registeredPageSize
|
|
|
|
|
+ const end = start + this.registeredPageSize
|
|
|
|
|
+ this.registeredResources = this.allRegisteredResources.slice(0, end)
|
|
|
|
|
+ console.log('loadRegisteredPage - pageNum:', pageNum, 'start:', start, 'end:', end, 'loaded:', this.registeredResources.length, 'total:', this.allRegisteredResources.length)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 加载线索指定页数据
|
|
|
|
|
+ loadUnregisteredPage(pageNum) {
|
|
|
|
|
+ if (!this.allUnregisteredResources || this.allUnregisteredResources.length === 0) {
|
|
|
|
|
+ console.warn('loadUnregisteredPage: allUnregisteredResources为空')
|
|
|
|
|
+ this.unregisteredResources = []
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const start = (pageNum - 1) * this.unregisteredPageSize
|
|
|
|
|
+ const end = start + this.unregisteredPageSize
|
|
|
|
|
+ this.unregisteredResources = this.allUnregisteredResources.slice(0, end)
|
|
|
|
|
+ console.log('loadUnregisteredPage - pageNum:', pageNum, 'start:', start, 'end:', end, 'loaded:', this.unregisteredResources.length, 'total:', this.allUnregisteredResources.length)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 加载更多资源
|
|
|
|
|
+ loadMoreRegistered() {
|
|
|
|
|
+ if (this.registeredLoading) return
|
|
|
|
|
+ if (this.registeredResources.length >= this.registeredTotal) return
|
|
|
|
|
+
|
|
|
|
|
+ this.registeredLoading = true
|
|
|
|
|
+ this.registeredPageNum++
|
|
|
|
|
+ const start = (this.registeredPageNum - 1) * this.registeredPageSize
|
|
|
|
|
+ const end = start + this.registeredPageSize
|
|
|
|
|
+ const newData = this.allRegisteredResources.slice(start, end)
|
|
|
|
|
+ this.registeredResources = [...this.registeredResources, ...newData]
|
|
|
|
|
+ this.registeredLoading = false
|
|
|
|
|
+ },
|
|
|
|
|
+ // 加载更多线索
|
|
|
|
|
+ loadMoreUnregistered() {
|
|
|
|
|
+ if (this.unregisteredLoading) return
|
|
|
|
|
+ if (this.unregisteredResources.length >= this.unregisteredTotal) return
|
|
|
|
|
+
|
|
|
|
|
+ this.unregisteredLoading = true
|
|
|
|
|
+ this.unregisteredPageNum++
|
|
|
|
|
+ const start = (this.unregisteredPageNum - 1) * this.unregisteredPageSize
|
|
|
|
|
+ const end = start + this.unregisteredPageSize
|
|
|
|
|
+ const newData = this.allUnregisteredResources.slice(start, end)
|
|
|
|
|
+ this.unregisteredResources = [...this.unregisteredResources, ...newData]
|
|
|
|
|
+ this.unregisteredLoading = false
|
|
|
|
|
+ },
|
|
|
// 加载我的资源数据
|
|
// 加载我的资源数据
|
|
|
async loadMyResources() {
|
|
async loadMyResources() {
|
|
|
try {
|
|
try {
|
|
@@ -453,21 +572,35 @@ export default {
|
|
|
// 确保isUser是数字类型
|
|
// 确保isUser是数字类型
|
|
|
isUser = parseInt(isUser) || 0
|
|
isUser = parseInt(isUser) || 0
|
|
|
|
|
|
|
|
|
|
+ // 处理userId字段,支持多种可能的字段名(userId或user_id)
|
|
|
|
|
+ let userId = item.userId !== null && item.userId !== undefined ? item.userId :
|
|
|
|
|
+ (item.user_id !== null && item.user_id !== undefined ? item.user_id : null)
|
|
|
|
|
+ // 确保userId是数字类型或null
|
|
|
|
|
+ if (userId !== null && userId !== undefined) {
|
|
|
|
|
+ userId = parseInt(userId)
|
|
|
|
|
+ if (isNaN(userId) || userId <= 0) {
|
|
|
|
|
+ userId = null
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 处理isMatch字段
|
|
// 处理isMatch字段
|
|
|
let isMatch = item.isMatch !== null && item.isMatch !== undefined ? item.isMatch :
|
|
let isMatch = item.isMatch !== null && item.isMatch !== undefined ? item.isMatch :
|
|
|
(item.is_match !== null && item.is_match !== undefined ? item.is_match : 0)
|
|
(item.is_match !== null && item.is_match !== undefined ? item.is_match : 0)
|
|
|
isMatch = parseInt(isMatch) || 0
|
|
isMatch = parseInt(isMatch) || 0
|
|
|
|
|
|
|
|
- // 调试日志:检查isUser字段
|
|
|
|
|
- console.log('=== isUser字段处理 ===')
|
|
|
|
|
|
|
+ // 调试日志:检查isUser和userId字段
|
|
|
|
|
+ console.log('=== isUser和userId字段处理 ===')
|
|
|
console.log('资源ID:', resourceId, '姓名:', item.name)
|
|
console.log('资源ID:', resourceId, '姓名:', item.name)
|
|
|
console.log('原始数据:', {
|
|
console.log('原始数据:', {
|
|
|
isUser: item.isUser,
|
|
isUser: item.isUser,
|
|
|
is_user: item.is_user,
|
|
is_user: item.is_user,
|
|
|
|
|
+ userId: item.userId,
|
|
|
|
|
+ user_id: item.user_id,
|
|
|
'item完整对象': item
|
|
'item完整对象': item
|
|
|
})
|
|
})
|
|
|
console.log('处理后的isUser值:', isUser, '类型:', typeof isUser)
|
|
console.log('处理后的isUser值:', isUser, '类型:', typeof isUser)
|
|
|
- console.log('=== isUser字段处理结束 ===')
|
|
|
|
|
|
|
+ console.log('处理后的userId值:', userId, '类型:', typeof userId)
|
|
|
|
|
+ console.log('=== isUser和userId字段处理结束 ===')
|
|
|
|
|
|
|
|
// 处理标签(从后端返回的tags字段,如果没有则使用原有的labels)
|
|
// 处理标签(从后端返回的tags字段,如果没有则使用原有的labels)
|
|
|
let resourceTags = []
|
|
let resourceTags = []
|
|
@@ -479,13 +612,16 @@ export default {
|
|
|
resourceTags = labels
|
|
resourceTags = labels
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return {
|
|
|
|
|
- id: resourceId,
|
|
|
|
|
|
|
+ const resourceObj = {
|
|
|
|
|
+ id: resourceId, // 主要使用的ID字段
|
|
|
|
|
+ resourceId: resourceId, // 备用ID字段,确保兼容性
|
|
|
|
|
+ resource_id: resourceId, // 备用ID字段,确保兼容性
|
|
|
avatar: avatarUrl, // 使用处理后的头像URL
|
|
avatar: avatarUrl, // 使用处理后的头像URL
|
|
|
name: item.name || '',
|
|
name: item.name || '',
|
|
|
gender: item.gender === 1 ? '男' : item.gender === 2 ? '女' : '未知',
|
|
gender: item.gender === 1 ? '男' : item.gender === 2 ? '女' : '未知',
|
|
|
- status: '已审核', // 可以根据实际字段判断
|
|
|
|
|
|
|
+ status: item.status !== undefined && item.status !== null ? item.status : 0, // 审核状态,默认为0(待审核)
|
|
|
isUser: isUser, // 添加isUser字段,默认为0
|
|
isUser: isUser, // 添加isUser字段,默认为0
|
|
|
|
|
+ userId: userId, // 添加userId字段,可能为null
|
|
|
isMatch: isMatch, // 添加isMatch字段,默认为0
|
|
isMatch: isMatch, // 添加isMatch字段,默认为0
|
|
|
isPlus: false,
|
|
isPlus: false,
|
|
|
labels: resourceTags, // 使用处理后的标签列表
|
|
labels: resourceTags, // 使用处理后的标签列表
|
|
@@ -494,22 +630,37 @@ export default {
|
|
|
originalPhone: item.phone || '', // 保存原始完整手机号用于复制
|
|
originalPhone: item.phone || '', // 保存原始完整手机号用于复制
|
|
|
isQuality: false
|
|
isQuality: false
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log('创建资源对象 - ID:', resourceObj.id, '名称:', resourceObj.name, 'isUser:', resourceObj.isUser, 'userId:', resourceObj.userId)
|
|
|
|
|
+ return resourceObj
|
|
|
}).filter(item => item !== null) // 过滤掉无效的资源(resourceId无效的)
|
|
}).filter(item => item !== null) // 过滤掉无效的资源(resourceId无效的)
|
|
|
|
|
|
|
|
- // 将资源分为两部分:已注册和未注册
|
|
|
|
|
- this.registeredResources = allResources.filter(item => item.isUser === 1)
|
|
|
|
|
- this.unregisteredResources = allResources.filter(item => item.isUser === 0)
|
|
|
|
|
|
|
+ // 将资源分为两部分:已注册和未注册(保存全部数据)
|
|
|
|
|
+ // 已注册用户条件:isUser === 1 且 userId !== null 且 userId !== undefined
|
|
|
|
|
+ this.allRegisteredResources = allResources.filter(item => {
|
|
|
|
|
+ const isRegistered = item.isUser === 1 && item.userId !== null && item.userId !== undefined
|
|
|
|
|
+ return isRegistered
|
|
|
|
|
+ })
|
|
|
|
|
+ // 未注册用户(线索):isUser !== 1 或 userId === null 或 userId === undefined
|
|
|
|
|
+ this.allUnregisteredResources = allResources.filter(item => {
|
|
|
|
|
+ const isUnregistered = item.isUser !== 1 || item.userId === null || item.userId === undefined
|
|
|
|
|
+ return isUnregistered
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
// 设置总数
|
|
// 设置总数
|
|
|
- this.registeredTotal = this.registeredResources.length
|
|
|
|
|
- this.unregisteredTotal = this.unregisteredResources.length
|
|
|
|
|
|
|
+ this.registeredTotal = this.allRegisteredResources.length
|
|
|
|
|
+ this.unregisteredTotal = this.allUnregisteredResources.length
|
|
|
|
|
+
|
|
|
|
|
+ console.log('数据分类完成 - 全部资源:', allResources.length, '已注册:', this.allRegisteredResources.length, '未注册:', this.allUnregisteredResources.length)
|
|
|
|
|
|
|
|
- // 如果当前页超出范围,重置到第一页
|
|
|
|
|
- if (this.registeredPageNum > Math.ceil(this.registeredTotal / this.registeredPageSize) && this.registeredTotal > 0) {
|
|
|
|
|
|
|
+ // 根据当前标签加载第一页数据
|
|
|
|
|
+ if (this.currentTab === 'resource') {
|
|
|
this.registeredPageNum = 1
|
|
this.registeredPageNum = 1
|
|
|
- }
|
|
|
|
|
- if (this.unregisteredPageNum > Math.ceil(this.unregisteredTotal / this.unregisteredPageSize) && this.unregisteredTotal > 0) {
|
|
|
|
|
|
|
+ this.loadRegisteredPage(1)
|
|
|
|
|
+ console.log('加载资源第一页后 - registeredResources.length:', this.registeredResources.length)
|
|
|
|
|
+ } else {
|
|
|
this.unregisteredPageNum = 1
|
|
this.unregisteredPageNum = 1
|
|
|
|
|
+ this.loadUnregisteredPage(1)
|
|
|
|
|
+ console.log('加载线索第一页后 - unregisteredResources.length:', this.unregisteredResources.length)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 保留resources用于兼容(包含所有资源)
|
|
// 保留resources用于兼容(包含所有资源)
|
|
@@ -530,37 +681,18 @@ export default {
|
|
|
// 重新加载资源数据,包含搜索关键词
|
|
// 重新加载资源数据,包含搜索关键词
|
|
|
await this.loadMyResources()
|
|
await this.loadMyResources()
|
|
|
},
|
|
},
|
|
|
- // 资源上一页
|
|
|
|
|
- prevRegisteredPage() {
|
|
|
|
|
- if (this.registeredPageNum > 1) {
|
|
|
|
|
- this.registeredPageNum--
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 资源下一页
|
|
|
|
|
- nextRegisteredPage() {
|
|
|
|
|
- const totalPages = Math.ceil(this.registeredTotal / this.registeredPageSize)
|
|
|
|
|
- if (this.registeredPageNum < totalPages) {
|
|
|
|
|
- this.registeredPageNum++
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 线索上一页
|
|
|
|
|
- prevUnregisteredPage() {
|
|
|
|
|
- if (this.unregisteredPageNum > 1) {
|
|
|
|
|
- this.unregisteredPageNum--
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 线索下一页
|
|
|
|
|
- nextUnregisteredPage() {
|
|
|
|
|
- const totalPages = Math.ceil(this.unregisteredTotal / this.unregisteredPageSize)
|
|
|
|
|
- if (this.unregisteredPageNum < totalPages) {
|
|
|
|
|
- this.unregisteredPageNum++
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
// 删除资源
|
|
// 删除资源
|
|
|
async handleDelete(id) {
|
|
async handleDelete(id) {
|
|
|
- // 验证id是否有效
|
|
|
|
|
|
|
+ // 如果id无效,尝试从当前资源列表中查找
|
|
|
if (id === null || id === undefined || id === 'undefined' || id === 'null' || id === '') {
|
|
if (id === null || id === undefined || id === 'undefined' || id === 'null' || id === '') {
|
|
|
- console.error('删除资源失败: 资源ID无效', id)
|
|
|
|
|
|
|
+ console.warn('删除资源失败: 资源ID无效,尝试从资源列表中查找', id)
|
|
|
|
|
+ // 尝试从当前显示的资源中找到对应的资源
|
|
|
|
|
+ const allDisplayData = this.currentTab === 'resource'
|
|
|
|
|
+ ? this.getRegisteredDisplayData
|
|
|
|
|
+ : this.getUnregisteredDisplayData
|
|
|
|
|
+
|
|
|
|
|
+ // 如果仍然找不到,显示错误
|
|
|
|
|
+ console.error('删除资源失败: 无法获取资源ID', id)
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '资源ID无效,无法删除',
|
|
title: '资源ID无效,无法删除',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -569,16 +701,26 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 确保id是有效的整数
|
|
// 确保id是有效的整数
|
|
|
- const resourceId = parseInt(id)
|
|
|
|
|
|
|
+ let resourceId = parseInt(id)
|
|
|
if (isNaN(resourceId) || resourceId <= 0) {
|
|
if (isNaN(resourceId) || resourceId <= 0) {
|
|
|
- console.error('删除资源失败: 资源ID格式错误', id)
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '资源ID格式错误,无法删除',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ // 如果解析失败,尝试从字符串中提取数字
|
|
|
|
|
+ const match = String(id).match(/\d+/)
|
|
|
|
|
+ if (match) {
|
|
|
|
|
+ resourceId = parseInt(match[0])
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (isNaN(resourceId) || resourceId <= 0) {
|
|
|
|
|
+ console.error('删除资源失败: 资源ID格式错误', id, '类型:', typeof id)
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '资源ID格式错误,无法删除',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ console.log('准备删除资源,ID:', resourceId, '原始ID:', id)
|
|
|
|
|
+
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '删除确认',
|
|
title: '删除确认',
|
|
|
content: '确定要删除该资源吗?',
|
|
content: '确定要删除该资源吗?',
|
|
@@ -615,9 +757,7 @@ export default {
|
|
|
icon: 'success'
|
|
icon: 'success'
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- // 删除成功后刷新资源列表,并重置分页
|
|
|
|
|
- this.registeredPageNum = 1
|
|
|
|
|
- this.unregisteredPageNum = 1
|
|
|
|
|
|
|
+ // 删除成功后刷新资源列表
|
|
|
await this.loadMyResources()
|
|
await this.loadMyResources()
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -651,8 +791,8 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 检查用户是否已注册
|
|
|
|
|
- if (resource.isUser !== 1) {
|
|
|
|
|
|
|
+ // 检查用户是否已注册(isUser === 1 且 userId !== null)
|
|
|
|
|
+ if (resource.isUser !== 1 || resource.userId === null || resource.userId === undefined) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '该用户还未注册用户端,注册之后才能进行匹配',
|
|
title: '该用户还未注册用户端,注册之后才能进行匹配',
|
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -709,8 +849,8 @@ export default {
|
|
|
console.log('item.id:', item.id)
|
|
console.log('item.id:', item.id)
|
|
|
console.log('item.isUser:', item.isUser)
|
|
console.log('item.isUser:', item.isUser)
|
|
|
|
|
|
|
|
- // 判断是否为已注册用户
|
|
|
|
|
- if (item.isUser === 1) {
|
|
|
|
|
|
|
+ // 判断是否为已注册用户(isUser === 1 且 userId !== null)
|
|
|
|
|
+ if (item.isUser === 1 && item.userId !== null && item.userId !== undefined) {
|
|
|
// 已注册,跳转到客户详情页面
|
|
// 已注册,跳转到客户详情页面
|
|
|
const resourceId = item.id
|
|
const resourceId = item.id
|
|
|
console.log('准备跳转,resourceId:', resourceId)
|
|
console.log('准备跳转,resourceId:', resourceId)
|
|
@@ -782,11 +922,67 @@ export default {
|
|
|
// 清除之前的定时器
|
|
// 清除之前的定时器
|
|
|
this.stopAutoRefresh()
|
|
this.stopAutoRefresh()
|
|
|
// 每30秒刷新一次,检查用户注册状态变化
|
|
// 每30秒刷新一次,检查用户注册状态变化
|
|
|
- this.refreshTimer = setInterval(() => {
|
|
|
|
|
|
|
+ this.refreshTimer = setInterval(async () => {
|
|
|
console.log('定时刷新:检查用户注册状态变化')
|
|
console.log('定时刷新:检查用户注册状态变化')
|
|
|
- this.loadMyResources()
|
|
|
|
|
|
|
+ // 先批量检查并更新线索用户的注册状态
|
|
|
|
|
+ await this.batchCheckClueRegistrationStatus()
|
|
|
|
|
+ // 然后刷新资源列表
|
|
|
|
|
+ await this.loadMyResources()
|
|
|
}, 30000) // 30秒
|
|
}, 30000) // 30秒
|
|
|
},
|
|
},
|
|
|
|
|
+ // 批量检查并更新线索用户的注册状态
|
|
|
|
|
+ async batchCheckClueRegistrationStatus() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 获取红娘ID,优先使用userInfo中的matchmakerId,否则使用userId
|
|
|
|
|
+ const userInfo = uni.getStorageSync('userInfo') || {}
|
|
|
|
|
+ const userId = uni.getStorageSync('userId')
|
|
|
|
|
+ let matchmakerId = userInfo.matchmakerId || userId || null
|
|
|
|
|
+
|
|
|
|
|
+ if (!matchmakerId) {
|
|
|
|
|
+ console.warn('未找到红娘ID,跳过批量检查线索用户注册状态')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 确保matchmakerId是有效的整数
|
|
|
|
|
+ matchmakerId = parseInt(matchmakerId)
|
|
|
|
|
+ if (isNaN(matchmakerId) || matchmakerId <= 0) {
|
|
|
|
|
+ console.warn('红娘ID无效,跳过批量检查线索用户注册状态')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const baseUrl = process.env.NODE_ENV === 'development'
|
|
|
|
|
+ ? 'http://localhost:8083/api' // 开发环境 - 通过网关
|
|
|
|
|
+ : 'https://your-domain.com/api' // 生产环境
|
|
|
|
|
+
|
|
|
|
|
+ console.log('开始批量检查线索用户注册状态...', '红娘ID:', matchmakerId)
|
|
|
|
|
+
|
|
|
|
|
+ const [error, res] = await uni.request({
|
|
|
|
|
+ url: `${baseUrl}/my-resource/batch-check-clue-registration`,
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ matchmakerId: matchmakerId
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ if (error) {
|
|
|
|
|
+ console.error('批量检查线索用户注册状态失败:', error)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (res.statusCode === 200 && res.data && res.data.code === 200) {
|
|
|
|
|
+ const updateCount = res.data.data?.updateCount || 0
|
|
|
|
|
+ if (updateCount > 0) {
|
|
|
|
|
+ console.log(`✅ 批量检查完成,更新了 ${updateCount} 条线索用户记录`)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log('✅ 批量检查完成,没有需要更新的线索用户')
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.warn('批量检查线索用户注册状态返回异常:', res.data)
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('批量检查线索用户注册状态时发生异常:', e)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 停止自动刷新
|
|
// 停止自动刷新
|
|
|
stopAutoRefresh() {
|
|
stopAutoRefresh() {
|
|
|
if (this.refreshTimer) {
|
|
if (this.refreshTimer) {
|
|
@@ -813,9 +1009,9 @@ export default {
|
|
|
// 图片加载错误处理(内部方法)
|
|
// 图片加载错误处理(内部方法)
|
|
|
handleImageError(index, type) {
|
|
handleImageError(index, type) {
|
|
|
try {
|
|
try {
|
|
|
- // 获取当前页的数据
|
|
|
|
|
- const pageData = type === 'registered' ? this.getRegisteredPageData : this.getUnregisteredPageData
|
|
|
|
|
- const resource = pageData && pageData[index]
|
|
|
|
|
|
|
+ // 获取当前显示的数据
|
|
|
|
|
+ const displayData = type === 'registered' ? this.getRegisteredDisplayData : this.getUnregisteredDisplayData
|
|
|
|
|
+ const resource = displayData && displayData[index]
|
|
|
if (!resource) {
|
|
if (!resource) {
|
|
|
console.warn('图片加载失败:资源不存在,index:', index, 'type:', type)
|
|
console.warn('图片加载失败:资源不存在,index:', index, 'type:', type)
|
|
|
return
|
|
return
|
|
@@ -845,16 +1041,26 @@ export default {
|
|
|
// 根据resourceId在全部数据中找到对应的资源并更新
|
|
// 根据resourceId在全部数据中找到对应的资源并更新
|
|
|
console.log('图片加载失败,将URL设置为空,显示CSS默认背景')
|
|
console.log('图片加载失败,将URL设置为空,显示CSS默认背景')
|
|
|
if (type === 'registered') {
|
|
if (type === 'registered') {
|
|
|
- const fullList = this.registeredResources
|
|
|
|
|
- const foundIndex = fullList.findIndex(item => item.id === resourceId)
|
|
|
|
|
- if (foundIndex !== -1) {
|
|
|
|
|
- this.$set(this.registeredResources[foundIndex], 'avatar', '')
|
|
|
|
|
|
|
+ // 更新全部数据
|
|
|
|
|
+ const allListIndex = this.allRegisteredResources.findIndex(item => item.id === resourceId)
|
|
|
|
|
+ if (allListIndex !== -1) {
|
|
|
|
|
+ this.$set(this.allRegisteredResources[allListIndex], 'avatar', '')
|
|
|
|
|
+ }
|
|
|
|
|
+ // 更新显示数据
|
|
|
|
|
+ const displayListIndex = this.registeredResources.findIndex(item => item.id === resourceId)
|
|
|
|
|
+ if (displayListIndex !== -1) {
|
|
|
|
|
+ this.$set(this.registeredResources[displayListIndex], 'avatar', '')
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- const fullList = this.unregisteredResources
|
|
|
|
|
- const foundIndex = fullList.findIndex(item => item.id === resourceId)
|
|
|
|
|
- if (foundIndex !== -1) {
|
|
|
|
|
- this.$set(this.unregisteredResources[foundIndex], 'avatar', '')
|
|
|
|
|
|
|
+ // 更新全部数据
|
|
|
|
|
+ const allListIndex = this.allUnregisteredResources.findIndex(item => item.id === resourceId)
|
|
|
|
|
+ if (allListIndex !== -1) {
|
|
|
|
|
+ this.$set(this.allUnregisteredResources[allListIndex], 'avatar', '')
|
|
|
|
|
+ }
|
|
|
|
|
+ // 更新显示数据
|
|
|
|
|
+ const displayListIndex = this.unregisteredResources.findIndex(item => item.id === resourceId)
|
|
|
|
|
+ if (displayListIndex !== -1) {
|
|
|
|
|
+ this.$set(this.unregisteredResources[displayListIndex], 'avatar', '')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -868,14 +1074,14 @@ export default {
|
|
|
// 图片加载成功处理(内部方法)
|
|
// 图片加载成功处理(内部方法)
|
|
|
handleImageLoad(index, type) {
|
|
handleImageLoad(index, type) {
|
|
|
try {
|
|
try {
|
|
|
- // 获取当前页的数据
|
|
|
|
|
- const pageData = type === 'registered' ? this.getRegisteredPageData : this.getUnregisteredPageData
|
|
|
|
|
- if (pageData && pageData[index]) {
|
|
|
|
|
|
|
+ // 获取当前显示的数据
|
|
|
|
|
+ const displayData = type === 'registered' ? this.getRegisteredDisplayData : this.getUnregisteredDisplayData
|
|
|
|
|
+ if (displayData && displayData[index]) {
|
|
|
console.log('图片加载成功:', {
|
|
console.log('图片加载成功:', {
|
|
|
index: index,
|
|
index: index,
|
|
|
type: type,
|
|
type: type,
|
|
|
- resource: pageData[index]?.name,
|
|
|
|
|
- avatarUrl: pageData[index]?.avatar
|
|
|
|
|
|
|
+ resource: displayData[index]?.name,
|
|
|
|
|
+ avatarUrl: displayData[index]?.avatar
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -919,6 +1125,64 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /* 资源/线索切换标签 */
|
|
|
|
|
+ .tab-switcher {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ background: #FFFFFF;
|
|
|
|
|
+ border-bottom: 1rpx solid #F0F0F0;
|
|
|
|
|
+ padding: 0 30rpx;
|
|
|
|
|
+
|
|
|
|
|
+ .tab-item {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ padding: 25rpx 0;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
+
|
|
|
|
|
+ .tab-text {
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ margin-right: 8rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .tab-count {
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &.active {
|
|
|
|
|
+ .tab-text {
|
|
|
|
|
+ color: #9C27B0;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .tab-count {
|
|
|
|
|
+ color: #9C27B0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ content: '';
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ height: 4rpx;
|
|
|
|
|
+ background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
|
|
|
|
|
+ border-radius: 2rpx 2rpx 0 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &:active {
|
|
|
|
|
+ opacity: 0.7;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/* 搜索栏 */
|
|
/* 搜索栏 */
|
|
|
.search-bar {
|
|
.search-bar {
|
|
|
padding: 20rpx;
|
|
padding: 20rpx;
|
|
@@ -999,61 +1263,31 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /* 分页控件 */
|
|
|
|
|
- .pagination {
|
|
|
|
|
|
|
+ /* 加载更多提示 */
|
|
|
|
|
+ .load-more-tip {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
padding: 30rpx 0;
|
|
padding: 30rpx 0;
|
|
|
- gap: 30rpx;
|
|
|
|
|
- margin-top: 20rpx;
|
|
|
|
|
|
|
|
|
|
- .pagination-btn {
|
|
|
|
|
- padding: 12rpx 30rpx;
|
|
|
|
|
- background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
|
|
|
|
|
- color: #FFFFFF;
|
|
|
|
|
- border-radius: 25rpx;
|
|
|
|
|
|
|
+ .load-more-text {
|
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
|
- font-weight: 500;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- box-shadow: 0 2rpx 8rpx rgba(156, 39, 176, 0.3);
|
|
|
|
|
- transition: all 0.3s;
|
|
|
|
|
-
|
|
|
|
|
- &:active {
|
|
|
|
|
- transform: scale(0.95);
|
|
|
|
|
- box-shadow: 0 1rpx 4rpx rgba(156, 39, 176, 0.4);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &.disabled {
|
|
|
|
|
- background: #E0E0E0;
|
|
|
|
|
- color: #999;
|
|
|
|
|
- box-shadow: none;
|
|
|
|
|
- opacity: 0.6;
|
|
|
|
|
-
|
|
|
|
|
- &:active {
|
|
|
|
|
- transform: none;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ color: #999;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 没有更多数据提示 */
|
|
|
|
|
+ .no-more-tip {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 30rpx 0;
|
|
|
|
|
|
|
|
- .pagination-info {
|
|
|
|
|
|
|
+ .no-more-text {
|
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
|
- color: #666;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
|
|
+ color: #999;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- /* 占位元素,用于保持固定高度 */
|
|
|
|
|
- .resource-placeholder {
|
|
|
|
|
- /* 使用与resource-item相同的高度和margin来占位 */
|
|
|
|
|
- /* resource-item: padding 25rpx * 2 + margin-bottom 20rpx + 内容高度约250rpx = 约320rpx */
|
|
|
|
|
- height: 320rpx;
|
|
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
|
- /* 不显示内容,但保持空间 */
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- pointer-events: none;
|
|
|
|
|
- flex-shrink: 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/* 空状态 */
|
|
/* 空状态 */
|
|
|
.empty-state {
|
|
.empty-state {
|
|
@@ -1193,6 +1427,32 @@ export default {
|
|
|
color: #FF9800;
|
|
color: #FF9800;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /* 审核状态标签样式 */
|
|
|
|
|
+ &.audit-tag {
|
|
|
|
|
+ margin-left: 10rpx;
|
|
|
|
|
+
|
|
|
|
|
+ /* 待审核 - 橙色/黄色 */
|
|
|
|
|
+ &.audit-pending {
|
|
|
|
|
+ background: #FFF3E0;
|
|
|
|
|
+ color: #FF9800;
|
|
|
|
|
+ border: 1rpx solid #FFB74D;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 审核通过 - 绿色 */
|
|
|
|
|
+ &.audit-approved {
|
|
|
|
|
+ background: #E8F5E9;
|
|
|
|
|
+ color: #4CAF50;
|
|
|
|
|
+ border: 1rpx solid #81C784;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 审核未通过 - 红色 */
|
|
|
|
|
+ &.audit-rejected {
|
|
|
|
|
+ background: #FFEBEE;
|
|
|
|
|
+ color: #F44336;
|
|
|
|
|
+ border: 1rpx solid #E57373;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|