123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <!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="bgc-back h100p ovh">
- <div id="app" v-cloak>
- <div class="search-box">
- <van-search v-model="value" show-action placeholder="请输入机具SN号或扫描" @search="onsearch">
- <template #action><span class="vm pl16 pr16 more" @click="goback">取消</span></template>
- <template #right-icon><span class="pl8" @click="onScan"><img class="vm" src="./static/images/icon-scan@3x.png" alt="" width="20" height="20"></span></template>
- </van-search>
- </div>
- <van-row v-cloak>
- <van-col class="bgcfff" span="24">
- <div class="ovh-x" ref="wrapper2">
- <van-cell-group class="top_line machine-list" v-for="item,index in transactions" :key="item.Id">
- <van-cell :border="false" :value="item.PosSnType" value-class="f12 c333">
- <template #title>
- <div class="f14 c333"><span class="vm">SN:</span><span class="vm pr6" :id="'sn'+index">{{item.PosSn}}</span><span class="dib vm" :data-clipboard-text="item.PosSn" data-clipboard-action="copy" :data-clipboard-target="'#sn'+index" :ref="'copy'+index" @click="copySN(index)" @mouseenter="copySN(index)"><img src="./static/images/icon-copy.png" alt="" width="12" height="12"></span></div>
- </template>
- </van-cell>
- <van-cell class="spcell" :border="false" :title="'来自:'+item.FromStore" title-class="f12 c999">
- <template #default v-if="item.BrandName"><span class="brandcard" @click="screenisshow = true">{{item.BrandName}}</span></template>
- </van-cell>
- <van-cell :border="false" :title="item.CreateDate" title-class="f12 c999"></van-cell>
- </van-cell-group>
- </div>
- </van-col>
- </van-row>
- </div>
- <script src="./static/js/clipboard.min.js"></script>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- app.searchContent = PublicLib.getCookieInfo("ScanContent");
- PublicLib.putCookieInfo('ScanContent', '');
- //- 拿到扫描结果进行赋值传输
- app.getmachinelist();
- };
-
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- copyBtn: {},
- transactions: [
- ],
- value: '',
- loading: false,
- error: false,
- finished: false,
- refreshing: false,
- pageinfo:{
- PageSize:100,
- PageNum:1
- }
- };
- },
- beforeUpdate() {
- this.$nextTick(() => {
- this.$refs.wrapper2.style.height = `${document.documentElement.clientHeight - 55}px`;
- });
- },
- methods: {
- giveToast(str){
- vant.Toast(str);
- },
- copySN(index){
- const that = this;
- this.$nextTick(() => {
- that.copyBtn = new ClipboardJS(this.$refs['copy'+index][0]);
- const clipboard = that.copyBtn;
- clipboard.on('success', function(e) {
- that.giveToast('复制成功');
- });
- clipboard.on('error', function(e) {
- that.giveToast('复制失败,请手动选择复制!');
- });
- });
- },
- onsearch(){
- this.getmachinelist();
- },
- goback() {
- PublicLib.GoBack({Level:1});
- },
- onScan(){
- PublicLib.ScanQRCode();
- },
- async getmachinelist(){
- //- PublicLib.ShowLoading({Message:''});
- const machinesearchType = PublicLib.getCookieInfo('machinesearchType');
- let Url = '';
- switch(machinesearchType){
- case 'total':
- Url = 'api/v1/pos/posmachines/mymachines?t='+Math.random(6);
- break;
- case 'bind':
- Url = 'api/v1/pos/posmachines/mymachinesforbind?t='+Math.random(6);
- break;
- case 'unbind':
- Url = 'api/v1/pos/posmachines/mymachinesforunbind?t='+Math.random(6);
- break;
- };
- const BrandId = PublicLib.getCookieInfo('productMachineId');
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest(Url,JSON.stringify({...this.pageinfo,BrandId,UserId,SnNo:this.value,BrandSubId:''}));
- if(res.status !== '1')return tips('机具列表获取失败!');
- //- PublicLib.HideLoading();
- this.transactions=res.data;
- },
-
- }
- });
- </script>
- </body>
- </html>
|