Browse Source

fix: 上下滚动时间轴

develop
lucky 4 years ago
parent
commit
d533a01ca2
  1. 9
      CHANGELOG.md
  2. 4
      src/App.vue
  3. 0
      src/components/Globals/Globals.vue
  4. 4
      src/components/Project/Project.vue
  5. 0
      src/components/Project/component/TimeBar.vue
  6. 0
      src/components/Project/component/TimeLine.vue
  7. 8
      src/components/Roles/Roles.vue
  8. 39
      src/components/Roles/component/RoleList.vue
  9. 20
      src/components/TimeLine/TimeLine.vue
  10. 0
      src/components/TimeLine/component/Barrier.vue
  11. 26
      src/components/TimeLine/component/TimeBox.vue
  12. 2
      src/components/TimeLine/component/TimeStatus.vue
  13. 0
      src/components/TimeLine/component/Title.vue
  14. 5
      src/pages.json
  15. 10
      src/pages/index/index.vue
  16. 2
      src/uni.scss

9
CHANGELOG.md

@ -3,10 +3,12 @@
### 🌟 新功能 ### 🌟 新功能
范围|描述|commitId 范围|描述|commitId
--|--|-- --|--|--
- | 标题栏变化 | [c0fcd9d](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/c0fcd9d)
- | 标题栏角色栏全局任务组件新建 | [0500cb4](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/0500cb4) - | 标题栏角色栏全局任务组件新建 | [0500cb4](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/0500cb4)
- | 角色栏实现 | [94cd671](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/94cd671) - | 角色栏实现 | [94cd671](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/94cd671)
- | 时间轴界面 | [33927e9](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/33927e9) - | 时间轴界面 | [33927e9](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/33927e9)
- | 提交到本地 | [9cbe411](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/9cbe411) - | 提交到本地 | [9cbe411](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/9cbe411)
- | 添加时间轴上下滚动 | [2b81bbc](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/2b81bbc)
- | db store | [6414c4f](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/6414c4f) - | db store | [6414c4f](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/6414c4f)
- | indexedDB | [687394e](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/687394e) - | indexedDB | [687394e](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/687394e)
富文本插件 | 富文本插件demo测试 | [ed3d644](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/ed3d644) 富文本插件 | 富文本插件demo测试 | [ed3d644](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/ed3d644)
@ -23,12 +25,6 @@
- | 图标修改 | [54bca09](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/54bca09) - | 图标修改 | [54bca09](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/54bca09)
- | 无基本变化 | [21ac4bb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/21ac4bb) - | 无基本变化 | [21ac4bb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/21ac4bb)
- | 组件新建 | [89c0035](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/89c0035) - | 组件新建 | [89c0035](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/89c0035)
- | 更新代码 | [8c27e68](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/8c27e68)
- | 更新代码 | [1f40a76](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/1f40a76)
- | 任务快捷方式图标增加 | [4aba872](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/4aba872)
- | 图标修改 | [54bca09](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/54bca09)
- | 无基本变化 | [21ac4bb](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/21ac4bb)
- | 组件新建 | [89c0035](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/89c0035)
### 🐛 Bug 修复 ### 🐛 Bug 修复
@ -73,3 +69,4 @@
--|--|-- --|--|--
- | !2 基础模板v1.1.0 | [f5e61dd](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/f5e61dd) - | !2 基础模板v1.1.0 | [f5e61dd](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/f5e61dd)
- | init | [c0f1deb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/c0f1deb) - | init | [c0f1deb](http://gitea@dd.tall.wiki:wally/TALL-MUI-3/commits/c0f1deb)

4
src/App.vue

@ -19,10 +19,6 @@ export default {
}; };
</script> </script>
<style>
@import './common/styles/iconfont.scss';
</style>
<style lang="scss"> <style lang="scss">
@import './common/styles/iconfont.scss'; @import './common/styles/iconfont.scss';
@import 'uview-ui/index.scss'; @import 'uview-ui/index.scss';

