增加搜索功能
This commit is contained in:
parent
9eb875ea08
commit
0cfc3aebc7
|
|
@ -11,8 +11,8 @@
|
|||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view>选择用户</view>
|
||||
<view class="u-m-t-24 u-flex u-row-between " @tap="chooseUser">
|
||||
<view v-if="!user">选择用户</view>
|
||||
<view class="u-flex" v-else>
|
||||
<view v-if="!user||!user.id">选择用户</view>
|
||||
<view class="u-flex" v-if="user&&user.id">
|
||||
<up-avatar :src="user.headImg" shape="square" :size="30"></up-avatar>
|
||||
<!-- <view class="headeimg">
|
||||
<image class="img" :src="user.headImg" mode=""></image>
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
<view class="u-p-b-24 ">
|
||||
<view class="font-bold">订单备注</view>
|
||||
<view class="u-m-t-32 u-flex ">
|
||||
<uni-easyinput type="textarea" v-model="note" placeholder="请输入备注"></uni-easyinput>
|
||||
<uni-easyinput type="textarea" v-model="note" placeholder="请输入备注"></uni-easyinput>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@
|
|||
<view class="u-font-28 color-666 ">搜索</view>
|
||||
<view class="u-flex u-m-t-20 u-flex-wrap u-row-between">
|
||||
<view class="u-m-b-30" v-for="(goodsItem, goodsIndex) in searchResult" :key="goodsIndex">
|
||||
<goods-item :img="{width:'330rpx',height:'370rpx'}" @chooseGuige="chooseGuige($event,index)"
|
||||
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
|
||||
:index="goodsIndex" :data="goodsItem"></goods-item>
|
||||
<goods-item :img="{width:'330rpx',height:'330rpx'}" @chooseGuige="chooseGuige($event,goodsItem.index)"
|
||||
@add="goodsUpdate($event,goodsItem.index,true)" @reduce="goodsUpdate($event,index,false)"
|
||||
:index="goodsItem.goodsIndex" :data="goodsItem"></goods-item>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -462,10 +462,21 @@
|
|||
function returnSearchGoods() {
|
||||
const newval = searchValue.value
|
||||
let arr = []
|
||||
let goods=[]
|
||||
for(let i in data.tabbar){
|
||||
const goodsArr=data.tabbar[i].foods||[]
|
||||
for(let k in goodsArr){
|
||||
goods.push({
|
||||
...goodsArr[k],
|
||||
index:i,
|
||||
goodsIndex:k
|
||||
})
|
||||
}
|
||||
}
|
||||
if (newval == "") {
|
||||
arr = $originGoods;
|
||||
arr = goods;
|
||||
} else {
|
||||
arr = $originGoods.filter((v) =>
|
||||
arr = goods.filter((v) =>
|
||||
v.name.includes(newval.trim())
|
||||
);
|
||||
}
|
||||
|
|
@ -984,7 +995,6 @@
|
|||
// watchChooseuser()
|
||||
watchChooseTable()
|
||||
watchUpdate()
|
||||
init()
|
||||
})
|
||||
let isCreateOrderToDetail = ref(false)
|
||||
onLoad((opt) => {
|
||||
|
|
@ -1002,7 +1012,7 @@
|
|||
// go.back()
|
||||
// }, 1500)
|
||||
// }
|
||||
// init()
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue