需求修改

This commit is contained in:
蔡玲
2024-09-06 09:35:26 +08:00
parent b4f459a974
commit 20f8520be2
8 changed files with 137 additions and 38 deletions

View File

@@ -5,18 +5,34 @@
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">区域</span>
<span class="filter_label">区域</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
<uni-data-select v-model="index1" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">区域二</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index2" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">区域三</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index3" :localdata="options1"></uni-data-select>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index === ''}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index === ''}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === '' && index2 === '' && index3 === ''}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === '' && index2 === '' && index3 === ''}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
</view>
</view>
</template>
@@ -24,6 +40,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
// import {regionList} from '@/utils/mork2.js'
import {regionList, handheldLock} from '@/utils/getData2.js'
export default {
components: {
@@ -33,8 +50,10 @@
data() {
return {
title: '',
options: [],
index: '',
options1: [],
index1: '',
index2: '',
index3: '',
disabled: false
};
},
@@ -45,22 +64,20 @@
methods: {
async _regionList () {
let res = await regionList()
this.options = [...res.content]
this.options.map(el => {
this.options1 = [...res.content]
this.options1.map(el => {
this.$set(el, 'text', el.label)
})
},
selectChange (e) {
this.index = e
},
async _handheldLock (type) {
this.disabled = true
if (this.index === '') {
if (this.index1 === '' && this.index2 === '' && this.index3 === '') {
this.disabled = false
return
}
try {
let res = await handheldLock(this.index, type)
let arr = [this.index1, this.index2, this.index3]
let res = await handheldLock(arr, type)
this.clearUp()
uni.showToast({
title: res.message,
@@ -71,7 +88,9 @@
}
},
clearUp () {
this.index = ''
this.index1 = ''
this.index2 = ''
this.index3 = ''
this.disabled = false
}
}