Browse Source

修改企业搜索展示二维码图片

v3
chenrui 2 years ago
parent
commit
b72adf9a7a
  1. 13
      src/views/enforce/noScanFilter.vue
  2. 10
      src/views/enterprise/companyFilter.vue

13
src/views/enforce/noScanFilter.vue

@ -38,7 +38,7 @@
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"> <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<div class="case-item" v-for="(item, index) in dataList" :key="index" @click="toDetail(item)"> <div class="case-item" v-for="(item, index) in dataList" :key="index" @click="toDetail(item)">
<span class="company-code"><img src="../../assets/images/code-ex.jpg"></span> <span class="company-code"><img :src="item.qrCodeUrl"></span>
<div class="case-title">{{ item.enterpriseName }}</div> <div class="case-title">{{ item.enterpriseName }}</div>
<!-- <div class="case-depart">{{ item.phonenumber }}</div> <!-- <div class="case-depart">{{ item.phonenumber }}</div>
<div class="case-time">{{ item.loginName }}</div> --> <div class="case-time">{{ item.loginName }}</div> -->
@ -54,8 +54,9 @@
<script setup> <script setup>
import {ref,defineEmits,getCurrentInstance,defineProps } from 'vue'; import {ref,defineEmits,getCurrentInstance,defineProps } from 'vue';
// import {queryUsers} from '../../api/user' // import {queryUsers} from '../../api/user'
import {queryEnterpriseInfoList} from '@/api/enterprise' import {queryEnterpriseInfoList,queryEnterpriseInfoListAndQrInfo} from '@/api/enterprise'
import {getDict} from "@/api/Home"; import {getDict} from "@/api/Home";
import {baseUrl} from "@/config/env";
const {useCommon} = $globalStore; const {useCommon} = $globalStore;
//子组件调用父组件方法 //子组件调用父组件方法
const emits = defineEmits(['reciveData','close']); const emits = defineEmits(['reciveData','close']);
@ -113,7 +114,7 @@ const props = defineProps( {
} }
const queryList = () =>{ const queryList = () =>{
searchParam.pageNum = (curPage.value-1)*searchParam.pageSize; searchParam.pageNum = (curPage.value-1)*searchParam.pageSize;
queryEnterpriseInfoList(searchParam, success => { queryEnterpriseInfoListAndQrInfo(searchParam, success => {
curPage.value++; curPage.value++;
loading.value = false; // 查出结果停止加载 loading.value = false; // 查出结果停止加载
if (success.total <= dataList.value.length) { if (success.total <= dataList.value.length) {
@ -121,6 +122,10 @@ const props = defineProps( {
finished.value = true; finished.value = true;
return; return;
} }
for (let index = 0; index < success.rows.length; index++) {
const element = success.rows[index];
element.qrCodeUrl = baseUrl + element.qrCodeUrl
}
// this.dataList = success.data // this.dataList = success.data
dataList.value.push(...success.rows); dataList.value.push(...success.rows);
}, error => { }, error => {
@ -132,7 +137,7 @@ const props = defineProps( {
onRefresh(); onRefresh();
} }
const cancel = () =>{ const cancel = () =>{
searchParam.enterpriseName = ''; searchParam.searchValue = '';
search() search()
} }
const selectData = (item) =>{ const selectData = (item) =>{

10
src/views/enterprise/companyFilter.vue

@ -17,7 +17,7 @@
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad"> <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<div class="case-item" v-for="(item, index) in dataList" :key="index" @click="selectData(item)"> <div class="case-item" v-for="(item, index) in dataList" :key="index" @click="selectData(item)">
<span class="company-code"><img src="../../assets/images/code-ex.jpg"></span> <span class="company-code"><img :src="item.qrCodeUrl"></span>
<div class="case-title">{{ item.enterpriseName }}</div> <div class="case-title">{{ item.enterpriseName }}</div>
<!-- <div class="case-depart">{{ item.phonenumber }}</div> <!-- <div class="case-depart">{{ item.phonenumber }}</div>
<div class="case-time">{{ item.loginName }}</div> --> <div class="case-time">{{ item.loginName }}</div> -->
@ -32,7 +32,7 @@
<script> <script>
import {ref} from 'vue' import {ref} from 'vue'
// import {queryUsers} from '../../api/user' // import {queryUsers} from '../../api/user'
import {queryEnterpriseInfoList} from '../../api/enterprise' import {queryEnterpriseInfoList,queryEnterpriseInfoListAndQrInfo} from '@/api/enterprise'
const {useCommon} = $globalStore const {useCommon} = $globalStore
export default { export default {
@ -83,7 +83,7 @@
}, },
queryList() { queryList() {
this.searchParam.pageNum = (this.curPage-1)*this.searchParam.pageSize; this.searchParam.pageNum = (this.curPage-1)*this.searchParam.pageSize;
queryEnterpriseInfoList(this.searchParam, success => { queryEnterpriseInfoListAndQrInfo(this.searchParam, success => {
this.curPage++; this.curPage++;
this.loading = false; // 查出结果停止加载 this.loading = false; // 查出结果停止加载
if (success.total <= this.dataList.length) { if (success.total <= this.dataList.length) {
@ -91,6 +91,10 @@
this.finished = true; this.finished = true;
return; return;
} }
for (let index = 0; index < success.rows.length; index++) {
const element = success.rows[index];
element.qrCodeUrl = baseUrl + element.qrCodeUrl
}
// this.dataList = success.data // this.dataList = success.data
this.dataList.push(...success.rows); this.dataList.push(...success.rows);
}, error => { }, error => {

Loading…
Cancel
Save