(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-order-index"],{"3ad6":function(t,a,e){"use strict";e.r(a);var n=e("b57c"),i=e.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){e.d(a,t,(function(){return n[t]}))}(s);a["default"]=i.a},5642:function(t,a,e){"use strict";e.d(a,"b",(function(){return n})),e.d(a,"c",(function(){return i})),e.d(a,"a",(function(){}));var n=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-uni-view",{staticClass:"order-page",class:{"wechat-browser":t.isWeixinBrowser}},[e("v-uni-view",{staticClass:"header-title",class:{"hide-in-wechat":t.isWeixinBrowser}},[t._v("我的购票")]),e("v-uni-view",{staticClass:"order-list"},[t.reservationList.length>0?t._l(t.reservationList,(function(a){return e("v-uni-view",{key:a.id},["paid"===a.status||"completed"===a.status?e("v-uni-view",{staticClass:"order-card purchased"},[e("v-uni-view",{staticClass:"order-card-header"},[e("v-uni-view",{staticClass:"status purchased"},[e("span",{staticClass:"status-text"},[t._v(t._s(t.getStatusText(a.status)))])]),e("v-uni-view",{staticClass:"date"},[t._v(t._s(t.formatChinaDate(a.created_at)))])],1),e("v-uni-view",{staticClass:"order-info"},[e("v-uni-view",{staticClass:"flight"},[t._v(t._s(a.ship?a.ship.ship_number:""))]),e("v-uni-view",{staticClass:"desc"},[t._v(t._s(a.direction_name)+" | "+t._s(a.batch&&a.batch.name?a.batch.name:"-"))])],1),e("v-uni-view",{staticClass:"order-actions single-btn"},[e("v-uni-button",{staticClass:"detail-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onShowDetail(a)}}},[t._v("查看详情")])],1)],1):"pending"===a.status||"price_checked"===a.status?e("v-uni-view",{staticClass:"order-card pending"},[e("v-uni-view",{staticClass:"order-card-header"},[e("v-uni-view",{staticClass:"status pending"},[e("span",{staticClass:"status-text"},[t._v(t._s(t.getStatusText(a.status)))])]),e("v-uni-view",{staticClass:"date"},[t._v(t._s(t.formatChinaDate(a.created_at)))])],1),e("v-uni-view",{staticClass:"order-info"},[e("v-uni-view",{staticClass:"flight"},[t._v(t._s(a.ship?a.ship.ship_number:""))]),e("v-uni-view",{staticClass:"desc"},[t._v(t._s(a.direction_name)+" | "+t._s(a.batch&&a.batch.name?a.batch.name:"-"))])],1),e("v-uni-view",{staticClass:"order-actions"},[e("v-uni-button",{staticClass:"cancel-btn",attrs:{disabled:!1},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onCancelOrder(a)}}},[t._v("取消预约")]),e("v-uni-button",{staticClass:"detail-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onShowDetail(a)}}},[t._v("查看详情")])],1)],1):"rejected"===a.status?e("v-uni-view",{staticClass:"order-card pending"},[e("v-uni-view",{staticClass:"order-card-header"},[e("v-uni-view",{staticClass:"status rejected"},[e("span",{staticClass:"status-text"},[t._v(t._s(t.getStatusText(a.status)))])]),e("v-uni-view",{staticClass:"date"},[t._v(t._s(t.formatChinaDate(a.created_at)))])],1),e("v-uni-view",{staticClass:"order-info"},[e("v-uni-view",{staticClass:"flight"},[t._v(t._s(a.ship?a.ship.ship_number:""))]),e("v-uni-view",{staticClass:"desc"},[t._v(t._s(a.direction_name)+" | "+t._s(a.batch&&a.batch.name?a.batch.name:"-"))])],1),e("v-uni-view",{staticClass:"order-actions"},[e("v-uni-button",{staticClass:"cancel-btn",attrs:{disabled:!1},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goReservation(a)}}},[t._v("重新预约")]),e("v-uni-button",{staticClass:"detail-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onShowDetail(a)}}},[t._v("查看详情")])],1)],1):"unpaid"===a.status||"approved"===a.status?e("v-uni-view",{staticClass:"order-card confirmed"},[e("v-uni-view",{staticClass:"order-card-header"},[e("v-uni-view",{staticClass:"status confirmed"},[e("span",{staticClass:"status-text"},[t._v(t._s(t.getStatusText(a.status)))])]),e("v-uni-view",{staticClass:"date"},[t._v(t._s(t.formatChinaDate(a.created_at)))])],1),e("v-uni-view",{staticClass:"order-info"},[e("v-uni-view",{staticClass:"flight"},[t._v(t._s(a.ship?a.ship.ship_number:""))]),e("v-uni-view",{staticClass:"desc"},[t._v(t._s(a.direction_name)+" | "+t._s(a.batch&&a.batch.name?a.batch.name:"-"))])],1),e("v-uni-view",{staticClass:"order-actions"},[e("v-uni-button",{staticClass:"detail-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onShowDetail(a)}}},[t._v("查看详情")]),e("v-uni-button",{staticClass:"buy-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goPayOrder(a)}}},[t._v("去支付")])],1)],1):"canceled"===a.status?e("v-uni-view",{staticClass:"order-card canceled"},[e("v-uni-view",{staticClass:"order-card-header"},[e("v-uni-view",{staticClass:"status canceled"},[e("span",{staticClass:"status-text"},[t._v(t._s(t.getStatusText(a.status)))])]),e("v-uni-view",{staticClass:"date"},[t._v(t._s(t.formatChinaDate(a.created_at)))])],1),e("v-uni-view",{staticClass:"order-info"},[e("v-uni-view",{staticClass:"flight"},[t._v(t._s(a.ship?a.ship.ship_number:""))]),e("v-uni-view",{staticClass:"desc"},[t._v(t._s(a.direction_name)+" | "+t._s(a.batch&&a.batch.name?a.batch.name:"-"))])],1),e("v-uni-view",{staticClass:"order-actions single-btn"},[e("v-uni-button",{staticClass:"detail-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onShowDetail(a)}}},[t._v("查看详情")])],1)],1):t._e()],1)})):[e("v-uni-view",{staticClass:"empty-box"},[e("v-uni-image",{staticClass:"empty-img",attrs:{src:"/static/empty.png",mode:"aspectFit"}}),e("v-uni-view",{staticClass:"empty-text"},[t._v("暂无订单")])],1)]],2)],1)},i=[]},"6bb3":function(t,a,e){"use strict";e.r(a);var n=e("5642"),i=e("3ad6");for(var s in i)["default"].indexOf(s)<0&&function(t){e.d(a,t,(function(){return i[t]}))}(s);e("d18d");var d=e("828b"),o=Object(d["a"])(i["default"],n["b"],n["c"],!1,null,"d1f705d8",null,!1,n["a"],void 0);a["default"]=o.exports},"70f7":function(t,a,e){var n=e("bf03");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=e("967d").default;i("4a687750",n,!0,{sourceMap:!1,shadowMode:!1})},b57c:function(t,a,e){"use strict";e("6a54");var n=e("f5bd").default;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=n(e("2634")),s=n(e("2fdc"));e("5c47"),e("0506"),e("795c"),e("c223"),e("bf0f"),e("d4b5");var d=e("8b9f"),o={name:"OrderPage",data:function(){return{reservationStatusEnum:[],reservationList:[],isWeixinBrowser:!1}},onLoad:function(){this.isWeixinBrowser=/MicroMessenger/i.test(navigator.userAgent)},onShow:function(){var t=this;this.fetchReservationStatusEnum().then((function(){t.fetchReservationList()}))},methods:{formatChinaDate:function(t){if(!t)return"";var a=new Date(t),e=a.getFullYear(),n=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0");return"".concat(e,"-").concat(n,"-").concat(i)},fetchReservationStatusEnum:function(){var t=this;return(0,s.default)((0,i.default)().mark((function a(){var e,n;return(0,i.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(e=uni.getStorageSync("token"),e){a.next=3;break}return a.abrupt("return");case 3:return a.prev=3,a.next=6,new Promise((function(t,a){uni.request({url:"".concat(d.API.RESERVATION_STATUS_ENUM,"?token=").concat(e),method:"GET",success:t,fail:a})}));case 6:n=a.sent,n.data&&0===n.data.errcode&&(t.reservationStatusEnum=n.data.data),a.next=12;break;case 10:a.prev=10,a.t0=a["catch"](3);case 12:case"end":return a.stop()}}),a,null,[[3,10]])})))()},fetchReservationList:function(){var t=this;return(0,s.default)((0,i.default)().mark((function a(){var e,n;return(0,i.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(e=uni.getStorageSync("token"),e){a.next=3;break}return a.abrupt("return");case 3:return a.prev=3,a.next=6,new Promise((function(t,a){uni.request({url:"".concat(d.API.RESERVATION_LIST,"?token=").concat(e),method:"GET",success:t,fail:a})}));case 6:n=a.sent,n.data&&0===n.data.errcode&&(t.reservationList=n.data.data.data,console.log(t.reservationList)),a.next=12;break;case 10:a.prev=10,a.t0=a["catch"](3);case 12:case"end":return a.stop()}}),a,null,[[3,10]])})))()},onCancelOrder:function(t){var a=this;uni.showModal({title:"提示",content:"确定要取消该预约吗?",confirmText:"确定",cancelText:"再想想",success:function(e){if(e.confirm){var n=uni.getStorageSync("token");if(!n)return void uni.showToast({title:"请先登录",icon:"none"});uni.showLoading({title:"取消中..."}),uni.request({url:"".concat(d.API.CANCEL_RESERVATION,"/").concat(t.id,"?token=").concat(n),method:"POST",success:function(t){uni.hideLoading(),t.data&&0===t.data.errcode?(uni.showToast({title:"已取消预约",icon:"success"}),a.fetchReservationList()):uni.showToast({title:t.data.errmsg||"取消失败",icon:"none"})},fail:function(){uni.hideLoading(),uni.showToast({title:"网络错误",icon:"none"})}})}}})},onShowDetail:function(t){var a=JSON.stringify(t);uni.navigateTo({url:"/pages/order/pay_order_detail?item=".concat(encodeURIComponent(a))})},goPayOrder:function(t){var a=JSON.stringify(t);uni.navigateTo({url:"/pages/order/pay_order_detail?item=".concat(encodeURIComponent(a))})},goReservation:function(t){uni.navigateTo({url:"/pages/reservation/index"})},getStatusText:function(t){return this.reservationStatusEnum&&this.reservationStatusEnum[t]?this.reservationStatusEnum[t].label:t}}};a.default=o},bf03:function(t,a,e){var n=e("c86c");a=n(!1),a.push([t.i,".order-page[data-v-d1f705d8]{background:linear-gradient(180deg,#cbe6ff,#f6faff);min-height:100vh;padding-bottom:20px;font-family:SourceHanSansCN,PingFang SC,Microsoft YaHei,sans-serif}.header-title[data-v-d1f705d8]{text-align:center;font-size:%?36?%;font-weight:700;padding-top:7vh;letter-spacing:%?2?%}.header[data-v-d1f705d8]{display:flex;align-items:center;justify-content:space-between;padding:20px 16px 10px 16px;background:linear-gradient(180deg,#cbe6ff,#f6faff)}.back-btn[data-v-d1f705d8], .more-btn[data-v-d1f705d8]{font-size:24px;color:#333}.title[data-v-d1f705d8]{font-size:22px;font-weight:700;color:#222}.order-list[data-v-d1f705d8]{padding:10px 0 0 0;margin-top:%?44?%}.order-card[data-v-d1f705d8]{background:#fff;border-radius:10px;margin:0 16px 16px 16px;box-shadow:0 2px 8px rgba(0,0,0,.04);padding:18px 18px 12px 18px;height:%?340?%}.order-card-header[data-v-d1f705d8]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.status[data-v-d1f705d8]{font-size:12px;border-radius:%?8?%;padding:2px 8px;color:#fff;font-weight:500;display:inline-block;-webkit-transform:skewX(-20deg);transform:skewX(-20deg);border:none}.status-text[data-v-d1f705d8]{display:inline-block;-webkit-transform:skewX(20deg);transform:skewX(20deg)}.status.purchased[data-v-d1f705d8]{background:#22c58b}.status.pending[data-v-d1f705d8]{background:#ff9800}.status.rejected[data-v-d1f705d8]{background:#ff4d4f}.status.confirmed[data-v-d1f705d8]{background:#217aff}.status.cancelled[data-v-d1f705d8]{background:#bdbdbd}.status.canceled[data-v-d1f705d8]{background:#b0b8c6;color:#fff}.date[data-v-d1f705d8]{color:#173766;font-size:15px}.order-info[data-v-d1f705d8]{margin-bottom:24px}.flight[data-v-d1f705d8]{font-size:16px;font-weight:500;margin-top:12px}.desc[data-v-d1f705d8]{color:#888;font-size:14px;margin-top:10px}.order-actions[data-v-d1f705d8]{display:flex;gap:12px}uni-button[data-v-d1f705d8]{flex:1;border-radius:4px;padding:8px 0;font-size:16px;margin:0}.detail-btn[data-v-d1f705d8]{background:#e4f3fe;color:#217aff;height:%?69?%;display:flex;align-items:center;justify-content:center;font-size:14px;margin-left:auto}.order-actions.single-btn[data-v-d1f705d8]{justify-content:flex-end}.order-actions.single-btn .detail-btn[data-v-d1f705d8]{flex:0 0 auto;width:153px}.buy-btn[data-v-d1f705d8], .rebook-btn[data-v-d1f705d8]{background:linear-gradient(90deg,#3b7cff,#5bb6ff);color:#fff;height:%?69?%;display:flex;align-items:center;justify-content:center;font-size:14px}.cancel-btn[data-v-d1f705d8]{background:#ededed;color:#bdbdbd;height:%?69?%;display:flex;align-items:center;justify-content:center;font-size:14px}.cancel-btn[disabled][data-v-d1f705d8]{opacity:1}.tabbar[data-v-d1f705d8]{position:fixed;left:0;right:0;bottom:0;height:60px;background:#fff;display:flex;border-top:1px solid #eaeaea;z-index:10}.tab-item[data-v-d1f705d8]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#888;font-size:14px}.tab-item.active[data-v-d1f705d8]{color:#217aff}.icon[data-v-d1f705d8]{font-size:22px;margin-bottom:2px}.detail-modal-mask[data-v-d1f705d8]{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.5);z-index:9999;display:flex;align-items:center;justify-content:center}.detail-modal[data-v-d1f705d8]{background:#fff;border-radius:20px;padding:%?64?% %?56?% %?48?% %?56?%;width:90vw;max-width:500px;min-height:420px;margin:0 auto;position:relative;display:flex;flex-direction:column}.detail-modal-content[data-v-d1f705d8]{flex:1 1 auto;min-height:0;overflow-y:auto}.modal-close[data-v-d1f705d8]{position:absolute;right:%?24?%;top:%?24?%;font-size:%?44?%;color:#222;z-index:2;cursor:pointer}.modal-title[data-v-d1f705d8]{font-size:%?38?%;font-weight:700;margin-bottom:%?40?%;text-align:left}.modal-row[data-v-d1f705d8]{display:flex;justify-content:space-between;align-items:center;font-size:%?34?%;color:#222;margin-bottom:%?36?%}.modal-label[data-v-d1f705d8]{color:#3b4a6b;min-width:%?180?%;font-size:%?34?%}.modal-amount[data-v-d1f705d8]{color:#217aff;font-size:%?32?%;font-weight:700}.modal-confirm-btn[data-v-d1f705d8]{width:160px!important;height:44px!important;line-height:44px!important;border-radius:12px!important;background:linear-gradient(90deg,#3b7cff,#5bb6ff)!important;color:#fff!important;font-size:18px!important;font-weight:500!important;margin:40px auto 0 auto!important;border:none!important;outline:none!important;display:block!important;padding:0!important;box-sizing:border-box!important;text-align:center!important;align-self:center!important;flex-shrink:0!important;flex-grow:0!important}.order-card.canceled[data-v-d1f705d8]{opacity:.7}.empty-box[data-v-d1f705d8]{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:%?120?%}.empty-img[data-v-d1f705d8]{width:%?320?%;height:%?320?%;margin-bottom:%?32?%}.empty-text[data-v-d1f705d8]{color:#888;font-size:%?28?%}.hide-in-wechat[data-v-d1f705d8]{display:none!important}.wechat-browser[data-v-d1f705d8]{margin-top:%?-44?%}",""]),t.exports=a},d18d:function(t,a,e){"use strict";var n=e("70f7"),i=e.n(n);i.a}}]);