123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <!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 pt0" style="padding-top:0;">
- <div class="merchant_sign" id="app" ref="container" v-cloak>
- <van-nav-bar left-arrow title="暂存箱" @click-left="goback" right-text="全部清除" @click-right="deteleAll" v-if="toptitleisshow">
- <template #left>
- <van-icon name="arrow-left"> </van-icon>
- </template>
- </van-nav-bar>
- <div class="merchant-sign-tabs">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="merchantlist.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>
- <van-swipe-cell v-for="item in merchantlist" :key="item.Id" stop-propagation="true">
- <template>
- <van-cell @click="goestablish(item.Id)">
- <template #title>
- <div class="df">
- <div class="icon df" v-if="item.type === 1">企</div>
- <div class="icon df personle" v-if="item.type === 2">个</div>
- <div class="comname f14">{{item.Name}}
- <div class="f12 c999">创建时间:{{item.CreateDate}}</div>
- </div>
- </div>
- </template>
- <template #default>
- <div class="df center"><img src="./static/images/sign-wait.png" alt="">
- <div>未提交</div>
- </div>
- </template>
- </van-cell>
- </template>
- <template #right>
- <van-button class="delete-button" square text="删除" type="danger" @click="cellDetele(item.Id)"></van-button>
- </template>
- </van-swipe-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);
- Vue.use(vant.Dialog);
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- isnodata:false,
- toptitleisshow:false,
- checkactive:0,
- searchcontent:'',
- merchantTypes: [
- {
- id: 1,
- title: '全部',
- dot:2,
- },
- {
- id: 2,
- title: '审核中',
- dot:2,
- },
- {
- id: 3,
- title: '审核失败',
- dot:2,
- },
- {
- id: 4,
- title: '待签约',
- dot:200,
- },
- {
- id: 5,
- title: '已签约',
- dot:900,
- },
- ],
- merchantlist:[
- ],
- loading: false,
- finished: false,
- refreshing: false,
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- };
- },
- created(){
- this.toptitleisshow = toptitleisshow;
- this.getmerchantlist('refresh');
- },
- mounted() {
- },
- methods: {
- goestablish(id){
- PublicLib.putCookieInfo('storageId', id);
- PublicLib.putCookieInfo('isformstorage', 1);
- PublicLib.Goto({Url:'merchant-establish'});
- },
- onSearch(){
- if(this.searchcontent === '') {
- return tips('请输入搜索关键词!')
- };
- console.log('搜索逻辑!')
- },
- //- 删除单元格
- async cellDetele(id) {
- const index = this.merchantlist.findIndex(item=>{
- return item.id === id;
- });
- this.merchantlist.splice(index,1);
- //- TODO:调取接口删除数据
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('api/v1/merchantinfo/delete?t='+Math.random(6),JSON.stringify({Id:id,UserId}));
- if(res.status === '1'){
- tips('删除成功!');
- }else{
- tips('删除失败,请退出后重试!');
- };
- this.isnodata = this.merchantlist.length === 0 ? true : false;
- },
- deteleAll(){
- this.merchantlist = [];
- this.isnodata = this.merchantlist.length === 0 ? true : false;
- //- TODO:调取接口删除全部数据
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- onLoad() {
- if (this.refreshing) {
- //- this.merchantlist = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- };
- this.pageinfo.PageNum++;
- this.getmerchantlist();
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.pageinfo.PageNum = 1;
- this.getmerchantlist('refresh')
- },
- //- 获取暂存箱列表
- async getmerchantlist(type = 'onload'){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/merchantinfo/tmpmerchantlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId}));
- if(res.status !== '1') return tips('获取暂存商户列表失败,请重试!');
- //- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- if(type === 'refresh'){
- this.merchantlist = res.data
- this.refreshing = false;
- }else{
- this.merchantlist.push(...res.data);
- }
- this.loading = false;
- if(this.merchantlist.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- }
- });
- </script>
- </body>
- </html>
|