merchant-temporary-storage.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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 pt0" style="padding-top:0;">
  18. <div class="merchant_sign" id="app" ref="container" v-cloak>
  19. <van-nav-bar left-arrow title="暂存箱" @click-left="goback" right-text="全部清除" @click-right="deteleAll" v-if="toptitleisshow">
  20. <template #left>
  21. <van-icon name="arrow-left"> </van-icon>
  22. </template>
  23. </van-nav-bar>
  24. <div class="merchant-sign-tabs">
  25. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="merchantlist.length === 0 ? 'isnodata':''">
  26. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false">
  27. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  28. <van-cell-group>
  29. <van-swipe-cell v-for="item in merchantlist" :key="item.Id" stop-propagation="true">
  30. <template>
  31. <van-cell @click="goestablish(item.Id)">
  32. <template #title>
  33. <div class="df">
  34. <div class="icon df" v-if="item.type === 1">企</div>
  35. <div class="icon df personle" v-if="item.type === 2">个</div>
  36. <div class="comname f14">{{item.Name}}
  37. <div class="f12 c999">创建时间:{{item.CreateDate}}</div>
  38. </div>
  39. </div>
  40. </template>
  41. <template #default>
  42. <div class="df center"><img src="./static/images/sign-wait.png" alt="">
  43. <div>未提交</div>
  44. </div>
  45. </template>
  46. </van-cell>
  47. </template>
  48. <template #right>
  49. <van-button class="delete-button" square text="删除" type="danger" @click="cellDetele(item.Id)"></van-button>
  50. </template>
  51. </van-swipe-cell>
  52. </van-cell-group>
  53. </van-list>
  54. </van-pull-refresh>
  55. </div>
  56. </div>
  57. <script src="./static/js/klm-vv.min.js"></script>
  58. <script src="./static/js/appfunc.min.js"></script>
  59. <script src="./static/js/klm-axios-config.js"></script>
  60. <script src="./static/js/publicfn.js"></script>
  61. <script>
  62. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  63. // 可以通过下面的方式手动注册
  64. Vue.use(vant.Lazyload);
  65. Vue.use(vant.Dialog);
  66. // 在 #app 标签下渲染一个按钮组件
  67. let app = new Vue({
  68. el: '#app',
  69. data() {
  70. return {
  71. isnodata:false,
  72. toptitleisshow:false,
  73. checkactive:0,
  74. searchcontent:'',
  75. merchantTypes: [
  76. {
  77. id: 1,
  78. title: '全部',
  79. dot:2,
  80. },
  81. {
  82. id: 2,
  83. title: '审核中',
  84. dot:2,
  85. },
  86. {
  87. id: 3,
  88. title: '审核失败',
  89. dot:2,
  90. },
  91. {
  92. id: 4,
  93. title: '待签约',
  94. dot:200,
  95. },
  96. {
  97. id: 5,
  98. title: '已签约',
  99. dot:900,
  100. },
  101. ],
  102. merchantlist:[
  103. ],
  104. loading: false,
  105. finished: false,
  106. refreshing: false,
  107. pageinfo:{
  108. PageSize:10,
  109. PageNum:1
  110. },
  111. };
  112. },
  113. created(){
  114. this.toptitleisshow = toptitleisshow;
  115. this.getmerchantlist('refresh');
  116. },
  117. mounted() {
  118. },
  119. methods: {
  120. goestablish(id){
  121. PublicLib.putCookieInfo('storageId', id);
  122. PublicLib.putCookieInfo('isformstorage', 1);
  123. PublicLib.Goto({Url:'merchant-establish'});
  124. },
  125. onSearch(){
  126. if(this.searchcontent === '') {
  127. return tips('请输入搜索关键词!')
  128. };
  129. console.log('搜索逻辑!')
  130. },
  131. //- 删除单元格
  132. async cellDetele(id) {
  133. const index = this.merchantlist.findIndex(item=>{
  134. return item.id === id;
  135. });
  136. this.merchantlist.splice(index,1);
  137. //- TODO:调取接口删除数据
  138. const UserId = PublicLib.getCookieInfo('userId');
  139. const res = await postRequest('api/v1/merchantinfo/delete?t='+Math.random(6),JSON.stringify({Id:id,UserId}));
  140. if(res.status === '1'){
  141. tips('删除成功!');
  142. }else{
  143. tips('删除失败,请退出后重试!');
  144. };
  145. this.isnodata = this.merchantlist.length === 0 ? true : false;
  146. },
  147. deteleAll(){
  148. this.merchantlist = [];
  149. this.isnodata = this.merchantlist.length === 0 ? true : false;
  150. //- TODO:调取接口删除全部数据
  151. },
  152. goback(){
  153. PublicLib.GoBack({Level:1});
  154. },
  155. onLoad() {
  156. if (this.refreshing) {
  157. //- this.merchantlist = [];
  158. this.refreshing = false;
  159. this.pageinfo.PageNum = 0;
  160. };
  161. this.pageinfo.PageNum++;
  162. this.getmerchantlist();
  163. },
  164. onRefresh() {
  165. // 清空列表数据
  166. this.finished = false;
  167. // 重新加载数据
  168. // 将 loading 设置为 true,表示处于加载状态
  169. this.loading = true;
  170. this.pageinfo.PageNum = 1;
  171. this.getmerchantlist('refresh')
  172. },
  173. //- 获取暂存箱列表
  174. async getmerchantlist(type = 'onload'){
  175. const UserId = PublicLib.getCookieInfo('userId');
  176. const res = await getRequest('/api/v1/merchantinfo/tmpmerchantlist?t='+Math.random(6),JSON.stringify({...this.pageinfo,UserId}));
  177. if(res.status !== '1') return tips('获取暂存商户列表失败,请重试!');
  178. //- PublicLib.HideLoading();
  179. if(res.data.length < this.pageinfo.PageSize) {
  180. this.finished = true;
  181. };
  182. if(type === 'refresh'){
  183. this.merchantlist = res.data
  184. this.refreshing = false;
  185. }else{
  186. this.merchantlist.push(...res.data);
  187. }
  188. this.loading = false;
  189. if(this.merchantlist.length === 0) {this.isnodata = true}else{this.isnodata = false};
  190. },
  191. }
  192. });
  193. </script>
  194. </body>
  195. </html>