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"],{"0470":function(t,n,e){"use strict";var a=e("90bc"),i=e.n(a);i.a},"0daf":function(t,n,e){var a=e("c86c");n=a(!1),n.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=n},"201c":function(t,n,e){"use strict";var a=e("e66c"),i=e.n(a);i.a},"28a2":function(t,n,e){"use strict";e.r(n);var a=e("68d4"),i=e.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(s);n["default"]=i.a},"4eb6":function(t,n,e){"use strict";e.r(n);var a=e("4f9e"),i=e.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(s);n["default"]=i.a},"4f9e":function(t,n,e){"use strict";e("6a54"),Object.defineProperty(n,"__esModule",{value:!0}),n.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()}}};n.default=a},"67ca":function(t,n,e){"use strict";e.r(n);var a=e("93ae"),i=e("4eb6");for(var s in i)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(s);e("0470");var o=e("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"28453a18",null,!1,a["a"],void 0);n["default"]=r.exports},"68d4":function(t,n,e){"use strict";e("6a54");var a=e("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=a(e("2634")),s=a(e("2fdc"));e("5c47"),e("0506"),e("bf0f"),e("d4b5"),e("c223");var o=a(e("67ca")),r=e("8b9f"),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 n(){var e,a;return(0,i.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e=uni.getStorageSync("token"),e){n.next=4;break}return uni.showToast({title:"请先登录",icon:"none"}),n.abrupt("return");case 4:return uni.showLoading({title:"加载中..."}),n.prev=5,console.log(r.API.SHIP_INDEX),n.next=9,new Promise((function(t,n){uni.request({url:r.API.SHIP_INDEX,method:"GET",data:{token:e},success:t,fail:n})}));case 9:a=n.sent,uni.hideLoading(),a.data&&0===a.data.errcode?t.shipList=a.data.data||[]:uni.showToast({title:a.data.errmsg||"获取失败",icon:"none"}),n.next=18;break;case 14:n.prev=14,n.t0=n["catch"](5),uni.hideLoading(),uni.showToast({title:n.t0.message||"网络错误",icon:"none"});case 18:case"end":return n.stop()}}),n,null,[[5,14]])})))()},goAdd:function(){uni.navigateTo({url:"/pages/index/ship_add"})},goDetail:function(t){var n=encodeURIComponent(JSON.stringify(t));uni.navigateTo({url:"/pages/index/ship_detail?id=".concat(t.id,"&item=").concat(n)})},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 n=encodeURIComponent(JSON.stringify(t));uni.navigateTo({url:"/pages/index/ship_add?edit=1&ship=".concat(n)})},onDelete:function(t){var n=this,e=uni.getStorageSync("token");e?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(e),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(){n.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"})}}};n.default=c},"90bc":function(t,n,e){var a=e("c487");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("967d").default;i("373142f1",a,!0,{sourceMap:!1,shadowMode:!1})},"93ae":function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){}));var a=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("v-uni-view",{staticClass:"nav-bar",style:{paddingTop:t.statusBarHeight+"px"}},[e("v-uni-view",{staticClass:"nav-content"},[e("v-uni-image",{staticClass:"back-btn",attrs:{src:"/static/back.png",mode:"aspectFit"},on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.onBack.apply(void 0,arguments)}}}),e("v-uni-text",{staticClass:"nav-title"},[t._v(t._s(t.title))]),e("v-uni-view",{staticClass:"right-slot"},[t._t("right")],2)],1),t._t("default")],2)},i=[]},"99f1":function(t,n,e){"use strict";e.r(n);var a=e("f176"),i=e("28a2");for(var s in i)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(s);e("201c");var o=e("828b"),r=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,"4ba8b919",null,!1,a["a"],void 0);n["default"]=r.exports},c487:function(t,n,e){var a=e("c86c");n=a(!1),n.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=n},e66c:function(t,n,e){var a=e("0daf");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("967d").default;i("0a3022a0",a,!0,{sourceMap:!1,shadowMode:!1})},f176:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){}));var a=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("v-uni-view",{staticClass:"reservation-page",class:{"wechat-browser":t.isWeixinBrowser}},[t.isWeixinBrowser?t._e():e("v-uni-view",{staticClass:"fixed-nav"},[e("NavBar",{attrs:{title:"船只管理"}})],1),e("v-uni-view",{staticClass:"content-area"},[0===t.shipList.length?e("v-uni-view",{staticClass:"empty-tip"},[e("v-uni-image",{staticClass:"empty-img",attrs:{src:"/static/empty.png",mode:"aspectFit"}}),e("v-uni-text",{staticClass:"empty-text"},[t._v("暂无船只信息")])],1):e("v-uni-view",t._l(t.shipList,(function(n){return e("v-uni-view",{key:n.id,staticClass:"ship-cell",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goDetail(n)}}},[e("v-uni-view",{staticClass:"ship-card-header"},["pending"===n.status?e("v-uni-view",{staticClass:"status pending"},[e("span",{staticClass:"status-text"},[t._v("待审核")])]):"rejected"===n.status?e("v-uni-view",{staticClass:"status rejected"},[e("span",{staticClass:"status-text"},[t._v("已拒绝")])]):"approved"===n.status?e("v-uni-view",{staticClass:"status approved"},[e("span",{staticClass:"status-text"},[t._v("已通过")])]):t._e()],1),e("v-uni-view",{staticClass:"ship-title"},[t._v("船号:"),e("v-uni-text",{staticClass:"ship-no"},[t._v(t._s(n.ship_number))])],1),e("v-uni-view",{staticClass:"ship-row"},[t._v("所有人: "+t._s(n.owner_name))]),e("v-uni-view",{staticClass:"ship-row"},[t._v("联系电话: "+t._s(n.phone))]),e("v-uni-view",{staticClass:"ship-row"},[t._v("总吨位: "+t._s(n.total_tonnage)+" 吨")])],1)})),1)],1),0===t.shipList.length?e("v-uni-view",{staticClass:"fixed-bottom"},[e("v-uni-button",{staticClass:"add-cell-btn",on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.goAdd.apply(void 0,arguments)}}},[t._v("添加")])],1):t._e(),1===t.shipList.length?e("v-uni-view",{staticClass:"fixed-bottom"},["pending"===t.shipList[0].status?[e("v-uni-button",{staticClass:"add-cell-btn",on:{click:function(n){n.stopPropagation(),arguments[0]=n=t.$handleEvent(n),t.goEdit(t.shipList[0])}}},[t._v("修改")])]:"rejected"===t.shipList[0].status?[e("v-uni-button",{staticClass:"add-cell-btn",on:{click:function(n){n.stopPropagation(),arguments[0]=n=t.$handleEvent(n),t.goEdit(t.shipList[0])}}},[t._v("修改")]),e("v-uni-button",{staticClass:"delete-cell-btn",on:{click:function(n){n.stopPropagation(),arguments[0]=n=t.$handleEvent(n),t.onDelete(t.shipList[0])}}},[t._v("删除")])]:"approved"===t.shipList[0].status?[e("v-uni-button",{staticClass:"delete-cell-btn",on:{click:function(n){n.stopPropagation(),arguments[0]=n=t.$handleEvent(n),t.onDelete(t.shipList[0])}}},[t._v("删除")])]:t._e()],2):t._e()],1)},i=[]}}]);