index.js 11 KB

1
  1. require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/annex/vip_paid/index"],{"026d":function(e,t,n){},"43ec1":function(e,t,n){"use strict";(function(e,i){var o=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("26cb"),s=n("d1ea"),a=n("86eb"),m=(n("5d9d"),o(n("224b"))),l=n("4e39"),c={components:{home:function(){Promise.all([n.e("common/vendor"),n.e("components/home/index")]).then(function(){return resolve(n("3b71"))}.bind(null,n)).catch(n.oe)},payment:function(){Promise.all([n.e("common/vendor"),n.e("components/payment/index")]).then(function(){return resolve(n("470a"))}.bind(null,n)).catch(n.oe)}},filters:{dateFormat:function(e){return(0,m.default)(1e3*e).format("YYYY-MM-DD")},moneyFormat:function(e){return parseFloat(e)}},data:function(){return{memberType:[],userInfo:{},memberRights:[],memberExplain:[],memberCoupons:[],isGetFree:null,popupShow:!1,account:"",password:"",goodsList:[],pay_order_id:"",payMode:[{name:this.$t("微信支付"),icon:"icon-weixinzhifu",value:"weixin",title:this.$t("微信支付"),payStatus:!0}],pay_close:!1,totalPrice:"0",formContent:"",page:1,limit:15,finished:!1,memberEndTime:"",type:"",svip:null,mc_id:0,initIn:!1}},watch:{popupShow:{immediate:!0,handler:function(){this.account="",this.password=""}}},computed:(0,r.mapGetters)(["isLogin"]),onLoad:function(){this.isLogin?(this.memberCard(),this.groomList(),this.getOrderPayType()):(0,a.toLogin)()},onShow:function(){this.payClose();var t=e.getEnterOptionsSync();if("1038"==t.scene&&"wxef277996acc166c3"==t.referrerInfo.appId&&this.initIn){var n=t.referrerInfo.extraData;this.initIn=!1,n?("success"==n.code||n.code,this.memberCard()):this.memberCard()}},onReachBottom:function(){this.groomList()},methods:{pay:function(){"free"===this.type?this.createMemberCard("weixin"):this.pay_close=!0},scrollToCard:function(){var e=i.createSelectorQuery().in(this);e.select("#card").boundingClientRect((function(e){i.pageScrollTo({scrollTop:e.top})})).exec()},goDetail:function(e){i.navigateTo({url:"/pages/goods_details/index?id=".concat(e)})},memberCard:function(){var e=this;i.showLoading({title:this.$t("正在加载中")}),(0,s.memberCard)().then((function(t){i.hideLoading();var n=t.data,o=n.is_get_free,r=n.member_coupons,a=n.member_explain,m=n.member_rights,l=n.member_type;e.isGetFree=o,e.userInfo=o.user_info,e.memberRights=m,e.memberType=l,e.memberCoupons=r,e.memberExplain=a,o.is_record&&(e.memberType=e.memberType.filter((function(e){return"free"!==e.type}))),e.totalPrice=e.memberType[0].pre_price,e.type=e.memberType[0].type,e.svip=e.memberType[0],e.mc_id=e.memberType[0].mc_id,(0,s.memberOverdueTime)({member_type:e.svip.type,vip_day:e.svip.vip_day}).then((function(t){e.memberEndTime=t.data.data}))})).catch((function(e){i.showToast({title:e,icon:"none"})}))},groomList:function(){var e=this;this.finished||(i.showLoading({title:this.$t("正在加载中")}),(0,s.groomList)(5,{page:this.page,limit:this.limit}).then((function(t){i.hideLoading(),e.goodsList=e.goodsList.concat(t.data.list),e.finished=t.data.list.length<e.limit,e.page+=1})).catch((function(e){i.hideLoading()})))},checkType:function(e){var t=this;this.type=e.type,this.svip=e,this.totalPrice=e.pre_price,this.mc_id=e.mc_id,(0,s.memberOverdueTime)({member_type:e.type,vip_day:e.vip_day,mc_id:e.mc_id}).then((function(e){t.memberEndTime=e.data.data}))},closePopup:function(){this.popupShow=!1},getMemberCard:function(){var e=this;(0,s.memberCard)().then((function(t){var n=t.data;e.memberType=n.member_type,e.memberRights=n.member_rights,e.isGetFree=n.is_get_free})).catch((function(e){}))},getOrderPayType:function(){var e=this;(0,l.basicConfig)().then((function(t){var n=t.data,i=(n.ali_pay_status,n.pay_weixin_open);e.payMode[0].payStatus=i,e.payMode[1].payStatus=!1})).catch((function(e){i.showToast({title:e,icon:"none"})}))},memberSelect:function(e){this.memberSelected=e},drawMemberCard:function(){var e={member_card_code:"",member_card_pwd:"",from:"weixinh5"};return this.popupShow?this.account?this.password?(e.from="routine",i.showLoading({title:this.$t("正在加载中")}),void(0,s.memberCardDraw)(e).then((function(e){i.showToast({title:e.msg,success:function(){this.popupShow=!1,this.getMemberCard()}})})).catch((function(e){i.showToast({title:e,icon:"none"})}))):i.showToast({title:this.$t("请输入卡密"),icon:"none"}):i.showToast({title:this.$t("请输入卡号"),icon:"none"}):this.popupShow=!0},createMemberCard:function(e){var t=this;i.showLoading({title:this.$t("正在加载中")});var n={pay_type:e,type:"1",from:"routine",member_type:this.svip.type,mc_id:this.mc_id,price:this.svip.pre_price,money:this.svip.price};(0,s.memberCardCreate)(n).then((function(e){parseFloat(t.svip.pre_price)>0?t.callPay(e):(t.memberCard(),t.groomList(),i.hideLoading(),i.showToast({title:t.$t("成功开启试用")}))})).catch((function(e){i.showToast({title:e,icon:"none"})}))},formpost:function(e,t){var n=document.createElement("form");for(var i in n.action=e,n.method="post",n.target="_self",n.style.display="none",t){var o=document.createElement("input");o.name=i,o.value=t[i],n.appendChild(o)}document.body.appendChild(n),this.$nextTick((function(e){n.submit()}))},callPay:function(t){var n=this,o=t.data,r=o.status,s=o.result,a=(s.orderId,s.jsConfig);switch(r){case"ORDER_EXIST":case"EXTEND_ORDER":case"ALLINPAY_PAY":i.hideLoading(),this.initIn=!0,e.openEmbeddedMiniProgram({appId:"wxef277996acc166c3",extraData:{cusid:a.cusid,appid:a.appid,version:a.version,trxamt:a.trxamt,reqsn:a.reqsn,notify_url:a.notify_url,body:a.body,remark:a.remark,validtime:a.validtime,randomstr:a.randomstr,paytype:a.paytype,sign:a.sign,signtype:a.signtype}}),this.jumpData={orderId:t.data.result.orderId,msg:t.msg};break;case"PAY_ERROR":i.hideLoading(),this.$util.Tips({title:t.msg},{tab:5,url:"/pages/annex/vip_paid/index"});break;case"SUCCESS":i.hideLoading(),this.$util.Tips({title:t.msg,icon:"success"},{tab:5,url:"/pages/annex/vip_paid/index"});break;case"WECHAT_PAY":var m="";m=i.requestOrderPayment?"requestOrderPayment":"requestPayment",i[m]({timeStamp:a.timestamp,nonceStr:a.nonceStr,package:a.package,signType:a.signType,paySign:a.paySign,success:function(e){n.$util.Tips({title:n.$t("支付成功"),icon:"success"},{tab:5,url:"/pages/annex/vip_paid/index"})},fail:function(){i.showToast({title:n.$t("取消支付"),icon:"none"})},complete:function(){i.hideLoading()}});break;case"WECHAT_H5_PAY":i.showToast({title:t.msg,success:function(){location.href=a.h5_url}});break;case"ALIPAY_PAY":i.hideLoading(),i.navigateTo({url:"/pages/users/alipay_invoke/index?id=".concat(t.data.result.order_id,"&link=").concat(a.qrCode,"&from=member")});break}},onChangeFun:function(e){var t=e,n=t.action||null,i=void 0!=t.value?t.value:null;this.pay_close=!1,n&&this[n]&&this[n](i)},payClose:function(){this.pay_close=!1},payCheck:function(e){this.createMemberCard(e)},checkForm:function(e){var t=this,n=e.detail.value,o={member_card_code:"",member_card_pwd:"",from:"H5"};return n.account?n.password?(o.member_card_code=n.account,o.member_card_pwd=n.password,o.from="routine",i.showLoading({title:this.$t("激活中")}),void(0,s.memberCardDraw)(o).then((function(e){var n=t;i.showToast({title:e.msg,success:function(){n.memberCard(),n.groomList(),n.getOrderPayType(),n.popupShow=!1}})})).catch((function(e){i.showToast({title:e,icon:"none"})}))):i.showToast({title:this.$t("请输入卡密"),icon:"none"}):i.showToast({title:this.$t("请输入卡号"),icon:"none"})}}};t.default=c}).call(this,n("bc2e")["default"],n("543d")["default"])},"533e":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){}));var i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.userInfo.is_ever_level?e.$t("永久SVIP会员"):null),i=!e.userInfo.is_ever_level&&e.userInfo.is_money_level?e.$t("SVIP会员"):null,o=!e.userInfo.is_ever_level&&e.userInfo.is_money_level?e._f("dateFormat")(e.userInfo.overdue_time):null,r=!e.userInfo.is_ever_level&&e.userInfo.is_money_level?e.$t("到期"):null,s=e.userInfo.is_ever_level||e.userInfo.is_money_level?null:e.$t("您与"),a=e.userInfo.is_ever_level||e.userInfo.is_money_level?null:e.$t("商城的第"),m=e.userInfo.is_ever_level||e.userInfo.is_money_level?null:e.$t("天."),l=e.userInfo.is_money_level?e.$t("已累积为您节省"):null,c=e.userInfo.is_money_level?e.$t("¥"):null,u=e.userInfo.is_money_level?null:e.$t("开通即享会员权益"),d=!e.userInfo.is_ever_level&&e.userInfo.is_money_level?e.$t("续费会员"):null,p=e.userInfo.is_ever_level||e.userInfo.is_money_level?null:e.$t("开通会员"),f=e.memberRights.length,_=f?e.$t("SVIP会员尊享权"):null,h=!e.userInfo.is_ever_level&&e.userInfo.is_money_level?e.$t("续费会员"):null,v=e.userInfo.is_ever_level||e.userInfo.is_money_level?null:e.$t("开通会员"),y=e.userInfo.is_ever_level?null:e.$t("有效期至"),g=e.userInfo.is_ever_level?null:e.__map(e.memberType,(function(t,n){var i=e.__get_orig(t),o=e.$t("¥"),r=e._f("moneyFormat")(t.pre_price),s="free"===t.type?e.$t("试用"):null,a="free"===t.type?e.$t("天"):null,m="free"!==t.type?e.$t("¥"):null,l="free"!==t.type?e._f("moneyFormat")(t.price):null;return{$orig:i,m15:o,f1:r,m16:s,m17:a,m18:m,f2:l}})),b=!e.userInfo.is_ever_level&&e.memberExplain?e.$t("购买即视为同意"):null,$=!e.userInfo.is_ever_level&&e.memberExplain?e.$t("会员用户协议"):null,I=e.userInfo.is_ever_level||"free"!==e.type?null:e.$t("立即试用"),w=e.userInfo.is_ever_level||"free"===e.type?null:e.$t("立即支付"),T=e.userInfo.is_ever_level?null:e.$t("点击兑换卡密"),C=e.memberCoupons.length,x=C?e.$t("会员优惠券"):null,L=C?e.$t("查看更多"):null,P=C?e.__map(e.memberCoupons,(function(t,n){var i=e.__get_orig(t),o=t.is_fail||t.status===e.$t("已使用"),r=e.$t("¥"),s=e._f("moneyFormat")(t.coupon_price),a="0.00"===t.use_min_price?e.$t("无门槛券"):null,m="0.00"!==t.use_min_price?e.$t("满"):null,l="0.00"!==t.use_min_price?e._f("moneyFormat")(t.use_min_price):null,c="0.00"!==t.use_min_price?e.$t("元可用"):null;return{$orig:i,m26:o,m27:r,f3:s,m28:a,m29:m,f4:l,m30:c}})):null,S=e.goodsList.length,E=S?e.$t("SVIP商品推荐"):null,k=S?e.__map(e.goodsList,(function(t,n){var i=e.__get_orig(t),o=e.$t("¥"),r=e.$t("商城价"),s=e.$t("¥");return{$orig:i,m32:o,m33:r,m34:s}})):null,O=e.$t("激活会员卡"),F=e.$t("请输入卡号"),M=e.$t("请输入卡密"),R=e.$t("确认激活");e.$mp.data=Object.assign({},{$root:{m0:n,m1:i,f0:o,m2:r,m3:s,m4:a,m5:m,m6:l,m7:c,m8:u,m9:d,m10:p,g0:f,m11:_,m12:h,m13:v,m14:y,l0:g,m19:b,m20:$,m21:I,m22:w,m23:T,g1:C,m24:x,m25:L,l1:P,g2:S,m31:E,l2:k,m35:O,m36:F,m37:M,m38:R}})},o=[]},"7a82":function(e,t,n){"use strict";var i=n("026d"),o=n.n(i);o.a},9996:function(e,t,n){"use strict";n.r(t);var i=n("43ec1"),o=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(r);t["default"]=o.a},e784:function(e,t,n){"use strict";n.r(t);var i=n("533e"),o=n("9996");for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);n("7a82");var s=n("f0c5"),a=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"5ad3856f",null,!1,i["a"],void 0);t["default"]=a.exports},ed4e:function(e,t,n){"use strict";(function(e,t){var i=n("4ea4");n("4789");i(n("66fd"));var o=i(n("e784"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])}},[["ed4e","common/runtime","common/vendor"]]]);