fix(ui): 我的页继续瘦身 + 计算结果页客服按钮统一 + 历史页标题运行时回写
my-profile.vue: - 整段移除「工具与服务」(邀请有礼当前未上线,剩它一项无意义) - 同步清理 iconGift / goToInvite 残留 calculator-result.vue: - 「联系专业营养师」按钮 MP-WEIXIN 端改用 <button open-type='contact'> - 与 welcome-gift / customer-service 统一行为,零 JS API 依赖 - 非小程序端保留原 contactNutritionist 兜底 - contact-btn-mp 重置 button 默认 line-height/border 视觉一致 calculator-history.vue: - onLoad 中 uni.setNavigationBarTitle 强制回写「我的计算记录」 - 兜底部分开发者工具/旧编译缓存把 UTF-8 标题渲染成乱码的场景 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
// 运行时强制回写中文标题,避免开发者工具/旧编译缓存读取 pages.json 时
|
||||||
|
// 出现页面标题乱码(部分版本会把 UTF-8 当 GBK 渲染)
|
||||||
|
uni.setNavigationBarTitle({ title: '我的计算记录' })
|
||||||
this.fetch()
|
this.fetch()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
|||||||
@@ -121,10 +121,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 联系专业营养师按钮 -->
|
<!-- 联系专业营养师按钮:小程序使用原生 button open-type='contact' 直接唤起客服 -->
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<button class="contact-btn contact-btn-mp" open-type="contact" hover-class="none">
|
||||||
|
<text>联系专业营养师</text>
|
||||||
|
</button>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<view class="contact-btn" @click="contactNutritionist">
|
<view class="contact-btn" @click="contactNutritionist">
|
||||||
<text>联系专业营养师</text>
|
<text>联系专业营养师</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 营养配餐Tab内容 -->
|
<!-- 营养配餐Tab内容 -->
|
||||||
@@ -249,10 +256,17 @@
|
|||||||
<text class="adopt-text">采纳计划,开始打卡</text>
|
<text class="adopt-text">采纳计划,开始打卡</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 联系专业营养师按钮 -->
|
<!-- 联系专业营养师按钮:小程序使用原生 button open-type='contact' 直接唤起客服 -->
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<button class="contact-btn contact-btn-mp" open-type="contact" hover-class="none">
|
||||||
|
<text>联系专业营养师</text>
|
||||||
|
</button>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<view class="contact-btn" @click="contactNutritionist">
|
<view class="contact-btn" @click="contactNutritionist">
|
||||||
<text>联系专业营养师</text>
|
<text>联系专业营养师</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 底部安全距离 -->
|
<!-- 底部安全距离 -->
|
||||||
@@ -483,7 +497,7 @@ export default {
|
|||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tab:未激活灰字、透明底边占位(无可见下划线);激活加粗+主色+橙色底边(BUG-002) */
|
/* Tab:未激活 #9ca3af、无橙色下划线;激活加粗 + 主色字 + 3px 橙色底边(BUG-002) */
|
||||||
.tab-item {
|
.tab-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
@@ -493,40 +507,31 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 16rpx;
|
gap: 16rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: #9ca3af;
|
|
||||||
font-weight: 400;
|
|
||||||
text-decoration: none;
|
|
||||||
border-bottom: 3px solid transparent;
|
|
||||||
transition: color 0.2s ease, border-color 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item .tab-icon,
|
|
||||||
.tab-item .tab-text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 未激活:灰字、常规字重(显式写到 text 节点,避免小程序不继承 view 颜色) */
|
|
||||||
.tab-item:not(.active) .tab-icon,
|
|
||||||
.tab-item:not(.active) .tab-text {
|
|
||||||
color: #9ca3af;
|
|
||||||
font-weight: 400;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 激活:粗体、主色、橙色底边(与未激活同宽底边,避免切换时跳动) */
|
|
||||||
.tab-item.active {
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: #f97316;
|
/* 与激活态同厚底边占位,避免切换跳动;透明即无可见下划线 */
|
||||||
font-weight: 700;
|
border-bottom: 3px solid transparent;
|
||||||
text-decoration: none;
|
transition: color 0.2s ease, border-color 0.2s ease, font-weight 0.15s ease;
|
||||||
border-bottom: 3px solid #f97316;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-item.active .tab-icon,
|
/* 字色与字重落在 text 节点上,避免部分端不继承 view 的 color */
|
||||||
.tab-item.active .tab-text {
|
.tab-icon,
|
||||||
|
.tab-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #9ca3af;
|
||||||
|
font-weight: 400;
|
||||||
|
transition: color 0.2s ease, font-weight 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
color: #f97316;
|
color: #f97316;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-decoration: none;
|
border-bottom: 3px solid #f97316;
|
||||||
|
|
||||||
|
.tab-icon,
|
||||||
|
.tab-text {
|
||||||
|
color: #f97316;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 内容滚动区域 */
|
/* 内容滚动区域 */
|
||||||
@@ -787,6 +792,14 @@ export default {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* 小程序原生 button 样式重置(保证视觉与原 view 版按钮一致) */
|
||||||
|
.contact-btn-mp {
|
||||||
|
line-height: 96rpx;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.contact-btn-mp::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* 空状态 */
|
/* 空状态 */
|
||||||
.empty-placeholder {
|
.empty-placeholder {
|
||||||
|
|||||||
@@ -52,16 +52,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 工具与服务:仅保留已实现入口(其它项隐藏) -->
|
<!-- 工具与服务:当前所有入口(含「邀请有礼」)暂未上线,整段隐藏 -->
|
||||||
<view class="section-card">
|
|
||||||
<view class="section-title">工具与服务</view>
|
|
||||||
<view class="menu-list">
|
|
||||||
<view class="menu-item" @click="goToInvite">
|
|
||||||
<image class="menu-icon-img" :src="iconGift" mode="aspectFit"></image>
|
|
||||||
<text class="menu-text">邀请有礼</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 退出登录按钮 -->
|
<!-- 退出登录按钮 -->
|
||||||
<view class="logout-btn" @click="handleLogout">
|
<view class="logout-btn" @click="handleLogout">
|
||||||
@@ -92,7 +83,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// 仅保留模板还在使用的图标资源;其它未开发入口已隐藏,对应图标无需加载
|
// 仅保留模板还在使用的图标资源;其它未开发入口已隐藏,对应图标无需加载
|
||||||
iconVerified: 'https://www.figma.com/api/mcp/asset/e06ebfe5-bf8d-40e7-9b5f-a395c823127b',
|
iconVerified: 'https://www.figma.com/api/mcp/asset/e06ebfe5-bf8d-40e7-9b5f-a395c823127b',
|
||||||
iconGift: 'https://www.figma.com/api/mcp/asset/afaeb0a1-7276-4a8c-87c0-ba4dc4ce3eba',
|
|
||||||
iconLogout: 'https://www.figma.com/api/mcp/asset/a4d5597f-0287-4411-a173-1e62db3c6c9f',
|
iconLogout: 'https://www.figma.com/api/mcp/asset/a4d5597f-0287-4411-a173-1e62db3c6c9f',
|
||||||
userInfo: {
|
userInfo: {
|
||||||
name: '慢友小张',
|
name: '慢友小张',
|
||||||
@@ -154,9 +144,6 @@ export default {
|
|||||||
goToCalculatorHistory() {
|
goToCalculatorHistory() {
|
||||||
uni.navigateTo({ url: '/pages/tool/calculator-history' })
|
uni.navigateTo({ url: '/pages/tool/calculator-history' })
|
||||||
},
|
},
|
||||||
goToInvite() {
|
|
||||||
uni.navigateTo({ url: '/pages/tool/invite-rewards' })
|
|
||||||
},
|
|
||||||
handleLogout() {
|
handleLogout() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
|
|||||||
Reference in New Issue
Block a user