Commit 78a9fb5b by xiexiaoqin

fix: task complete button disabled status

parent e10bad17
<import src="../../template/avater/index.axml"/> <import src="../../template/avater/index.axml"/>
<import src="../../template/deleteBtn/index.axml"/> <import src="../../template/deleteBtn/index.axml"/>
<import src="../../template/checkbox/index.axml"/> <import src="../../template/checkbox/index.axml"/>
<view a:if="{{action == 'create'}}" class="picker-complete {{disabled ? 'btn-disabled' : ''}}" onTap='complete'>完成</view> <view a:if="{{action == 'create'}}" class="picker-complete {{!currentTask.taskInfos.taskTitle ? 'btn-disabled' : ''}}" onTap='complete'>完成</view>
<view class="task-column edit-column"> <view class="task-column edit-column">
<template a:if="{{action == 'update'}}" is="checkbox" data="{{status: currentTask.taskStatus, id:currentTask.id}}"></template> <template a:if="{{action == 'update'}}" is="checkbox" data="{{status: currentTask.taskStatus, id:currentTask.id}}"></template>
<input onInput="inputChange" value="{{currentTask.taskInfos.taskTitle}}" placeholder="请输入任务标题"/> <input onInput="inputChange" value="{{currentTask.taskInfos.taskTitle}}" placeholder="请输入任务标题"/>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="task-column participator-top" data-acceptorId="{{currentTask.acceptorId}}" onTap="handleExcutorChange"> <view class="task-column participator-top" data-acceptorId="{{currentTask.acceptorId}}" onTap="handleExcutorChange">
<text class="iconicon_attender iconfont icon"></text> <text class="iconicon_attender iconfont icon"></text>
<text class="participator-title">{{currentTask.acceptorInfo ? '执行人' : '设置执行人'}}</text> <text class="participator-title">{{currentTask.acceptorInfo ? '执行人' : '设置执行人'}}</text>
<text class="iconright iconfont icon"</text> <text class="iconright iconfont icon"></text>
</view> </view>
<view class="participator-bottom" a:if="{{currentTask.acceptorInfo}}"> <view class="participator-bottom" a:if="{{currentTask.acceptorInfo}}">
<view class="people" data-acceptorId="{{currentTask.acceptorId}}" onTap="handleExcutorChange"> <view class="people" data-acceptorId="{{currentTask.acceptorId}}" onTap="handleExcutorChange">
......
...@@ -5,8 +5,7 @@ create.Component({ ...@@ -5,8 +5,7 @@ create.Component({
store: pageStore, store: pageStore,
mixins: [], mixins: [],
data: { data: {
currentTask: null, //store currentTask: null //store
disabled: true
}, },
props: { props: {
action: '' action: ''
...@@ -31,9 +30,6 @@ create.Component({ ...@@ -31,9 +30,6 @@ create.Component({
}, },
inputChange: debounce(function (e) { inputChange: debounce(function (e) {
const value = e.detail.value; const value = e.detail.value;
this.setData({
disabled: !value
})
this.store.data.currentTask.taskInfos = { taskTitle: value }; this.store.data.currentTask.taskInfos = { taskTitle: value };
this.update(); this.update();
}, 100), }, 100),
...@@ -51,7 +47,7 @@ create.Component({ ...@@ -51,7 +47,7 @@ create.Component({
complete: throttle( complete: throttle(
function () { function () {
const { currentTask } = this.store.data; const { currentTask } = this.store.data;
if (this.data.disabled) { if (!currentTask.taskInfos.taskTitle) {
return return
} }
this.props.onComplete() this.props.onComplete()
......
...@@ -9,20 +9,19 @@ page { ...@@ -9,20 +9,19 @@ page {
margin-top: 16rpx; margin-top: 16rpx;
} }
.affair-list>view {
margin-bottom: 48rpx;
}
.simple-column { .simple-column {
color: rgba(25, 31, 37, 0.4); color: rgba(25, 31, 37, 0.4);
font-size: 26rpx; font-size: 26rpx;
line-height: 68rpx; line-height: 1.5;
text-align: center; text-align: center;
margin-bottom: 48rpx;
} }
.compose-column { .compose-column {
position: relative; position: relative;
padding-left: 104rpx; padding-left: 104rpx;
margin-bottom: 48rpx;
padding-top: 16rpx;
} }
.compose-column>.avater { .compose-column>.avater {
...@@ -32,7 +31,7 @@ page { ...@@ -32,7 +31,7 @@ page {
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 16rpx;
} }
.compose-column>.task-avater { .compose-column>.task-avater {
...@@ -498,6 +497,7 @@ input { ...@@ -498,6 +497,7 @@ input {
.affair-list-title { .affair-list-title {
font-size: 40rpx; font-size: 40rpx;
color: rgba(25, 31, 37, 1); color: rgba(25, 31, 37, 1);
margin-bottom: 64rpx;
} }
.permissionContant { .permissionContant {
......
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