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-07 17:59:31 +08:00
< view class = "zd-col-24 filter_select" >
< uni-data-select :placeholder = "placeholder" v-model = "index" :localdata="options" @change="selectChange" > < / uni -data -select >
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 {
2024-08-07 17:59:31 +08:00
placeholder : this . $t ( 'uni.dataSelect.placeholder' ) ,
2024-08-07 14:44:11 +08:00
title : '' ,
2024-08-07 17:59:31 +08:00
options : [ { text : 'QFQ_2' , value : 'QFQ_2' } , { text : 'QFQ_4' , value : 'QFQ_4' } ] ,
index : '' ,
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 {
let res = await updateTask ( this . index , type )
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 >