2024-08-07 14:44:11 +08:00
< template >
< view class = "zd_container" >
< nav-bar :title = "title" > < / nav-bar >
< view class = "zd_content" >
< view class = "zd_wrapper" >
2024-08-07 17:59:31 +08:00
< view class = "zd-row border-bottom" >
< view class = "zd-col-7" >
< span class = "filter_label" > { { $t ( 'filter.point' ) } } < / span >
2024-08-07 14:44:11 +08:00
< / view >
2024-08-09 14:52:18 +08:00
< view class = "zd-col-24" >
< input type = "text" class = "filter_input" v-model = "code" disabled >
2024-08-07 14:44:11 +08:00
< / view >
< / view >
< / view >
< / view >
< view class = "zd-row submit-bar" >
2024-08-07 17:59:31 +08:00
< button class = "zd-col-11 button-default" @click ="cancle" > {{ $ t ( ' button.cancel ' ) }} < / button >
< button class = "zd-col-11 button-primary" : class = "{'button-info': index === ''}" :disabled = "disabled" @tap ="_updateTask('1')" > {{ $ t ( ' take -and -place ' ) }} < / button >
2024-08-07 14:44:11 +08:00
< / view >
< / view >
< / template >
< script >
import NavBar from '@/components/NavBar.vue'
import { updateTask } from '@/utils/getData2.js'
export default {
components : {
NavBar
} ,
data ( ) {
return {
title : '' ,
2024-08-09 14:52:18 +08:00
code : 'QFQ_4' ,
2024-08-07 17:59:31 +08:00
disabled : false
2024-08-07 14:44:11 +08:00
} ;
} ,
onLoad ( options ) {
this . title = options . title
} ,
methods : {
2024-08-07 17:59:31 +08:00
selectChange ( e ) {
this . index = e
this . disabled = false
} ,
cancle ( ) {
this . index = ''
} ,
2024-08-07 14:44:11 +08:00
async _updateTask ( type ) {
this . disabled = true
2024-08-07 17:59:31 +08:00
if ( ! this . index ) {
2024-08-07 14:44:11 +08:00
this . disabled = false
2024-08-07 17:59:31 +08:00
return
}
try {
2024-08-09 14:52:18 +08:00
let res = await updateTask ( this . code , type )
2024-08-07 17:59:31 +08:00
this . cancle ( )
2024-08-07 14:44:11 +08:00
uni . showToast ( {
2024-08-08 10:23:55 +08:00
title : res . message ,
2024-08-07 14:44:11 +08:00
icon : 'none'
} )
} catch ( err ) {
this . disabled = false
}
}
}
}
< / script >
< style lang = "stylus" scoped >
< / style >