merchant-search.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. </head>
  17. <body class="bgc-back pb0">
  18. <div id="app">
  19. <div class="merchant-list" v-cloak>
  20. <van-search class="screensearch" v-model="searchContent" placeholder="请输入商户编号/手机号/SN号/姓名" show-action @search="onSearch" @cancel="onCancel"></van-search>
  21. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  22. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  23. <van-cell-group :border="false">
  24. <van-cell v-for="item,index in merchants" :title="item.MerchantName" @click="godetail(item.Id)" is-link center>
  25. <template #label><span class="mr16">注册时间:{{item.KqRegTime}}</span><span>当月交易额(元):{{item.ThisMonthTrade}}</span></template>
  26. </van-cell>
  27. </van-cell-group>
  28. </van-list>
  29. </van-pull-refresh>
  30. </div>
  31. </div>
  32. <script src="./static/js/klm-vv.min.js"></script>
  33. <script src="./static/js/appfunc.min.js"></script>
  34. <script src="./static/js/klm-axios-config.js"></script>
  35. <script src="./static/js/publicfn.js"></script>
  36. <script>
  37. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  38. // 可以通过下面的方式手动注册
  39. Vue.use(vant.Lazyload);
  40. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  41. // 在 #app 标签下渲染一个按钮组件
  42. let app = new Vue({
  43. el: '#app',
  44. data() {
  45. return {
  46. active: 0,
  47. searchContent: '',
  48. merchantTypes: [
  49. ],
  50. pageinfo:{
  51. PageSize:10,
  52. PageNum:1
  53. },
  54. merchants:[
  55. ],
  56. ProductType:0,
  57. loading: false,
  58. finished: false,
  59. refreshing: false,
  60. searchcontent:'',
  61. };
  62. },
  63. created() {
  64. },
  65. methods: {
  66. godetail(id){
  67. PublicLib.putCookieInfo('merchantId', id);
  68. PublicLib.Goto({Url:'merchant-detail'});
  69. },
  70. //- 发起搜索
  71. onSearch(val) {
  72. this.searchcontent = val;
  73. this.getsearchlist();
  74. },
  75. onCancel() {
  76. PublicLib.GoBack({Level:1});
  77. },
  78. onLoad() {
  79. if (this.refreshing) {
  80. this.merchants = [];
  81. this.refreshing = false;
  82. this.pageinfo.PageNum = 0;
  83. }
  84. this.pageinfo.PageNum++;
  85. this.getsearchlist();
  86. },
  87. onRefresh() {
  88. // 清空列表数据
  89. this.finished = false;
  90. // 重新加载数据
  91. // 将 loading 设置为 true,表示处于加载状态
  92. this.loading = true;
  93. this.onLoad();
  94. },
  95. async getsearchlist(){
  96. //- PublicLib.ShowLoading({Message:''});
  97. const UserId = PublicLib.getCookieInfo('userId');
  98. const res = await getRequest('api/v1/merchantinfo/merchantsearch?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId,SearchKey:this.searchcontent,ProductType:this.ProductType}));
  99. if(res.status !== '1') return tips('搜索商户列表失败,请重试!');
  100. //- PublicLib.HideLoading();
  101. if(res.data.length < this.pageinfo.PageSize) {
  102. this.finished = true;
  103. };
  104. this.merchants.push(...res.data);
  105. this.loading = false;
  106. }
  107. }
  108. });
  109. </script>
  110. </body>
  111. </html>