| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845 |
- <template>
- <view class="my-resources">
-
- <view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFFFFF'}"></view>
- <!-- 顶部导航栏 -->
- <view class="header">
- <view class="header-left" @click="goBack">
- <text class="back-icon">←</text>
- </view>
- <text class="header-title">我的资源</text>
- <view class="header-right">
- <text class="dropdown-arrow">▼</text>
- </view>
- </view>
- <!-- 搜索栏 -->
- <view class="search-bar">
- <view class="search-input-wrapper">
- <view class="search-icon-small"></view>
- <input type="text" class="search-input" placeholder="请输入姓名、手机号或标签(如:温柔)" v-model="searchKeyword" @input="handleSearch" />
- </view>
- </view>
- <!-- 资源/线索切换标签 -->
- <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="50" :enable-back-to-top="true" :scroll-with-animation="true">
- <!-- 资源部分(已注册用户) -->
- <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-count">({{ registeredTotal }})</text>
- </view>
- <view class="resource-list-container">
- <view class="resource-item" v-for="(item, index) in getRegisteredDisplayData" :key="getRegisteredItemKey(item, index)" @click="handleResourceClickSafe(item, index)">
- <!-- 右上角选中图标(左移) -->
- <view class="select-icon">✓-</view>
- <!-- 编辑按钮 -->
- <view class="edit-icon" @click.stop="handleEdit(item.id || item.resourceId || item.resource_id)">
- <text class="edit-text">编辑</text>
- </view>
-
- <view class="resource-header">
- <image
- :src="item.avatar"
- mode="aspectFill"
- class="resource-avatar"
- @error="handleImageErrorRegistered(index)"
- @load="handleImageLoadRegistered(index)"
- :lazy-load="true"
- ></image>
- <view class="resource-basic-info">
- <view class="name-gender">
- <text class="resource-name">{{ item.name }}</text>
- <text class="resource-gender gender-tag">{{ item.gender }}</text>
- </view>
- <view class="status-tag-wrapper">
- <text class="status-tag register-tag registered">已注册</text>
- <text class="status-tag match-tag" :class="{ 'matched': item.isMatch === 1, 'unmatched': item.isMatch === 0 || !item.isMatch }">
- {{ item.isMatch === 1 ? '已匹配' : '未匹配' }}
- </text>
- </view>
- </view>
- </view>
- <view class="resource-details">
- <view class="labels">
- <text class="label" v-for="(label, idx) in item.labels" :key="idx">{{ label }}</text>
- </view>
- <view class="requirement-box">
- <text class="requirement-label">择偶要求:</text>
- <text class="requirement-content">{{ item.requirement }}</text>
- </view>
- <view class="contact-box">
- <text class="contact-label">联系方式:</text>
- <text class="contact-number">{{ item.contact }}</text>
- <text class="copy-btn" @click.stop="handleCopyContact(item.originalPhone || item.contact)">复制</text>
- </view>
- <view class="action-buttons">
- <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 class="quality-tag" v-if="item.isQuality">
- <text class="quality-star">★</text>
- <text class="quality-text">优质资源</text>
- </view>
- </view>
- </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 class="resource-section" v-if="currentTab === 'clue'">
- <view class="section-header" v-if="unregisteredResources.length > 0">
- <text class="section-title">线索</text>
- <text class="section-count">({{ unregisteredTotal }})</text>
- </view>
- <view class="resource-list-container">
- <view class="resource-item" v-for="(item, index) in getUnregisteredDisplayData" :key="getUnregisteredItemKey(item, index)" @click="handleResourceClickSafe(item, index)">
- <!-- 右上角选中图标(左移) -->
- <view class="select-icon">✓-</view>
- <!-- 编辑按钮 -->
- <view class="edit-icon" @click.stop="handleEdit(item.id || item.resourceId || item.resource_id)">
- <text class="edit-text">编辑</text>
- </view>
-
- <view class="resource-header">
- <image
- :src="item.avatar"
- mode="aspectFill"
- class="resource-avatar"
- @error="handleImageErrorUnregistered(index)"
- @load="handleImageLoadUnregistered(index)"
- :lazy-load="true"
- ></image>
- <view class="resource-basic-info">
- <view class="name-gender">
- <text class="resource-name">{{ item.name }}</text>
- <text class="resource-gender gender-tag">{{ item.gender }}</text>
- </view>
- <view class="status-tag-wrapper">
- <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 class="resource-details">
- <view class="labels">
- <text class="label" v-for="(label, idx) in item.labels" :key="idx">{{ label }}</text>
- </view>
- <!-- 未审核通过原因 -->
- <view class="reject-reason" v-if="item.status === 2 && item.rejectReason">
- <text class="reject-reason-text">审核未通过原因:{{ item.rejectReason }}</text>
- </view>
- <view class="requirement-box">
- <text class="requirement-label">择偶要求:</text>
- <text class="requirement-content">{{ item.requirement }}</text>
- </view>
- <view class="contact-box">
- <text class="contact-label">联系方式:</text>
- <text class="contact-number">{{ item.contact }}</text>
- <text class="copy-btn" @click.stop="handleCopyContact(item.originalPhone || item.contact)">复制</text>
- </view>
- <view class="action-buttons">
- <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 class="quality-tag" v-if="item.isQuality">
- <text class="quality-star">★</text>
- <text class="quality-text">优质资源</text>
- </view>
- </view>
- </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 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>
- </scroll-view>
- <!-- 底部添加按钮 -->
- <view class="add-button" @click="handleAdd">
- <text class="add-button-icon">+</text>
- </view>
- <!-- 底部导航 -->
- <view class="tabbar">
- <view class="tabbar-item home" @click="navigateToWorkbench">
- <view class="tabbar-icon"></view>
- <text class="tabbar-text">工作台</text>
- </view>
- <view class="tabbar-item resources active" @click="navigateToMyResources">
- <view class="tabbar-icon"></view>
- <text class="tabbar-text">我的资源</text>
- </view>
- <view class="tabbar-item trophy" @click="navigateToRanking">
- <view class="tabbar-icon"></view>
- <text class="tabbar-text">排行榜</text>
- </view>
- <!-- <view class="tabbar-item message" @click="navigateToMessage">
- <view class="tabbar-icon">
- <view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
- </view>
- <text class="tabbar-text">消息</text>
- </view> -->
- <view class="tabbar-item mine" @click="navigateToMine">
- <view class="tabbar-icon"></view>
- <text class="tabbar-text">我的</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import api from '@/utils/api.js'
-
- export default {
- data() {
- return {
- statusBarHeight: 0,
- searchKeyword: '',
- isFirstLoad: true, // 标记是否为首次加载
- currentTab: 'resource', // 当前选中的标签:'resource' 或 'clue'
- resources: [], // 保留用于兼容
- registeredResources: [], // 已注册用户(资源部分)- 已加载的数据
- unregisteredResources: [], // 未注册用户(线索部分)- 已加载的数据
- allRegisteredResources: [], // 已注册用户(资源部分)- 全部数据(从后端获取)
- allUnregisteredResources: [], // 未注册用户(线索部分)- 全部数据(从后端获取)
- refreshTimer: null, // 定时刷新器
- // 资源分页
- registeredPageNum: 1, // 资源当前页码
- registeredPageSize: 3, // 资源每页显示数量
- registeredTotal: 0, // 资源总数
- registeredLoading: false, // 资源加载中标志
- // 线索分页
- unregisteredPageNum: 1, // 线索当前页码
- unregisteredPageSize: 3, // 线索每页显示数量
- unregisteredTotal: 0, // 线索总数
- unregisteredLoading: false // 线索加载中标志
- }
- },
- computed: {
- // 全局未读消息数
- unreadCount() {
- return this.$store.getters.getTotalUnread || 0
- },
- // 获取资源已加载的数据(用于显示)
- getRegisteredDisplayData() {
- const data = (this.registeredResources || []).filter(item => {
- const isValid = item && item.id !== undefined && item.id !== null
- if (!isValid) {
-
- }
- return isValid
- })
-
- return data
- },
- // 获取线索已加载的数据(用于显示)
- getUnregisteredDisplayData() {
- const data = (this.unregisteredResources || []).filter(item => {
- const isValid = item && item.id !== undefined && item.id !== null
- return isValid
- })
- return data
- }
- },
- onLoad() {
- // 加载我的资源数据
- this.loadMyResources()
- this.isFirstLoad = false
-
- // 监听刷新事件
- uni.$on('refreshResourceList', () => {
-
- this.loadMyResources()
- })
-
- // 启动定时刷新,每30秒检查一次用户注册状态变化
- this.startAutoRefresh()
- //获取状态栏高度
- const systemInfo = uni.getSystemInfoSync()
- this.statusBarHeight = systemInfo.statusBarHeight
- },
- onShow() {
- // 页面显示时刷新列表(从其他页面返回时,非首次加载)
- if (!this.isFirstLoad) {
- this.loadMyResources()
- }
- // 重新启动定时刷新
- this.startAutoRefresh()
- },
- onHide() {
- // 页面隐藏时停止定时刷新
- this.stopAutoRefresh()
- },
- onUnload() {
- // 页面卸载时移除事件监听和停止定时刷新
- uni.$off('refreshResourceList')
- this.stopAutoRefresh()
- },
- methods: {
-
- //返回上一页
- goBack() {
- uni.navigateBack({
- delta: 1 // 返回上一级页面
- })
- },
- // 获取审核状态文本
- 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(e) {
-
- if (this.currentTab === 'resource') {
- // 资源列表加载更多
-
- if (!this.registeredLoading) {
- // 如果已加载数量小于总数,继续加载
- if (this.registeredTotal > 0 && this.registeredResources.length < this.registeredTotal) {
-
- this.loadMoreRegistered()
- } else if (this.registeredTotal === 0) {
-
- this.loadMoreRegistered()
- }
- }
- } else {
-
- if (!this.unregisteredLoading) {
- // 如果已加载数量小于总数,继续加载
- if (this.unregisteredTotal > 0 && this.unregisteredResources.length < this.unregisteredTotal) {
-
- this.loadMoreUnregistered()
- } else if (this.unregisteredTotal === 0) {
-
- this.loadMoreUnregistered()
- }
- }
- }
- },
- // 加载资源指定页数据(从后端加载,使用isUser参数过滤已注册用户)
- async loadRegisteredPage(pageNum) {
- if (this.registeredLoading) return
-
- this.registeredLoading = true
- this.registeredPageNum = pageNum
-
- try {
- // 获取当前登录用户ID
- const userInfo = uni.getStorageSync('userInfo') || {}
- const userId = uni.getStorageSync('userId')
- let currentUserId = userInfo.userId || userId || null
-
- console.log('=== loadRegisteredPage 调试信息 ===')
- console.log('userInfo:', JSON.stringify(userInfo))
- console.log('userId from storage:', userId)
- console.log('currentUserId:', currentUserId)
-
- if (currentUserId !== null && currentUserId !== undefined) {
- currentUserId = parseInt(currentUserId)
- if (isNaN(currentUserId) || currentUserId <= 0) {
- currentUserId = null
- }
- }
-
- if (!currentUserId) {
- console.log('❌ 未获取到有效的用户ID,无法加载资源')
- uni.showToast({
- title: '请先登录',
- icon: 'none'
- })
- this.registeredResources = []
- this.registeredLoading = false
- return
- }
-
- const baseUrl = 'https://api.zhongruanke.cn/api'
-
- // 构建查询参数,使用isUser=1参数只获取已注册用户
- let url = `${baseUrl}/my-resource/list?currentUserId=${currentUserId}&pageNum=${pageNum}&pageSize=${this.registeredPageSize}&isUser=1`
- if (this.searchKeyword && this.searchKeyword.trim()) {
- url += `&keyword=${encodeURIComponent(this.searchKeyword.trim())}`
- }
-
- console.log('请求URL:', url)
-
- const [error, res] = await uni.request({
- url: url,
- method: 'GET',
- timeout: 15000
- })
-
- console.log('请求结果 - error:', error)
- console.log('请求结果 - res.statusCode:', res ? res.statusCode : 'null')
- console.log('请求结果 - res.data:', res ? JSON.stringify(res.data) : 'null')
-
- if (error) {
- console.log('❌ 请求失败:', JSON.stringify(error))
- uni.showToast({
- title: '网络请求失败',
- icon: 'none'
- })
- this.registeredResources = []
- this.registeredLoading = false
- return
- }
-
- if (res.statusCode === 200 && res.data && res.data.code === 200) {
- const pageData = res.data.data
- console.log('pageData:', JSON.stringify(pageData))
- if (pageData && pageData.records) {
- console.log('records数量:', pageData.records.length)
- // 转换数据格式,并过滤掉无效数据(null值)
- const resources = this.convertResourceData(pageData.records).filter(item => item !== null && item !== undefined)
- console.log('转换后资源数量:', resources.length)
-
- // 如果是第一页,直接替换;否则追加
- if (pageNum === 1) {
- this.registeredResources = resources
- } else {
- this.registeredResources = [...this.registeredResources, ...resources]
- }
-
- // 更新总数(使用后端返回的total)
- this.registeredTotal = pageData.total || 0
- console.log('资源总数:', this.registeredTotal)
-
- } else {
- console.log('⚠️ pageData或records为空')
- if (pageNum === 1) {
- this.registeredResources = []
- this.registeredTotal = 0
- }
- }
- } else {
- console.log('❌ 响应状态异常:', res.statusCode, res.data)
- uni.showToast({
- title: res.data?.message || '加载失败',
- icon: 'none'
- })
- }
- } catch (e) {
- console.log('❌ 加载资源异常:', e)
- if (this.registeredPageNum === 1) {
- this.registeredResources = []
- }
- } finally {
- this.registeredLoading = false
- }
- },
- // 加载线索指定页数据(从后端加载,使用isUser参数过滤未注册用户)
- async loadUnregisteredPage(pageNum) {
- if (this.unregisteredLoading) {
- return
- }
-
- this.unregisteredLoading = true
- this.unregisteredPageNum = pageNum
-
- try {
- // 获取当前登录用户ID
- const userInfo = uni.getStorageSync('userInfo') || {}
- const userId = uni.getStorageSync('userId')
- let currentUserId = userInfo.userId || userId || null
-
- console.log('=== loadUnregisteredPage 调试信息 ===')
- console.log('userInfo:', JSON.stringify(userInfo))
- console.log('userId from storage:', userId)
- console.log('currentUserId:', currentUserId)
-
- if (currentUserId !== null && currentUserId !== undefined) {
- currentUserId = parseInt(currentUserId)
- if (isNaN(currentUserId) || currentUserId <= 0) {
- currentUserId = null
- }
- }
-
- if (!currentUserId) {
- console.log('❌ 未获取到有效的用户ID,无法加载线索')
- this.unregisteredResources = []
- this.unregisteredLoading = false
- return
- }
-
- const baseUrl = 'https://api.zhongruanke.cn/api'
-
- // 构建查询参数,使用isUser=0参数只获取未注册用户(线索)
- let url = `${baseUrl}/my-resource/list?currentUserId=${currentUserId}&pageNum=${pageNum}&pageSize=${this.unregisteredPageSize}&isUser=0`
- if (this.searchKeyword && this.searchKeyword.trim()) {
- url += `&keyword=${encodeURIComponent(this.searchKeyword.trim())}`
- }
-
- console.log('请求URL:', url)
-
- const [error, res] = await uni.request({
- url: url,
- method: 'GET',
- timeout: 15000
- })
-
- console.log('请求结果 - error:', error)
- console.log('请求结果 - res.statusCode:', res ? res.statusCode : 'null')
-
- if (error) {
- console.log('❌ 请求失败:', JSON.stringify(error))
- uni.showToast({
- title: '网络请求失败',
- icon: 'none'
- })
- this.unregisteredResources = []
- this.unregisteredLoading = false
- return
- }
-
- if (res.statusCode === 200 && res.data && res.data.code === 200) {
- const pageData = res.data.data
- console.log('pageData:', JSON.stringify(pageData))
-
- if (pageData && pageData.records) {
- console.log('records数量:', pageData.records.length)
- // 转换数据格式,并过滤掉无效数据(null值)
- const resources = this.convertResourceData(pageData.records).filter(item => item !== null && item !== undefined)
- console.log('转换后线索数量:', resources.length)
-
- // 如果是第一页,直接替换;否则追加
- if (pageNum === 1) {
- this.unregisteredResources = resources
- } else {
- this.unregisteredResources = [...this.unregisteredResources, ...resources]
- }
-
- // 更新总数(使用后端返回的total)
- this.unregisteredTotal = pageData.total || 0
- console.log('线索总数:', this.unregisteredTotal)
-
- } else {
- console.log('⚠️ pageData或records为空')
- if (pageNum === 1) {
- this.unregisteredResources = []
- this.unregisteredTotal = 0
- }
- }
- } else {
- console.log('❌ 响应状态异常:', res.statusCode, res.data)
- }
- } catch (e) {
- console.log('❌ 加载线索异常:', e)
- if (this.unregisteredPageNum === 1) {
- this.unregisteredResources = []
- }
- } finally {
- this.unregisteredLoading = false
- }
- },
- // 加载更多资源(从后端分页加载)
- async loadMoreRegistered() {
- if (this.registeredLoading) return
- // 如果已加载的数据已经达到或超过估算的总数,不再加载
- if (this.registeredResources.length >= this.registeredTotal && this.registeredTotal > 0) return
-
- this.registeredPageNum++
- await this.loadRegisteredPage(this.registeredPageNum)
- },
- // 加载更多线索(从后端分页加载)
- async loadMoreUnregistered() {
- if (this.unregisteredLoading) return
- // 如果已加载的数据已经达到或超过估算的总数,不再加载
- if (this.unregisteredResources.length >= this.unregisteredTotal && this.unregisteredTotal > 0) return
-
- this.unregisteredPageNum++
- await this.loadUnregisteredPage(this.unregisteredPageNum)
- },
- // 转换资源数据格式(提取公共方法)
- convertResourceData(records) {
- return records.map(item => {
- let requirement = item.mateSelectionCriteria || item.mate_selection_criteria || ''
- if (requirement) {
- requirement = requirement.trim()
- }
-
- const labels = []
- if (item.constellation) {
- labels.push(item.constellation)
- }
- if (item.occupation) {
- labels.push(item.occupation)
- }
-
- let avatarUrl = item.avatarUrl || item.avatar_url || item.avatar || ''
- if (!avatarUrl || avatarUrl.trim() === '' || avatarUrl === 'null' || avatarUrl === null || avatarUrl === undefined) {
- avatarUrl = ''
- } else {
- avatarUrl = avatarUrl.trim()
- }
-
- let resourceId = item.resourceId || item.resource_id
- if (resourceId === null || resourceId === undefined || resourceId === 'undefined' || resourceId === 'null') {
- return null
- }
- resourceId = parseInt(resourceId)
- if (isNaN(resourceId) || resourceId <= 0) {
- return null
- }
-
- let isUser = item.isUser !== null && item.isUser !== undefined ? item.isUser :
- (item.is_user !== null && item.is_user !== undefined ? item.is_user : 0)
- isUser = parseInt(isUser) || 0
-
- let userId = item.userId !== null && item.userId !== undefined ? item.userId :
- (item.user_id !== null && item.user_id !== undefined ? item.user_id : null)
- if (userId !== null && userId !== undefined) {
- userId = parseInt(userId)
- if (isNaN(userId) || userId <= 0) {
- userId = null
- }
- }
-
- let isMatch = item.isMatch !== null && item.isMatch !== undefined ? item.isMatch :
- (item.is_match !== null && item.is_match !== undefined ? item.is_match : 0)
- isMatch = parseInt(isMatch) || 0
-
- let resourceTags = []
- if (item.tags && Array.isArray(item.tags) && item.tags.length > 0) {
- resourceTags = item.tags
- } else if (labels && labels.length > 0) {
- resourceTags = labels
- }
-
- return {
- id: resourceId,
- resourceId: resourceId,
- resource_id: resourceId,
- avatar: avatarUrl,
- name: item.name || '',
- gender: item.gender === 1 ? '男' : item.gender === 2 ? '女' : '未知',
- status: item.status !== undefined && item.status !== null ? item.status : 0,
- rejectReason: item.rejectReason || item.reject_reason || '',
- isUser: isUser,
- userId: userId,
- isMatch: isMatch,
- isPlus: false,
- labels: resourceTags,
- requirement: requirement || '暂无要求',
- contact: item.phone ? item.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') : '',
- originalPhone: item.phone || '',
- isQuality: false
- }
- }).filter(item => item !== null)
- },
- // 加载我的资源数据(改为分页加载)
- async loadMyResources() {
- try {
- // 重置分页
- this.registeredPageNum = 1
- this.unregisteredPageNum = 1
- // 同时加载资源和线索,进入页面即可两端都查询完毕
- await Promise.all([
- this.loadRegisteredPage(1),
- this.loadUnregisteredPage(1)
- ])
- } catch (e) {
-
- }
- },
- // 搜索
- async handleSearch() {
- // 重置分页到第一页
- this.registeredPageNum = 1
- this.unregisteredPageNum = 1
- // 重新加载资源数据,包含搜索关键词
- await this.loadMyResources()
- },
- // 删除资源
- async handleDelete(id) {
- // 如果id无效,尝试从当前资源列表中查找
- if (id === null || id === undefined || id === 'undefined' || id === 'null' || id === '') {
-
- // 尝试从当前显示的资源中找到对应的资源
- const allDisplayData = this.currentTab === 'resource'
- ? this.getRegisteredDisplayData
- : this.getUnregisteredDisplayData
-
- // 如果仍然找不到,显示错误
-
- uni.showToast({
- title: '资源ID无效,无法删除',
- icon: 'none'
- })
- return
- }
-
- // 确保id是有效的整数
- let resourceId = parseInt(id)
- if (isNaN(resourceId) || resourceId <= 0) {
- // 如果解析失败,尝试从字符串中提取数字
- const match = String(id).match(/\d+/)
- if (match) {
- resourceId = parseInt(match[0])
- }
-
- if (isNaN(resourceId) || resourceId <= 0) {
-
- uni.showToast({
- title: '资源ID格式错误,无法删除',
- icon: 'none'
- })
- return
- }
- }
-
-
-
- uni.showModal({
- title: '删除确认',
- content: '确定要删除该资源吗?',
- success: async (res) => {
- if (res.confirm) {
- try {
- uni.showLoading({
- title: '删除中...'
- })
-
- const baseUrl = 'https://api.zhongruanke.cn/api'
-
- const [error, deleteRes] = await uni.request({
- url: `${baseUrl}/my-resource/delete/${resourceId}`,
- method: 'DELETE'
- })
-
- uni.hideLoading()
-
- if (error) {
-
- uni.showToast({
- title: '删除失败',
- icon: 'none'
- })
- return
- }
-
- if (deleteRes.statusCode === 200 && deleteRes.data && deleteRes.data.code === 200) {
- uni.showToast({
- title: '删除成功',
- icon: 'success'
- })
-
- // 删除成功后刷新资源列表
- await this.loadMyResources()
- } else {
- uni.showToast({
- title: deleteRes.data.message || '删除失败',
- icon: 'none'
- })
- }
- } catch (e) {
- uni.hideLoading()
-
- uni.showToast({
- title: '删除失败,请稍后重试',
- icon: 'none'
- })
- }
- }
- }
- })
- },
- // 精准匹配
- // 编辑资源
- handleEdit(id) {
- // 跳转到资源录入页面(编辑模式),传递资源ID
- uni.navigateTo({
- url: `/pages/matchmaker-workbench/resource-input?resourceId=${id}`,
- success: () => {
-
- },
- fail: (err) => {
-
- uni.showToast({
- title: '跳转失败',
- icon: 'none'
- })
- }
- })
- },
- handleMatch(id) {
- // 查找资源项
- const allResources = [...this.registeredResources, ...this.unregisteredResources]
- const resource = allResources.find(item => item.id === id)
-
- if (!resource) {
- uni.showToast({
- title: '资源不存在',
- icon: 'none'
- })
- return
- }
-
- // 检查用户是否已注册(isUser === 1 且 userId !== null)
- if (resource.isUser !== 1 || resource.userId === null || resource.userId === undefined) {
- uni.showToast({
- title: '该用户还未注册用户端,注册之后才能进行匹配',
- icon: 'none',
- duration: 3000
- })
- return
- }
-
- // 已注册用户,跳转到精准匹配页面
-
- uni.navigateTo({
- url: `/pages/matchmaker-workbench/precise-match?resourceId=${id}`
- })
- },
- // 复制联系方式
- handleCopyContact(contact) {
- if (!contact) {
- uni.showToast({
- title: '联系方式为空',
- icon: 'none'
- })
- return
- }
-
- // 如果是脱敏的手机号,需要从原始数据中获取完整号码
- // 这里需要根据实际情况调整,可能需要从item中获取原始phone
- // 暂时先复制显示的文本
- uni.setClipboardData({
- data: contact,
- success: () => {
- uni.showToast({
- title: '已复制到剪贴板',
- icon: 'success'
- })
- },
- fail: () => {
- uni.showToast({
- title: '复制失败',
- icon: 'none'
- })
- }
- })
- },
- // 客户点击事件,跳转到客户详情页面
- handleClientClick(id) {
- uni.navigateTo({
- url: `/pages/matchmaker-workbench/client-detail?resourceId=${id}`
- })
- },
- // 资源项点击事件(安全包装方法)
- handleResourceClickSafe(item, index) {
- // 如果 item 无效,尝试从数组中获取
- if (!item || item === null || item === undefined) {
-
- const dataArray = this.currentTab === 'resource' ? this.getRegisteredDisplayData : this.getUnregisteredDisplayData
- if (dataArray && Array.isArray(dataArray) && index >= 0 && index < dataArray.length) {
- item = dataArray[index]
- }
- }
-
- // 如果仍然无效,直接返回
- if (!item || item === null || item === undefined) {
- return
- }
-
- // 调用实际的点击处理方法
- this.handleResourceClick(item)
- },
- // 资源项点击事件
- handleResourceClick(item) {
- // 检查 item 是否存在
- if (!item || item === null || item === undefined) {
-
- return
- }
-
-
-
- // 检查 item.id 是否存在
- if (!item.id && item.id !== 0) {
-
- uni.showToast({
- title: '资源ID无效',
- icon: 'none',
- duration: 2000
- })
- return
- }
-
- // 判断是否为已注册用户(isUser === 1 且 userId !== null)
- if (item.isUser === 1 && item.userId !== null && item.userId !== undefined) {
- // 已注册,跳转到客户详情页面
- const resourceId = item.id
-
- uni.navigateTo({
- url: `/pages/matchmaker-workbench/client-detail?resourceId=${resourceId}`,
- success: () => {
-
- },
- fail: (err) => {
-
- uni.showToast({
- title: '跳转失败,请重试',
- icon: 'none'
- })
- }
- })
- } else {
- // 未注册,提示用户
- uni.showToast({
- title: '该用户还未注册用户端',
- icon: 'none',
- duration: 2000
- })
- }
- },
- // 添加资源
- handleAdd() {
- // 跳转到信息录入页面
- uni.navigateTo({
- url: '/pages/matchmaker-workbench/resource-input',
- success: () => {
-
- },
- fail: (err) => {
-
- uni.showToast({
- title: '页面跳转失败',
- icon: 'none'
- })
- }
- })
- },
- // 导航到工作台
- navigateToWorkbench() {
- uni.navigateTo({
- url: '/pages/matchmaker-workbench/index'
- })
- },
- // 导航到我的资源
- navigateToMyResources() {
- // 已在我的资源页面,无需跳转
- },
- // 导航到排行榜
- navigateToRanking() {
- uni.navigateTo({
- url: '/pages/matchmaker-workbench/ranking'
- })
- },
- // 导航到消息
- navigateToMessage() {
- uni.navigateTo({
- url: '/pages/matchmaker-workbench/message'
- })
- },
- // 导航到我的
- navigateToMine() {
- uni.navigateTo({
- url: '/pages/matchmaker-workbench/mine'
- })
- },
- // 启动自动刷新
- startAutoRefresh() {
- // 清除之前的定时器
- this.stopAutoRefresh()
- // 每30秒刷新一次,检查用户注册状态变化
- this.refreshTimer = setInterval(async () => {
-
- // 先批量检查并更新线索用户的注册状态
- await this.batchCheckClueRegistrationStatus()
- // 然后刷新资源列表
- await this.loadMyResources()
- }, 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) {
-
- return
- }
-
- // 确保matchmakerId是有效的整数
- matchmakerId = parseInt(matchmakerId)
- if (isNaN(matchmakerId) || matchmakerId <= 0) {
-
- return
- }
-
- const baseUrl = 'https://api.zhongruanke.cn/api'
-
-
-
- const [error, res] = await uni.request({
- url: `${baseUrl}/my-resource/batch-check-clue-registration`,
- method: 'POST',
- data: {
- matchmakerId: matchmakerId
- }
- })
-
- if (error) {
-
- return
- }
-
- if (res.statusCode === 200 && res.data && res.data.code === 200) {
- const updateCount = res.data.data?.updateCount || 0
-
- }
- } catch (e) {
-
- }
- },
- // 停止自动刷新
- stopAutoRefresh() {
- if (this.refreshTimer) {
- clearInterval(this.refreshTimer)
- this.refreshTimer = null
- }
- },
- // 已注册资源图片加载错误处理
- handleImageErrorRegistered(index) {
- this.handleImageError(index, 'registered')
- },
- // 未注册资源图片加载错误处理
- handleImageErrorUnregistered(index) {
- this.handleImageError(index, 'unregistered')
- },
- // 已注册资源图片加载成功处理
- handleImageLoadRegistered(index) {
- this.handleImageLoad(index, 'registered')
- },
- // 未注册资源图片加载成功处理
- handleImageLoadUnregistered(index) {
- this.handleImageLoad(index, 'unregistered')
- },
- // 图片加载错误处理(内部方法)
- handleImageError(index, type) {
- try {
- // 获取当前显示的数据
- const displayData = type === 'registered' ? this.getRegisteredDisplayData : this.getUnregisteredDisplayData
- const resource = displayData && displayData[index]
- if (!resource) {
-
- return
- }
-
- const originalUrl = resource.avatar
- const resourceId = resource.id
-
-
-
- if (originalUrl &&
- originalUrl.trim() !== '' &&
- !originalUrl.includes('placeholder') &&
- !originalUrl.includes('default') &&
- !originalUrl.includes('via.placeholder')) {
-
- if (type === 'registered') {
-
- const displayListIndex = this.registeredResources.findIndex(item => item.id === resourceId)
- if (displayListIndex !== -1) {
- this.$set(this.registeredResources[displayListIndex], 'avatar', '')
- }
- } else {
-
- const displayListIndex = this.unregisteredResources.findIndex(item => item.id === resourceId)
- if (displayListIndex !== -1) {
- this.$set(this.unregisteredResources[displayListIndex], 'avatar', '')
- }
- }
- }
- } catch (e) {
-
- }
- },
- // 图片加载成功处理(内部方法)
- handleImageLoad(index, type) {
- try {
- // 获取当前显示的数据
- const displayData = type === 'registered' ? this.getRegisteredDisplayData : this.getUnregisteredDisplayData
- if (displayData && displayData[index]) {
-
- }
- } catch (e) {
-
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .my-resources {
- min-height: 100vh;
- background: #F5F5F5;
- display: flex;
- flex-direction: column;
- }
- /* 顶部导航栏 */
- .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx 30rpx;
- // padding-top: calc(20rpx + env(safe-area-inset-top));
- background: #FFFFFF;
- border-bottom: 1rpx solid #F0F0F0;
- .header-left {
- width: 40rpx; // 固定宽度,避免挤压标题
- }
- // 新增:返回按钮样式
- .back-icon {
- font-size: 36rpx;
- color: #9C27B0; // 和标题颜色统一
- font-weight: bold;
- }
- .header-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #9C27B0;
- flex: 1; // 让标题占中间剩余空间,实现居中
- text-align: center;
- }
- .header-right {
- .dropdown-arrow {
- font-size: 24rpx;
- color: #9C27B0;
- font-weight: normal;
- }
- }
- }
- /* 资源/线索切换标签 */
- .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 {
- padding: 20rpx;
- background: #F5F5F5;
- .search-input-wrapper {
- display: flex;
- align-items: center;
- background: #FFFFFF;
- border-radius: 30rpx;
- padding: 12rpx 20rpx;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
- .search-icon-small {
- width: 32rpx;
- height: 32rpx;
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
- margin-right: 15rpx;
- }
- .search-input {
- flex: 1;
- font-size: 28rpx;
- color: #333;
- border: none;
- outline: none;
- background: transparent;
- &::placeholder {
- color: #999;
- }
- }
- }
- }
- .content {
- flex: 1;
- height: 0; /* 配合 flex: 1 使用,确保 scroll-view 有明确高度 */
- padding: 0 20rpx 140rpx;
- box-sizing: border-box;
- }
- /* 资源分组 */
- .resource-section {
- margin-bottom: 30rpx;
- min-height: calc(50vh - 100rpx); /* 确保至少占半屏高度 */
- display: flex;
- flex-direction: column;
-
- .section-header {
- display: flex;
- align-items: center;
- padding: 20rpx 0 15rpx;
- margin-bottom: 10rpx;
- flex-shrink: 0;
-
- .section-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #9C27B0;
- margin-right: 10rpx;
- }
-
- .section-count {
- font-size: 26rpx;
- color: #999;
- font-weight: normal;
- }
- }
-
- /* 资源列表容器,确保有固定高度 */
- .resource-list-container {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: calc(50vh - 200rpx);
- }
- }
-
- /* 加载更多提示 */
- .load-more-tip {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 30rpx 0;
-
- .load-more-text {
- font-size: 26rpx;
- color: #999;
- }
- }
-
- /* 没有更多数据提示 */
- .no-more-tip {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 30rpx 0;
-
- .no-more-text {
- font-size: 26rpx;
- color: #999;
- }
- }
- /* 空状态 */
- .empty-state {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 100rpx 0;
-
- .empty-text {
- font-size: 28rpx;
- color: #999;
- }
- }
- /* 资源列表 */
- .resource-item {
- background: #FFFFFF;
- border-radius: 20rpx;
- margin-bottom: 20rpx;
- padding: 25rpx;
- position: relative;
- box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
- /* 右上角选中图标 */
- .select-icon {
- position: absolute;
- top: 20rpx;
- right: 120rpx; /* 左移,为编辑按钮留出空间 */
- width: 40rpx;
- height: 40rpx;
- background: #FF4444;
- color: #FFFFFF;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 24rpx;
- font-weight: bold;
- z-index: 10;
- }
-
- .edit-icon {
- position: absolute;
- top: 20rpx;
- right: 20rpx;
- padding: 8rpx 20rpx;
- background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 10;
- box-shadow: 0 2rpx 8rpx rgba(156, 39, 176, 0.3);
-
- .edit-text {
- color: #FFFFFF;
- font-size: 24rpx;
- font-weight: 500;
- }
- }
- .resource-header {
- display: flex;
- align-items: flex-start;
- margin-bottom: 20rpx;
- padding-right: 50rpx;
- .resource-avatar {
- width: 100rpx;
- height: 100rpx;
- border-radius: 8rpx;
- margin-right: 20rpx;
- flex-shrink: 0;
- background-color: #F5F5F5;
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23CCCCCC"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
- background-size: 60% 60%;
- background-position: center;
- background-repeat: no-repeat;
- }
- .resource-basic-info {
- flex: 1;
- min-width: 0;
- .name-gender {
- display: flex;
- align-items: center;
- gap: 10rpx;
- margin-bottom: 12rpx;
- .resource-name {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .resource-gender {
- font-size: 26rpx;
- color: #666;
-
- &.gender-tag {
- display: inline-block;
- padding: 4rpx 12rpx;
- background: #F3E5F5;
- color: #9C27B0;
- border-radius: 12rpx;
- font-size: 22rpx;
- font-weight: 500;
- }
- }
- }
- .status-tag-wrapper {
- display: flex;
- align-items: center;
- .status-tag {
- display: inline-block;
- padding: 4rpx 12rpx;
- border-radius: 12rpx;
- font-size: 22rpx;
- font-weight: 500;
- margin-right: 8rpx;
- &.approved {
- background: #E3F2FD;
- color: #2196F3;
- }
- &.pending {
- background: #FFF3E0;
- color: #FF9800;
- }
-
- &.register-tag {
- &.registered {
- background: #E8F5E9;
- color: #4CAF50;
- }
-
- &.unregistered {
- background: #FCE4EC;
- color: #E91E63;
- }
- }
-
- &.match-tag {
- margin-left: 10rpx;
-
- &.matched {
- background: #E3F2FD;
- color: #2196F3;
- }
-
- &.unmatched {
- background: #FFF3E0;
- 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;
- }
- }
- }
- }
- }
- }
- .resource-details {
- .labels {
- display: flex;
- flex-wrap: wrap;
- gap: 10rpx;
- margin-bottom: 15rpx;
- .label {
- display: inline-block;
- padding: 6rpx 14rpx;
- background: #F3E5F5;
- color: #9C27B0;
- border-radius: 15rpx;
- font-size: 22rpx;
- font-weight: 500;
- }
- }
- .requirement-box {
- background: #F3E5F5;
- border-radius: 12rpx;
- padding: 16rpx 20rpx;
- margin-bottom: 15rpx;
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- .requirement-label {
- font-size: 28rpx;
- color: #7B1FA2;
- font-weight: 500;
- margin-right: 8rpx;
- white-space: nowrap;
- }
- .requirement-content {
- font-size: 28rpx;
- color: #7B1FA2;
- font-weight: 400;
- }
- }
- .contact-box {
- margin-bottom: 20rpx;
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- .contact-label {
- font-size: 26rpx;
- color: #333;
- font-weight: 500;
- margin-right: 10rpx;
- white-space: nowrap;
- }
- .contact-number {
- flex: 1;
- font-size: 26rpx;
- color: #333;
- font-weight: 400;
- min-width: 0;
- }
- .copy-btn {
- font-size: 24rpx;
- color: #9C27B0;
- font-weight: 500;
- margin-left: 15rpx;
- white-space: nowrap;
- cursor: pointer;
- }
- }
- .action-buttons {
- display: flex;
- justify-content: space-between;
- align-items: center;
- gap: 15rpx;
- .delete-btn {
- flex: 1;
- padding: 14rpx 0;
- background: #FFEBEE;
- color: #E91E63;
- border-radius: 25rpx;
- font-size: 26rpx;
- font-weight: 500;
- text-align: center;
- }
- .match-btn {
- flex: 1.5;
- padding: 14rpx 0;
- background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
- color: #FFFFFF;
- border-radius: 25rpx;
- font-size: 26rpx;
- font-weight: 500;
- text-align: center;
- }
- }
- }
- /* 优质资源标签 */
- .quality-tag {
- position: absolute;
- top: 80rpx;
- right: 20rpx;
- background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
- color: #FFFFFF;
- font-size: 22rpx;
- font-weight: bold;
- padding: 8rpx 16rpx;
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- gap: 4rpx;
- box-shadow: 0 2rpx 8rpx rgba(156, 39, 176, 0.3);
- z-index: 5;
- .quality-star {
- font-size: 20rpx;
- }
- .quality-text {
- font-size: 22rpx;
- }
- }
- }
- /* 审核未通过原因 */
- .reject-reason {
- margin-top: 12rpx;
- padding: 14rpx 16rpx;
- background: #FFF3E0;
- border: 1rpx solid #FFCC80;
- border-radius: 10rpx;
- color: #E65100;
- font-size: 24rpx;
- line-height: 1.5;
- }
- /* 添加按钮 */
- .add-button {
- position: fixed;
- bottom: 200rpx;
- right: 40rpx;
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 4rpx 20rpx rgba(156, 39, 176, 0.4);
- z-index: 999;
- .add-button-icon {
- font-size: 60rpx;
- color: #FFFFFF;
- line-height: 1;
- font-weight: bold;
- }
- }
- /* 底部导航 */
- .tabbar {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- height: 100rpx;
- background: #FFFFFF;
- border-top: 1rpx solid #F0F0F0;
- display: flex;
- justify-content: space-around;
- align-items: center;
- padding-bottom: env(safe-area-inset-bottom);
- .tabbar-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 8rpx;
- padding: 10rpx 0;
- .tabbar-icon {
- width: 44rpx;
- height: 44rpx;
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
- position: relative;
- .badge {
- position: absolute;
- top: -8rpx;
- right: -8rpx;
- background: #FF4444;
- color: #FFFFFF;
- font-size: 20rpx;
- font-weight: bold;
- width: 32rpx;
- height: 32rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 16rpx;
- }
- }
- .tabbar-text {
- font-size: 20rpx;
- color: #999;
- }
- &.active {
- .tabbar-text {
- color: #9C27B0;
- font-weight: bold;
- }
- }
- &.home .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
- }
- &.active.home .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
- }
- &.resources .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
- }
- &.active.resources .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
- }
- &.trophy .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
- }
- &.active.trophy .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
- }
- &.message .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
- }
- &.active.message .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
- }
- &.mine .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
- }
- &.active.mine .tabbar-icon {
- background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
- }
- }
- }
- </style>
|