shop-php/public/static/js/pages-newActivity-giftBag-giftBag.7cc5948f.js
2024-02-27 17:24:41 +08:00

1 line
22 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-newActivity-giftBag-giftBag"],{2906:function(t,e,i){var n=i("cc63");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("13285854",n,!0,{sourceMap:!1,shadowMode:!1})},"3d8f":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={uniPopup:i("523b").default},a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"m_body"},[i("v-uni-view",{staticClass:"bg"},[i("v-uni-view",{staticClass:"bg_box"},[i("v-uni-image",{staticClass:"bg_img",attrs:{mode:"widthFix",src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/recharge.webp"}}),i("v-uni-view",{staticClass:"bg_border"})],1),i("v-uni-image",{staticClass:"bg_back",attrs:{src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.back.apply(void 0,arguments)}}}),i("v-uni-view",{staticClass:"body_card"},[i("v-uni-view",{staticClass:"card1"},[i("v-uni-view",{staticClass:"change_list"},t._l(t.changeList,(function(e,n){return i("v-uni-view",{key:n,staticClass:"change_item",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.changeItem(e,n)}}},[i("v-uni-image",{staticClass:"item_pic",attrs:{src:e.pic}}),i("v-uni-view",{staticClass:"item_content"},[i("v-uni-view",{staticClass:"top_left"},[i("v-uni-text",{staticClass:"c_icon"},[t._v("¥")]),i("v-uni-text",{staticClass:"c_content"},[t._v(t._s(e.count))])],1),i("v-uni-view",{staticClass:"top_right"},[i("v-uni-text",[t._v("数量:")]),i("v-uni-view",{on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.reduce(e)}}},[t._v("-")]),i("v-uni-view",{staticStyle:{width:"80rpx"}},[t._v(t._s(e.num))]),i("v-uni-view",{on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.append(e)}}},[t._v("+")])],1)],1)],1)})),1)],1)],1),i("v-uni-view",{staticClass:"a_tips"},[i("v-uni-view",[t._v("礼包说明:")]),i("v-uni-view",[t._v("购买1000-4999元礼包补贴对应金额5%的现金抵扣补贴")]),i("v-uni-view",[t._v("购买5000-9999元礼包补贴对应金额10%的现金抵扣补贴")]),i("v-uni-view",[t._v("购买10000-49999元礼包补贴对应金额15%的现金抵扣补贴")]),i("v-uni-view",[t._v("购买50000-100000元礼包补贴对应金额20%的现金抵扣补贴")])],1)],1),i("v-uni-view",{staticClass:"footer"},[i("v-uni-view",{staticClass:"f_tip"},[t._v("总计购买礼包金额:"),i("v-uni-view",{staticClass:"price"},[i("v-uni-text",[t._v(t._s(t.total))]),t._v("元")],1)],1),i("v-uni-view",{staticClass:"primary_btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.$u.throttle(t.submitSub,1500)}}},[t._v("立即购买")])],1),i("uni-popup",{ref:"redTipsRef"},[i("v-uni-view",{staticClass:"ref_ref"},[i("v-uni-view",{staticClass:"ref_top"},[t._v("购买礼包金额达到"),0==t.red_type?i("v-uni-text",[t._v("1000-4999")]):t._e(),1==t.red_type?i("v-uni-text",[t._v("5000-9999")]):t._e(),2==t.red_type?i("v-uni-text",[t._v("10000-49999")]):t._e(),3==t.red_type?i("v-uni-text",[t._v("50000-100000")]):t._e()],1),i("v-uni-view",{staticClass:"ref_center"},[t._v("赠送补贴变为")]),i("v-uni-view",{staticClass:"ref_bottom"},[i("v-uni-view",{staticClass:"bottom_item",staticStyle:{width:"100%"}},[i("v-uni-image",{attrs:{src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/re_redpacket.webp"}}),i("v-uni-view",{staticClass:"text"},[t._v(t._s(t.tipType[t.red_type].red1))])],1)],1)],1)],1),i("payment",{attrs:{payMode:t.payMode,order_id:t.rechar_id,pay_close:t.pay_close,"is-call":!0,totalPrice:t.totalPrice},on:{onChangeFun:function(e){arguments[0]=e=t.$handleEvent(e),t.onChangeFun.apply(void 0,arguments)}}}),i("authorize",{attrs:{isAuto:t.isAuto,isShowAuth:t.isShowAuth},on:{onLoadFun:function(e){arguments[0]=e=t.$handleEvent(e),t.onLoadFun.apply(void 0,arguments)},authColse:function(e){arguments[0]=e=t.$handleEvent(e),t.authColse.apply(void 0,arguments)}}})],1)},o=[]},"6ea7":function(t,e,i){"use strict";i.r(e);var n=i("3d8f"),a=i("a1fb");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("a9fe");var c=i("f0c5"),r=Object(c["a"])(a["default"],n["b"],n["c"],!1,null,"7b6c8d00",null,!1,n["a"],void 0);e["default"]=r.exports},a1fb:function(t,e,i){"use strict";i.r(e);var n=i("f61a"),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},a9fe:function(t,e,i){"use strict";var n=i("2906"),a=i.n(n);a.a},cc63:function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */uni-page-body[data-v-7b6c8d00]{background-color:#fff}body.?%PAGE?%[data-v-7b6c8d00]{background-color:#fff}.bg[data-v-7b6c8d00]{position:relative;padding-bottom:%?300?%}.bg .bg_box[data-v-7b6c8d00]{height:%?486?%;position:relative;overflow:hidden}.bg .bg_box .bg_img[data-v-7b6c8d00]{width:%?750?%;height:%?652?%;position:absolute;top:0;left:0}.bg .bg_box .bg_border[data-v-7b6c8d00]{position:absolute;bottom:0;left:0;width:100%;height:%?30?%;border-radius:%?60?% %?60?% 0 0;background-color:#fff}.bg .bg_back[data-v-7b6c8d00]{height:%?34?%;width:%?20?%;position:absolute;top:calc(0px + %?30?%);left:%?30?%}.bg .body_card[data-v-7b6c8d00]{color:#333}.bg .body_card .card1[data-v-7b6c8d00]{background-color:#fff}.bg .body_card .card1 .change_list[data-v-7b6c8d00]{width:%?700?%;margin:0 auto;display:flex;justify-content:space-between;flex-wrap:wrap}.bg .body_card .card1 .change_list .change_item[data-v-7b6c8d00]{width:%?335?%;height:%?172?%;text-align:center;border-radius:%?20?% %?20?% %?20?% %?20?%;font-size:%?40?%;position:relative;margin-bottom:%?30?%}.bg .body_card .card1 .change_list .change_item .item_pic[data-v-7b6c8d00]{position:absolute;left:0;top:0;width:100%;height:100%}.bg .body_card .card1 .change_list .change_item .item_content[data-v-7b6c8d00]{padding:%?26?%;position:absolute;left:0;top:0;width:100%;height:%?172?%;display:flex;flex-direction:column;justify-content:space-between}.bg .body_card .card1 .change_list .change_item .item_content .top_left[data-v-7b6c8d00]{font-size:%?58?%;color:#ffc53d;display:flex;align-content:center}.bg .body_card .card1 .change_list .change_item .item_content .top_left .tips[data-v-7b6c8d00]{font-size:%?24?%;border:%?5?% solid #ffc53d;margin-left:%?20?%;padding:%?5?% %?15?%;border-radius:%?60?%;color:#7c5906}.bg .body_card .card1 .change_list .change_item .item_content .top_left .c_content[data-v-7b6c8d00]{padding-top:%?10?%}.bg .body_card .card1 .change_list .change_item .item_content .top_left .c_icon[data-v-7b6c8d00]{padding-top:%?15?%;font-size:%?36?%}.bg .body_card .card1 .change_list .change_item .item_content .top_right[data-v-7b6c8d00]{display:flex;align-items:center;color:#ff3a32}.bg .body_card .card1 .change_list .change_item .item_content .top_right uni-text[data-v-7b6c8d00]{font-size:%?28?%}.bg .body_card .card1 .change_list .change_item .item_content .top_right uni-view[data-v-7b6c8d00]{height:%?60?%;width:%?40?%;text-align:center;line-height:%?60?%}.bg .body_card .card1 .change_list .change_item_active[data-v-7b6c8d00]{background:rgba(255,128,86,.2);border:%?5?% solid #ff8056;color:#ff8056}.bg .a_tips[data-v-7b6c8d00]{color:#ff8056;padding:0 %?30?%;line-height:%?40?%}.m_body .footer[data-v-7b6c8d00]{position:fixed;left:0;bottom:0;height:%?120?%;width:100vw;background-color:#fff;display:flex;justify-content:space-between;align-items:center;padding:0 %?20?%}.m_body .footer .f_tip[data-v-7b6c8d00]{display:flex;align-items:flex-end;font-style:%?26?%}.m_body .footer .f_tip .price[data-v-7b6c8d00]{color:#ff8056}.m_body .footer .f_tip .price uni-text[data-v-7b6c8d00]{font-size:%?44?%;margin-left:%?20?%;margin-right:%?5?%}.m_body .footer .primary_btn[data-v-7b6c8d00]{background-color:#fa8147;height:%?80?%;border-radius:%?80?%;width:%?180?%;color:#fff;line-height:%?80?%;text-align:center}.ref_ref[data-v-7b6c8d00]{width:%?630?%;height:%?200?%;background-color:#fff;border-radius:%?20?%;padding:%?20?% %?10?%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}.ref_ref .ref_top[data-v-7b6c8d00]{color:#ffc53d}.ref_ref .ref_center[data-v-7b6c8d00]{font-size:%?24?%;border:%?5?% solid #ffc53d;margin-left:%?20?%;padding:%?5?% %?15?%;border-radius:%?60?%;color:#7c5906}.ref_ref .ref_bottom[data-v-7b6c8d00]{font-size:%?28?%;display:flex;align-items:center;justify-content:space-between;color:#ff3a32}.ref_ref .ref_bottom .bottom_item[data-v-7b6c8d00]{width:%?280?%;display:flex;align-items:center}.ref_ref .ref_bottom .bottom_item uni-image[data-v-7b6c8d00]{width:%?32?%;height:%?40?%}.ref_ref .ref_bottom .bottom_item .text[data-v-7b6c8d00]{padding-left:%?15?%}',""]),t.exports=e},f61a:function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("13d5"),i("d3b7"),i("99af"),i("d401"),i("25f0"),i("acd8"),i("a9e3");var a=n(i("2909")),o=n(i("5530")),c=i("33b4"),r=i("f89e"),s=i("26cb"),u=n(i("104c")),d=n(i("7c0a")),l={components:{authorize:u.default,payment:d.default},data:function(){return{userInfo:{},curNow:0,list1:[{name:"余额购买"},{name:"购买记录"}],changeList:[{count:100,pic:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/a_re_item5.webp",num:0},{count:200,pic:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/a_re_item6.webp",num:0},{count:500,pic:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/a_re_item7.webp",num:0},{count:1e3,pic:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/a_re_item8.webp",num:0}],nowChange:0,nowPrice:0,priceCount:1,isAuto:!1,isShowAuth:!1,recordList:[],tipType:[{red1:"5%的现金抵扣补贴"},{red1:"10%的现金抵扣补贴"},{red1:"15%的现金抵扣补贴"},{red1:"20%的现金抵扣补贴"},{red1:""}],red_type:4,where:{page:1,limit:15,type:2},otherValue:"其他",now_money:0,navRecharge:["账户购买","佣金转入"],active:0,number:"",from:"",placeholder:"0.00",picList:[],activePic:0,money:"",numberPic:"",rechar_id:"0",rechargeAttention:[],pay_close:!1,totalPrice:"0",payMode:[{name:"微信支付",icon:"icon-weixinzhifu",value:"h5",title:"微信快捷支付",payStatus:!0}]}},onLoad:function(){this.isLogin?this.getUserInfo():(this.isAuto=!0,this.isShowAuth=!0)},onShow:function(){},computed:(0,o.default)((0,o.default)({},(0,s.mapGetters)(["isLogin","viewColor","keyColor"])),{},{total:function(){return this.changeList.reduce((function(t,e){return t+e.count*e.num}),0)}}),onReachBottom:function(){this.getCommissionInfo()},methods:{back:function(){uni.navigateBack()},clickTab1:function(t){this.curNow=t.index,1==t.index&&(this.recordList=[],this.where.page=1,this.getCommissionInfo())},changeItem:function(t,e){if(this.nowPrice=t,this.nowChange=e,this.priceCount*this.nowPrice>1e5)return this.priceCount=Math.floor(1e5/this.nowPrice),(0,r.Toast)("不可超过10万元")},append:function(t){if(this.total+t.count>=0&&this.total+t.count<1e3?this.red_type=4:this.total+t.count>=1e3&&this.total+t.count<=4999&&0!=this.red_type?(this.red_type=0,this.$refs.redTipsRef.open()):this.total+t.count>=5e3&&this.total+t.count<=9999&&1!=this.red_type?(this.red_type=1,this.$refs.redTipsRef.open()):this.total+t.count>=1e4&&this.total+t.count<=49999&&2!=this.red_type?(this.red_type=2,this.$refs.redTipsRef.open()):this.total+t.count>=5e4&&this.total+t.count<=1e5&&3!=this.red_type&&(this.red_type=3,this.$refs.redTipsRef.open()),this.total+t.count>1e5||this.total>=1e5)return(0,r.Toast)("不可超过10万元");t.num++},reduce:function(t){if(this.total-t.count>=0&&this.total-t.count<1e3?this.red_type=4:this.total-t.count>=1e3&&this.total-t.count<=4999&&0!=this.red_type?(this.red_type=0,this.$refs.redTipsRef.open()):this.total-t.count>=5e3&&this.total-t.count<=9999&&1!=this.red_type?(this.red_type=1,this.$refs.redTipsRef.open()):this.total-t.count>=1e4&&this.total-t.count<=49999&&2!=this.red_type?(this.red_type=2,this.$refs.redTipsRef.open()):this.total-t.count>=5e4&&this.total-t.count<=1e5&&3!=this.red_type&&(this.red_type=3,this.$refs.redTipsRef.open()),0==this.total||0==t.num)return(0,r.Toast)("不能再少啦");t.num--},getCommissionInfo:function(){var t=this;(0,c.getCommissionInfo)(this.where).then((function(e){e.data.list.length>0&&(t.recordList=[].concat((0,a.default)(t.recordList),(0,a.default)(e.data.list)),e.data.list.length>=15&&t.where.page++)}))},picCharge:function(t,e){this.activePic=t,void 0===e?(this.rechar_id="0",this.numberPic="",this.otherValue=""):(this.otherValue="其他",this.total="",this.rechar_id=e.id.toString(),this.numberPic=e.data.price)},getRecharge:function(){var t=this;getRechargeApi().then((function(e){t.picList=e.data.recharge_quota,t.picList[0]&&(t.rechar_id=t.picList[0].id.toString(),t.numberPic=t.picList[0].data.price),t.rechargeAttention=e.data.recharge_attention||[]})).catch((function(e){t.$dialog.toast({mes:e})}))},onLoadFun:function(){this.isShowAuth=!1,this.getUserInfo(),this.getRecharge()},authColse:function(t){this.isShowAuth=t},navRecharges:function(t){this.active=t},getUserInfo:function(){var t=this;(0,c.spreadInfo)().then((function(e){t.$set(t,"userInfo",e.data)}))},payClose:function(){this.pay_close=!1},payCheck:function(t){this.createOrder(t)},submitSub:function(t){var e=this,i=this.total;if(e.active){if(parseFloat(i)<0||NaN==parseFloat(i)||void 0==i||""==i)return e.$util.Tips({title:"请输入金额"});uni.showModal({title:"转入余额",content:"转入余额后无法再次转出,确认是否转入余额",success:function(t){if(t.confirm)rechargeBrokerage({brokerage:parseFloat(i)}).then((function(t){uni.showToast({icon:"success",title:"转入成功"})})).catch((function(t){return e.$util.Tips({title:t})}));else if(t.cancel)return e.$util.Tips({title:"已取消"})}})}else{if(0==this.rechar_id){if(0===parseFloat(e.total))return e.$util.Tips({title:"购买金额金额不能为0"});if(!e.total)return e.$util.Tips({title:"请填写购买金额!"});if(!Number(e.total))return e.$util.Tips({title:"请填写正确的金额!"})}this.pay_close=!0}},createOrder:function(t){var e=this,i={price:0==e.rechar_id?e.total:e.numberPic,recharge_id:e.rechar_id,type:t,return_url:location.port?location.protocol+"//"+location.hostname+":"+location.port+"/pages/users/user_money/money":location.protocol+"//"+location.hostname+"/pages/users/user_money/money"};(0,c.rechargeWechat)(i).then((function(t){e.callPay(t)})).catch((function(t){uni.showToast({title:t,icon:"none"})}))},callPay:function(t){var e=t.data.type,i=(t.data.recharge_id,t.data.pay_key),n=t.data.config;switch(e){case"ORDER_EXIST":case"EXTEND_ORDER":case"PAY_ERROR":case"error":uni.hideLoading(),(0,r.Toast)(t.message);break;case"success":uni.hideLoading(),uni.showToast({icon:"success",title:t.message});break;case"alipay":case"alipayQr":return uni.hideLoading(),this.$emit("onChangeFun",{action:"payClose"}),void uni.navigateTo({url:"/pages/order_pay_back/index?keyCode="+i+"&url="+n+"&type=10"});case"wechat":case"weixin":case"weixinApp":n.timeStamp=n.timestamp,this.$wechat.pay(n).then((function(t){uni.showToast({icon:"success",title:t.message})})).catch((function(t){uni.showToast({icon:"success",title:"取消支付"})}));break;case"balance":uni.hideLoading(),(0,r.Toast)(t.msg);break;case"h5":var a=window.location.protocol+"//"+window.location.host,o="".concat(a,"/pages/users/user_money/money"),c=encodeURIComponent(o),s=n.mweb_url||n.h5_url,u="".concat(s,"&redirect_url=").concat(c);setTimeout((function(){location.href=u}),100);break}},onChangeFun:function(t){var e=t,i=e.action||null,n=void 0!=e.value?e.value:null;i&&this[i]&&this[i](n)}},onPullDownRefresh:function(){uni.stopPullDownRefresh()}};e.default=l},f89e:function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.ActionSheet=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000";return new Promise((function(i,n){uni.showActionSheet({itemList:t,itemColor:e,success:function(t){i(t.tapIndex)},fail:function(t){n(t.errMsg)}})}))},e.Authorize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userInfo";return new Promise((function(e,i){uni.authorize({scope:t,success:function(t){e(t)},fail:function(t){i(t)}})}))},e.GetUserInfo=function(){return new Promise((function(t,e){uni.getUserInfo({success:function(e){t(e)},fail:function(t){e(t)}})}))},e.Loading=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"正在加载...",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uni.showLoading((0,o.default)({title:t,mask:!0},e))},e.Modal=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"提示",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"这是一个模态弹窗!",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{showCancel:!0,cancelText:"取消",confirmText:"确定"};return new Promise((function(n,a){uni.showModal((0,o.default)((0,o.default)({},i),{},{title:t,content:e,success:function(t){t.confirm&&n(),t.cancel&&a()}}))}))},e.ScrollTo=function(t){uni.pageScrollTo({scrollTop:t,duration:300})},e.Toast=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:800,a=(0,o.default)({title:t,duration:n,position:"center",mask:!0,icon:e||"none"},i);uni.showToast(a)},e.chooseImage=function(t){return new Promise((function(e,i){uni.chooseImage({count:t,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){e(t)},fail:function(t){i(t)}})}))},e.clearStorage=function(){try{uni.clearStorageSync()}catch(t){throw new Error("处理失败")}},e.convertObj=c,e.formatDate=r,e.getQuarterStartDate=function(){var t=new Date(d,function(){var t=0;u<3&&(t=0);2<u&&u<6&&(t=3);5<u&&u<9&&(t=6);u>8&&(t=9);return t}(),1);return r(t,"yyyy-MM-dd")},e.getStorage=function(t){var e=uni.getStorageSync(t);try{"number"!=typeof JSON.parse(e)&&(e=JSON.parse(e))}catch(i){}return e},e.hideLoading=function(){try{uni.hideLoading()}catch(t){throw new Error("处理失败")}},e.navigateBack=function(t){uni.navigateBack({delta:t})},e.navigateTo=function(t,e,i){var n=e,a="navigateTo";switch(n=i?n+"?"+c(i):n,t){case 1:a="navigateTo";break;case 2:a="redirectTo";break;case 3:a="reLaunch";break;case 4:a="switchTab";break;default:a="navigateTo";break}uni[a]({url:n,animationType:"slide-in-right",animationDuration:200})},e.pathToBase64=function(t){return new Promise((function(e,i){if("object"===("undefined"===typeof window?"undefined":(0,a.default)(window))&&"document"in window){if("function"===typeof FileReader){var n=new XMLHttpRequest;return n.open("GET",t,!0),n.responseType="blob",n.onload=function(){if(200===this.status){var t=new FileReader;t.onload=function(t){e(t.target.result)},t.onerror=i,t.readAsDataURL(this.response)}},n.onerror=i,void n.send()}var o=document.createElement("canvas"),c=o.getContext("2d"),r=new Image;return r.onload=function(){o.width=r.width,o.height=r.height,c.drawImage(r,0,0),e(o.toDataURL()),o.height=o.width=0},r.onerror=i,void(r.src=t)}"object"!==("undefined"===typeof plus?"undefined":(0,a.default)(plus))?"object"===("undefined"===typeof wx?"undefined":(0,a.default)(wx))&&wx.canIUse("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:t,encoding:"base64",success:function(t){e("data:image/png;base64,"+t.data)},fail:function(t){i(t)}}):i(new Error("not support")):plus.io.resolveLocalFileSystemURL(getLocalFilePath(t),(function(t){t.file((function(t){var n=new plus.io.FileReader;n.onload=function(t){e(t.target.result)},n.onerror=function(t){i(t)},n.readAsDataURL(t)}),(function(t){i(t)}))}),(function(t){i(t)}))}))},e.removeStorage=function(t){t&&uni.removeStorageSync(t)},e.serialize=function(t){if(null!=t&&""!=t)try{return JSON.parse(JSON.stringify(t))}catch(e){return t instanceof Array?[]:{}}return t},e.setStorage=function(t,e){if("string"==typeof e)return uni.setStorageSync(t,e),e;uni.setStorageSync(t,JSON.stringify(e))},e.showMonthFirstDay=function(){var t=(new Date).setDate(1);return r(new Date(t).getTime(),"yyyy-MM-dd")},e.showWeekFirstDay=function(){var t=new Date,e=t.getDay()||7;return t.setDate(t.getDate()-e+1),r(t,"yyyy-MM-dd")},e.throttle=function(t,e){var i,n;e=e||200;return function(){for(var a=this,o=arguments.length,c=new Array(o),r=0;r<o;r++)c[r]=arguments[r];i=c,n||(n=setTimeout((function(){n=null,t.apply(a,i)}),e))}},e.unique=function(t){t=t||[];for(var e={},i=0;i<t.length;i++){var n=JSON.stringify(t[i]);"undefined"==typeof n&&(e[n]=1)}for(var i in t.length=0,e)t[t.length]=i;return t};var a=n(i("53ca")),o=n(i("5530"));function c(t){var e,i=[];return Object.keys(t).forEach((function(e){i.push("".concat(e,"=").concat(t[e]))})),e=i.join("&"),e}function r(t,e){return t?(e=e||"yyyy-MM-dd hh:mm:ss",new Date(t).format(e)):""}i("e9c4"),i("d9e2"),i("d401"),i("d3b7"),i("159b"),i("b64b"),i("14d9"),i("99af"),i("ac1f"),i("00b4"),i("5319"),i("4d63"),i("c607"),i("2c3e"),i("25f0"),Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var i in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,String(this.getFullYear()).substr(4-RegExp.$1.length))),e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr(String(e[i]).length)));return t};var s=new Date,u=s.getMonth(),d=s.getYear();d+=d<2e3?1900:0}}]);