123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>搜索-我的创客-创业帮</title>
- <meta name="keywords" content="搜索-我的创客-创业帮">
- <meta name="description" content="搜索-我的创客-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="搜索-我的创客-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .top0{
- top:0;
- z-index:-1;
- }
- </style>
- </head>
- <body class="bgc-back">
- <div id="app">
- <div class="bgcfff abs top0" ref="wrapper2" style="width:100%;"></div>
- <div v-cloak style="z-index:99">
- <van-sticky class="search-box">
- <van-search v-model="searchContent" :placeholder="searchplace" show-action @search="onSearch" @cancel="onCancel" shape="round"></van-search>
- </van-sticky>
- <div class="ovh">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="creaters.length === 0 ? 'isnodata':''">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <van-cell-group :border="false">
- <van-cell v-for="item,index in creaters" center @click="getcreaterdetail(item.Id)" is-link>
- <template #icon>
- <div class="mr12">
- <van-image class="searchimg" :src="item.HeadPhoto" fit="cover" lazy-load round></van-image>
- </div>
- </template>
- <template #title><span class="f16 c333 vb">{{item.RealName}}</span><span class="f12 c999 ml16 vb">注册时间:{{item.CreateDate}}</span></template>
- <template #label>
- <div class="f12 c999">本月交易额(元):{{Number(item.ThisMonthTrade) | tofixed2}}</div>
- </template>
- </van-cell>
- </van-cell-group>
- </van-list>
- </van-pull-refresh>
- </div>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- searchplace:'',
- isnodata:false,
- searchContent: '',
- isShow: false,
- creaters: [
- ],
- loading: false,
- finished: false,
- refreshing: false,
- pageinfo:{
- PageSize:15,
- PageNum:1
- }
- };
- },
- created(){
- this.ischange = PublicLib.getCookieInfo('ischange') === 'true' ? true : false;
- },
- mounted(){
- this.searchplace = this.ischange ? '请输入创客编码' : '请输入创客姓名';
- this.$refs.wrapper2.style.height = `${Func.getStatusBarHeight()}px`;
- },
- methods: {
- getcreaterdetail(id){
- id = id ? id : PublicLib.getCookieInfo('userId');
- PublicLib.putCookieInfo('querycreaterid', id);
- if(this.ischange){
- PublicLib.Goto({Url:'maker-details-change'});
- }else{
- PublicLib.Goto({Url:'maker-details-echarts'});
- };
- },
- onSearch(val) {
- if(val === '') return tips('搜索项不能为空');
- this.creaters = [];
- this.getcreatelist();
- },
- onCancel() {
- PublicLib.GoBack({Level:1});
- },
- onLoad() {
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- this.pageinfo.PageNum++;
- this.getcreatelist();
- },
- onRefresh() {
- this.pageinfo.PageNum = 1;
- // 清空列表数据
- //- this.creaters = [];
- this.finished = false;
-
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- this.getcreatelist('refresh')
- //- this.onLoad();
- },
- //- 获取创客列表
- async getcreatelist(type = 'onload'){
- let Url = '';
- if(this.ischange){
- Url = 'api/v1/users/SearchMakerList?t='+Math.random(6);
- }else{
- Url = 'api/v1/users/mymakerlist?t='+Math.random(6);
- };
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest(Url,JSON.stringify({...this.pageinfo,RealName:this.searchContent,UserId,Sort:'',UserLevel:''}));
- if(res.status !== '1') return tips('获取创客列表失败,请重试!');
- if(res.data.length<15) {
- this.finished = true;
- };
- if(type==='refresh'){
- this.creaters = res.data
- this.refreshing = false;
- }
- if(type==='onload'){
- this.creaters.push(...res.data);
- }
- this.loading = false;
- if(this.creaters.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- }
- });
- </script>
- </body>
- </html>
|