chore:改了头像的地址

This commit is contained in:
2026-04-20 15:44:58 +08:00
parent 7675e8e04d
commit d8b78168a8
4 changed files with 25 additions and 11 deletions

View File

@@ -2,6 +2,8 @@
* 客服统一处理服务
* 整合各种客服方式,提供统一的调用接口
*/
import IMAGE_CONFIG from './image-config.js';
export class CustomerService {
constructor(vueInstance, externalConfig = null) {
this.vm = vueInstance;
@@ -473,7 +475,7 @@ export class CustomerService {
// 优先使用指定的智能客服头像
if (config?.type === 'aikefu' || config?.type === 'wxwork' || config?.type === 'qyweixin') {
return '/static/images/image_680328925892268.png';
return this.vm.$util.img(IMAGE_CONFIG.aiAvatar);
}
return shopInfo.kefuimg || this.vm.$util?.getDefaultImage()?.kefu || '';

View File

@@ -4,7 +4,7 @@
<view class="goods-container">
<!-- AI客服悬浮按钮 -->
<view class="ai-chat-float-btn" @tap.stop="$emit('aiChatClick')" v-if="goodsSkuDetail">
<image src="/static/images/image_680328925892268.png" mode="aspectFill" class="ai-avatar-icon" />
<image :src="aiAvatarUrl" mode="aspectFill" class="ai-avatar-icon" />
</view>
<!-- 弹幕 -->
@@ -463,6 +463,7 @@
// 商品详情视图
import scroll from '@/common/js/scroll-view.js';
import detail from './detail.js';
import IMAGE_CONFIG from '@/common/js/image-config.js';
import pengpaiFadeinOut from '../pengpai-fadein-out/pengpai-fadein-out.vue';
@@ -479,6 +480,11 @@ export default {
components: {
pengpaiFadeinOut
},
computed: {
aiAvatarUrl() {
return this.$util.img(IMAGE_CONFIG.aiAvatar);
}
},
mixins: [scroll, detail]
};
</script>

View File

@@ -353,6 +353,7 @@
</template>
<script>
import aiService from '@/common/js/ai-service.js'
import IMAGE_CONFIG from '@/common/js/image-config.js'
export default {
name: 'ai-chat-message',
@@ -411,20 +412,13 @@ export default {
streamInterval: null,
streamContent: '',
isStreaming: false,
// 固定AI头像
aiAvatar: '/static/images/image_680328925892268.png',
// 本地用户头像(优先使用缓存,无缓存则用默认图)
localUserAvatar: '',
// 默认头像路径
defaultAvatar: '/static/images/user-avatar.png',
showAvatarSelector: false, // 头像选择弹窗控制
localUserNickname: '', // 当前用户昵称
defaultNickname: '我', // 默认昵称
showNicknameEditor: false, // 昵称编辑弹窗控制
tempNickname: '', // 昵称编辑临时值
// 1. 使用图片URL:设置为图片链接字符串
// 2. 使用emoji:设置为空字符串或null,将显示默认的🤖
aiAvatarUrl: '/static/images/image_680328925892268.png',
// AI头像错误状态
avatarError: false,
@@ -439,6 +433,17 @@ export default {
historyOffset: 0,
isFetchingHistory: false
}
},
computed: {
aiAvatar() {
return this.$util.img(IMAGE_CONFIG.aiAvatar);
},
defaultAvatar() {
return this.$util.img(IMAGE_CONFIG.userAvatar);
},
aiAvatarUrl() {
return this.$util.img(IMAGE_CONFIG.aiAvatar);
}
},
onShow() {
// 如果不是 AI 客服,立即退出并跳转

View File

@@ -79,6 +79,7 @@ import { mapGetters, mapMutations } from 'vuex'
import navigationHelper from '@/common/js/navigation';
import { EventSafety } from '@/common/js/event-safety';
import aiChatMessage from './ai-chat-message.vue';
import IMAGE_CONFIG from '@/common/js/image-config.js';
export default {
components: {
@@ -121,10 +122,10 @@ export default {
/// ---- 关于AI客服的配置,支持远程配置 ----
userAvatar() {
return this.globalAIKefuConfig?.userAvatar || '/static/images/user-avatar.png'
return this.globalAIKefuConfig?.userAvatar || this.$util.img(IMAGE_CONFIG.userAvatar)
},
aiAvatar() {
return this.globalAIKefuConfig?.aiAvatar || '/static/images/ai-avatar.png'
return this.globalAIKefuConfig?.aiAvatar || this.$util.img(IMAGE_CONFIG.aiAvatar)
},
/// ---- others ----
containerHeight() {