Parcourir la source

feat: 添加ICP备案号 + 动态版本号 + 隐藏开票状态

- 我的页面底部添加ICP备案号 粤ICP备2026097261号-1X
- 版本号改用 wx.getAccountInfoSync() 动态获取真实版本
- 隐藏我的页面「发票管理」菜单入口
- 隐藏订单列表和订单详情中的「未开票」状态标签

Co-Authored-By: Claude <noreply@anthropic.com>
skyline il y a 1 jour
Parent
commit
d8a339941d

+ 20 - 5
haha-mp/src/pages/my/my.vue

@@ -56,13 +56,14 @@
           <view class="menu-text">我的卡片</view>
           <view class="menu-arrow"></view>
         </view>
-        <view class="menu-item" @click="goToInvoice">
+        <!-- 发票管理暂时隐藏 -->
+        <!-- <view class="menu-item" @click="goToInvoice">
           <view class="menu-icon">
             <image class="menu-svg-icon" src="/static/icons/invoice.svg" mode="aspectFit"></image>
           </view>
           <view class="menu-text">发票管理</view>
           <view class="menu-arrow"></view>
-        </view>
+        </view> -->
       </view>
     </view>
 
@@ -107,6 +108,11 @@
     <view class="version-info">
       {{ appVersion }}
     </view>
+
+    <!-- ICP备案号 -->
+    <view class="icp-info">
+      粤ICP备2026097261号-1X
+    </view>
   </view>
 </template>
 
@@ -117,12 +123,12 @@ import { logout as logoutApi } from '../../api/user';
 import { getCouponCount } from '../../api/coupon';
 import { clearAuth, getUserInfo as getStoredUserInfo } from '../../utils/auth';
 import { logger } from '../../utils/logger';
-import { APP_VERSION } from '../../utils/config';
+import { getAppVersion } from '../../utils/config';
 import type { UserInfo } from '../../api/user';
 
 const userInfo = ref<UserInfo | null>(null);
 const availableCouponCount = ref(0);
-const appVersion = APP_VERSION;
+const appVersion = getAppVersion();
 
 // 显示手机号(脱敏)
 const displayPhone = computed(() => {
@@ -454,7 +460,16 @@ const handleLogout = () => {
   text-align: center;
   font-size: 22rpx;
   color: $color-text-tertiary;
-  padding: $spacing-lg 0;
+  padding: $spacing-lg 0 0;
+  animation: fadeIn 0.4s ease;
+}
+
+/* ========== ICP备案号 ========== */
+.icp-info {
+  text-align: center;
+  font-size: 20rpx;
+  color: $color-text-tertiary;
+  padding: $spacing-xs 0 $spacing-lg;
   animation: fadeIn 0.4s ease;
 }
 </style>

+ 2 - 1
haha-mp/src/pages/orderDetail/orderDetail.vue

@@ -15,7 +15,8 @@
           </view>
           <text class="status-text">{{ order.statusText || getStatusText(order.status) }}</text>
         </view>
-        <text class="invoice-status">未开票</text>
+        <!-- 开票状态暂时隐藏 -->
+        <!-- <text class="invoice-status">未开票</text> -->
       </view>
 
       <!-- 订单明细 -->

+ 2 - 1
haha-mp/src/pages/orders/orders.vue

@@ -22,7 +22,8 @@
         <view class="order-header">
           <view class="time-invoice-container">
             <text class="order-time">{{ order.createTime }}</text>
-            <text class="invoice-status">未开票</text>
+            <!-- 开票状态暂时隐藏 -->
+            <!-- <text class="invoice-status">未开票</text> -->
           </view>
           <text :class="['order-status', order.status]">{{ getStatusText(order.status) }}</text>
         </view>

+ 23 - 2
haha-mp/src/utils/config.ts

@@ -9,8 +9,29 @@ const isDevelopment = import.meta.env.DEV || false;
 /** 客服电话 */
 export const CUSTOMER_SERVICE_PHONE = '400-0755-315';
 
-/** 应用版本号(与 package.json 同步) */
-export const APP_VERSION = 'v1.62.11';
+/** 获取小程序真实版本号 */
+export const getAppVersion = (): string => {
+  try {
+    // #ifdef MP-WEIXIN
+    const accountInfo = wx.getAccountInfoSync();
+    const { version, envVersion } = accountInfo.miniProgram;
+    if (envVersion === 'release') {
+      return `v${version}`;
+    }
+    if (envVersion === 'trial') {
+      return '体验版';
+    }
+    return '开发版';
+    // #endif
+  } catch {
+    // 非微信小程序环境或调用失败时回退
+    return 'v1.0.0';
+  }
+  // 非微信小程序编译目标时回退
+  // #ifndef MP-WEIXIN
+  return 'v1.0.0';
+  // #endif
+};
 
 export const API_CONFIG = {
   // 后端API基础URL