|
|
@@ -13,35 +13,35 @@
|
|
|
<!-- 头部卡片 -->
|
|
|
<view class="header-card">
|
|
|
<view class="avatar-wrapper">
|
|
|
- <image :src="getAvatarUrl(matchmaker.avatarUrl)"
|
|
|
+ <image :src="getAvatarUrl(matchmaker.avatar_url)"
|
|
|
class="avatar"
|
|
|
mode="aspectFill"
|
|
|
- @error="handleImageError"
|
|
|
- @load="handleImageLoad">
|
|
|
+ @error="handleImageError(item)"
|
|
|
+ @load="handleImageLoad(item)">
|
|
|
</image>
|
|
|
<view class="avatar-placeholder" v-if="shouldShowPlaceholder()">
|
|
|
<text class="placeholder-icon">👤</text>
|
|
|
</view>
|
|
|
<view class="level-badge" :class="'level-' + (matchmaker.level || 1)">
|
|
|
- {{ matchmaker.levelName || '青铜红娘' }}
|
|
|
+ {{ matchmaker.level_name || '青铜红娘' }}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="basic-info">
|
|
|
<view class="name-row">
|
|
|
- <text class="name">{{ matchmaker.realName }}</text>
|
|
|
+ <text class="name">{{ matchmaker.real_name }}</text>
|
|
|
<view class="gender-icon">
|
|
|
{{ matchmaker.gender === 1 ? '♂' : '♀' }}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="type-tag" :class="matchmaker.matchmakerType === 2 ? 'formal' : 'parttime'">
|
|
|
- {{ matchmaker.typeName || '兼职红娘' }}
|
|
|
+ <view class="type-tag" :class="matchmaker.matchmaker_type === 2 ? 'formal' : 'parttime'">
|
|
|
+ {{ matchmaker.type_name || '兼职红娘' }}
|
|
|
</view>
|
|
|
|
|
|
<view class="stats-grid">
|
|
|
<view class="stats-item">
|
|
|
- <text class="stats-value">{{ matchmaker.successCouples || 0 }}</text>
|
|
|
+ <text class="stats-value">{{ matchmaker.success_couples || 0 }}</text>
|
|
|
<text class="stats-label">成功撮合</text>
|
|
|
</view>
|
|
|
<view class="stats-divider"></view>
|
|
|
@@ -88,13 +88,13 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 地址信息卡片 -->
|
|
|
- <view class="section-card" v-if="matchmaker.fullAddress">
|
|
|
+ <view class="section-card" v-if="matchmaker.full_address">
|
|
|
<view class="section-title">
|
|
|
<text class="title-icon">📍</text>
|
|
|
<text class="title-text">服务地区</text>
|
|
|
</view>
|
|
|
<view class="address-content">
|
|
|
- <text class="address-text">{{ matchmaker.fullAddress }}</text>
|
|
|
+ <text class="address-text">{{ matchmaker.full_address }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -142,7 +142,7 @@
|
|
|
<text class="title-text">成功案例</text>
|
|
|
</view>
|
|
|
<view class="success-tip">
|
|
|
- <text class="tip-text">已成功撮合 {{ matchmaker.successCouples || 0 }} 对佳偶</text>
|
|
|
+ <text class="tip-text">已成功撮合 {{ matchmaker.success_couples || 0 }} 对佳偶</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -235,6 +235,7 @@ export default {
|
|
|
|
|
|
try {
|
|
|
const result = await api.matchmaker.getDetail(this.matchmakerId)
|
|
|
+ console.log(result)
|
|
|
this.matchmaker = result
|
|
|
} catch (error) {
|
|
|
console.error('加载红娘详情失败:', error)
|
|
|
@@ -249,6 +250,20 @@ export default {
|
|
|
this.loading = false
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 图片加载成功处理
|
|
|
+ */
|
|
|
+ handleImageLoad(item) {
|
|
|
+ console.log(item)
|
|
|
+ // 防御性检查:确保item存在且是对象
|
|
|
+ if (!item || typeof item !== 'object') {
|
|
|
+ console.warn('handleImageLoad: item参数无效', item)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$set(item, 'imageLoadError', false)
|
|
|
+ this.$set(item, 'imageLoaded', true)
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取等级文本
|
|
|
@@ -327,23 +342,25 @@ export default {
|
|
|
shouldShowPlaceholder() {
|
|
|
if (!this.matchmaker) return false
|
|
|
// 如果没有头像URL,或头像加载失败,显示占位符
|
|
|
- return !this.matchmaker.avatarUrl || this.imageLoadError ||
|
|
|
- (this.matchmaker.avatarUrl && this.matchmaker.avatarUrl.includes('placeholder'))
|
|
|
+ return !this.matchmaker.avatar_url || this.imageLoadError ||
|
|
|
+ (this.matchmaker.avatar_url && this.matchmaker.avatar_url.includes('placeholder'))
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 图片加载成功处理
|
|
|
- */
|
|
|
- handleImageLoad() {
|
|
|
- this.imageLoadError = false
|
|
|
- },
|
|
|
|
|
|
/**
|
|
|
* 图片加载错误处理
|
|
|
*/
|
|
|
- handleImageError() {
|
|
|
- console.log('头像加载失败:', this.matchmaker?.realName, this.matchmaker?.avatarUrl)
|
|
|
- this.imageLoadError = true
|
|
|
+ handleImageError(item) {
|
|
|
+ console.log(item)
|
|
|
+ // 防御性检查:确保item存在且是对象
|
|
|
+ if (!item || typeof item !== 'object') {
|
|
|
+ console.warn('handleImageError: item参数无效', item)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('头像加载失败:', item.real_name, item.avatar_url)
|
|
|
+ this.$set(item, 'imageLoadError', true)
|
|
|
+ this.$set(item, 'imageLoaded', false)
|
|
|
},
|
|
|
|
|
|
/**
|