From a083681697e957ae4d41194df3c91afdae264281 Mon Sep 17 00:00:00 2001 From: tsui110 Date: Tue, 6 Jan 2026 13:02:51 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=B8=8A=E6=9E=B6=E6=8A=96=E9=9F=B3?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E5=90=84=E7=B1=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 17 +++++ components/custom-tab-bar-toutiao.vue | 93 +++++++++++++++++++++++ components/custom-tab-bar.vue | 105 ++++++++++++++++++++++++++ pages.json | 1 + pages/cabinet/index.vue | 15 ++++ pages/index/index.vue | 22 ++++++ pages/mine/index.vue | 44 +++++++++-- pages/shop/index.vue | 18 ++++- 8 files changed, 309 insertions(+), 6 deletions(-) create mode 100644 components/custom-tab-bar-toutiao.vue create mode 100644 components/custom-tab-bar.vue diff --git a/App.vue b/App.vue index 1a71f18..1a74b74 100644 --- a/App.vue +++ b/App.vue @@ -1,3 +1,4 @@ + + + diff --git a/components/custom-tab-bar.vue b/components/custom-tab-bar.vue new file mode 100644 index 0000000..279d78a --- /dev/null +++ b/components/custom-tab-bar.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/pages.json b/pages.json index 5e99261..11a0dba 100644 --- a/pages.json +++ b/pages.json @@ -219,6 +219,7 @@ } ], "tabBar": { + "custom": true, "color": "#7A7E83", "selectedColor": "#007AFF", "backgroundColor": "#FFFFFF", diff --git a/pages/cabinet/index.vue b/pages/cabinet/index.vue index c98200d..41f9982 100644 --- a/pages/cabinet/index.vue +++ b/pages/cabinet/index.vue @@ -2,6 +2,15 @@ + + + + + + + + + @@ -166,6 +175,12 @@ import { onShow, onReachBottom, onShareAppMessage, onPullDownRefresh } from '@dc import { getInventory, getProductDetail, redeemInventory, requestShipping, cancelShipping, listAddresses, getShipments, createAddressShare } from '@/api/appUser' import { vibrateShort } from '@/utils/vibrate.js' import { checkPhoneBound, checkPhoneBoundSync } from '@/utils/checkPhone.js' +// #ifdef MP-TOUTIAO +import customTabBarToutiao from '@/components/custom-tab-bar-toutiao.vue' +// #endif +// #ifndef MP-TOUTIAO +import customTabBar from '@/components/custom-tab-bar.vue' +// #endif const currentTab = ref(0) const aggregatedList = ref([]) diff --git a/pages/index/index.vue b/pages/index/index.vue index 876c2cd..afa185b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -6,6 +6,14 @@ + + + + + + + + @@ -54,6 +62,7 @@ + @@ -71,6 +80,7 @@ + @@ -133,10 +143,22 @@ import { authRequest, request } from '../../utils/request.js' import SplashScreen from '@/components/SplashScreen.vue' import { checkPhoneBound, checkPhoneBoundSync } from '../../utils/checkPhone.js' +// #ifdef MP-TOUTIAO +import customTabBarToutiao from '@/components/custom-tab-bar-toutiao.vue' +// #endif +// #ifndef MP-TOUTIAO +import customTabBar from '@/components/custom-tab-bar.vue' +// #endif export default { components: { SplashScreen + // #ifdef MP-TOUTIAO + , customTabBarToutiao + // #endif + // #ifndef MP-TOUTIAO + , customTabBar + // #endif }, data() { return { diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 7cafb79..3ced4e2 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -3,6 +3,14 @@ + + + + + + + + {{ douyinUserId ? '已绑定' : '绑定抖音' }} + + + + + + 扫雷 + + @@ -477,8 +493,22 @@ import { getUserTasks, getTaskProgress, getInviteRecords, modifyUser, getUserProfile, bindDouyinID } from '../../api/appUser.js' import { checkPhoneBoundSync } from '../../utils/checkPhone.js' +// #ifdef MP-TOUTIAO +import customTabBarToutiao from '@/components/custom-tab-bar-toutiao.vue' +// #endif +// #ifndef MP-TOUTIAO +import customTabBar from '@/components/custom-tab-bar.vue' +// #endif export default { + components: { + // #ifdef MP-TOUTIAO + customTabBarToutiao + // #endif + // #ifndef MP-TOUTIAO + customTabBar + // #endif + }, data() { return { userId: '', @@ -946,7 +976,7 @@ export default { }, toBindDouyinOrder() { if (!this.checkPhoneBound()) return - + // 检查是否已绑定 if (this.douyinUserId) { uni.showToast({ @@ -955,7 +985,7 @@ export default { }) return } - + uni.showModal({ title: '绑定抖音', editable: true, @@ -967,17 +997,17 @@ export default { uni.showToast({ title: '抖音号不能为空', icon: 'none' }) return } - + try { uni.showLoading({ title: '绑定中...' }) const data = await bindDouyinID(douyinId) this.douyinUserId = data.douyin_id - + // 更新缓存 const userInfo = uni.getStorageSync('user_info') || {} userInfo.douyin_user_id = data.douyin_id uni.setStorageSync('user_info', userInfo) - + uni.hideLoading() uni.showToast({ title: '绑定成功', icon: 'success' }) } catch (err) { @@ -988,6 +1018,10 @@ export default { } }) }, + toMinesweeper() { + if (!this.checkPhoneBound()) return + uni.navigateTo({ url: '/pages-game/game/minesweeper/index' }) + }, handleInvite() { const code = this.getInviteCode() const path = this.getInviteSharePath() diff --git a/pages/shop/index.vue b/pages/shop/index.vue index 8618642..9baa30e 100644 --- a/pages/shop/index.vue +++ b/pages/shop/index.vue @@ -1,7 +1,15 @@