|
|
@ -20,11 +20,11 @@ |
|
|
|
<view class="" slot="body"> {{ tip.text }} </view> |
|
|
|
<view class="flex justify-end" slot="foot"> |
|
|
|
<u-button size="mini" @tap="onCancel">取消</u-button> |
|
|
|
<u-button v-if="tip.status === 1" size="mini" @tap="onPause">暂停</u-button> |
|
|
|
<u-button v-if="tip.status === 2" size="mini" @tap="onContinu">继续</u-button> |
|
|
|
<u-button v-if="tip.status === 1 || tip.status === 2" size="mini" @tap="onRestart">重新开始</u-button> |
|
|
|
<u-button v-if="tip.status === 1 || tip.status === 2" type="primary" size="mini" @tap="onComplete">结束</u-button> |
|
|
|
<u-button v-if="tip.status === 0 || tip.status === 3" type="primary" size="mini" @tap="onConfirm">确定</u-button> |
|
|
|
<u-button v-if="tip.status === 1" size="mini" @tap="onChangeStatus(1)">暂停</u-button> |
|
|
|
<u-button v-if="tip.status === 2" size="mini" @tap="onChangeStatus(2)">继续</u-button> |
|
|
|
<u-button v-if="tip.status === 1 || tip.status === 2" size="mini" @tap="onChangeStatus(0)">重新开始</u-button> |
|
|
|
<u-button v-if="tip.status === 1 || tip.status === 2" type="primary" size="mini" @tap="onChangeStatus(3)">结束</u-button> |
|
|
|
<u-button v-if="tip.status === 0 || tip.status === 3" type="primary" size="mini" @tap="onChangeStatus(0)">确定</u-button> |
|
|
|
</view> |
|
|
|
</u-card> |
|
|
|
</view> |
|
|
@ -58,17 +58,14 @@ export default { |
|
|
|
this.onCancel(); |
|
|
|
}, |
|
|
|
|
|
|
|
// TODO: 暂停 |
|
|
|
onPause() {}, |
|
|
|
|
|
|
|
// 重新开始 |
|
|
|
onRestart() {}, |
|
|
|
|
|
|
|
// 结束完成 |
|
|
|
onComplete() {}, |
|
|
|
|
|
|
|
// 继续 |
|
|
|
onContinu() {}, |
|
|
|
/** |
|
|
|
* 执行修改任务状态的动作 |
|
|
|
* @param {number} type 状态码 0开始 1暂停 2继续 3完成 默认0 |
|
|
|
*/ |
|
|
|
onChangeStatus(type) { |
|
|
|
const param = { id: this.tip.taskId, type }; |
|
|
|
// TODO: 发请求 |
|
|
|
}, |
|
|
|
|
|
|
|
// 点击了取消 |
|
|
|
onCancel() { |
|
|
|