You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
12 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-ship_manage"],{"00ec":function(t,e,n){"use strict";n.r(e);var a=n("64b0"),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},"291a":function(t,e,n){var a=n("9098");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("967d").default;i("2fa82ad0",a,!0,{sourceMap:!1,shadowMode:!1})},"345c":function(t,e,n){"use strict";n.r(e);var a=n("e07c"),i=n.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);e["default"]=i.a},"3b2a":function(t,e,n){"use strict";n.r(e);var a=n("fd9b"),i=n("345c");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("e3dd");var o=n("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"4ba8b919",null,!1,a["a"],void 0);e["default"]=r.exports},"561e":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"nav-bar",style:{paddingTop:t.statusBarHeight+"px"}},[n("v-uni-view",{staticClass:"nav-content"},[n("v-uni-image",{staticClass:"back-btn",attrs:{src:"/static/back.png",mode:"aspectFit"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onBack.apply(void 0,arguments)}}}),n("v-uni-text",{staticClass:"nav-title"},[t._v(t._s(t.title))]),n("v-uni-view",{staticClass:"right-slot"},[t._t("right")],2)],1),t._t("default")],2)},i=[]},6105:function(t,e,n){var a=n("c86c");e=a(!1),e.push([t.i,'@charset "UTF-8";\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* uni.scss */[data-v-4ba8b919] uni-input::-webkit-input-placeholder{font-size:%?24?%!important;color:#b0b8c6}[data-v-4ba8b919] uni-input::placeholder{font-size:%?24?%!important;color:#b0b8c6}.reservation-page[data-v-4ba8b919]{background:linear-gradient(180deg,#eaf3ff,#f6faff);min-height:100vh;padding-bottom:%?140?%}.wechat-browser[data-v-4ba8b919]{padding-top:%?20?%}.wechat-browser .content-area[data-v-4ba8b919]{padding-top:0}.fixed-nav[data-v-4ba8b919]{position:fixed;top:0;left:0;right:0;z-index:100;background:linear-gradient(180deg,#cbe6ff,#f6faff);box-shadow:0 2px 8px rgba(0,0,0,.04)}.content-area[data-v-4ba8b919]{padding:%?220?% %?24?% %?24?% %?24?%;min-height:calc(100vh - %?220?% - %?140?%)}.ship-cell[data-v-4ba8b919]{background:#fff;border-radius:%?16?%;box-shadow:0 %?2?% %?8?% rgba(0,0,0,.04);padding:%?32?% %?28?%;margin-bottom:%?32?%;border:%?1?% solid #e5e5e5}.ship-card-header[data-v-4ba8b919]{display:flex;align-items:center;margin-bottom:%?12?%}.status[data-v-4ba8b919]{font-size:%?24?%;border-radius:%?8?%;padding:2px %?18?%;color:#fff;font-weight:500;display:inline-block;-webkit-transform:skewX(-20deg);transform:skewX(-20deg);border:none;margin-right:%?16?%}.status-text[data-v-4ba8b919]{display:inline-block;-webkit-transform:skewX(20deg);transform:skewX(20deg)}.status.pending[data-v-4ba8b919]{background:#ff9800}.status.rejected[data-v-4ba8b919]{background:#ff3b3b}.status.approved[data-v-4ba8b919]{background:#22c58b}.ship-title[data-v-4ba8b919]{font-size:%?32?%;font-weight:700;margin-bottom:%?18?%;color:#222}.ship-no[data-v-4ba8b919]{color:#222;font-weight:700;font-size:%?32?%}.ship-row[data-v-4ba8b919]{font-size:%?28?%;color:#222;margin-bottom:%?10?%}.fixed-bottom[data-v-4ba8b919]{position:fixed;left:0;right:0;bottom:0;background:#fcfcfc;box-shadow:0 %?-2?% %?16?% rgba(59,124,255,.08);padding:%?24?% %?24?% %?32?% %?24?%;z-index:999;display:flex;justify-content:center}.add-cell-btn[data-v-4ba8b919]{min-width:%?320?%;height:%?80?%;border-radius:%?40?%;background:#217aff;color:#fff;font-size:%?32?%;font-weight:500;border:none;outline:none;box-shadow:0 %?4?% %?16?% rgba(33,122,255,.08);transition:background .2s}.empty-tip[data-v-4ba8b919]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:%?120?% 0}.empty-img[data-v-4ba8b919]{width:%?240?%;height:%?240?%;margin-bottom:%?24?%}.empty-text[data-v-4ba8b919]{font-size:%?28?%;color:#666}.delete-cell-btn[data-v-4ba8b919]{min-width:%?320?%;height:%?80?%;border-radius:%?40?%;background:#ff3b3b;color:#fff;font-size:%?32?%;font-weight:500;border:none;outline:none;box-shadow:0 %?4?% %?16?% rgba(255,59,59,.12);transition:background .2s}.with-margin[data-v-4ba8b919]{margin-left:%?24?%}',""]),t.exports=e},"64b0":function(t,e,n){"use strict";n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a={props:{title:{type:String,default:""}},data:function(){return{statusBarHeight:0}},mounted:function(){this.statusBarHeight=uni.getSystemInfoSync().statusBarHeight||0},methods:{onBack:function(){console.log("onBack"),uni.navigateBack()}}};e.default=a},7645:function(t,e,n){"use strict";var a=n("291a"),i=n.n(a);i.a},"8c6c":function(t,e,n){var a=n("6105");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=n("967d").default;i("69a9ba3b",a,!0,{sourceMap:!1,shadowMode:!1})},9098:function(t,e,n){var a=n("c86c");e=a(!1),e.push([t.i,".nav-bar[data-v-28453a18]{background:transparent}.nav-content[data-v-28453a18]{display:flex;align-items:center;justify-content:space-between;height:44px;padding:0 16px}.back-btn[data-v-28453a18]{width:16px;height:16px;display:flex;align-items:center;justify-content:center}.nav-title[data-v-28453a18]{font-size:16px;font-weight:400;color:#222;flex:1;text-align:center}.right-slot[data-v-28453a18]{min-width:24px}",""]),t.exports=e},e07c:function(t,e,n){"use strict";n("6a54");var a=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("2634")),s=a(n("2fdc"));n("5c47"),n("0506"),n("bf0f"),n("d4b5"),n("c223");var o=a(n("efbe")),r=n("bd31"),c={name:"ShipManagePage",components:{NavBar:o.default},data:function(){return{isWeixinBrowser:!1,shipList:[]}},onLoad:function(){this.isWeixinBrowser=/MicroMessenger/i.test(navigator.userAgent)},onShow:function(){this.fetchShipList()},methods:{fetchShipList:function(){var t=this;return(0,s.default)((0,i.default)().mark((function e(){var n,a;return(0,i.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=uni.getStorageSync("token"),n){e.next=4;break}return uni.showToast({title:"请先登录",icon:"none"}),e.abrupt("return");case 4:return uni.showLoading({title:"加载中..."}),e.prev=5,console.log(r.API.SHIP_INDEX),e.next=9,new Promise((function(t,e){uni.request({url:r.API.SHIP_INDEX,method:"GET",data:{token:n},success:t,fail:e})}));case 9:a=e.sent,uni.hideLoading(),a.data&&0===a.data.errcode?t.shipList=a.data.data||[]:uni.showToast({title:a.data.errmsg||"获取失败",icon:"none"}),e.next=18;break;case 14:e.prev=14,e.t0=e["catch"](5),uni.hideLoading(),uni.showToast({title:e.t0.message||"网络错误",icon:"none"});case 18:case"end":return e.stop()}}),e,null,[[5,14]])})))()},goAdd:function(){uni.navigateTo({url:"/pages/index/ship_add"})},goDetail:function(t){var e=encodeURIComponent(JSON.stringify(t));uni.navigateTo({url:"/pages/index/ship_detail?id=".concat(t.id,"&item=").concat(e)})},getShipStatusText:function(t){return"pending"===t?"待审核":"rejected"===t?"已拒绝":"approved"===t?"已通过":""},getShipStatusClass:function(t){return"pending"===t?"pending":"rejected"===t?"rejected":"approved"===t?"approved":""},goEdit:function(t){var e=encodeURIComponent(JSON.stringify(t));uni.navigateTo({url:"/pages/index/ship_add?edit=1&ship=".concat(e)})},onDelete:function(t){var e=this,n=uni.getStorageSync("token");n?t&&t.id?uni.showModal({title:"提示",content:"确定要删除该船舶吗?",success:function(a){a.confirm&&(uni.showLoading({title:"删除中..."}),uni.request({url:"".concat(r.API.SHIP_DELETE,"/").concat(t.id,"?token=").concat(n),method:"POST",data:{},header:{"content-type":"application/json"},success:function(t){uni.hideLoading(),t.data&&0===t.data.errcode?(uni.showToast({title:"删除成功",icon:"success"}),setTimeout((function(){e.fetchShipList()}),1e3)):uni.showToast({title:t.data.errmsg||"删除失败",icon:"none"})},fail:function(t){uni.hideLoading(),uni.showToast({title:"网络错误",icon:"none"})}}))}}):uni.showToast({title:"无效的船舶信息",icon:"none"}):uni.showToast({title:"请先登录",icon:"none"})}}};e.default=c},e3dd:function(t,e,n){"use strict";var a=n("8c6c"),i=n.n(a);i.a},efbe:function(t,e,n){"use strict";n.r(e);var a=n("561e"),i=n("00ec");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("7645");var o=n("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"28453a18",null,!1,a["a"],void 0);e["default"]=r.exports},fd9b:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"reservation-page",class:{"wechat-browser":t.isWeixinBrowser}},[t.isWeixinBrowser?t._e():n("v-uni-view",{staticClass:"fixed-nav"},[n("NavBar",{attrs:{title:"船只管理"}})],1),n("v-uni-view",{staticClass:"content-area"},[0===t.shipList.length?n("v-uni-view",{staticClass:"empty-tip"},[n("v-uni-image",{staticClass:"empty-img",attrs:{src:"/static/empty.png",mode:"aspectFit"}}),n("v-uni-text",{staticClass:"empty-text"},[t._v("暂无船只信息")])],1):n("v-uni-view",t._l(t.shipList,(function(e){return n("v-uni-view",{key:e.id,staticClass:"ship-cell",on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.goDetail(e)}}},[n("v-uni-view",{staticClass:"ship-card-header"},["pending"===e.status?n("v-uni-view",{staticClass:"status pending"},[n("span",{staticClass:"status-text"},[t._v("待审核")])]):"rejected"===e.status?n("v-uni-view",{staticClass:"status rejected"},[n("span",{staticClass:"status-text"},[t._v("已拒绝")])]):"approved"===e.status?n("v-uni-view",{staticClass:"status approved"},[n("span",{staticClass:"status-text"},[t._v("已通过")])]):t._e()],1),n("v-uni-view",{staticClass:"ship-title"},[t._v("船号:"),n("v-uni-text",{staticClass:"ship-no"},[t._v(t._s(e.ship_number))])],1),n("v-uni-view",{staticClass:"ship-row"},[t._v("所有人: "+t._s(e.owner_name))]),n("v-uni-view",{staticClass:"ship-row"},[t._v("联系电话: "+t._s(e.phone))]),n("v-uni-view",{staticClass:"ship-row"},[t._v("总吨位: "+t._s(e.total_tonnage)+" 吨")])],1)})),1)],1),0===t.shipList.length?n("v-uni-view",{staticClass:"fixed-bottom"},[n("v-uni-button",{staticClass:"add-cell-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goAdd.apply(void 0,arguments)}}},[t._v("添加")])],1):t._e(),1===t.shipList.length?n("v-uni-view",{staticClass:"fixed-bottom"},["pending"===t.shipList[0].status?[n("v-uni-button",{staticClass:"add-cell-btn",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.goEdit(t.shipList[0])}}},[t._v("修改")])]:"rejected"===t.shipList[0].status?[n("v-uni-button",{staticClass:"add-cell-btn",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.goEdit(t.shipList[0])}}},[t._v("修改")]),n("v-uni-button",{staticClass:"delete-cell-btn",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.onDelete(t.shipList[0])}}},[t._v("删除")])]:"approved"===t.shipList[0].status?[n("v-uni-button",{staticClass:"delete-cell-btn",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.onDelete(t.shipList[0])}}},[t._v("删除")])]:t._e()],2):t._e()],1)},i=[]}}]);