123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <!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" v-cloak>
- <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">
- <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"> </van-empty>
- <van-radio-group v-model="result">
- <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" @click="toggle(index)">
- <div class="bind_detail_collection_card df bgcfff">
- <van-radio :name="item" ref="checkboxes" checked-color="#FD824D"> </van-radio><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>
- </div>
- </van-list>
- </van-radio-group>
- </van-pull-refresh>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button color="#FD824D" text="确认关联" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- </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 {
- roundisshow:'',
- result:{},
- toptitleisshow:false,
- loading: false,
- finished: false,
- refreshing: false,
- codelist:[
- ],
- bindId:'',
- previouselement:'',
- pageinfo:{
- PageSize:10,
- PageNum:1,
- }
- };
- },
- created() {
- this.bindId = PublicLib.getCookieInfo('collectionId');
- 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.codelist.push(...res.data);
- this.result = this.codelist[0];
- this.loading = false;
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- onRefresh(){
- this.loading = false;
- this.refreshing = true;
- this.onLoad();
- },
- onLoad() {
- if (this.refreshing) {
- this.codelist = [];
- this.refreshing = false;
- this.pageinfo.PageNum = 0;
- }
- this.pageinfo.PageNum++;
- this.getsoundlist();
- },
- 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';
- },
- toggle(index) {
- this.$refs.checkboxes[index].toggle();
- },
- //- 绑定按钮
- async onClickButton(){
- let BindMerchantId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('/api/v1/posmachines/add?t='+Math.random(6),JSON.stringify({BindMerchantId,QrCodeId:this.bindId,MachineId:this.result.Id}));
- if(res.status !== '1' ) return tips(res.info);
- tips('关联音响成功!');
- setTimeout(()=>{
- this.goback();
- },2000);
- }
- }
- });
- </script>
- </body>
- </html>
|