123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>已绑详情-已绑音响-创业帮</title>
- <meta name="keywords" content="已绑详情-已绑音响-创业帮">
- <meta name="description" content="已绑详情-已绑音响-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="已绑详情-已绑音响-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgcf5f5f5 pb0 ovh" style="padding-top:0; height:100vh;">
- <div id="app">
- <van-nav-bar class="mall_title bottom_line" title="已绑音响" v-if="toptitleisshow" @click-left="goback">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="ovx-y" v-cloak>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height:90vh;" :class="codelist.length === 0 ? 'isnodata':''">
- <van-empty class="custom-image" image="./static/images/no-data.png" description="您的门店暂未绑定音响" v-if="codelist.length === 0 && flag"> </van-empty>
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
- <div class="bind_detail_collection bgcfff" v-for="item,index in codelist" :key="index">
- <div class="bind_detail_collection_card df bgcfff"><img src="./static/images/index-sound.png" alt="">
- <div class="card_info">
- <div class="df">
- <div class="f14 c333 name">绑定门店: {{item.MerchantName}}</div>
- </div>
- <div class="df">
- <nobr class="f12 c999 title">绑定时间</nobr>
- <div class="f12 c999 content">{{item.BindingTime}}</div>
- </div>
- <div class="df">
- <nobr class="f12 c999 title">SN码</nobr>
- <div class="f12 c999 content">{{item.PosSn}}</div>
- </div>
- </div>
- <div class="card_btn_un f14" @click="unbind(item.Id)">解除音响</div>
- </div>
- <div class="relationcode df" @click="roundisshowfn(item.Id)" v-if="item.QrCodeList.length !== 0"><img src="./static/images/index-relation-code.png" alt="">
- <div class="f14 c333">关联收款码数量 {{item.BindCount}}</div>
- <div class="open" :ref="'anim'+item.Id"></div>
- </div>
- <div class="round" v-if="roundisshow === item.Id">
- <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="">
- <div class="card_info">
- <div class="df">
- <div class="f14 c333 name">收款码</div>
- </div>
- <div class="df">
- <nobr class="f12 c999 title">绑定时间</nobr>
- <div class="f12 c999 content">{{obj.BindDate}}</div>
- </div>
- <div class="df">
- <nobr class="f12 c999 title">SN码</nobr>
- <div class="f12 c999 content">{{obj.Sn}}</div>
- </div>
- </div>
- <div class="card_btn_relieve f14" @click="unbindsound(obj.Id,item.Id)">解除关联</div>
- </div>
- </div>
- </div>
- </van-list>
- </van-pull-refresh>
- </div>
- <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>
- <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>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- function OnStart(){
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- flag:false,
- dialogisshow:false,
- undialogisshow:false,
- roundisshow:'',
- toptitleisshow:false,
- loading: false,
- finished: false,
- refreshing: false,
- codelist:[
- ],
- previouselement:'',
- pageinfo:{
- PageSize:10,
- PageNum:1,
- },
- unbindId:'',
- unbindqrId:'',
- codeId:'',
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.getsoundlist();
- },
- methods: {
- //- 绑定音响列表
- async getsoundlist(){
- let BindMerchantId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/posmachines/bindedmachines?t='+Math.random(6),JSON.stringify({...this.pageinfo,BindMerchantId}));
- if(res.status !== '1') return tips(res.info);
- if(res.data.length < this.pageinfo.PageSize){
- this.finished = true;
- };
- this.flag = true;
- this.codelist.push(...res.data);
- this.loading = false;
- },
- //- 解除音响绑定
- async removesound(Id){
- let BindMerchantId = PublicLib.getCookieInfo('userId')
- const res = await postRequest('/api/v1/posmachines/remove?t='+Math.random(6),JSON.stringify({Id,BindMerchantId}));
- if(res.status !== '1') {
- tips(res.info);
- }else{
- //- 解除关联操作,从列表中去除音响
- const index = this.codelist.findIndex(item=>{
- return item.Id === Id;
- });
- this.codelist.splice(index,1);
- tips('音响解绑成功!');
- };
- },
- //- 解除二维码关联
- async removeqrcode(Id){
- let MerchantId = PublicLib.getCookieInfo('userId')
- const res = await postRequest('/api/v1/merchantqrcode/remove?t='+Math.random(6),JSON.stringify({Id,MerchantId}));
- if(res.status !== '1') {
- tips(res.info);
- }else{
- //- 解除关联操作,从列表中去除
- let qrid = '';
- this.codelist.forEach(item=>{
- if(item.Id === this.codeId){
- qrid = item.QrCodeList.findIndex(obj=>obj.Id = this.unbindqrId);
- item.QrCodeList.splice(qrid,1);
- };
- });
- tips('收款码解绑成功!')
- };
- },
- onRefresh(){
- this.loading = true;
- this.refreshing = true;
- this.onLoad();
- },
- onLoad() {
- if (this.refreshing) {
- this.codelist = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- }
- this.pageinfo.PageNum++;
- this.getsoundlist();
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- roundisshowfn(id){
- if(this.previouselement !== ''){
- this.previouselement.className = 'open unanim'
- }
- if(id === this.roundisshow) {
- this.$refs['anim'+id][0].className = 'open unanim';
- return this.roundisshow = '';
- };
- this.roundisshow = id;
- this.previouselement = this.$refs['anim'+id][0];
- this.$refs['anim'+id][0].className = 'open anim';
- },
- //- 替换
- //- replace(Id){
- //- PublicLib.putCookieInfo('soundqrcodeId', Id);
- //- PublicLib.Goto({Url:'bind-detail-sound-replace'});
- //- },
- //- 解除
- relieve(){
- this.removesound(this.unbindId);
- },
- //- 音响解除
- unbind(Id){
- this.dialogisshow = true;
- this.unbindId = Id;
- },
- //- 二维码解除
- unbindsound(Id,qrcodeid){
- this.undialogisshow = true;
- this.unbindqrId = Id;
- this.codeId = qrcodeid;
- },
- //- 二维码解除
- qrcoderelieve(){
- this.removeqrcode(this.unbindqrId);
- }
- }
- });
- </script>
- </body>
- </html>
|