bind-detail-sound.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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">
  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" v-cloak>
  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. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
  26. <div class="bind_detail_collection bgcfff" v-for="item,index in codelist" :key="index">
  27. <div class="bind_detail_collection_card df bgcfff"><img src="./static/images/index-sound.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.BindingTime}}</div>
  35. </div>
  36. <div class="df">
  37. <nobr class="f12 c999 title">SN码</nobr>
  38. <div class="f12 c999 content">{{item.PosSn}}</div>
  39. </div>
  40. </div>
  41. <div class="card_btn_un f14" @click="unbind(item.Id)">解除音响</div>
  42. </div>
  43. <div class="relationcode df" @click="roundisshowfn(item.Id)" v-if="item.QrCodeList.length !== 0"><img src="./static/images/index-relation-code.png" alt="">
  44. <div class="f14 c333">关联收款码数量 {{item.BindCount}}</div>
  45. <div class="open" :ref="'anim'+item.Id"></div>
  46. </div>
  47. <div class="round" v-if="roundisshow === item.Id">
  48. <div class="bind_detail_collection_card df bgcfff bindcode" v-for="obj,ind in item.QrCodeList" :key="ind"><img src="./static/images/index-collectioncode.png" alt="">
  49. <div class="card_info">
  50. <div class="df">
  51. <div class="f14 c333 name">收款码</div>
  52. </div>
  53. <div class="df">
  54. <nobr class="f12 c999 title">绑定时间</nobr>
  55. <div class="f12 c999 content">{{obj.BindDate}}</div>
  56. </div>
  57. <div class="df">
  58. <nobr class="f12 c999 title">SN码</nobr>
  59. <div class="f12 c999 content">{{obj.Sn}}</div>
  60. </div>
  61. </div>
  62. <div class="card_btn_relieve f14" @click="unbindsound(obj.Id,item.Id)">解除关联</div>
  63. </div>
  64. </div>
  65. </div>
  66. </van-list>
  67. </van-pull-refresh>
  68. </div>
  69. <van-dialog class="option" style="border-radius:4px;" v-model="dialogisshow" message="解绑后该音响将不可再次绑定,音响下关联的全部收款码将变为未关联状态!" width="300" title="确认解绑音响?" confirm-button-text="确认解绑" show-cancel-button @confirm="relieve" @cancel="dialogisshow = false"> </van-dialog>
  70. <van-dialog class="option" style="border-radius:4px;" v-model="undialogisshow" message="确认解除关联?" width="300" title="解除关联" confirm-button-text="确认解除" show-cancel-button @confirm="qrcoderelieve" @cancel="dialogisshow = false"> </van-dialog>
  71. </div>
  72. <script src="./static/js/klm-vv.min.js"></script>
  73. <script src="./static/js/klm-axios-config.js"></script>
  74. <script>
  75. function OnStart(){
  76. };
  77. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  78. // 可以通过下面的方式手动注册
  79. Vue.use(vant.Lazyload);
  80. // 在 #app 标签下渲染一个按钮组件
  81. let app = new Vue({
  82. el: '#app',
  83. data() {
  84. return {
  85. flag:false,
  86. dialogisshow:false,
  87. undialogisshow:false,
  88. roundisshow:'',
  89. toptitleisshow:false,
  90. loading: false,
  91. finished: false,
  92. refreshing: false,
  93. codelist:[
  94. ],
  95. previouselement:'',
  96. pageinfo:{
  97. PageSize:10,
  98. PageNum:1,
  99. },
  100. unbindId:'',
  101. unbindqrId:'',
  102. codeId:'',
  103. };
  104. },
  105. created() {
  106. this.toptitleisshow = toptitleisshow;
  107. this.getsoundlist();
  108. },
  109. methods: {
  110. //- 绑定音响列表
  111. async getsoundlist(){
  112. let BindMerchantId = PublicLib.getCookieInfo('userId');
  113. const res = await getRequest('/api/v1/posmachines/bindedmachines?t='+Math.random(6),JSON.stringify({...this.pageinfo,BindMerchantId}));
  114. if(res.status !== '1') return tips(res.info);
  115. if(res.data.length < this.pageinfo.PageSize){
  116. this.finished = true;
  117. };
  118. this.flag = true;
  119. this.codelist.push(...res.data);
  120. this.loading = false;
  121. },
  122. //- 解除音响绑定
  123. async removesound(Id){
  124. let BindMerchantId = PublicLib.getCookieInfo('userId')
  125. const res = await postRequest('/api/v1/posmachines/remove?t='+Math.random(6),JSON.stringify({Id,BindMerchantId}));
  126. if(res.status !== '1') {
  127. tips(res.info);
  128. }else{
  129. //- 解除关联操作,从列表中去除音响
  130. const index = this.codelist.findIndex(item=>{
  131. return item.Id === Id;
  132. });
  133. this.codelist.splice(index,1);
  134. tips('音响解绑成功!');
  135. };
  136. },
  137. //- 解除二维码关联
  138. async removeqrcode(Id){
  139. let MerchantId = PublicLib.getCookieInfo('userId')
  140. const res = await postRequest('/api/v1/merchantqrcode/remove?t='+Math.random(6),JSON.stringify({Id,MerchantId}));
  141. if(res.status !== '1') {
  142. tips(res.info);
  143. }else{
  144. //- 解除关联操作,从列表中去除
  145. let qrid = '';
  146. this.codelist.forEach(item=>{
  147. if(item.Id === this.codeId){
  148. qrid = item.QrCodeList.findIndex(obj=>obj.Id = this.unbindqrId);
  149. item.QrCodeList.splice(qrid,1);
  150. };
  151. });
  152. tips('收款码解绑成功!')
  153. };
  154. },
  155. onRefresh(){
  156. this.loading = true;
  157. this.refreshing = true;
  158. this.onLoad();
  159. },
  160. onLoad() {
  161. if (this.refreshing) {
  162. this.codelist = [];
  163. this.refreshing = false;
  164. this.pageinfo.PageNum = 0;
  165. }
  166. this.pageinfo.PageNum++;
  167. this.getsoundlist();
  168. },
  169. goback(){
  170. PublicLib.GoBack({Level:1});
  171. },
  172. roundisshowfn(id){
  173. if(this.previouselement !== ''){
  174. this.previouselement.className = 'open unanim'
  175. }
  176. if(id === this.roundisshow) {
  177. this.$refs['anim'+id][0].className = 'open unanim';
  178. return this.roundisshow = '';
  179. };
  180. this.roundisshow = id;
  181. this.previouselement = this.$refs['anim'+id][0];
  182. this.$refs['anim'+id][0].className = 'open anim';
  183. },
  184. //- 替换
  185. //- replace(Id){
  186. //- PublicLib.putCookieInfo('soundqrcodeId', Id);
  187. //- PublicLib.Goto({Url:'bind-detail-sound-replace'});
  188. //- },
  189. //- 解除
  190. relieve(){
  191. this.removesound(this.unbindId);
  192. },
  193. //- 音响解除
  194. unbind(Id){
  195. this.dialogisshow = true;
  196. this.unbindId = Id;
  197. },
  198. //- 二维码解除
  199. unbindsound(Id,qrcodeid){
  200. this.undialogisshow = true;
  201. this.unbindqrId = Id;
  202. this.codeId = qrcodeid;
  203. },
  204. //- 二维码解除
  205. qrcoderelieve(){
  206. this.removeqrcode(this.unbindqrId);
  207. }
  208. }
  209. });
  210. </script>
  211. </body>
  212. </html>