bind-detail-collection.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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="bgcf5f5f5 pb0 ovh" style="padding-top:0; height:100vh;">
  18. <div id="app" v-cloak>
  19. <van-nav-bar class="mall_title bottom_line" 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="ovx-y">
  23. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height:90vh;" :class="codelist.length === 0 ? 'isnodata':''">
  24. <van-empty class="custom-image" image="./static/images/no-data.png" description="您的门店暂未绑定收款码" v-if="codelist.length === 0 &amp;&amp; flag"> </van-empty>
  25. <div class="bind_detail_collection">
  26. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
  27. <div class="bind_detail_collection_card df bgcfff" v-for="item,index in codelist" :key="index"><img src="./static/images/index-collectioncode.png" alt="">
  28. <div class="card_info">
  29. <div class="df">
  30. <div class="f14 c333 name">绑定门店: {{item.MerchantName}}</div>
  31. </div>
  32. <div class="df">
  33. <nobr class="f12 c999 title">绑定时间</nobr>
  34. <div class="f12 c999 content">{{item.BindDate}}</div>
  35. </div>
  36. <div class="df">
  37. <nobr class="f12 c999 title">SN码</nobr>
  38. <div class="f12 c999 content">{{item.SnNo}}</div>
  39. </div>
  40. <div class="df"></div>
  41. </div>
  42. <div class="card_btn f14" v-if="item.BindFlag === 0" @click="gorelation(item.Id)">去关联</div>
  43. <div class="card_btn_un f14" v-else @click="removecollection(item.Id)">解除关联</div>
  44. </div>
  45. </van-list>
  46. </div>
  47. </van-pull-refresh>
  48. </div>
  49. <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300" theme="round-button" confirm-button-text="确定" v-model="examinedialogisshow" title="解除关联失败" message="此收款码为音响码,替换后方可解除关联" @confirm="examinedialogisshow = false"> </van-dialog>
  50. </div>
  51. <script src="./static/js/klm-vv.min.js"></script>
  52. <script src="./static/js/klm-axios-config.js"></script>
  53. <script>
  54. function OnStart(){
  55. app.onstartcollectionlist();
  56. };
  57. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  58. // 可以通过下面的方式手动注册
  59. Vue.use(vant.Lazyload);
  60. // 在 #app 标签下渲染一个按钮组件
  61. let app = new Vue({
  62. el: '#app',
  63. data() {
  64. return {
  65. flag:false,
  66. toptitleisshow:false,
  67. examinedialogisshow:false,
  68. loading: false,
  69. finished: false,
  70. refreshing: false,
  71. codelist:[],
  72. pageinfo:{
  73. PageSize:10,
  74. PageNum:1,
  75. },
  76. unbindid:'',
  77. };
  78. },
  79. created() {
  80. this.toptitleisshow = toptitleisshow;
  81. this.getcollectionlist();
  82. },
  83. methods: {
  84. goback(){
  85. PublicLib.GoBack({Level:1});
  86. },
  87. onRefresh(){
  88. this.loading = true;
  89. this.refreshing = true;
  90. this.onLoad();
  91. },
  92. onLoad() {
  93. if (this.refreshing) {
  94. this.codelist = [];
  95. this.refreshing = false;
  96. this.pageinfo.PageNum = 0;
  97. }
  98. this.pageinfo.PageNum++;
  99. this.getcollectionlist();
  100. },
  101. gorelation(id){
  102. this.codelist = [];
  103. PublicLib.putCookieInfo('collectionId', id);
  104. PublicLib.Goto({Url:'bind-detail-sound-relation'});
  105. },
  106. //- 已绑二维码列表
  107. async getcollectionlist(){
  108. let MerchantId = PublicLib.getCookieInfo('userId')
  109. const res = await getRequest('/api/v1/merchantqrcode/list?t='+Math.random(6),JSON.stringify({...this.pageinfo,MerchantId}));
  110. if(res.status !== '1') return tips(res.info);
  111. if(res.data.length < this.pageinfo.PageSize){
  112. this.finished = true;
  113. };
  114. this.flag = true;
  115. this.codelist.push(...res.data);
  116. this.loading = false;
  117. },
  118. //- 已绑二维码列表
  119. async onstartcollectionlist(){
  120. this.pageinfo.PageNum = 1;
  121. let MerchantId = PublicLib.getCookieInfo('userId')
  122. const res = await getRequest('/api/v1/merchantqrcode/list?t='+Math.random(6),JSON.stringify({...this.pageinfo,MerchantId}));
  123. if(res.status !== '1') return tips(res.info);
  124. if(res.data.length < this.pageinfo.PageSize){
  125. this.finished = true;
  126. };
  127. this.flag = true;
  128. this.codelist = res.data;
  129. this.loading = false;
  130. },
  131. //- 解除二维码绑定
  132. removecollection(Id){
  133. PublicLib.putCookieInfo('unbindqrcode', Id);
  134. PublicLib.ShowDialog({
  135. Title:'解除关联',
  136. Message:'是否解除关联二维码?',
  137. ConfirmText:'解除关联',
  138. CancelText:'暂不解除',
  139. ConfirmAction:'app.removefn()',
  140. CanelAction:''
  141. });
  142. },
  143. async removefn(){
  144. const Id = PublicLib.getCookieInfo("unbindqrcode")
  145. const MerchantId = PublicLib.getCookieInfo('userId')
  146. const res = await postRequest('/api/v1/merchantqrcode/remove?t='+Math.random(6),JSON.stringify({Id,MerchantId}));
  147. if(res.status !== '1') {
  148. this.examinedialogisshow = true
  149. }else{
  150. tips('解除关联成功')
  151. //- 解除关联操作
  152. this.codelist.forEach(item=>{
  153. if(item.Id == Id){
  154. item.BindFlag = 0;
  155. };
  156. });
  157. };
  158. },
  159. }
  160. });
  161. </script>
  162. </body>
  163. </html>