平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
11 KiB

2 months ago
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/index/addTemplate"],{"38fd":function(t,i,e){"use strict";(function(t){var n=e("47a9"),s=e("3b2d");Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var o=e("7312"),a=(n(e("3cc2")),function(t,i){if(!i&&t&&t.__esModule)return t;if(null===t||"object"!==s(t)&&"function"!==typeof t)return{default:t};var e=h(i);if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var r=o?Object.getOwnPropertyDescriptor(t,a):null;r&&(r.get||r.set)?Object.defineProperty(n,a,r):n[a]=t[a]}n.default=t,e&&e.set(t,n);return n}(e("b37f")));n(e("ec9a"));function h(t){if("function"!==typeof WeakMap)return null;var i=new WeakMap,e=new WeakMap;return(h=function(t){return t?e:i})(t)}var r={data:function(){return{QrUrl:"1212",QrList1:{name:"",path:"",imgUrl:""},number:"",shippList:[],bufferData:[],categoryId:"",printName:"",shopId:t.getStorageSync("shopId"),shipId:"",discountCurrent:"left",items:[{value:"left",name:"靠左"},{value:"right",name:"居中"}],discountCurrent2:"blod",items2:[{value:"blod",name:"加粗"},{value:"notblod",name:"不加粗"}],iconList:[],screenHeight:0}},components:{kkPrinter:function(){Promise.all([e.e("common/vendor"),e.e("components/kk-printer/index")]).then(function(){return resolve(e("6e81"))}.bind(null,e)).catch(e.oe)}},onLoad:function(i){var e=t.getSystemInfoSync();if(this.screenHeight=e.screenHeight,this.iconList=(0,o.washingInstructions)(),t.getStorageSync("qrcode")&&(this.QrList1=t.getStorageSync("qrcode"),t.removeStorageSync("qrcode")),i){var n=JSON.parse(i.item);this.shipId=n.id,this.printName=n.printName,this.shippList=n.content;for(var s=0;s<this.shippList.length;s++)void 0==this.shippList[s].leftIcon&&(this.shippList[s].leftIcon=[]),void 0==this.shippList[s].rightIcon&&(this.shippList[s].rightIcon=[]);this.$forceUpdate()}},methods:{backPage:function(){t.navigateBack()},addItemName:function(i,e){if(i.detail.value.length>6)return t.showToast({title:"最多输入6个字符",icon:"none"}),void(this.QrList1.name="");this.QrList1.name=i.detail.value},scanCodeAdd:function(i){var e=this;t.scanCode({success:function(n){if(""!=n.result){if(-1==n.result.indexOf("u.wechat.com")&&-1==n.result.indexOf("qr.alipay.com")&&-1==n.result.indexOf("wxp://")&&n.result.length>80){var s=t.getStorageSync("shopId").substring("10","12")+(0,o.generateUUID)().substring("0","7"),a=[];a.push({id:s,longUrl:n.result}),e.tui.request("/app/urlMapping/saveOrUpdateUrlMapping","post",a,!1,!1).then((function(t){200==t.code&&(e.QrList1.path=e.tui.interfaceUrl()+"/app/urlMapping/redirect?id="+s)}))}else e.QrList1.path=n.result;e.QrUrl=e.QrList1.path,e.canUpdate=!1,e.$forceUpdate(),setTimeout((function(t){e.getQRCode(i)}),1e3)}else t.showToast({title:"扫描失败",icon:"none"})},fail:function(i){t.showToast({title:"扫描失败",icon:"none"})}})},getQRCode:function(i){var e=this;setTimeout((function(i){e.$refs.uqrcode.toTempFilePath({success:function(i){var n=t.createCanvasContext("qrcode1",e);n.setFillStyle("#fff"),n.fillRect(0,0,200,200);var s=e.getTempFilePath(i.tempFilePath);s.then((function(i){n.drawImage(i,8,8,184,184),n.draw(!0),setTimeout((function(i){t.canvasToTempFilePath({x:0,y:0,width:200,height:200,destWidth:200,destHeight:200,canvasId:"qrcode1",success:function(i){t.uploadFile({url:e.tui.interfaceUrl()+"/upload/file",filePath:i.tempFilePath,name:"file",header:{"content-type":"multipart/form-data",accessToken:e.tui.getToken()},formData:{},success:function(t){var i=JSON.parse(t.data);e.QrList1.imgUrl=i.result,e.canUpdate=!0,e.$forceUpdate()}})}})}),500)}))}})}),1e3)},getTempFilePath:function(i){return new Promise((function(e,n){var s=t.getFileSystemManager();i=i.split(",")[1];var o="temp_image_"+Date.now()+".png",a=t.env.USER_DATA_PATH+"/"+o,h=t.base64ToArrayBuffer(i);s.writeFile({filePath:a,data:h,encoding:"binary",success:function(t){return e(a)},fail:function(t){return n(t)}})}))},delIcon:function(i,e,n){var s=this;t.showModal({title:"提示"