|
@@ -1,52 +1,71 @@
|
|
|
<template>
|
|
|
- <view class="content">
|
|
|
- <view class="card">
|
|
|
+ <view class="content">
|
|
|
+ <view class="card">
|
|
|
<view class="card-item" v-for="(item, index) in menus" :key="index" @tap="openPage(item.url)">
|
|
|
- <view>{{item.text}}</view>
|
|
|
+ <uni-icons :type="item.icon" size="40" color="rgb(50, 50, 50)"></uni-icons>
|
|
|
+ <view class="card-item-text">{{item.text}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import token from '../../utils/token.js';
|
|
|
import pages from '../../utils/pages.js';
|
|
|
-
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- isLogin: false,
|
|
|
+
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isLogin: false,
|
|
|
menus: []
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
if (token.has()) {
|
|
|
this.isLogin = true;
|
|
|
}
|
|
|
this.menus = pages.pages;
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
openPage(url) {
|
|
|
uni.navigateTo({
|
|
|
url: url
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- .content {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
-
|
|
|
+ page {
|
|
|
+ background-color: rgb(235, 235, 235);
|
|
|
+ }
|
|
|
+ .content {
|
|
|
.card {
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
- width: 200upx;
|
|
|
- height: 200upx;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: flex-start;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10upx;
|
|
|
+
|
|
|
+ .card-item {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ width: calc(33.3% - 20upx);
|
|
|
+ height: 200upx;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin: 10upx;
|
|
|
+ color: rgb(50, 50, 50);
|
|
|
+ border: 2upx solid rgb(230, 230, 230);
|
|
|
+ background-color: rgb(245, 245, 245);
|
|
|
+
|
|
|
+ .card-item-text {
|
|
|
+ margin-top: 15upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-</style>
|
|
|
+ }
|
|
|
+</style>
|