From d7fe8ae3888c8e2b1eea3c1e3769be0d42a21cc9 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 16 十月 2023 09:03:47 +0800
Subject: [PATCH] Merge branch '1.0.3' of http://139.186.142.91:10010/r/productDev/dmMes into 1.0.3
---
minipro_standard/pages_adjust/components/user.vue | 57 +++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 41 insertions(+), 16 deletions(-)
diff --git a/minipro_standard/pages_adjust/components/user.vue b/minipro_standard/pages_adjust/components/user.vue
index ad496c9..4e82b0f 100644
--- a/minipro_standard/pages_adjust/components/user.vue
+++ b/minipro_standard/pages_adjust/components/user.vue
@@ -5,11 +5,11 @@
</view>
<view class="content">
<view class="content_search">
- <u-search :showAction="false" placeholder="鎼滅储濮撳悕" v-model="keyword"></u-search>
+ <u-search :showAction="false" placeholder="鎼滅储濮撳悕" v-model="form.name" @search="searchInput"></u-search>
</view>
- <div class="content_total">鍏眥{total}}鏉℃暟鎹�</div>
+ <div class="content_total">鍏眥{form.total}}鏉℃暟鎹�</div>
<scroll-view class="content_list" scroll-y>
- <div class="content_list_item" v-for="(item, index) in indexList" :key="index" @click="getVal(item)">
+ <div class="content_list_item" v-for="(item, index) in list" :key="index" @click="jump(item)">
<div class="content_list_item_name">
<span>{{item.name}}</span>
</div>
@@ -20,35 +20,60 @@
</template>
<script>
+ import { allUser } from '@/util/api/PlanningAPI'
export default {
props: {
show: Boolean
},
data() {
return {
- keyword: '',
- total: 0,
- indexList: []
+ list: [],
+ loading: false,
+ finished: false,
+ refreshing: false,
+ form: {
+ capacity: 50,
+ page: 0,
+ total: 0,
+ name: ''
+ }
};
},
methods: {
- getVal(item) {
+ // 鎼滅储妗�
+ searchInput(data) {
+ this.form.page = 0
+ this.finished = false
+ this.list = []
+ this.loadmore()
+ },
+ jump(item) {
this.$emit('value', item)
},
open() {
- this.indexList = []
- this.loadmore()
- },
- scrolltolower() {
+ this.list = []
+ this.form.page = 0
+ this.finished = false
+ this.list = []
this.loadmore()
},
loadmore() {
- for (let i = 0; i < 20; i++) {
- this.indexList.push({
- id: i,
- name: `鏉庝紵锝滅敓浜ч儴锝�${i}`
+ allUser({ name: this.form.name })
+ .then(res => {
+ if (res.code === 200 && res.data && res.data.length !== 0) {
+ this.form.total = res.data.length
+ this.list = res.data
+ } else {
+ this.finished = true;
+ }
+ }).catch(err => {
+ this.loading = false;
+ this.finished = true;
+ if (this.refreshing) {
+ this.list = []
+ this.refreshing = false;
+ }
})
- }
},
close() {
this.$emit('close')
--
Gitblit v1.9.3