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 replacebl">
- <van-radio :name="item" ref="checkboxes" checked-color="#FD824D"> </van-radio><img src="./static/images/index-collectioncode.png" alt="">
- <div class="card_info">
- <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>
- <van-dialog class="option" style="border-radius:4px;" v-model="dialogisshow" message="确认替换音响码?" width="300" confirm-button-text="确认替换" show-cancel-button @confirm="replace" @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 {
- roundisshow:'',
- result:[],
- dialogisshow:false,
- toptitleisshow:false,
- loading: false,
- finished: false,
- refreshing: false,
- codelist:[
- ],
- qrcodeId:'',
- pageinfo:{
- PageSize:10,
- PageNum:1,
- }
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.qrcodeId = PublicLib.getCookieInfo('collectionId');
- this.getsoundcodelist();
- },
- methods: {
- 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.getsoundcodelist();
- },
- roundisshowfn(id){
- console.log(id)
- if(id === this.roundisshow) {
- return this.roundisshow = '';
- };
- this.roundisshow = id;
- },
- toggle(index) {
- this.$refs.checkboxes[index].toggle();
- },
- onClickButton(){
- if(this.result.length === 0 ){
- return;
- }
- this.dialogisshow = true;
- },
- replace(){
- this.onreplacecode();
- },
- //- 获取音响码列表
- async getsoundcodelist(){
- let BindMerchantId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/posmachines/replacemachines?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.loading = false;
- },
- //- 替换音响码
- async onreplacecode(){
- let MerchantId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('/api/v1/merchantqrcode/confirmreplace?t='+Math.random(6),JSON.stringify({MerchantId,MachineId:this.qrcodeId,QrCodeId:this.result.Id}));
- if(res.status !== '1' ) return tips(res.info);
- tips('替换音响码成功!');
- //- TODO:去除已经替换音响吗
- }
-
- }
- });
- </script>
- </body>
- </html>
|