0
src/components/Globals/index.vue → src/components/Globals/Globals.vue

4
src/components/Project/Project.vue

@ -8,8 +8,8 @@
</template> </template>
<script> <script>
import TimeBar from './components/TimeBar'; import TimeBar from './component/TimeBar';
import TimeLine from './components/TimeLine'; import TimeLine from './component/TimeLine';
export default { export default {
name: 'Project', name: 'Project',

0
src/components/Project/components/TimeBar.vue → src/components/Project/component/TimeBar.vue

0
src/components/Project/components/TimeLine.vue → src/components/Project/component/TimeLine.vue

8
src/components/Roles/Roles.vue

@ -6,15 +6,13 @@
* @LastEditTime: 2021-07-20 10:54:27 * @LastEditTime: 2021-07-20 10:54:27
--> -->
<template> <template>
<view class="wrap bg-white"> <view class="wrap bg-white px-2">
<view class="px-2"> <role-list />
<role-list />
</view>
</view> </view>
</template> </template>
<script> <script>
import RoleList from './components/RoleList.vue'; import RoleList from './component/RoleList';
export default { export default {
name: 'Roles', name: 'Roles',

39
src/components/Roles/components/RoleList.vue → src/components/Roles/component/RoleList.vue

@ -4,7 +4,7 @@
<scroll-view :enable-flex="true" :scroll-left="scrollLeft" :throttle="false" scroll-with-animation scroll-x> <scroll-view :enable-flex="true" :scroll-left="scrollLeft" :throttle="false" scroll-with-animation scroll-x>
<view class="tabBox"> <view class="tabBox">
<view :key="index" @click="changeIndex(index)" class="tab-item" v-for="(item, index) in roles"> <view :key="index" @click="changeIndex(index)" class="tab-item" v-for="(item, index) in roles">
<view :class="setColor(item.isMine, tabIndex, index)" class="tab-children u-skeleton-rect">{{ item.value }}</view> <view :class="setColor(item.mine, tabIndex, index)" class="tab-children u-skeleton-rect">{{ item.name }}</view>
</view> </view>
</view> </view>
<u-skeleton :animation="true" :loading="loading" bgcolor="#fff"></u-skeleton> <u-skeleton :animation="true" :loading="loading" bgcolor="#fff"></u-skeleton>
@ -22,16 +22,16 @@ export default {
tabList: [], //tab dom tabList: [], //tab dom
scrollLeft: 0, //scrollview scrollLeft: 0, //scrollview
roles: [ roles: [
{ id: 1, value: '项目经理', isMine: 0 }, { id: 1, name: '项目经理', mine: 0, pm: 1, sequence: 1 },
{ id: 2, value: '运维', isMine: 0 }, { id: 2, name: '运维', mine: 0, pm: 0, sequence: 2 },
{ id: 3, value: '导师一', isMine: 1 }, { id: 3, name: '导师一', mine: 1, pm: 0, sequence: 3 },
{ id: 4, value: '导师二', isMine: 1 }, { id: 4, name: '导师二', mine: 1, pm: 0, sequence: 4 },
{ id: 5, value: '导师三', isMine: 1 }, { id: 5, name: '导师三', mine: 1, pm: 0, sequence: 5 },
{ id: 6, value: '导师四', isMine: 1 }, { id: 6, name: '导师四', mine: 1, pm: 0, sequence: 6 },
{ id: 7, value: '导师五', isMine: 1 }, { id: 7, name: '导师五', mine: 1, pm: 0, sequence: 7 },
{ id: 8, value: '导师六', isMine: 1 }, { id: 8, name: '导师六', mine: 1, pm: 0, sequence: 8 },
{ id: 9, value: '导师七', isMine: 1 }, { id: 9, name: '导师七', mine: 1, pm: 0, sequence: 9 },
{ id: 10, value: '导师八', isMine: 1 }, { id: 10, name: '导师八', mine: 1, pm: 0, sequence: 10 },
], ],
loading: true, // loading: true, //
}; };
@ -68,14 +68,14 @@ export default {
}, },
// //
setColor(isMine, tabIndex, index) { setColor(mine, tabIndex, index) {
if (isMine === 1 && tabIndex === index) { if (mine === 1 && tabIndex === index) {
return 'default-tab-choice'; return 'default-tab-choice';
} }
if (isMine === 1 && tabIndex !== index) { if (mine === 1 && tabIndex !== index) {
return 'default-tab-item'; return 'default-tab-item';
} }
if (isMine === 0 && tabIndex === index) { if (mine === 0 && tabIndex === index) {
return 'tab-choice'; return 'tab-choice';
} }
}, },
@ -84,9 +84,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$tabChoiceColor: #f40; //线
$max: 100%;
// //
.wrap { .wrap {
position: relative; position: relative;
@ -120,13 +117,13 @@ $max: 100%;
} }
.default-tab-item { .default-tab-item {
color: $tabChoiceColor; color: $roleChoiceColor;
} }
.default-tab-choice { .default-tab-choice {
// //
position: relative; position: relative;
color: $tabChoiceColor; color: $roleChoiceColor;
font-weight: 600; font-weight: 600;
} }
.default-tab-choice:before { .default-tab-choice:before {
@ -137,7 +134,7 @@ $max: 100%;
width: 100%; width: 100%;
height: 6rpx; height: 6rpx;
border-radius: 2rpx; border-radius: 2rpx;
background: $tabChoiceColor; background: $roleChoiceColor;
} }
.tab-choice { .tab-choice {

20
src/components/TimeLine/index.vue → src/components/TimeLine/TimeLine.vue

@ -8,32 +8,30 @@
<template> <template>
<!-- <Barrier /> --> <!-- <Barrier /> -->
<scroll-view <scroll-view
:lower-threshold="300"
:scrollTop="scrollTop" :scrollTop="scrollTop"
:scrollY="true" :scrollY="true"
:style="{ height: height }" :upper-threshold="300"
@scroll="scroll" @scroll="scroll"
@scrolltolower="handleScrollBottom" @scrolltolower="handleScrollBottom"
@scrolltoupper="handleScrollTop" @scrolltoupper="handleScrollTop"
> >
<!-- :style="{ height: height }" --> <TimeBox ref="child" />
<TimeBox />
</scroll-view> </scroll-view>
</template> </template>
<script> <script>
// import Barrier from './components/Barrier.vue'; // import Barrier from './component/Barrier.vue';
import TimeBox from './components/TimeBox.vue'; import TimeBox from './component/TimeBox.vue';
export default { export default {
name: 'TimeLine', name: 'TimeLine',
components: { TimeBox }, components: { TimeBox },
data() { data() {
return { height: '', scrollTop: 0 }; return { scrollTop: 0 };
},
mounted() {
this.height = document.getElementsByClassName('main')[0].clientHeight + 'px';
console.log(this.height);
}, },
methods: { methods: {
//
scroll(e) { scroll(e) {
console.log(e.detail.scrollTop); console.log(e.detail.scrollTop);
}, },
@ -41,11 +39,13 @@ export default {
// //
handleScrollTop() { handleScrollTop() {
console.log('滚动到顶部'); console.log('滚动到顶部');
this.$refs.child.addTopList();
}, },
// //
handleScrollBottom() { handleScrollBottom() {
console.log('滚动到底部'); console.log('滚动到底部');
this.$refs.child.addBottomList();
}, },
}, },
}; };

0
src/components/TimeLine/components/Barrier.vue → src/components/TimeLine/component/Barrier.vue

26
src/components/TimeLine/components/TimeBox.vue → src/components/TimeLine/component/TimeBox.vue

@ -22,8 +22,8 @@
</view> </view>
</view> </view>
<view class="border-l-2 border-gray-300 ml-3.5 my-2"> <view class="border-l-2 border-gray-300 ml-3.5 my-2">
<view class="ml-4 shadow-lg"> <view class="ml-4 shadow-lg task-box overflow-hidden">
<u-card :show-foot="false" :show-head="false" border-radius="25" class="h-16" margin="0"> <u-card :show-foot="false" :show-head="false" class="h-16" margin="0">
<view slot="body"> <view slot="body">
<view class="u-col-between p-0 u-skeleton"> <view class="u-col-between p-0 u-skeleton">
<view class="u-skeleton-rect">瓶身描绘的牡丹一如你初妆</view> <view class="u-skeleton-rect">瓶身描绘的牡丹一如你初妆</view>
@ -40,9 +40,29 @@
import TimeStatus from './TimeStatus.vue'; import TimeStatus from './TimeStatus.vue';
export default { export default {
name: 'TimeBox', name: 'TimeBox',
components: { TimeStatus }, components: { TimeStatus },
data() { data() {
return { list: [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3] }; return { list: [0, 1, 2, 0, 1, 2] };
},
methods: {
addTopList() {
this.list.unshift(0, 0, 0);
console.log('this.list: ', this.list);
},
addBottomList() {
this.list.push(1, 1, 1);
console.log('this.list: ', this.list);
},
}, },
}; };
</script> </script>
<style scoped lang="scss">
.task-box {
border-radius: 24rpx;
}
</style>

2
src/components/TimeLine/components/TimeStatus.vue → src/components/TimeLine/component/TimeStatus.vue

@ -106,6 +106,6 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.u-progress-bg { .u-progress-bg {
background: rgba(255, 255, 255, 0) !important; background: $uni-bg-color-transparent !important;
} }
</style> </style>

0
src/components/TimeLine/components/Title.vue → src/components/TimeLine/component/Title.vue

5
src/pages.json

@ -40,6 +40,9 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"easycom": { "easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "autoscan": true,
"custom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
} }
} }

10
src/pages/index/index.vue

@ -28,15 +28,15 @@
</template> </template>
<script> <script>
import Globals from 'components/Globals/index.vue'; // import Globals from 'components/Globals/index.vue';
import Title from 'components/Title/Title.vue'; // import Title from 'components/Title/Title.vue';
import Roles from 'components/Roles/Roles.vue'; // import Roles from 'components/Roles/Roles.vue';
import TimeLine from 'components/TimeLine/index.vue'; // import TimeLine from 'components/TimeLine/index.vue';
// import Project from 'components/Project/Project.vue'; // import Project from 'components/Project/Project.vue';
export default { export default {
components: { Globals, TimeLine, Roles, Title }, // components: { Globals, TimeLine, Roles, Title },
data() { data() {
return { title: 'Hello', height: '', scrollHeight: null }; return { title: 'Hello', height: '', scrollHeight: null };
}, },

2
src/uni.scss

@ -27,12 +27,14 @@ $uni-text-color-inverse: #fff; //反色
$uni-text-color-grey: #999; //辅助灰色如加载更多的提示信息 $uni-text-color-grey: #999; //辅助灰色如加载更多的提示信息
$uni-text-color-placeholder: #808080; $uni-text-color-placeholder: #808080;
$uni-text-color-disable: #c0c0c0; $uni-text-color-disable: #c0c0c0;
$roleChoiceColor: #f59e0b;
/* 背景颜色 */ /* 背景颜色 */
$uni-bg-color: #ffffff; $uni-bg-color: #ffffff;
$uni-bg-color-grey: #f8f8f8; $uni-bg-color-grey: #f8f8f8;
$uni-bg-color-hover: #f1f1f1; //点击状态颜色 $uni-bg-color-hover: #f1f1f1; //点击状态颜色
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); //遮罩颜色 $uni-bg-color-mask: rgba(0, 0, 0, 0.4); //遮罩颜色
$uni-bg-color-transparent: rgba(255, 255, 255, 0); //透明色
/* 边框颜色 */ /* 边框颜色 */
$uni-border-color: #c8c7cc; $uni-border-color: #c8c7cc;

Loading…
Cancel
Save