4-chunk.js 11KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"0kNP":function(t,e,i){t.exports=i.p+"assets/img/detail/superman.png?2255eb0e"},"1ml8":function(t,e,i){},5:function(t,e){},"6sj6":function(t,e,i){},"7e3b":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return a}));var s={name:"Monthpicker",components:{},model:{prop:"value",event:"change"},props:{value:{type:[String],default:""},activitys:{required:!0,type:Array,default:function(){return[]}}},data:function(){return{currentIndex:0}},computed:{activityName:function(){var t=this.activitys,e=this.currentIndex;return 0===t.length?"":function(t){var e="";switch(t){case"一月活動":e="1月";break;case"二月活動":e="2月";break;case"三月活動":e="3月";break;case"四月活動":e="4月";break;case"五月活動":e="5月";break;case"六月活動":e="6月";break;case"七月活動":e="7月";break;case"八月活動":e="8月";break;case"九月活動":e="9月";break;case"十月活動":e="10月";break;case"十一月活動":e="11月";break;case"十二月活動":e="12月";break;default:e=t}return e}(t[e])},inputValue:{get:function(){return this.value},set:function(t){this.$emit("change",t)}}},watch:{},mounted:function(){var t=this.activitys,e=this.currentIndex;this.inputValue=t[e]},beforeDestroy:function(){},methods:{onPrev:function(){var t=this.activitys;this.currentIndex;this.currentIndex=Math.max(this.currentIndex-1,0),this.inputValue=t[this.currentIndex]},onNext:function(){var t=this.activitys;this.currentIndex;this.currentIndex=Math.min(this.currentIndex+1,t.length-1),this.inputValue=t[this.currentIndex]}}},n=(i("d0GA"),i("psIG")),a=Object(n.a)(s,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"monthpicker-component"},[e("div",{staticClass:"button button-prev",on:{click:this.onPrev}},[e("img",{attrs:{src:i("Hd6Z")}})]),e("div",{staticClass:"box"},[e("div",{staticClass:"text"},[this._v(this._s(this.activityName))])]),e("div",{staticClass:"button button-next",on:{click:this.onNext}},[e("img",{attrs:{src:i("R/IN")}})])])}),[],!1,null,null,null).exports},BLvH:function(t,e,i){"use strict";var s=i("1ml8");i.n(s).a},Vz7R:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return u}));var s=i("8VmE"),n=i.n(s),a=i("lOrp"),r=i("2MRG"),c={components:{Monthpicker:i("7e3b").default,ReceiptDetail:i("hAzi").default},props:{content:{reqiured:!0,type:Object,default:function(){return{status:""}}}},data:function(){return{vHeight:"auto",apiResult:[],currentActivity:""}},computed:n()({},a.a.mapState([]),a.a.mapGetters(["LINEID"]),{activitys:function(){var t=this.apiResult;return 0===t.length?[]:t.map((function(t){return t.activityName}))},receipts:function(){var t=this.apiResult,e=this.currentActivity;if(0===t.length)return[];var i=t.filter((function(t){return t.activityName===e})),s=[];return i.map((function(t){return t.receipts})).forEach((function(t){t.forEach((function(t){s=[].concat(s,t)}))})),s}}),mounted:function(){var t=this;this.LINEID||this.$router.push("/"),window.addEventListener("resize",this.onResize),this.onResize(),this.$store.commit("setLoading",!0),r.a.lstreceipt().then((function(e){var i=e.data;t.apiResult=i})).then((function(){t.$store.commit("setLoading",!1)})).catch((function(e){t.$store.commit("setLoading",!1),t.$store.commit("setMessage",e.message),t.$store.commit("setShowPopup",!0)}))},beforeDestroy:function(){},methods:n()({},a.a.mapMutations(["setLoading"]),a.a.mapActions([]),{onResize:function(){this.vHeight=window.innerHeight-document.querySelector(".header").clientHeight-30/640*window.innerWidth+"px"},onHomeClick:function(){this.$router.push("/")},onLoginClick:function(){this.$router.push("/login")},onDetailClick:function(){this.$router.push("/detail")}})},o=(i("BLvH"),i("psIG")),u=Object(o.a)(c,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"page-detail"},[s("div",{staticClass:"row header"},[t.activitys.length>0?s("div",{staticClass:"col inner-wrapper"},[t.activitys.length>0?s("Monthpicker",{attrs:{activitys:t.activitys},model:{value:t.currentActivity,callback:function(e){t.currentActivity=e},expression:"currentActivity"}}):t._e()],1):t._e()]),s("div",{staticClass:"row"},[s("div",{staticClass:"col"},[0===t.receipts.length?s("div",{staticClass:"detail-wrapper flex-center",style:{height:t.vHeight}},[s("p",{staticClass:"empty-wording"},[t._v("目前尚無登記資料,快來登記喔!")]),s("img",{staticClass:"superman",attrs:{src:i("0kNP")}})]):s("div",{staticClass:"detail-wrapper",style:{height:t.vHeight}},t._l(t.receipts,(function(t,e){return s("ReceiptDetail",{key:"receipt"+(e+1),attrs:{receipt:t}})})),1)])]),s("div",{staticClass:"row",attrs:{id:"footer"}},[s("div",{staticClass:"col inner-wrapper"},[s("div",{staticClass:"button-container flex-between-end"},[s("div",{staticClass:"button button-login",on:{click:t.onLoginClick}},[s("img",{attrs:{src:i("GOW3")}})]),s("div",{staticClass:"button button-detail",on:{click:t.onDetailClick}},[s("img",{attrs:{src:i("K7tl")}})])]),s("div",{staticClass:"button-container flex-center move-up-30"},[s("div",{staticClass:"button button-home",on:{click:t.onHomeClick}},[s("img",{attrs:{src:i("1yA9")}})])])])])])}),[],!1,null,null,null).exports},ZeNR:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAABICAYAAACkyiqPAAACMElEQVR4Ae3ctXoVURiG0VwBcgFon4qWq8Xj7p70uLu7uw/5B7c9kI3Mc2YVC6Lf0bfL7LbtJ++Wil2DRYb7sfETsb265vsXKvbX13z/YMV+e833lyr2t2buD6f2gxCEkCaE39AxUrw5feHnTpwtar3fPZbeP3qq3vv9k+n9Q8frvT80k97fdzRr/+3o/KctIQjhVwgh3kxZTl9IOL/yXfv2T2Xunzz7ZQhh+LsQlotZGxJ3qGVAKoTiC54smhDCJ80KAQ4cK43suxiaGQJ88z5vZgggBBACVIawJTQ9BIRQakAIIAQQAggBhABCACGAEEAIGRDC8j+l1AgIAVpA0TNeetQzGYSAK9RCU0MAIYAQIB3CmSAEglMshMB7jnO5W+ocKYIni1blXCM4crLUd+hqaNUQwCkWIAQQQj6EsDk0IgRwPQIIAYQAQgAhgBBACCAEEAJkhrA5fPwzVU8azjVqUfDxwrMXHaOhySGAUyxACCCENIRwNyRCAOcaNQ6OczkTPh6bnR4C5xqBEMApFiAEEAIIAVyPAEIAIYAQPgVx6Hh6eGgmfm7FKvf7J/P2j55K73eP1Xv/xNn0fsdIvfer35j/cl8IQsjaF8LQgUvxAz91Y3A+64FU7d/rywut9/C15P7j7ola7+85djO5/7JjtNb7ie2QtZ2/LwQhCCF98f4XiiYAIUBGCO3x/YSlzDtTtX8wc399xf6Fmu+vrti/X/P9tgrFf9wXghCEEN4B9Eb24/0jRJkAAAAASUVORK5CYII="},d0GA:function(t,e,i){"use strict";var s=i("pilX");i.n(s).a},hAzi:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return l}));var s=i("8VmE"),n=i.n(s),a=i("lOrp"),r=i("2MRG"),c=i("+Ov0"),o=(i("XQ6/"),{name:"ReceiptDetail",components:{},props:{receipt:{required:!0,type:Object,default:function(){return{id:1,order_date:"2021-07-09",account_bank:"006",account_no:"1100600001372691",order_no:"0000000000287737",rStatus:1,rStatusMsg:"未開獎",rStatusBtn:"N"}}}},data:function(){return{isSend:!1,isSuccess:!1}},computed:{id:function(){return this.receipt.id},order_date:function(){return this.receipt.order_date},account_bank:function(){var t=this.receipt,e=c.a.filter((function(e){return e.code===t.account_bank.toString()}));return 0===e.length?"":e[0].code+" "+e[0].bank},account_no:function(){return this.receipt.account_no},order_no:function(){return this.receipt.order_no},rStatus:function(){return this.receipt.rStatus},rStatusMsg:function(){var t=this.isSuccess,e="";switch(this.receipt.rStatus){case 1:e="未開獎";break;case 2:e="未中獎";break;case 3:case 4:e="已中獎";break;case 5:e=t?"已領取":"成功";break;case 6:e="失敗";break;case 7:e="未驗證";break;case 8:e="未領獎";break;case 9:e="已領取"}return e},rStatusColor:function(){var t=this.receipt.rStatus;return 3===t||5===t?"yellow":"gray"},rStatusWording:function(){var t=this.receipt,e=this.isSend,i=this.isSuccess,s="";switch(t.rStatus){case 3:s=e?"交易資料驗證中":"請點選驗證";break;case 4:s="交易資料驗證中";break;case 5:s=i?"":"請點選領獎";break;case 6:s="交易資料不正確";break;case 7:case 8:s="資料已過期"}return s},modifyRStatusMsg:function(){var t=this.rStatusMsg;return Array.from(t)},rStatusBtn:function(){return"Y"===this.receipt.rStatusBtn},rStatusCalss:function(){var t=this.receipt,e=this.isSend,i=t.rStatus;return(3!==i||e)&&(5!==i||e)?"detail-status__complete":"detail-status__award"}},mounted:function(){},beforeDestroy:function(){},methods:n()({},a.a.mapMutations(["setLoading","setMessage","setShowPopup"]),a.a.mapActions([]),{sendToVerify:function(){var t=this;if(!this.isSend){var e=this.id;this.$store.commit("setLoading",!0),r.a.redeemreceipt(e).then((function(e){e.succ&&(t.isSend=!0,t.isSuccess=!0),t.$store.commit("setLoading",!1)})).catch((function(e){t.$store.commit("setLoading",!1),t.$store.commit("setMessage",e.message),t.$store.commit("setShowPopup",!0)}))}},receiveAward:function(){var t=this;if(!this.isSend){var e=this.id;this.$store.commit("setLoading",!0),r.a.getreceipt(e).then((function(e){e.succ&&(t.isSend=!0,t.isSuccess=!0),t.$store.commit("setLoading",!1)})).catch((function(e){t.$store.commit("setLoading",!1),t.$store.commit("setMessage",e.message),t.$store.commit("setShowPopup",!0)}))}},onVerifyFail:function(){this.$store.commit("setMessage",'很抱歉,驗證結果顯示您輸入的<br>交易資料不正確,<br>如有任何疑問,請洽客服信箱:<br><a href="mailto: service.taiwanpay@ogilvy.com">service.taiwanpay@ogilvy.com</a>'),this.$store.commit("setShowPopup",!0)},onExpired:function(){this.$store.commit("setMessage",'很抱歉,該筆資料已過期,<br>如有任何疑問,請洽客服信箱:<br><a href="mailto: service.taiwanpay@ogilvy.com">service.taiwanpay@ogilvy.com</a>'),this.$store.commit("setShowPopup",!0)},onClick:function(){switch(this.receipt.rStatus){case 3:this.sendToVerify();break;case 5:this.receiveAward();break;case 6:this.onVerifyFail();break;case 7:case 8:this.onExpired()}}})}),u=(i("zGrP"),i("psIG")),l=Object(u.a)(o,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"receipt-detail-component"},[s("div",{staticClass:"box"},[s("div",{staticClass:"detail-container"},[s("p",{staticClass:"detail-item"},[t._v("交易日期:"+t._s(t.order_date))]),s("p",{staticClass:"detail-item"},[t._v("交易銀行:"+t._s(t.account_bank))]),s("p",{staticClass:"detail-item last-item"},[t._v("交易帳號:"+t._s(t.account_no))]),s("p",{staticClass:"order-number"},[t._v("訂單編號:"+t._s(t.order_no))])]),s("div",{staticClass:"detail-status",class:t.rStatusCalss,on:{click:t.onClick}},[s("h1",{staticClass:"h1"},[t._v(t._s(t.rStatusWording))]),5===t.rStatus?s("p",{staticClass:"detail-text"},[t._v("獎金將於10月5日發放至預設帳戶")]):t._e(),3!==t.rStatus||t.isSend?t._e():s("div",{staticClass:"button button-award"},[s("img",{attrs:{src:i("ZeNR")}}),t._m(0)]),5!==t.rStatus||t.isSend?t._e():s("div",{staticClass:"button button-award"},[s("img",{attrs:{src:i("ZeNR")}}),t._m(1)])])]),s("div",{staticClass:"receipt-status",class:{"receipt-status__gray":"gray"===t.rStatusColor,"receipt-status__yellow":"yellow"===t.rStatusColor}},t._l(t.modifyRStatusMsg,(function(e){return s("span",[t._v(t._s(e))])})),0)])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"inner-wrapper flex-center"},[e("span",[this._v("驗證")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"inner-wrapper flex-center"},[e("span",[this._v("領獎")])])}],!1,null,null,null).exports},pilX:function(t,e,i){},zGrP:function(t,e,i){"use strict";var s=i("6sj6");i.n(s).a}}]);