Browse Source

增加设置页面

ming 3 years ago
parent
commit
0bfafa36f4
4 changed files with 48 additions and 13 deletions
  1. 1 2
      components/fs-tab/fs-tab.vue
  2. 35 0
      modules/common/setting.vue
  3. 7 0
      pages.json
  4. 5 11
      pages/my/my.vue

+ 1 - 2
components/fs-tab/fs-tab.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="text-center" :class="[sticky ? 'fs-tab-sticky' : '']">
+	<view class="text-center" :class="[sticky ? 'fs-tab-sticky' : '',gutter ? 'fs-tab-gutter' : '']">
 		<scroll-view
 			:scroll-x="scrollable" 
 			:style="{'background-color':bgColor}">
@@ -10,7 +10,6 @@
 				colorType,
 				round ? 'round' : '',
 				center ? 'fs-tab-center' : '',
-				gutter ? 'fs-tab-gutter' : '',
 			]">
 				<view
 					class="fs-tab-item" 

+ 35 - 0
modules/common/setting.vue

@@ -0,0 +1,35 @@
+<template>
+	<fs-container>
+		<template #default>
+			<fs-cell-group arrow border gutter>
+				<fs-cell link="/pages/my/userInfo" title="个人信息"></fs-cell>
+			</fs-cell-group>
+		</template>
+		
+		<template #footer v-if="token">
+			<view class="layout-box">
+				<fs-button round full @click="handleLogout">退出登录</fs-button>
+			</view>
+		</template>
+	</fs-container>
+</template>
+
+<script setup>
+import { computed } from 'vue'
+import { useStore } from 'vuex'
+import useUser from '@/hooks/useUser'
+
+const store = useStore()
+
+const token = computed(() => store.state.token)
+
+const handleLogout = () => {
+	store.dispatch('logout').then(res => {
+		console.log('logout')
+	})
+}
+</script>
+
+<style>
+
+</style>

+ 7 - 0
pages.json

@@ -113,6 +113,13 @@
 					"enablePullDownRefresh": false
 				}
 
+			}, {
+				"path": "setting",
+				"style": {
+					"navigationBarTitleText": "设置",
+					"enablePullDownRefresh": false
+				}
+
 			}
 		]
 	}],

+ 5 - 11
pages/my/my.vue

@@ -49,6 +49,11 @@
 		</fs-card>
 		
 		<fs-cell-group arrow border gutter>
+			<fs-cell link="/modules/common/setting" value="设置">
+				<template #title>
+					<fs-icon type="icon-setting" colorType="primary"></fs-icon>
+				</template>
+			</fs-cell>
 			<fs-cell link="/modules/common/licensePlate/list" value="车辆管理">
 				<template #title>
 					<fs-icon type="icon-car" colorType="primary"></fs-icon>
@@ -85,11 +90,6 @@
 				</template>
 			</fs-cell>
 		</fs-cell-group>
-		
-		<fs-gutter height="60rpx"></fs-gutter>
-		<fs-button round block @click="handleLogout">退出登录</fs-button>
-		<fs-gutter height="60rpx"></fs-gutter>
-		
 		<wx v-model="showLogin"></wx>
 	</view>
 </template>
@@ -113,12 +113,6 @@ const shortcutList = ref([
 ])
 
 const showLogin = ref(false)
-
-const handleLogout = () => {
-	store.dispatch('logout').then(res => {
-		console.log('logout')
-	})
-}
 </script>
 
 <style lang="scss" scoped>