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