hookehuyr

✨ feat(家长端): (甲方新提需求)选择学校列表功能调整,新增捐赠详情页,新增捐赠项组件

1 +<!--
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-30 10:20:34
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-05-31 11:56:24
6 + * @FilePath: /tswj/src/components/RankingList/index.vue
7 +-->
8 +<template>
9 + <!-- TODO: 捐赠排行榜item组件完善 -->
10 + <div style="margin: 1rem 0; background-color: #FFF; position: relative;">
11 + <van-row>
12 + <van-col span="2" style="position: relative;">
13 + <div style="position: absolute; top: 0; left: 20%;">
14 + <van-icon :name="icon_ranking" size="1.25rem" />
15 + </div>
16 + <div style="position: absolute; top: 0; left: 40%;">1</div>
17 + </van-col>
18 + <van-col span="18" style="padding: 1rem 0;">
19 + <!-- 如果多个学校遍历包裹结构 -->
20 + <div style="position: relative; height: 3rem;" @click="go('/client/chooseBook', { kg_id: item.id })">
21 + <van-row align="center" justify="center" style="position: relative; top: 50%; transform: translateY(-50%);">
22 + <van-col span="4">
23 + <van-image round width="3rem" height="3rem" :src="item.avatar ? item.avatar : icon_avatar" style="vertical-align: text-bottom;" />
24 + </van-col>
25 + <van-col span="20">
26 + <p class="title">{{ item.name }}</p>
27 + </van-col>
28 + </van-row>
29 + </div>
30 + </van-col>
31 + <van-col span="2">
32 + <div style="text-align: center; position: absolute; top: 40%;" @click="go('/client/donateList', { kg_id: item.id })">
33 + <van-icon name="arrow" color="#c5c5c5" size="1.25rem" />3000
34 + </div>
35 + </van-col>
36 + </van-row>
37 + </div>
38 +</template>
39 +
40 +<script setup>
41 +import icon_avatar from '@images/que-logo@2x.png'
42 +import icon_ranking from '@images/icon-shoucang02@2x.png'
43 +
44 +import { useGo } from '@/hooks/useGo'
45 +const go = useGo()
46 +
47 +// eslint-disable-next-line no-unused-vars
48 +const props = defineProps({
49 + item: {
50 + type: Object,
51 + default(rawProps) {
52 + return rawProps
53 + }
54 + }
55 +})
56 +const emit = defineEmits(['on-icon-click']);
57 +const handle = () => {
58 + emit('on-icon-click', '')
59 +}
60 +</script>
61 +
62 +<style lang="less" scoped>
63 +.wrapper {
64 + background-color: #fff;
65 + margin: 2rem 0;
66 + height: 3rem;
67 + // overflow: auto;
68 +
69 + .avatar {
70 + vertical-align: middle;
71 + }
72 +
73 + .title {
74 + color: #222222;
75 + display: inline-block;
76 + vertical-align: super;
77 + margin-left: 2rem;
78 + }
79 +}
80 +</style>
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-25 18:03:54
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-05-31 11:59:59
6 + * @FilePath: /tswj/src/router/routes/modules/client/index.js
7 + * @Description: 家长端展示页路由表
8 + */
1 const index = [{ 9 const index = [{
2 path: '/', 10 path: '/',
3 name: '首页', 11 name: '首页',
...@@ -25,6 +33,14 @@ const index = [{ ...@@ -25,6 +33,14 @@ const index = [{
25 }, 33 },
26 children: [] 34 children: []
27 }, { 35 }, {
36 + path: '/client/donateList',
37 + name: '幼儿园捐赠人捐赠金额排行榜',
38 + component: () => import('@/views/client/donateList.vue'),
39 + meta: {
40 + title: '捐赠明细'
41 + },
42 + children: []
43 +}, {
28 path: '/client/chooseBook', 44 path: '/client/chooseBook',
29 name: '客户端选择爱心书籍', 45 name: '客户端选择爱心书籍',
30 component: () => import('@/views/client/chooseBook.vue'), 46 component: () => import('@/views/client/chooseBook.vue'),
......
1 +<!--
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-04-21 11:21:39
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-05-31 11:30:12
6 + * @FilePath: /tswj/src/views/client/chooseSchool.vue
7 + * @Description: 选择学校列表
8 +-->
1 <template> 9 <template>
2 <div class="choose-school-page content-bg"> 10 <div class="choose-school-page content-bg">
3 <div class="modify-top" /> 11 <div class="modify-top" />
4 <div class="wrapper-content"> 12 <div class="wrapper-content">
5 <template v-for="(item, key) in schoolList" :key="key"> 13 <template v-for="(item, key) in schoolList" :key="key">
6 - <right-side-list 14 + <ranking-item :item="item" />
7 - :avatar="item.logo"
8 - @on-icon-click="go('/client/chooseBook', { kg_id: item.id })"
9 - >
10 - <span @click="go('/client/chooseBook', { kg_id: item.id })">
11 - {{ item.name }}
12 - </span>
13 - </right-side-list>
14 </template> 15 </template>
15 </div> 16 </div>
16 </div> 17 </div>
17 </template> 18 </template>
18 19
19 <script setup> 20 <script setup>
20 -import RightSideList from '@/components/RightSideList/index' 21 +import RankingItem from '@/components/RankingItem/index'
21 -import { useGo } from '@/hooks/useGo' 22 +// import { useGo } from '@/hooks/useGo'
22 import { killPages } from '@/hooks/useKeepAlive' 23 import { killPages } from '@/hooks/useKeepAlive'
23 24
24 -const go = useGo() 25 +// const go = useGo()
25 // 删除所有的 keep-alive 缓存 26 // 删除所有的 keep-alive 缓存
26 killPages(); 27 killPages();
27 </script> 28 </script>
......
1 +<!--
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-30 13:51:47
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-05-31 11:28:54
6 + * @FilePath: /tswj/src/views/client/donateList.vue
7 + * @Description: 幼儿园捐赠人捐赠金额排行榜
8 +-->
9 +<template>
10 + <!-- TODO: 排行榜详情列表 -->
11 + <!-- src/components/RankingItem/index.vue 到时候使用这一部分,可能有几个学校 -->
12 + <div class="van-hairline--bottom">
13 + <van-row style="padding: 0.5rem 1rem;">
14 + <van-col span="4">
15 + <van-image v-if="info.avatar" round width="3rem" height="3rem" :src="info.avatar ? info.avatar : icon_avatar" />
16 + </van-col>
17 + <van-col span="6" style="line-height: 3rem;">
18 + <div class="name-info">{{ info.name }}</div>
19 + </van-col>
20 + <van-col span="14" style="text-align: right; font-size: 0.9rem;">
21 + <p style="color: #C5C5C5; line-height: 1.5;">2022-05-27</p>
22 + <p style="color: #222222;">
23 + <span>《逃家小兔绘本》</span>
24 + <van-icon style="vertical-align: middle;" size="1rem" name="https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng73a86b62d29d42c2544d9bbb316217575224457db387ef42182b087764cb1fbd" />
25 + <span>&nbsp;x2</span>
26 + </p>
27 + </van-col>
28 + </van-row>
29 + </div>
30 +</template>
31 +
32 +<script setup>
33 +import { ref } from 'vue'
34 +import { useRoute, useRouter } from 'vue-router'
35 +
36 +import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
37 +//import { } from '@/utils/generateModules.js'
38 +import { icon_avatar } from '@/utils/generateIcons.js'
39 +//import { } from '@/composables'
40 +const $route = useRoute();
41 +const $router = useRouter();
42 +useTitle($route.meta.title);
43 +
44 +const info = ref({
45 + avatar: 'https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng76a8e87552945e0800cea4e5eb14ff2175cc7816e6acb5c79d714793c82d37f5',
46 + name: '杨妮妮'
47 +})
48 +</script>
49 +
50 +<style lang="less" scoped>
51 +
52 +</style>