hookehuyr

feat(TabBar): 添加用户认证状态和基本信息字段

添加用户信息字段和认证状态变量,为后续认证跳转逻辑做准备
...@@ -88,6 +88,22 @@ const getCurrentPage = () => { ...@@ -88,6 +88,22 @@ const getCurrentPage = () => {
88 * @param {string} url - 页面路径 88 * @param {string} url - 页面路径
89 */ 89 */
90 const navigateTo = (url) => { 90 const navigateTo = (url) => {
91 + // TODO: 等待正式接口
92 + // if ((url === '/pages/profile/index' || url === '/pages/sell/index') && !is_auth.value) {
93 + // Taro.showToast({
94 + // title: '请先完善个人信息',
95 + // icon: 'none',
96 + // duration: 2000,
97 + // success: (res) => {
98 + // setTimeout(() => {
99 + // Taro.navigateTo({
100 + // url: '/pages/register/index'
101 + // })
102 + // }, 2000);
103 + // }
104 + // })
105 + // return
106 + // }
91 Taro.redirectTo({ 107 Taro.redirectTo({
92 url: url 108 url: url
93 }) 109 })
...@@ -113,8 +129,24 @@ const getIconColor = (tab) => { ...@@ -113,8 +129,24 @@ const getIconColor = (tab) => {
113 return activeTab.value === tab ? '#f97316' : '#6b7280' 129 return activeTab.value === tab ? '#f97316' : '#6b7280'
114 } 130 }
115 131
132 +const userInfo = ref({
133 + avatar: '',
134 + nickname: '',
135 + phone: '1',
136 + gender: '',
137 + school: '',
138 + birthday: '',
139 +});
140 +
141 +const is_auth = ref(false);
142 +
116 onMounted(() => { 143 onMounted(() => {
117 getCurrentPage() 144 getCurrentPage()
145 + // 获取当前用户的信息
146 + // if (userInfo.value && userInfo.value.phone) {
147 + // is_auth.value = true
148 + // }
149 + is_auth.value = false
118 }) 150 })
119 </script> 151 </script>
120 152
......