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.

2 lines
4.4 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/ship_manage"],{218:function(e,n,t){"use strict";(function(e,n){var i=t(4);t(26);i(t(25));var o=i(t(219));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t(1)["default"],t(2)["createPage"])},219:function(e,n,t){"use strict";t.r(n);var i=t(220),o=t(222);for(var a in o)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(a);t(224);var r,c=t(175),s=Object(c["default"])(o["default"],i["render"],i["staticRenderFns"],!1,null,"748d0662",null,!1,i["components"],r);s.options.__file="pages/index/ship_manage.vue",n["default"]=s.exports},220:function(e,n,t){"use strict";t.r(n);var i=t(221);t.d(n,"render",(function(){return i["render"]})),t.d(n,"staticRenderFns",(function(){return i["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return i["recyclableRender"]})),t.d(n,"components",(function(){return i["components"]}))},221:function(e,n,t){"use strict";var i;t.r(n),t.d(n,"render",(function(){return o})),t.d(n,"staticRenderFns",(function(){return r})),t.d(n,"recyclableRender",(function(){return a})),t.d(n,"components",(function(){return i}));var o=function(){var e=this,n=e.$createElement,t=(e._self._c,e.shipList.length),i=e.shipList.length,o=e.shipList.length;e.$mp.data=Object.assign({},{$root:{g0:t,g1:i,g2:o}})},a=!1,r=[];o._withStripped=!0},222:function(e,n,t){"use strict";t.r(n);var i=t(223),o=t.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(a);n["default"]=o.a},223:function(e,n,t){"use strict";(function(e){var i=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(t(186)),a=i(t(188)),r=t(30),c=function(){t.e("components/NavBar").then(function(){return resolve(t(337))}.bind(null,t)).catch(t.oe)},s={name:"ShipManagePage",components:{NavBar:c},data:function(){return{isWeixinBrowser:!1,shipList:[]}},onLoad:function(){},onShow:function(){this.fetchShipList()},methods:{fetchShipList:function(){var n=this;return(0,a.default)(o.default.mark((function t(){var i,a;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e.getStorageSync("token"),i){t.next=4;break}return e.showToast({title:"请先登录",icon:"none"}),t.abrupt("return");case 4:return e.showLoading({title:"加载中..."}),t.prev=5,console.log(r.API.SHIP_INDEX),t.next=9,new Promise((function(n,t){e.request({url:r.API.SHIP_INDEX,method:"GET",data:{token:i},success:n,fail:t})}));case 9:a=t.sent,e.hideLoading(),a.data&&0===a.data.errcode?n.shipList=a.data.data||[]:e.showToast({title:a.data.errmsg||"获取失败",icon:"none"}),t.next=18;break;case 14:t.prev=14,t.t0=t["catch"](5),e.hideLoading(),e.showToast({title:t.t0.message||"网络错误",icon:"none"});case 18:case"end":return t.stop()}}),t,null,[[5,14]])})))()},goAdd:function(){e.navigateTo({url:"/pages/index/ship_add"})},goDetail:function(n){var t=encodeURIComponent(JSON.stringify(n));e.navigateTo({url:"/pages/index/ship_detail?id=".concat(n.id,"&item=").concat(t)})},getShipStatusText:function(e){return"pending"===e?"待审核":"rejected"===e?"已拒绝":"approved"===e?"已通过":""},getShipStatusClass:function(e){return"pending"===e?"pending":"rejected"===e?"rejected":"approved"===e?"approved":""},goEdit:function(n){var t=encodeURIComponent(JSON.stringify(n));e.navigateTo({url:"/pages/index/ship_add?edit=1&ship=".concat(t)})},onDelete:function(n){var t=this,i=e.getStorageSync("token");i?n&&n.id?e.showModal({title:"提示",content:"确定要删除该船舶吗?",success:function(o){o.confirm&&(e.showLoading({title:"删除中..."}),e.request({url:"".concat(r.API.SHIP_DELETE,"/").concat(n.id,"?token=").concat(i),method:"POST",data:{},header:{"content-type":"application/json"},success:function(n){e.hideLoading(),n.data&&0===n.data.errcode?(e.showToast({title:"删除成功",icon:"success"}),setTimeout((function(){t.fetchShipList()}),1e3)):e.showToast({title:n.data.errmsg||"删除失败",icon:"none"})},fail:function(n){e.hideLoading(),e.showToast({title:"网络错误",icon:"none"})}}))}}):e.showToast({title:"无效的船舶信息",icon:"none"}):e.showToast({title:"请先登录",icon:"none"})}}};n.default=s}).call(this,t(2)["default"])},224:function(e,n,t){"use strict";t.r(n);var i=t(225),o=t.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(a);n["default"]=o.a},225:function(e,n,t){}},[[218,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/ship_manage.js.map