cyywl_shop_app/dist/static/js/pages-activity-poster-poste...

1 line
8.1 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-activity-poster-poster-index"],{"18da":function(t,e,i){"use strict";var n=i("86e5"),a=i.n(n);a.a},5841:function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.bargainHeaderApi=function(){return a.default.get("bargain/header")},e.bargainUserCancel=function(t){return a.default.post("bargain/user/cancel",{bargainId:t})},e.combinationHeaderApi=function(){return a.default.get("combination/header")},e.getBargainDetail=function(t){return a.default.get("bargain/detail/"+t)},e.getBargainIndexApi=function(){return a.default.get("bargain/index",{},{noAuth:!0})},e.getBargainList=function(t){return a.default.get("bargain/list",t,{noAuth:!0})},e.getBargainPoster=function(t){return a.default.post("bargain/poster",t)},e.getBargainUser=function(t){return a.default.get("bargain/user",t)},e.getBargainUserCancel=function(t){return a.default.post("/bargain/user/cancel",t)},e.getBargainUserList=function(t){return a.default.get("bargain/record",t)},e.getCombinationDetail=function(t){return a.default.get("combination/detail/"+t)},e.getCombinationIndexApi=function(){return a.default.get("combination/index",{},{noAuth:!0})},e.getCombinationList=function(t){return a.default.get("combination/list",t,{noAuth:!0})},e.getCombinationMore=function(t){return a.default.get("combination/more",t,{noAuth:!0})},e.getCombinationPink=function(t){return a.default.get("combination/pink/"+t)},e.getCombinationPoster=function(t){return a.default.post("combination/poster",t)},e.getSeckillDetail=function(t){return a.default.get("seckill/detail/"+t)},e.getSeckillHeaderApi=function(){return a.default.get("seckill/header",{},{noAuth:!0})},e.getSeckillIndexApi=function(){return a.default.get("seckill/index",{},{noAuth:!0})},e.getSeckillIndexTime=function(){return a.default.get("seckill/index",{},{noAuth:!0})},e.getSeckillList=function(t,e){return a.default.get("seckill/list/"+t,e,{noAuth:!0})},e.postBargainHelp=function(t){return a.default.post("bargain/help",t)},e.postBargainHelpList=function(t,e){return a.default.get("bargain/help/list?limit="+t.limit+"&page="+t.page,e,{})},e.postBargainHelpPrice=function(t){return a.default.post("bargain/help/price",t)},e.postBargainStart=function(t){return a.default.post("bargain/start",{bargainId:t})},e.postCombinationRemove=function(t){return a.default.post("combination/remove",t)},e.scombinationCode=function(t){return a.default.get("combination/code/"+t)},e.seckillCode=function(t,e){return a.default.get("seckill/code/"+t,e)};var a=n(i("0a86"))},"5cfd":function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,"uni-page-body[data-v-7ea2cb10]{background-color:#d22516!important}body.?%PAGE?%[data-v-7ea2cb10]{background-color:#d22516!important}.canvas[data-v-7ea2cb10]{position:fixed;z-index:-5;opacity:0}.poster-poster .tip[data-v-7ea2cb10]{height:%?80?%;font-size:%?26?%;color:#e8c787;text-align:center;line-height:%?80?%}.poster-poster .tip .iconfont[data-v-7ea2cb10]{font-size:%?36?%;vertical-align:%?-4?%;margin-right:%?18?%}.poster-poster .pictrue[data-v-7ea2cb10]{width:%?690?%;height:%?1130?%;margin:0 auto %?50?% auto}.poster-poster .pictrue uni-image[data-v-7ea2cb10]{width:100%;height:100%}",""]),t.exports=e},6800:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=this._self._c||t;return e("v-uni-view",[e("v-uni-view",{staticClass:"poster-poster"},[e("v-uni-view",{staticClass:"tip"},[e("v-uni-text",{staticClass:"iconfont icon-shuoming"}),this._v("提示:点击图片即可保存至手机相册")],1),this.canvasStatus?e("v-uni-view",{staticClass:"pictrue"},[e("v-uni-image",{attrs:{src:this.imagePath}})],1):this._e(),e("v-uni-view",{staticClass:"canvas"},[e("v-uni-canvas",{staticStyle:{width:"750px",height:"1130px"},attrs:{"canvas-id":"firstCanvas",id:"firstCanvas"}}),e("v-uni-canvas",{staticStyle:{opacity:"0"},style:{width:this.qrcodeSize+"px",height:this.qrcodeSize+"px"},attrs:{"canvas-id":"qrcode"}})],1)],1)],1)},a=[]},"6eb2":function(t,e,i){"use strict";(function(t){i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("acd8"),i("fb6a");var a=i("5841"),o=n(i("6888")),r=i("ee69"),s={data:function(){return{parameter:{navbar:"1",return:"1",title:"拼团海报",color:!0,class:"0"},type:0,id:0,image:"",from:"",storeCombination:{},qrcodeSize:600,posterbackgd:"/static/images/canbj.png",PromotionCode:"",canvasStatus:!1,imgTop:""}},onLoad:function(t){this.from="wechat";if(!t.hasOwnProperty("type")||!t.hasOwnProperty("id"))return app.Tips({title:"参数错误",icon:"none"},{tab:3,url:1});this.type=t.type,this.id=t.id,1==t.type?uni.setNavigationBarTitle({title:"砍价海报"}):uni.setNavigationBarTitle({title:"拼团海报"})},onShow:function(){this.getPosterInfo()},methods:{getPosterInfo:function(){parseFloat(this.id),this.from;1==this.type||this.getCombinationPink()},getCombinationPink:function(){var t=this,e=this;(0,a.getCombinationPink)(this.id).then((function(i){t.storeCombination=i.data,t.getImageBase64(i.data.storeCombination.image),e.make(i.data.userInfo.uid)})).catch((function(e){t.$util.Tips({title:e}),uni.redirectTo({success:function(){},fail:function(){uni.navigateTo({url:"/pages/index/index"})}})}))},getImageBase64:function(t){var e=this;(0,r.imageBase64)({url:t}).then((function(t){e.imgTop=t.data.code}))},make:function(t){var e=this,i=location.protocol+"//"+window.location.host+"/pages/activity/goods_combination_status/index?id="+this.id+"&spread="+t;o.default.make({canvasId:"qrcode",text:i,size:this.qrcodeSize,margin:10,success:function(t){e.PromotionCode=t;var i=[e.posterbackgd,e.imgTop,e.PromotionCode],n=e.storeCombination.storeCombination.title,a=e.storeCombination.storeCombination.price,o=e.storeCombination.storeCombination.people,r=e.storeCombination.storeCombination.otPrice,s=e.storeCombination.count;setTimeout((function(){e.PosterCanvas(i,n,a,o,r,s)}),300)},complete:function(){},fail:function(t){e.$util.Tips({title:"海报二维码生成失败!"})}})},PosterCanvas:function(t,e,i,n,a,o){uni.showLoading({title:"海报生成中",mask:!0});var r=uni.createCanvasContext("firstCanvas");r.clearRect(0,0,0,0);var s=this;uni.getImageInfo({src:t[0],success:function(u){r.drawImage(t[0],0,0,750,1190),r.setFontSize(36),r.setTextAlign("center"),r.setFillStyle("#282828");var c=e,l="",d="",f=c.length;f>40?(c=c.slice(0,36)+"......",l=c.slice(0,19),d=c.slice(19,f)):f>20?(l=c.slice(0,19),d=c.slice(19,f)):(l=c,d=""),r.fillText(l,375,60),r.fillText(d,375,100),r.drawImage(t[1],150,350,450,450),r.save(),r.drawImage(t[2],300,950,140,140),r.restore(),r.setFontSize(72),r.setFillStyle("#fc4141"),r.fillText(i,250,210),r.setFontSize(32),r.setFillStyle("#FFFFFF"),r.fillText(n+"人团",538,198),r.setFontSize(26),r.setFillStyle("#3F3F3F"),r.setTextAlign("center"),r.fillText("原价:¥"+a+" 还差 "+o+"人 拼团成功",375,275),r.draw(!0,(function(){uni.canvasToTempFilePath({destWidth:750,destHeight:1190,canvasId:"firstCanvas",fileType:"jpg",success:function(t){uni.hideLoading(),s.imagePath=t.tempFilePath,s.canvasStatus=!0}})}))},fail:function(t){uni.hideLoading(),s.$util.Tips({title:"无法获取图片信息"})}})},showImage:function(){var e=this.image.split(",");uni.previewImage({urls:e,longPressActions:{itemList:["发送给朋友","保存图片","收藏"],success:function(e){t.log("选中了第"+(e.tapIndex+1)+"个按钮,第"+(e.index+1)+"张图片")},fail:function(e){t.log(e.errMsg)}}})}}};e.default=s}).call(this,i("5a52")["default"])},"71c4":function(t,e,i){"use strict";i.r(e);var n=i("6eb2"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},"86e5":function(t,e,i){var n=i("5cfd");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("163bd44b",n,!0,{sourceMap:!1,shadowMode:!1})},"89ba":function(t,e,i){"use strict";i.r(e);var n=i("6800"),a=i("71c4");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("18da");var r=i("f0c5"),s=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"7ea2cb10",null,!1,n["a"],void 0);e["default"]=s.exports}}]);