1 line
9.1 KiB
JavaScript
1 line
9.1 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["activity/coupon/detail"],{"3b0c":function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return r})),o.d(t,"a",(function(){}));var n=function(){var e=this,t=e.$createElement,o=(e._self._c,e.__("¥")),n=e.sprintf(e.__("满¥%s可用"),e.CenterCoupon.voucher_subtotal||e.CenterCoupon.activity_rule.requirement.buy.subtotal),r=e.sprintf(e.__("有效日期至:%s"),e.CenterCoupon.voucher_end_date||e.CenterCoupon.activity_endtime),i=e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.activity_state!=e.StateCode.ACTIVITY_STATE_NORMAL||2!=e.CenterCoupon.CouponType?null:e.__("立即领取"),u=e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.activity_state!=e.StateCode.ACTIVITY_STATE_NORMAL?null:e.__("立即领取"),f=e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.activity_state!=e.StateCode.ACTIVITY_STATE_FINISHED&&e.CenterCoupon.activity_state!=e.StateCode.ACTIVITY_STATE_CLOSED||e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_USED?null:e.__("已领完"),l=e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.voucher_state_id!=e.StateCode.VOUCHER_STATE_USED?null:e.__("已使用"),a=e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.voucher_state_id!=e.StateCode.VOUCHER_STATE_TIMEOUT?null:e.__("已过期"),C=!e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_UNUSED&&0==e.CenterCoupon.AllowOfflineWriteOff&&e.isOnLine?e.__("立即使用"):null,s=e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.voucher_state_id!=e.StateCode.VOUCHER_STATE_UNUSED||0!=e.CenterCoupon.AllowOfflineWriteOff||e.isOnLine?null:e.__("立即使用"),c=!e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_UNUSED&&e.CenterCoupon.AllowOfflineWriteOff?e.__("在线使用"):null,_=(e.CenterCoupon.AllowOfflineWriteOff,null),p=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.activity_state==e.StateCode.ACTIVITY_STATE_NORMAL&&2==e.CenterCoupon.CouponType?e.__("立即领取"):null,d=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.activity_state==e.StateCode.ACTIVITY_STATE_NORMAL?e.__("立即领取"):null,O=!e.CenterCoupon.AllowOfflineWriteOff||e.CenterCoupon.activity_state!=e.StateCode.ACTIVITY_STATE_FINISHED&&e.CenterCoupon.activity_state!=e.StateCode.ACTIVITY_STATE_CLOSED||e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_USED?null:e.__("已领完"),h=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_USED?e.__("已使用"):null,m=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_TIMEOUT?e.__("已过期"):null,I=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_UNUSED&&0==e.CenterCoupon.AllowOfflineWriteOff?e.__("立即使用"):null,v=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.voucher_state_id==e.StateCode.VOUCHER_STATE_UNUSED&&e.CenterCoupon.AllowOfflineWriteOff?e.__("在线使用"):null,T=(e.CenterCoupon.AllowOfflineWriteOff,null),A=e.CenterCoupon.AllowOfflineWriteOff&&e.CenterCoupon.AllowOfflineWriteOff?e.__("支持线下使用(在门店购物时,向店员出示此码抵扣)"):null,S=e.CenterCoupon.AllowOfflineWriteOff?null:e.__("使用条件"),w=e.CenterCoupon.AllowOfflineWriteOff?null:e.sprintf(e.__("满¥%s可用"),e.CenterCoupon.voucher_subtotal||e.CenterCoupon.activity_rule.requirement.buy.subtotal),g=e.CenterCoupon.AllowOfflineWriteOff?null:e.__("可用"),b=e.CenterCoupon.AllowOfflineWriteOff||0!==e.CenterCoupon.activity_on_is_off?null:e.__("查看"),E=e.CenterCoupon.AllowOfflineWriteOff?e.__("使用条件"):null,U=e.CenterCoupon.AllowOfflineWriteOff?e.sprintf(e.__("满¥%s可用"),e.CenterCoupon.voucher_subtotal||e.CenterCoupon.activity_rule.requirement.buy.subtotal):null,y=e.CenterCoupon.AllowOfflineWriteOff?e.__("可用"):null,W=e.CenterCoupon.AllowOfflineWriteOff?e.__("查看"):null,D=""!=e.CenterCoupon.Description&&null!=e.CenterCoupon.Description||e.CenterCoupon.AllowOfflineWriteOff?e.__("使用说明"):null,P=(""!=e.CenterCoupon.Description&&null!=e.CenterCoupon.Description||e.CenterCoupon.AllowOfflineWriteOff)&&e.CenterCoupon.AllowOfflineWriteOff?e.__("支持线下使用,领取后向店员展示优惠券详情"):null;e.$mp.data=Object.assign({},{$root:{m0:o,m1:n,m2:r,m3:i,m4:u,m5:f,m6:l,m7:a,m8:C,m9:s,m10:c,m11:_,m12:p,m13:d,m14:O,m15:h,m16:m,m17:I,m18:v,m19:T,m20:A,m21:S,m22:w,m23:g,m24:b,m25:E,m26:U,m27:y,m28:W,m29:D,m30:P}})},r=[]},"475a":function(e,t,o){"use strict";o.r(t);var n=o("3b0c"),r=o("597e");for(var i in r)["default"].indexOf(i)<0&&function(e){o.d(t,e,(function(){return r[e]}))}(i);o("b13c");var u=o("828b"),f=Object(u["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=f.exports},4896:function(e,t,o){e.exports={theme_bg:"#f30213"}},"597e":function(e,t,o){"use strict";o.r(t);var n=o("8663"),r=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(i);t["default"]=r.a},8663:function(e,t,o){"use strict";(function(e,n){var r=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(o("7ca3")),u=r(o("1985")),f=r(o("8000")),l=o("8f59");function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function C(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach((function(t){(0,i.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var s={data:function(){return{options:{},CenterCoupon:{activity_rule:{requirement:{buy:{}}}},cid:"",couponItemId:"",bannerShow:!1,isOnLine:!1}},computed:(0,l.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin"]),onLoad:function(t){e.setNavigationBarTitle({title:this.__("优惠券详情")}),this.setData({cid:t.cid,couponItemId:t.couponItemId});this.GetCouponInfo()},methods:C(C({},(0,l.mapMutations)(["login","logout","getPlantformInfo","forceUserInfo","getUserInfo"])),{},{GetCouponInfo:function(e){var t={activity_id:this.cid,user_voucher_id:this.couponItemId},o=this;o.$.request({url:this.Config.URL.user.voucher_get,data:t,success:function(e,t,n,r){200==t&&(e.AllowOfflineWriteOff=!1,o.setData({CenterCoupon:e}))}})},onGotUserInfo:function(e){if(null!=e.detail.userInfo){var t={Photo:e.detail.userInfo.avatarUrl,NickName:e.detail.userInfo.nickName,UserName:app.globalData.UserInfo.UserName};u.default.xsr(u.default.makeUrl(userapi.UpdateUserPhotoAndNickName,t),(function(e){})),app.imageUrl=e.detail.userInfo.avatarUrl,app.nickName=e.detail.userInfo.nickName,app.authorize=!0,this.shareQRCode()}},shareQRCode:function(e){var t={vendorId:app.globalData.VendorInfo.Id,userId:app.globalData.UserInfo.Id,couponId:this.cid};u.default.xsr(u.default.makeUrl(userapi.QRCouponCodePoster,t),(function(e){}))},showCodeImg:function(){n.previewImage({current:this.PageQRCodeInfo.Path,urls:[this.PageQRCodeInfo.Path]})},saveImg:function(){var e=this;u.default.loading(),n.downloadFile({url:this.PageQRCodeInfo.Path,success:function(t){u.default.hideloading(),n.saveImageToPhotosAlbum({filePath:t.tempFilePath,success:function(){e.setData({PageQRCodeInfo:{Path:"",IsShare:!1,IsShareBox:!1,IsJT:!1}}),u.default.alert("保存图片成功!")},fail:function(e){u.default.hideloading()}})},fail:function(e){u.default.hideloading()}})},cancelShare:function(){this.setData({PageQRCodeInfo:{Path:"",IsShare:!1,IsShareBox:!1,IsJT:!1}})},usenow:function(e){var t=e.currentTarget.dataset.store_id;this.$.redirectTo({url:"/member/product/coupon?store_id="+t})},receivenow:function(e){this.getCoupon(e.currentTarget.dataset.id)},setHide:function(){this.setData({bannerShow:!1})},Make:function(e){this.setData({bannerShow:!0});var t=e.currentTarget.dataset.writeoff_code;null!=t&&""!=t&&(this.couponItemId=t),f.default.make({canvasId:"qrcode",componentInstance:this,text:this.couponItemId,size:200,margin:10,backgroundColor:"#ffffff",foregroundColor:"#000000",fileType:"jpg",success:function(e){},fail:function(e){console.log(e)}})},getCoupon:function(e){var t=this,o=this,n={activity_id:e,user_is_new:0};this.forceUserInfo((function(e){e&&u.default.request({url:t.Config.URL.user.voucher_add,data:n,success:function(e,t,n,r){200==t?(o.getCouponlist(),o.$.confirm(o.__("领取成功!,去消费"),(function(e){e.confirm&&o.$.navigateTo({url:"/pagesub/index/store?store_id="+o.CenterCoupon.store_id})}))):u.default.alert(n)}})}))},shareBox:function(){this.setData({PageQRCodeInfo:{Path:"",IsShare:!0,IsShareBox:!0,IsJT:!1}})}})};t.default=s}).call(this,o("df3c")["default"],o("3223")["default"])},9010:function(e,t,o){"use strict";(function(e,t){var n=o("47a9");o("ec76");n(o("3240"));var r=n(o("475a"));e.__webpack_require_UNI_MP_PLUGIN__=o,t(r.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},b13c:function(e,t,o){"use strict";var n=o("4896"),r=o.n(n);r.a}},[["9010","common/runtime","common/vendor"]]]); |