creater-search.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>搜索-我的创客-创业帮</title>
  6. <meta name="keywords" content="搜索-我的创客-创业帮">
  7. <meta name="description" content="搜索-我的创客-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="搜索-我的创客-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .top0{
  18. top:0;
  19. z-index:-1;
  20. }
  21. </style>
  22. </head>
  23. <body class="bgc-back">
  24. <div id="app">
  25. <div class="bgcfff abs top0" ref="wrapper2" style="width:100%;"></div>
  26. <div v-cloak style="z-index:99">
  27. <van-sticky class="search-box">
  28. <van-search v-model="searchContent" :placeholder="searchplace" show-action @search="onSearch" @cancel="onCancel" shape="round"></van-search>
  29. </van-sticky>
  30. <div class="ovh">
  31. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="creaters.length === 0 ? 'isnodata':''">
  32. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  33. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  34. <van-cell-group :border="false">
  35. <van-cell v-for="item,index in creaters" center @click="getcreaterdetail(item.Id)" is-link>
  36. <template #icon>
  37. <div class="mr12">
  38. <van-image class="searchimg" :src="item.HeadPhoto" fit="cover" lazy-load round></van-image>
  39. </div>
  40. </template>
  41. <template #title><span class="f16 c333 vb">{{item.RealName}}</span><span class="f12 c999 ml16 vb">注册时间:{{item.CreateDate}}</span></template>
  42. <template #label>
  43. <div class="f12 c999">本月交易额(元):{{Number(item.ThisMonthTrade) | tofixed2}}</div>
  44. </template>
  45. </van-cell>
  46. </van-cell-group>
  47. </van-list>
  48. </van-pull-refresh>
  49. </div>
  50. </div>
  51. </div>
  52. <script src="./static/js/klm-vv.min.js"></script>
  53. <script src="./static/js/appfunc.min.js"></script>
  54. <script src="./static/js/klm-axios-config.js"></script>
  55. <script src="./static/js/publicfn.js"></script>
  56. <script>
  57. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  58. // 可以通过下面的方式手动注册
  59. Vue.use(vant.Lazyload);
  60. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  61. // 在 #app 标签下渲染一个按钮组件
  62. let app = new Vue({
  63. el: '#app',
  64. data() {
  65. return {
  66. searchplace:'',
  67. isnodata:false,
  68. searchContent: '',
  69. isShow: false,
  70. creaters: [
  71. ],
  72. loading: false,
  73. finished: false,
  74. refreshing: false,
  75. pageinfo:{
  76. PageSize:15,
  77. PageNum:1
  78. }
  79. };
  80. },
  81. created(){
  82. this.ischange = PublicLib.getCookieInfo('ischange') === 'true' ? true : false;
  83. },
  84. mounted(){
  85. this.searchplace = this.ischange ? '请输入创客编码' : '请输入创客姓名';
  86. this.$refs.wrapper2.style.height = `${Func.getStatusBarHeight()}px`;
  87. },
  88. methods: {
  89. getcreaterdetail(id){
  90. id = id ? id : PublicLib.getCookieInfo('userId');
  91. PublicLib.putCookieInfo('querycreaterid', id);
  92. if(this.ischange){
  93. PublicLib.Goto({Url:'maker-details-change'});
  94. }else{
  95. PublicLib.Goto({Url:'maker-details-echarts'});
  96. };
  97. },
  98. onSearch(val) {
  99. if(val === '') return tips('搜索项不能为空');
  100. this.creaters = [];
  101. this.getcreatelist();
  102. },
  103. onCancel() {
  104. PublicLib.GoBack({Level:1});
  105. },
  106. onLoad() {
  107. if (this.refreshing) {
  108. this.list = [];
  109. this.refreshing = false;
  110. }
  111. this.pageinfo.PageNum++;
  112. this.getcreatelist();
  113. },
  114. onRefresh() {
  115. this.pageinfo.PageNum = 1;
  116. // 清空列表数据
  117. //- this.creaters = [];
  118. this.finished = false;
  119. // 重新加载数据
  120. // 将 loading 设置为 true,表示处于加载状态
  121. this.loading = true;
  122. if (this.refreshing) {
  123. this.list = [];
  124. this.refreshing = false;
  125. }
  126. this.getcreatelist('refresh')
  127. //- this.onLoad();
  128. },
  129. //- 获取创客列表
  130. async getcreatelist(type = 'onload'){
  131. let Url = '';
  132. if(this.ischange){
  133. Url = 'api/v1/users/SearchMakerList?t='+Math.random(6);
  134. }else{
  135. Url = 'api/v1/users/mymakerlist?t='+Math.random(6);
  136. };
  137. const UserId = PublicLib.getCookieInfo('userId');
  138. const res = await getRequest(Url,JSON.stringify({...this.pageinfo,RealName:this.searchContent,UserId,Sort:'',UserLevel:''}));
  139. if(res.status !== '1') return tips('获取创客列表失败,请重试!');
  140. if(res.data.length<15) {
  141. this.finished = true;
  142. };
  143. if(type==='refresh'){
  144. this.creaters = res.data
  145. this.refreshing = false;
  146. }
  147. if(type==='onload'){
  148. this.creaters.push(...res.data);
  149. }
  150. this.loading = false;
  151. if(this.creaters.length === 0) {this.isnodata = true}else{this.isnodata = false};
  152. },
  153. }
  154. });
  155. </script>
  156. </body>
  157. </html>