Commit 11cf6ca3 authored by Damon's avatar Damon

refactor: 备件去掉搜索

parent db22cdc3
<template> <template>
<view class="u-flex det-wrap"> <view class="u-flex det-wrap">
<view class="search">
<u-search
:clearabled="true"
:action-style="searchStyle"
bg-color="#fff"
v-model="keyword"
@custom="searchParts"
@search="searchParts"
></u-search>
</view>
<view class="content" v-if="lists.length > 0"> <view class="content" v-if="lists.length > 0">
<scroll-view style="height: 100%;" scroll-y="true"> <scroll-view style="height: 100%;" scroll-y="true">
<select-parts <select-parts
...@@ -56,16 +45,10 @@ ...@@ -56,16 +45,10 @@
}, },
data() { data() {
return { return {
lists: [], lists: []
keyword: ''
} }
}, },
computed: { computed: {
searchStyle() {
return {
color: "#2272FF"
};
},
// 配件数 // 配件数
partNum() { partNum() {
return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0) return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0)
...@@ -85,10 +68,7 @@ ...@@ -85,10 +68,7 @@
}, },
methods: { methods: {
getReserve() { getReserve() {
const params = { this.$u.api.getMyReserve().then(res => {
keyword: this.keyword
}
this.$u.api.getMyReserve(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
const data = res.data || [] const data = res.data || []
this.lists = data.map(v => { this.lists = data.map(v => {
...@@ -101,11 +81,6 @@ ...@@ -101,11 +81,6 @@
} }
}) })
}, },
// 搜索配件
searchParts(val) {
this.keyword = val
this.getReserve()
},
numChange(val, index) { numChange(val, index) {
this.$set(this.lists[index], 'quantity', val) this.$set(this.lists[index], 'quantity', val)
}, },
......
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