Commit 197ac45f by xiexiaoqin

feat: fileList component and deletebtn template

parent 3f22b834
{ {
"pages": [ "pages": [
"pages/meetingDetail/meetingDetail",
"pages/index/index", "pages/index/index",
"pages/editMeeting/editMeeting", "pages/editMeeting/editMeeting",
"pages/participantsDetail/participantsDetail", "pages/participantsDetail/participantsDetail",
...@@ -17,7 +18,6 @@ ...@@ -17,7 +18,6 @@
"pages/remind/remind", "pages/remind/remind",
"pages/scheduleDetail/scheduleDetail", "pages/scheduleDetail/scheduleDetail",
"pages/createOrEditSchedule/createOrEditSchedule", "pages/createOrEditSchedule/createOrEditSchedule",
"pages/attendeeList/attendeeList", "pages/attendeeList/attendeeList"
"pages/meetingDetail/meetingDetail"
] ]
} }
\ No newline at end of file
.task-list {
border: 1rpx solid rgba(245, 246, 247, 1);
border-radius: 16rpx;
border-radius: 16rpx;
padding: 14rpx 16rpx 0;
margin-top: 16rpx;
}
.task-list>.file-box {
position: relative;
padding: 10rpx 10px 10rpx 76rpx;
margin-bottom: 14rpx;
}
.file-box>.file-icon {
position: absolute;
width: 64rpx;
height: 64rpx;
left: 6rpx;
top: 10rpx;
background: url(../../assests/all.png) center /100% 100%;
}
.file-box>.file-title {
font-size: 28rpx;
color: rgba(25, 31, 37, 1);
display: flex;
}
.file-box>.file-title>text:first-child {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.file-box>.file-title>text:last-child {
white-space: nowrap;
}
.file-box>.file-size {
color: rgba(25, 31, 37, 0.56);
font-size: 24rpx;
line-height: 40rpx;
height: 40rpx;
}
.file-box-mask {
background: rgba(25, 31, 37, 0.12)
}
.btns-pop {
padding: 0;
display: flex;
color: white;
height: 57rpx;
border-radius: 6px;
background: rgba(0, 0, 0, 0.8);
position: absolute;
z-index: 9;
top: -73rpx;
left: 50%;
}
.btns-pop>view {
width: 95rpx;
line-height: 57rpx;
text-align: center;
font-size: 26rpx;
}
.edit {
border-right: 1rpx solid #fff;
}
.btns-pop .triangle {
position: absolute;
bottom: -28rpx;
width: 0;
left: 50%;
margin-left: -16rpx;
height: 0;
border-top: 16rpx solid rgba(0, 0, 0, 0.8);
border-bottom: 16rpx solid rgba(0, 0, 0, 0);
border-right: 16rpx solid rgba(0, 0, 0, 0);
border-left: 16rpx solid rgba(0, 0, 0, 0);
}
.pdf {
background: url(../../assests/pdf.png) center /100% 100%;
}
.png, .jpg, .svg, .jpeg {
background: url(../../assests/image.png) center /100% 100%;
}
.docx {
background: url(../../assests/docx.png) center /100% 100%;
}
.mov {
background: url(../../assests/mp4.png) center /100% 100%;
}
.mp4 {
background: url(../../assests/mp4.png) center /100% 100%;
}
.ppt {
background: url(../../assests/ppt.png) center /100% 100%;
}
.pptx {
background: url(../../assests/ppt.png) center /100% 100%;
}
.pdf {
background: url(../../assests/pdf.png) center /100% 100%;
}
.xlsx {
background: url(../../assests/xlsx.png) center /100% 100%;
}
.zip {
background: url(../../assests/zip.png) center /100% 100%;
}
\ No newline at end of file
<view class="task-list">
<view class="file-box {{show ? 'file-box-mask' : ''}}" a:for="{{fileList}}" data-data="{{item}}" onTap="preview" onLongTap="showOperate">
<view class="file-icon {{item.fileType}}"></view>
<view class="file-title">
<text>{{item.filename.slice(0, item.filename.length - 5)}}</text>
<text>{{item.filename.slice(-5)}}</text></view>
<view class="file-size">{{item.filesize}}</view>
<view class="btns-pop" a:if="{{show}}">
<view class="edit" catchTap="updateFile" data-file="{{item.scheduleAccessory}}">
编辑
</view>
<view catchTap="deleteFile" data-file="{{item.scheduleAccessory}}">
删除
</view>
<view class="triangle"></view>
</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {
show: false
},
props: {},
didMount() {
},
didUpdate() {
},
didUnmount() { },
methods: {
preview(e) {
console.log(e)
let file = e.target.dataset.file
let data = {
ddUserId: getApp().globalData.userid,
type: 'download',
fileIds: file.fileId,
projectName: 'MING_MEETING'
}
previewPermissions(data).then(res => {
dd.previewFileInDingTalk({
corpId: dd.corpId,
spaceId: res.data.data,
fileId: file.fileId,
fileName: file.fileName,
fileSize: file.fileSize,
fileType: file.fileType
})
})
},
showOperate() {
this.setData({
show: true
})
},
deleteFile(e) {
// let data = event.target.dataset.file.id
dd.confirm({
title: '删除文件',
content: '确认删除文件吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
// delFile().then(res => {
// this.props.onReload();
// })
}
}
})
},
updateFile(e) {
this.setData({
show: false
})
dd.navigateTo({ url: `./../editFile/editFile?file=${JSON.stringify(e.target.dataset.file)}` })
}
},
});
{
"component": true
}
\ No newline at end of file
@import "../../template/avater/index.acss"; @import "../../template/avater/index.acss";
@import "../../template/deleteBtn/index.acss";
.task-list { .task-list {
border: 1rpx solid rgba(245, 246, 247, 1); border: 1rpx solid rgba(245, 246, 247, 1);
border-radius: 16rpx; border-radius: 16rpx;
...@@ -100,36 +101,17 @@ ...@@ -100,36 +101,17 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.delete-task-wrap {
display: flex;
justify-content: center;
margin: 300rpx auto 34rpx;
}
.delete-task {
border: 1rpx solid rgba(222, 222, 222, 1);
background: #fff;
border-radius: 48rpx;
color: rgba(27, 38, 61, 0.72);
font-size: 28rpx;
line-height: 64rpx;
padding: 0 34rpx;
}
.delete-task .iconfont {
color: rgba(242, 86, 67, 1);
font-size: 28rpx;
margin-right: 18rpx;
}
.checkbox { .checkbox {
border: 3rpx solid rgba(77, 217, 100, 1); border: 3rpx solid rgba(77, 217, 100, 1);
border-radius: 4rpx; border-radius: 4rpx;
width: 28rpx; width: 28rpx;
height: 28rpx; height: 28rpx;
margin-right: 18rpx; margin-right: 18rpx;
text-align: center;
line-height: 28rpx;
} }
.checkbox-active { .checkbox-active>.iconfont {
background: rgba(77, 217, 100, 1); color: rgba(77, 217, 100, 1);
font-size: 24rpx;
} }
\ No newline at end of file
<import src="../../template/avater/index.axml"/> <import src="../../template/avater/index.axml"/>
<import src="../../template/deleteBtn/index.axml"/>
<view class="task-list"> <view class="task-list">
<view class="task-box" a:for='{{taskList}}'> <view class="task-box" a:for='{{taskList}}'>
<template is="checkbox" data="{{status: item.status}}"></template> <template is="checkbox" data="{{status: item.status}}"></template>
...@@ -24,13 +25,11 @@ ...@@ -24,13 +25,11 @@
<view class="name">{{currentTask.username}}</view> <view class="name">{{currentTask.username}}</view>
</view> </view>
</view> </view>
<view class="delete-task-wrap"> <template is="deleteBtn" data="{{title: '删除该任务' }}"/>
<view class="delete-task" onTap="deleteTask">
<text class="iconfont iconicon_noAgreed1"></text>
删除该任务
</view>
</view>
</popup> </popup>
<!-- checkbox模板 {status: status}-->
<template name="checkbox"> <template name="checkbox">
<view class="checkbox {{status ? 'checkbox-active': ''}}" data-status="{{status}}" onTap="CheckChange"></view> <view class="checkbox {{status ? 'checkbox-active': ''}}" data-status="{{status}}" onTap="CheckChange">
<text a:if="{{status}}" class="iconfont iconicon_ok"></text>
</view>
</template> </template>
\ No newline at end of file
...@@ -29,7 +29,7 @@ Component({ ...@@ -29,7 +29,7 @@ Component({
gotoParticipatorPage() { gotoParticipatorPage() {
dd.navigateTo({ url: `../../pages/attendeeList/attendeeList?userId=${this.data.currentTask.userId}` }) dd.navigateTo({ url: `../../pages/attendeeList/attendeeList?userId=${this.data.currentTask.userId}` })
}, },
deleteTask() { handleDelete() {
}, },
inputChange(e) { inputChange(e) {
......
<import src="../../template/avater/index.axml"/> <import src="../../template/avater/index.axml"/>
<view class="column" a:for="{{participatorList}}"> <view class="column" a:for="{{$data.participatorList}}">
<view class="radio {{item.userId == userId ? 'radio-checked' : 'radio-uncheck'}}" data-userId="{{item.userId}}" onTap="onCheckChange"> <template is="radio" data="{{status: item.userId == userId, userId: item.userId}}"/>
<text a:if="{{item.userId == userId}}" class="iconfont iconicon_ok"></text>
</view>
<template is="avater" data="{{item}}"/> <template is="avater" data="{{item}}"/>
<view class="name">{{item.username}}</view> <view class="name">{{item.username}}</view>
</view> </view>
\ No newline at end of file <!-- radio模板 {status: status, userId: userId}-->
<template name='radio'>
<view class="radio {{status ? 'radio-checked' : 'radio-uncheck'}}" data-userId="{{userId}}" onTap="radioChange">
<text a:if="{{status}}" class="iconfont iconicon_ok"></text>
</view>
</template>
\ No newline at end of file
import create from 'dd-store'; import create from 'dd-store';
import PageStore from '../meetingDetail/store';
create.Page({ create.Page({
store: PageStore,
data: { data: {
$data: null,
participatorList: null, participatorList: null,
userId: null userId: null
}, },
onLoad(query) { onLoad(query) {
console.log('onLoad') console.log('onLoad')
console.log(this.store) console.log(this)
this.setData({ this.setData({
...query ...query
}) })
}, },
onCheckChange(e) { radioChange(e) {
//我要通知上一个页面状态变化了,页面和组件共享状态 //我要通知上一个页面状态变化了,页面和组件共享状态
this.setData({ this.setData({
userId: e.target.dataset.userId userId: e.target.dataset.userId
......
...@@ -32,16 +32,22 @@ page { ...@@ -32,16 +32,22 @@ page {
.compose-column>.avater { .compose-column>.avater {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx;
border-radius: 50%; border-radius: 50%;
background-color: rgba(21, 188, 131, 1);
background-position: center;
background-size: 100% 100%;
background-repeat: no-repeat;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
} }
.compose-column>.task-avater {
background: rgba(21, 188, 131, 1);
}
.compose-column>.task-avater>.iconfont {
color: #fff;
font-size: 40rpx;
}
.compose-column .title { .compose-column .title {
color: rgba(27, 38, 61, 1); color: rgba(27, 38, 61, 1);
font-size: 32rpx; font-size: 32rpx;
...@@ -53,7 +59,7 @@ page { ...@@ -53,7 +59,7 @@ page {
margin-left: 32rpx; margin-left: 32rpx;
} }
.task-list { /* .task-list {
border: 1rpx solid rgba(245, 246, 247, 1); border: 1rpx solid rgba(245, 246, 247, 1);
border-radius: 16rpx; border-radius: 16rpx;
border-radius: 16rpx; border-radius: 16rpx;
...@@ -73,7 +79,7 @@ page { ...@@ -73,7 +79,7 @@ page {
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
} } */
.task-box>.avater { .task-box>.avater {
width: 48rpx; width: 48rpx;
...@@ -96,7 +102,7 @@ page { ...@@ -96,7 +102,7 @@ page {
margin-right: 18rpx; margin-right: 18rpx;
} }
.task-list>.file-box { /* .task-list>.file-box {
position: relative; position: relative;
padding: 10rpx 10px 10rpx 76rpx; padding: 10rpx 10px 10rpx 76rpx;
margin-bottom: 14rpx; margin-bottom: 14rpx;
...@@ -131,7 +137,7 @@ page { ...@@ -131,7 +137,7 @@ page {
color: rgba(25, 31, 37, 0.56); color: rgba(25, 31, 37, 0.56);
font-size: 24rpx; font-size: 24rpx;
line-height: 40rpx; line-height: 40rpx;
} } */
.footer { .footer {
background: #fff; background: #fff;
......
<import src="../../template/avater/index.axml"/>
<view class="list"> <view class="list">
<block a:for="{{actionList}}"> <block a:for="{{actionList}}">
<view a:if="{{!item.logType}}" class='simple-column'>{{item.content}}</view>
<view a:if="{{item.logType == 'task'}}" class='compose-column'> <view a:if="{{item.logType == 'task'}}" class='compose-column'>
<view class="avater"></view> <view class="avater task-avater">
<text class="iconfont iconicon_task1"></text>
</view>
<view class="title"> <view class="title">
会议任务 会议任务
<text>{{item.createTime}}</text> <text>{{item.createTime}}</text>
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
<task-list taskList="{{item.taskInfos}}" onInputChange="inputChange" onCheckChange="checkChange" onReload="reload"/> <task-list taskList="{{item.taskInfos}}" onInputChange="inputChange" onCheckChange="checkChange" onReload="reload"/>
</view> </view>
<view a:if="{{item.logType == 'asseory'}}" class='compose-column'> <view a:if="{{item.logType == 'asseory'}}" class='compose-column'>
<view class="avater"></view> <template is="avater" data="{{item}}"/>
<view class="title"> <view class="title">
{{item.creator}} {{item.creator}}
<text>{{item.createTime}}</text> <text>{{item.createTime}}</text>
...@@ -18,23 +20,9 @@ ...@@ -18,23 +20,9 @@
<view class="desc"> <view class="desc">
{{item.description}} {{item.description}}
</view> </view>
<view class="task-list"> <file-list fileList="{{item.fileInfos}}" onReload="reload"/>
<view class="file-box">
<view class="file-icon"></view>
<view class="file-title">
<text>产品MVP核心流程中用后中用后</text>
<text>汇总.pdf</text></view>
<view class="file-size">103kb</view>
</view>
<view class="file-box">
<view class="file-icon"></view>
<view class="file-title">
<text>产品MVP核心流程中用后中用后</text>
<text>汇总.pdf</text></view>
<view class="file-size">103kb</view>
</view>
</view>
</view> </view>
<view a:else class='simple-column'>{{item.content}}</view>
</block> </block>
</view> </view>
<view class="footer"> <view class="footer">
......
...@@ -30,7 +30,8 @@ create.Page({ ...@@ -30,7 +30,8 @@ create.Page({
id: 1, content: '大actionList鹏13::00创建了会议', logType: '' id: 1, content: '大actionList鹏13::00创建了会议', logType: ''
}, },
{ {
id: 2, creator: '大鹏', createTime: '13::00', logType: 'asseory', id: 2, username: '大鹏', creator: '大鹏', createTime: '13::00', logType: 'asseory',
headUrl: '',
fileInfos: [{ fileInfos: [{
filename: '打算的你到哪搜点', fileSize: '1201' filename: '打算的你到哪搜点', fileSize: '1201'
}] }]
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
}, },
"usingComponents": { "usingComponents": {
"popup": "../../components/popup/index", "popup": "../../components/popup/index",
"task-list": "../../components/taskList/taskList" "task-list": "../../components/taskList/taskList",
"file-list": "../../components/fileList/fileList"
} }
} }
\ No newline at end of file
.delete-task-wrap {
display: flex;
justify-content: center;
margin: 300rpx auto 34rpx;
}
.delete-task {
border: 1rpx solid rgba(222, 222, 222, 1);
background: #fff;
border-radius: 48rpx;
color: rgba(27, 38, 61, 0.72);
font-size: 28rpx;
line-height: 64rpx;
padding: 0 34rpx;
}
.delete-task .iconfont {
color: rgba(242, 86, 67, 1);
font-size: 28rpx;
margin-right: 18rpx;
}
\ No newline at end of file
<template name="deleteBtn">
<view class="delete-task-wrap">
<view class="delete-task" onTap="handleDelete">
<text class="iconfont iconicon_noAgreed1"></text>
{{title}}
</view>
</view>
</template>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment