Showing
4 changed files
with
242 additions
and
2 deletions
| 1 | import { createApp } from 'vue'; | 1 | import { createApp } from 'vue'; |
| 2 | -import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper } from 'vant'; | 2 | +import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag } from 'vant'; |
| 3 | import router from './router'; | 3 | import router from './router'; |
| 4 | import App from './App.vue'; | 4 | import App from './App.vue'; |
| 5 | import axios from './utils/axios'; | 5 | import axios from './utils/axios'; |
| ... | @@ -32,6 +32,7 @@ app.use(Popup); | ... | @@ -32,6 +32,7 @@ app.use(Popup); |
| 32 | app.use(Picker); | 32 | app.use(Picker); |
| 33 | app.use(Sticky); | 33 | app.use(Sticky); |
| 34 | app.use(Stepper); | 34 | app.use(Stepper); |
| 35 | +app.use(Tag); | ||
| 35 | 36 | ||
| 36 | app.use(ConfigProvider); | 37 | app.use(ConfigProvider); |
| 37 | 38 | ... | ... |
| ... | @@ -93,6 +93,22 @@ export default [{ | ... | @@ -93,6 +93,22 @@ export default [{ |
| 93 | }, | 93 | }, |
| 94 | children: [] | 94 | children: [] |
| 95 | }, { | 95 | }, { |
| 96 | + path: '/client/personIndex', | ||
| 97 | + name: '个人首页', | ||
| 98 | + component: () => import('./views/client/personIndex.vue'), | ||
| 99 | + meta: { | ||
| 100 | + title: '个人首页' | ||
| 101 | + }, | ||
| 102 | + children: [] | ||
| 103 | +}, { | ||
| 104 | + path: '/me/index', | ||
| 105 | + name: '我的', | ||
| 106 | + component: () => import('./views/me/index.vue'), | ||
| 107 | + meta: { | ||
| 108 | + title: '我的' | ||
| 109 | + }, | ||
| 110 | + children: [] | ||
| 111 | +}, { | ||
| 96 | path: '/image', | 112 | path: '/image', |
| 97 | name: 'html转图片', | 113 | name: 'html转图片', |
| 98 | component: () => import('./views/html2canvas.vue'), | 114 | component: () => import('./views/html2canvas.vue'), | ... | ... |
src/views/me/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="me-index-page"> | ||
| 3 | + <div class="header-wrapper"> | ||
| 4 | + <div class="info"> | ||
| 5 | + <van-row> | ||
| 6 | + <van-col> | ||
| 7 | + <van-image round width="50" height="50" src="https://cdn.jsdelivr.net/npm/@vant/assets/cat.jpeg" | ||
| 8 | + style="padding-right: 1rem;" /> | ||
| 9 | + </van-col> | ||
| 10 | + <van-col class="text-wrapper" span="18"> | ||
| 11 | + <div> | ||
| 12 | + <div class="username">瑟日古娜</div> | ||
| 13 | + <div class="toggle-user">切换儿童</div> | ||
| 14 | + </div> | ||
| 15 | + <div class="address">呼和浩特市新城区蒙古族幼儿园</div> | ||
| 16 | + </van-col> | ||
| 17 | + </van-row> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <div class="sub-data"> | ||
| 21 | + <van-row> | ||
| 22 | + <van-col span="5" offset="1" class="un-tap-color"> | ||
| 23 | + <p>获赞</p> | ||
| 24 | + <p>25478</p> | ||
| 25 | + </van-col> | ||
| 26 | + <van-col span="1" class="divide">|</van-col> | ||
| 27 | + <van-col span="5" class="un-tap-color"> | ||
| 28 | + <p>粉丝</p> | ||
| 29 | + <p>45</p> | ||
| 30 | + </van-col> | ||
| 31 | + <van-col span="1" class="divide">|</van-col> | ||
| 32 | + <van-col span="5"> | ||
| 33 | + <p class="tap-color">关注</p> | ||
| 34 | + <p>26</p> | ||
| 35 | + </van-col> | ||
| 36 | + <van-col span="1" class="divide">|</van-col> | ||
| 37 | + <van-col span="5"> | ||
| 38 | + <p class="tap-color">未看</p> | ||
| 39 | + <p><van-tag round color="red">28</van-tag></p> | ||
| 40 | + </van-col> | ||
| 41 | + </van-row> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + | ||
| 45 | + <div class="van-hairline--bottom sub-handle"> | ||
| 46 | + <div> | ||
| 47 | + <my-button type="custom" :custom-style="styleObject1" @on-click="">实名认证</my-button> | ||
| 48 | + </div> | ||
| 49 | + <div> | ||
| 50 | + <my-button type="custom" :custom-style="styleObject2" @on-click="">新增儿童</my-button> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + | ||
| 54 | + <template v-for="(item, key) in itemList" :key="key"> | ||
| 55 | + <div class="van-hairline--bottom item-list"> | ||
| 56 | + <van-row> | ||
| 57 | + <van-col span="12">{{ item.name }}</van-col> | ||
| 58 | + <van-col span="12" style="text-align: right; color: #777777;"> | ||
| 59 | + <span v-if="!item.tag">{{ item.sum }} </span> | ||
| 60 | + <span v-else><van-tag round color="red">{{ item.sum }}</van-tag> </span> | ||
| 61 | + <van-icon name="arrow" /></van-col> | ||
| 62 | + </van-row> | ||
| 63 | + </div> | ||
| 64 | + </template> | ||
| 65 | + </div> | ||
| 66 | +</template> | ||
| 67 | + | ||
| 68 | +<script setup> | ||
| 69 | +import MyButton from '@/components/MyButton/index.vue' | ||
| 70 | + | ||
| 71 | +import { ref, reactive, onMounted } from 'vue' | ||
| 72 | +import { useRoute, useRouter } from 'vue-router' | ||
| 73 | +import axios from '@/utils/axios'; | ||
| 74 | +import $ from 'jquery' | ||
| 75 | +import { Toast } from 'vant'; | ||
| 76 | +const $route = useRoute(); | ||
| 77 | +const $router = useRouter(); | ||
| 78 | + | ||
| 79 | +// 自定义按钮颜色样式 | ||
| 80 | +const styleObject1 = reactive({ | ||
| 81 | + backgroundColor: '#FFFFFF', | ||
| 82 | + color: '#713610', | ||
| 83 | + borderColor: '#713610' | ||
| 84 | +}) | ||
| 85 | +const styleObject2 = reactive({ | ||
| 86 | + backgroundColor: '#FFFFFF', | ||
| 87 | + color: '#0B3A72', | ||
| 88 | + borderColor: '#0B3A72' | ||
| 89 | +}) | ||
| 90 | + | ||
| 91 | +const itemList = [ | ||
| 92 | + { | ||
| 93 | + name: '我的捐赠', | ||
| 94 | + sum: '5', | ||
| 95 | + to: '/' | ||
| 96 | + }, | ||
| 97 | + { | ||
| 98 | + name: '我的作品', | ||
| 99 | + sum: '5', | ||
| 100 | + to: '/' | ||
| 101 | + }, | ||
| 102 | + { | ||
| 103 | + name: '我的订阅', | ||
| 104 | + sum: '5', | ||
| 105 | + to: '/' | ||
| 106 | + }, | ||
| 107 | + { | ||
| 108 | + name: '我的收藏', | ||
| 109 | + sum: '5', | ||
| 110 | + to: '/' | ||
| 111 | + }, | ||
| 112 | + { | ||
| 113 | + name: '我的点赞', | ||
| 114 | + sum: '5', | ||
| 115 | + to: '/' | ||
| 116 | + }, | ||
| 117 | + { | ||
| 118 | + name: '我的留言', | ||
| 119 | + sum: '2', | ||
| 120 | + tag: true, | ||
| 121 | + to: '/' | ||
| 122 | + }, | ||
| 123 | + { | ||
| 124 | + name: '@我的', | ||
| 125 | + sum: '2', | ||
| 126 | + tag: true, | ||
| 127 | + to: '/' | ||
| 128 | + }, | ||
| 129 | +] | ||
| 130 | + | ||
| 131 | +onMounted(() => { | ||
| 132 | + | ||
| 133 | +}) | ||
| 134 | +</script> | ||
| 135 | + | ||
| 136 | +<script> | ||
| 137 | +import mixin from 'common/mixin'; | ||
| 138 | + | ||
| 139 | +export default { | ||
| 140 | + mixins: [mixin.init], | ||
| 141 | + data() { | ||
| 142 | + return { | ||
| 143 | + | ||
| 144 | + } | ||
| 145 | + }, | ||
| 146 | + mounted() { | ||
| 147 | + | ||
| 148 | + }, | ||
| 149 | + methods: { | ||
| 150 | + | ||
| 151 | + } | ||
| 152 | +} | ||
| 153 | +</script> | ||
| 154 | + | ||
| 155 | +<style lang="less" scoped> | ||
| 156 | +.me-index-page { | ||
| 157 | + .header-wrapper { | ||
| 158 | + background: linear-gradient(310deg, #FDD347 0%, #FFED6D 100%); | ||
| 159 | + .info { | ||
| 160 | + padding: 2rem; | ||
| 161 | + padding-right: 0; | ||
| 162 | + .text-wrapper { | ||
| 163 | + line-height: 1.5; | ||
| 164 | + .username { | ||
| 165 | + display: inline-block; | ||
| 166 | + overflow: auto; | ||
| 167 | + font-size: 1.15rem; | ||
| 168 | + color: #222222; | ||
| 169 | + } | ||
| 170 | + .toggle-user { | ||
| 171 | + float: right; | ||
| 172 | + font-size: 0.8rem; | ||
| 173 | + background-color: white; | ||
| 174 | + border-radius: 15px; | ||
| 175 | + padding: 5px 10px; | ||
| 176 | + color: #713610; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + .address { | ||
| 180 | + font-size: 0.85rem; | ||
| 181 | + color: #999999; | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | + .sub-data { | ||
| 185 | + text-align: center; | ||
| 186 | + overflow: auto; | ||
| 187 | + padding-bottom: 1rem; | ||
| 188 | + .un-tap-color { | ||
| 189 | + color: #666666; | ||
| 190 | + } | ||
| 191 | + .tap-color { | ||
| 192 | + color: #713610; | ||
| 193 | + } | ||
| 194 | + .divide { | ||
| 195 | + line-height: 2.5; | ||
| 196 | + color: #BCB4C9; | ||
| 197 | + font-size: 1rem; | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + .sub-handle { | ||
| 202 | + padding: 1rem 0; | ||
| 203 | + margin: 0 1rem; | ||
| 204 | + overflow: auto; | ||
| 205 | + div:first-child { | ||
| 206 | + width: 48%; | ||
| 207 | + float: left; | ||
| 208 | + margin-right: 2%; | ||
| 209 | + } | ||
| 210 | + div:last-child { | ||
| 211 | + width: 48%; | ||
| 212 | + float: left; | ||
| 213 | + margin-left: 2%; | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + .item-list { | ||
| 217 | + padding: 1rem 0; | ||
| 218 | + margin: 0 1rem; | ||
| 219 | + } | ||
| 220 | +} | ||
| 221 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment