user-warehouse-mini-list.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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="pb0 ovh pt0">
  18. <div class="warehouse-mini" id="app" v-cloak style="height:100vh;background-color: #F6F6F6;">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16 rightc333" left-arrow title="小分仓" v-if="toptitleisshow" @click-left="goback">
  20. <template #left><img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="ovh-x" ref="wrapper1" style="height:100vh;">
  23. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="height:100%;min-height:10vh;">
  24. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="creatorList.length === 0"></van-empty>
  25. <van-list v-model="loading" :finished="finished" finished-text="没有更多数据了" @load="onLoad" :immediate-check="false" v-else>
  26. <div class="infoBox bgcfff">
  27. <div class="df jcsb fl-dr-col c000 mb6" v-for="(item,index) in creatorList" :key="index">
  28. <div class="df aic"><img class="mr8 brandimg" :src="'./static/images/product-short'+item.Id+'.png'" alt="">
  29. <div class="f14 c333">{{item.Name}}</div>
  30. </div>
  31. <div class="df jcsb aic" v-for="i,ind in item.SnList" :key="i.Id">
  32. <div class="f12" style="width:4.1rem" :id="'sn'+i.SnNo">{{i.SnNo}}</div>
  33. <div class="btn f12" :data-clipboard-text="i.SnNo" data-clipboard-action="copy" :data-clipboard-target="'#sn'+i.SnNo" :ref="'copy'+i.SnNo" id="copy" @click="copyCode(i.SnNo)" @mouseenter="copyCode(i.SnNo)">复制</div>
  34. </div>
  35. </div>
  36. </div>
  37. </van-list>
  38. </van-pull-refresh>
  39. </div>
  40. </div>
  41. <script src="./static/js/clipboard.min.js"></script>
  42. <script src="./static/js/klm-vv.min.js"></script>
  43. <script src="./static/js/appfunc.min.js"></script>
  44. <script src="./static/js/klm-axios-config.js"></script>
  45. <script src="./static/js/publicfn.js"></script>
  46. <script>
  47. Vue.use(vant.Lazyload);
  48. let app = new Vue({
  49. el: '#app',
  50. data(){
  51. return{
  52. toptitleisshow,
  53. searchContent:'',
  54. refreshing:false,
  55. finished:false,
  56. loading:false,
  57. pageinfo:{
  58. PageSize:10,
  59. PageNum:1
  60. },
  61. creatorList:[
  62. ],
  63. isdata:false,
  64. }
  65. },
  66. created(){
  67. this.getminiWarehouse()
  68. },
  69. beforeUpdate(){
  70. },
  71. methods:{
  72. giveToast(str){
  73. vant.Toast(str);
  74. },
  75. copyCode(index){
  76. const that = this;
  77. this.$nextTick(() => {
  78. that.copyBtn = new ClipboardJS(this.$refs['copy'+index][0]);
  79. const clipboard = that.copyBtn;
  80. clipboard.on('success', function(e) {
  81. that.giveToast('复制成功');
  82. });
  83. clipboard.on('error', function(e) {
  84. that.giveToast('复制失败,请手动选择复制!');
  85. });
  86. });
  87. },
  88. goback(){
  89. PublicLib.GoBack({Level:1});
  90. },
  91. takephone(phonenum){
  92. PublicLib.PhoneCall(phonenum);
  93. },
  94. onLoad(){
  95. this.pageinfo.PageNum++;
  96. this.getminiWarehouse('onload');
  97. console.log(123);
  98. this.refreshing = false;
  99. },
  100. onRefresh(){
  101. this.loading = true;
  102. this.finished = false;
  103. this.pageinfo.PageNum = 1;
  104. this.getminiWarehouse();
  105. this.refreshing = false;
  106. },
  107. //获取列表
  108. async getminiWarehouse(type='refresh'){
  109. const that = this;
  110. let UserId = PublicLib.getCookieInfo('userId');
  111. let {PageSize,PageNum} = this.pageinfo
  112. const res = await getRequest('api/v1/pos/PreSendStockDetail/SnList?t='+Math.random(6),JSON.stringify({UserId,PageSize,PageNum}));
  113. if(res.status !== '1') return tips('请求失败!请重试')
  114. if(res.status === '1'){
  115. if(res.data.length < PageSize){
  116. this.finished = true
  117. };
  118. if(type === 'onload'){
  119. this.creatorList = [...this.creatorList,...res.data];
  120. this.loading = false;
  121. };
  122. if(type === 'refresh'){
  123. this.creatorList = res.data;
  124. };
  125. console.log(this.creatorList);
  126. };
  127. },
  128. },
  129. })
  130. </script>
  131. </body>
  132. </html>