邓宏
2 years ago
7 changed files with 153 additions and 29 deletions
@ -0,0 +1,61 @@ |
|||
<style lang="scss"> |
|||
.container{ |
|||
height:100%; |
|||
background:#f6f6f6; |
|||
scroll-view{ |
|||
flex-grow: 1; |
|||
height:1rpx; |
|||
background:#fff; |
|||
view{ |
|||
color:#777; |
|||
padding:20rpx 30rpx; |
|||
border-bottom:1rpx solid rgba(221, 221, 221, 0.5); |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
<template> |
|||
<view class="container flex"> |
|||
<d-search v-model="searchVal" @search="search"/> |
|||
<scroll-view scroll-y> |
|||
<view v-for="(v,k) in list" :key="k" @click="select(v)">{{v}}</view> |
|||
</scroll-view> |
|||
</view> |
|||
</template> |
|||
<script> |
|||
import request from '@/common/request' |
|||
export default { |
|||
data(){ |
|||
return{ |
|||
searchVal:"", |
|||
list:[], |
|||
eventChannel:null, |
|||
} |
|||
}, |
|||
onLoad(options){ |
|||
this.eventChannel=this.getOpenerEventChannel() |
|||
this.searchVal=options.data |
|||
this.search() |
|||
}, |
|||
methods:{ |
|||
async search(){ |
|||
var res=await request("/api/goods/supplierShow",{ |
|||
params:{supplier: this.searchVal} |
|||
}) |
|||
if(res.statu){ |
|||
this.list=res.data |
|||
}else{ |
|||
uni.showModal({ |
|||
title:"提示", |
|||
content:res.msg||"获取供应商列表失败!", |
|||
showCancel:false, |
|||
}) |
|||
} |
|||
}, |
|||
select(e){ |
|||
this.eventChannel.emit("update",e) |
|||
uni.navigateBack() |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue