|
|
@@ -17,7 +17,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view @click="confirmCustom(item)" class="user-list-item_box" v-for="(item,index) in list" :key="item.id">
|
|
|
+ <view @click="confirmCustom(item)" class="user-list-item_box" v-for="(item,index) in currentCustomList" :key="item.id">
|
|
|
<view class="head-box">
|
|
|
<view class="name">{{item.name}}</view>
|
|
|
</view>
|
|
|
@@ -37,29 +37,30 @@ export default {
|
|
|
props: {
|
|
|
myCustomList: {
|
|
|
type: Array,
|
|
|
- default: 0
|
|
|
+ default:[]
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
searchUser: '',
|
|
|
- list:[],
|
|
|
- focusInput:true
|
|
|
+ currentCustomList:[],
|
|
|
+ focusInput:false
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
if (!this.$util.isEmpty(this.myCustomList)) {
|
|
|
- this.list = this.myCustomList
|
|
|
+ this.currentCustomList = this.myCustomList
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
watch:{
|
|
|
myCustomList:{
|
|
|
handler(newList){
|
|
|
- this.list = newList
|
|
|
+ if (!this.$util.isEmpty(newList)) {
|
|
|
+ this.currentCustomList = newList
|
|
|
+ }
|
|
|
},
|
|
|
- immediate:true
|
|
|
+ immediate:true,
|
|
|
+ deep:true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -89,9 +90,9 @@ export default {
|
|
|
customList({ name: this.searchUser,isCashier:1 }).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
if(res.data.list.length > 12){
|
|
|
- this.list = res.data.list.slice(0,12)
|
|
|
+ this.currentCustomList = res.data.list.slice(0,12)
|
|
|
}else{
|
|
|
- this.list = res.data.list
|
|
|
+ this.currentCustomList = res.data.list
|
|
|
}
|
|
|
}
|
|
|
})
|