(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/vip_card/index/index"],{"677d":function(i,t,e){"use strict";var n,r=function(){var i=this,t=i.$createElement;i._self._c},o=[];e.d(t,"b",(function(){return r})),e.d(t,"c",(function(){return o})),e.d(t,"a",(function(){return n}))},"6fd5":function(i,t,e){"use strict";e.r(t);var n=e("c3f0"),r=e.n(n);for(var o in n)"default"!==o&&function(i){e.d(t,i,(function(){return n[i]}))}(o);t["default"]=r.a},8305:function(i,t,e){},b42c:function(i,t,e){"use strict";var n=e("8305"),r=e.n(n);r.a},c02e:function(i,t,e){"use strict";(function(i){e("8748");n(e("66fd"));var t=n(e("e9c8"));function n(i){return i&&i.__esModule?i:{default:i}}i(t.default)}).call(this,e("543d")["createPage"])},c3f0:function(i,t,e){"use strict";(function(i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=e("2f62");function r(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),e.push.apply(e,n)}return e}function o(i){for(var t=1;t0?(this.title=i.title,this.content=i.content,this.id=i.id,this.expire_day=i.expire_day):(this.title="",this.content="")},choose:function(i,t){var e=this;if(e.is_buy=!1,e.couponNum=0,e.cardNum=0,t>1||t0)for(var n in i.coupons)e.couponNum+=+i.coupons[n].send_num;if(i.cards.length>0)for(var r in i.cards)e.cardNum+=+i.cards[r].send_num;e.user.order.forEach((function(t){t.detail_id==i.id&&(e.is_buy=!0)}))},getList:function(){var t=this;t.$request({url:t.$api.vip_card.index}).then((function(e){t.$hideLoading(),t.first=!1,0==e.code?(t.user=e.data.user,e.data.user.order.forEach((function(i){i.detail_id==t.card.detail[0].id&&(t.is_buy=!0)})),t.user&&(t.start_time=t.user.start_time.slice(0,10).replace(/-/g,"/"),t.end_time=t.user.end_time.slice(0,10).replace(/-/g,"/"))):("超级会员卡已关闭"!=e.msg&&"无超级会员卡权限"!=e.msg||i.redirectTo({url:"/pages/index/index"}),i.showToast({title:e.msg,icon:"none",duration:1e3}))})).catch((function(i){t.$hideLoading()}))},getSetting:function(){var t=this;t.$showLoading({type:"global",text:"加载中..."}),t.$request({url:t.$api.vip_card.setting}).then((function(e){if(0==e.code){for(var n in t.getCard(),t.list=e.data,t.list.form.vip_icon_list)for(var r in t.list.form.vip_icon_list[n])switch(t.list.form.vip_icon_list[n][r].img){case"statics/img/app/vip_card/icon1.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon1;break;case"statics/img/app/vip_card/icon2.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon2;break;case"statics/img/app/vip_card/icon3.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon3;break;case"statics/img/app/vip_card/icon4.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon4;break;case"statics/img/app/vip_card/icon5.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon5;break;case"statics/img/app/vip_card/icon6.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon6;break;case"statics/img/app/vip_card/icon7.png":t.list.form.vip_icon_list[n][r].img=t.svipImg.icon7;break}3==t.list.form.vip_number?t.vip_icon_width=234:4==t.list.form.vip_number?t.vip_icon_width=175:5==t.list.form.vip_number&&(t.vip_icon_width=140),t.vipHeight=160*+t.list.form.vip_line+"rpx",t.icon_width=702*t.list.form.vip_icon_list.length+"rpx"}else i.showToast({title:e.msg,icon:"none",duration:1e3})})).catch((function(i){t.$hideLoading()}))},getCard:function(){var t=this;t.$request({url:t.$api.vip_card.card}).then((function(e){if(0==e.code){if(t.card=e.data,t.detail=t.card.detail[0],t.detail.coupons.length>0)for(var n in t.detail.coupons)t.couponNum+=+t.detail.coupons[n].send_num;if(t.detail.cards.length>0)for(var r in t.detail.cards)t.cardNum+=+t.detail.cards[r].send_num;t.getList()}else i.showToast({title:e.msg,icon:"none",duration:1e3})})).catch((function(i){t.$hideLoading()}))}},onLoad:function(t){var e=this;e.getSetting(),i.getSystemInfo({success:function(i){(i.model.indexOf("iPhone X")>-1||i.model.indexOf("iPhone 11")>-1||i.model.indexOf("iPhone11")>-1||i.model.indexOf("iPhone12")>-1)&&(e.iphone_x=!0)}})},onShow:function(){var t=this;i.getStorage({key:"vip_card_is_read",success:function(e){t.read=e.data,i.removeStorage({key:"vip_card_is_read",success:function(i){console.log("success")}})}}),t.first||t.getList()}};t.default=c}).call(this,e("543d")["default"])},e9c8:function(i,t,e){"use strict";e.r(t);var n=e("677d"),r=e("6fd5");for(var o in r)"default"!==o&&function(i){e.d(t,i,(function(){return r[i]}))}(o);e("b42c");var a,c=e("f0c5"),s=Object(c["a"])(r["default"],n["b"],n["c"],!1,null,"550f1689",null,!1,n["a"],a);t["default"]=s.exports}},[["c02e","common/runtime","common/vendor"]]]);