bind-detail-sound-relation.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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"> </van-empty>
  25. <van-radio-group v-model="result">
  26. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
  27. <div class="bind_detail_collection bgcfff" v-for="item,index in codelist" :key="index" @click="toggle(index)">
  28. <div class="bind_detail_collection_card df bgcfff">
  29. <van-radio :name="item" ref="checkboxes" checked-color="#FD824D"> </van-radio><img src="./static/images/index-sound.png" alt="">
  30. <div class="card_info">
  31. <div class="df">
  32. <div class="f14 c333 name">绑定门店: {{item.MerchantName}}</div>
  33. </div>
  34. <div class="df">
  35. <nobr class="f12 c999 title">绑定时间</nobr>
  36. <div class="f12 c999 content">{{item.BindingTime}}</div>
  37. </div>
  38. <div class="df">
  39. <nobr class="f12 c999 title">SN码</nobr>
  40. <div class="f12 c999 content">{{item.PosSn}}</div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </van-list>
  46. </van-radio-group>
  47. </van-pull-refresh>
  48. </div>
  49. <van-goods-action class="mall-bottom">
  50. <van-goods-action-button color="#FD824D" text="确认关联" @click="onClickButton"></van-goods-action-button>
  51. </van-goods-action>
  52. </div>
  53. <script src="./static/js/klm-vv.min.js"></script>
  54. <script src="./static/js/klm-axios-config.js"></script>
  55. <script>
  56. function OnStart(){
  57. };
  58. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  59. // 可以通过下面的方式手动注册
  60. Vue.use(vant.Lazyload);
  61. // 在 #app 标签下渲染一个按钮组件
  62. let app = new Vue({
  63. el: '#app',
  64. data() {
  65. return {
  66. roundisshow:'',
  67. result:{},
  68. toptitleisshow:false,
  69. loading: false,
  70. finished: false,
  71. refreshing: false,
  72. codelist:[
  73. ],
  74. bindId:'',
  75. previouselement:'',
  76. pageinfo:{
  77. PageSize:10,
  78. PageNum:1,
  79. }
  80. };
  81. },
  82. created() {
  83. this.bindId = PublicLib.getCookieInfo('collectionId');
  84. this.toptitleisshow = toptitleisshow;
  85. this.getsoundlist();
  86. },
  87. methods: {
  88. //- 绑定音响列表
  89. async getsoundlist(){
  90. let BindMerchantId = PublicLib.getCookieInfo('userId');
  91. const res = await getRequest('/api/v1/posmachines/bindedmachines?t='+Math.random(6),JSON.stringify({...this.pageinfo,BindMerchantId}));
  92. if(res.status !== '1') return tips(res.info);
  93. if(res.data.length < this.pageinfo.PageSize){
  94. this.finished = true;
  95. };
  96. this.codelist.push(...res.data);
  97. this.result = this.codelist[0];
  98. this.loading = false;
  99. },
  100. goback(){
  101. PublicLib.GoBack({Level:1});
  102. },
  103. onRefresh(){
  104. this.loading = false;
  105. this.refreshing = true;
  106. this.onLoad();
  107. },
  108. onLoad() {
  109. if (this.refreshing) {
  110. this.codelist = [];
  111. this.refreshing = false;
  112. this.pageinfo.PageNum = 0;
  113. }
  114. this.pageinfo.PageNum++;
  115. this.getsoundlist();
  116. },
  117. roundisshowfn(id){
  118. if(this.previouselement !== ''){
  119. this.previouselement.className = 'open unanim'
  120. }
  121. if(id === this.roundisshow) {
  122. this.$refs['anim'+id][0].className = 'open unanim';
  123. return this.roundisshow = '';
  124. };
  125. this.roundisshow = id;
  126. this.previouselement = this.$refs['anim'+id][0];
  127. this.$refs['anim'+id][0].className = 'open anim';
  128. },
  129. toggle(index) {
  130. this.$refs.checkboxes[index].toggle();
  131. },
  132. //- 绑定按钮
  133. async onClickButton(){
  134. let BindMerchantId = PublicLib.getCookieInfo('userId');
  135. const res = await postRequest('/api/v1/posmachines/add?t='+Math.random(6),JSON.stringify({BindMerchantId,QrCodeId:this.bindId,MachineId:this.result.Id}));
  136. if(res.status !== '1' ) return tips(res.info);
  137. tips('关联音响成功!');
  138. setTimeout(()=>{
  139. this.goback();
  140. },2000);
  141. }
  142. }
  143. });
  144. </script>
  145. </body>
  146. </html>