123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <!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">
- </head>
- <body class="bgc-back pb0">
- <div id="app">
- <div class="merchant-list" v-cloak>
- <van-search class="screensearch" v-model="searchContent" placeholder="请输入商户编号/手机号/SN号/姓名" show-action @search="onSearch" @cancel="onCancel"></van-search>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
- <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
- <van-cell-group :border="false">
- <van-cell v-for="item,index in merchants" :title="item.MerchantName" @click="godetail(item.Id)" is-link center>
- <template #label><span class="mr16">注册时间:{{item.KqRegTime}}</span><span>当月交易额(元):{{item.ThisMonthTrade}}</span></template>
- </van-cell>
- </van-cell-group>
- </van-list>
- </van-pull-refresh>
- </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 {
- active: 0,
- searchContent: '',
- merchantTypes: [
- ],
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
-
- merchants:[
- ],
- ProductType:0,
- loading: false,
- finished: false,
- refreshing: false,
- searchcontent:'',
- };
- },
- created() {
- },
- methods: {
- godetail(id){
- PublicLib.putCookieInfo('merchantId', id);
- PublicLib.Goto({Url:'merchant-detail'});
- },
- //- 发起搜索
- onSearch(val) {
- this.searchcontent = val;
- this.getsearchlist();
- },
- onCancel() {
- PublicLib.GoBack({Level:1});
- },
- onLoad() {
- if (this.refreshing) {
- this.merchants = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- }
- this.pageinfo.PageNum++;
- this.getsearchlist();
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
-
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onLoad();
- },
- async getsearchlist(){
- //- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/merchantinfo/merchantsearch?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId,SearchKey:this.searchcontent,ProductType:this.ProductType}));
- if(res.status !== '1') return tips('搜索商户列表失败,请重试!');
- //- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- this.merchants.push(...res.data);
- this.loading = false;
- }
- }
- });
- </script>
- </body>
- </html>
|