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.3 KiB
2 lines
4.3 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/ship_detail"],{274:function(t,e,n){"use strict";(function(t,e){var i=n(4);n(26);i(n(25));var o=i(n(275));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},275:function(t,e,n){"use strict";n.r(e);var i=n(276),o=n(278);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n(280);var r,c=n(33),s=Object(c["default"])(o["default"],i["render"],i["staticRenderFns"],!1,null,"bbc5a964",null,!1,i["components"],r);s.options.__file="pages/index/ship_detail.vue",e["default"]=s.exports},276:function(t,e,n){"use strict";n.r(e);var i=n(277);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},277:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return o})),n.d(e,"staticRenderFns",(function(){return r})),n.d(e,"recyclableRender",(function(){return a})),n.d(e,"components",(function(){return i}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.ship?t.getFileUrl(t.ship.picture1):null),i=t.ship?t.getFileUrl(t.ship.picture2):null,o=t.ship?t.getFileUrl(t.ship.picture3):null;t.$mp.data=Object.assign({},{$root:{m0:n,m1:i,m2:o}})},a=!1,r=[];o._withStripped=!0},278:function(t,e,n){"use strict";n.r(e);var i=n(279),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},279:function(t,e,n){"use strict";(function(t){var i=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n(44)),a=i(n(46)),r=n(30),c=function(){n.e("components/NavBar").then(function(){return resolve(n(314))}.bind(null,n)).catch(n.oe)},s={name:"ShipDetailPage",components:{NavBar:c},data:function(){return{ship:null,id:null}},onLoad:function(t){if(this.id=t.id,t.item)try{this.ship=JSON.parse(decodeURIComponent(t.item))}catch(e){this.ship=null}this.fetchShipDetail()},methods:{fetchShipDetail:function(){var e=this;return(0,a.default)(o.default.mark((function n(){var i,a;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=t.getStorageSync("token"),i){n.next=4;break}return t.showToast({title:"请先登录",icon:"none"}),n.abrupt("return");case 4:return t.showLoading({title:"加载中..."}),n.prev=5,n.next=8,new Promise((function(n,o){t.request({url:"".concat(r.API.SHIP_DETAIL,"/").concat(e.id),method:"GET",data:{token:i},success:n,fail:o})}));case 8:a=n.sent,t.hideLoading(),a.data&&0===a.data.errcode?e.ship=a.data.data:t.showToast({title:a.data.errmsg||"获取失败",icon:"none"}),n.next=17;break;case 13:n.prev=13,n.t0=n["catch"](5),t.hideLoading(),t.showToast({title:n.t0.message||"网络错误",icon:"none"});case 17:case"end":return n.stop()}}),n,null,[[5,13]])})))()},getFileUrl:function(t){return t?"".concat(r.API.BASE_URL,"/api/customer/upload-file/preview?id=").concat(t):""},onEdit:function(){if(this.ship){var e=encodeURIComponent(JSON.stringify(this.ship));t.navigateTo({url:"/pages/index/ship_add?edit=1&ship=".concat(e)})}},onDelete:function(){var e=this,n=t.getStorageSync("token");n?this.ship&&this.ship.id?t.showModal({title:"提示",content:"确定要删除该船舶吗?",success:function(i){i.confirm&&(t.showLoading({title:"删除中..."}),t.request({url:"".concat(r.API.SHIP_DELETE,"/").concat(e.ship.id,"?token=").concat(n),method:"POST",data:{},header:{"content-type":"application/json"},success:function(e){t.hideLoading(),e.data&&0===e.data.errcode?(t.showToast({title:"删除成功",icon:"success"}),setTimeout((function(){t.navigateBack()}),1e3)):t.showToast({title:e.data.errmsg||"删除失败",icon:"none"})},fail:function(e){t.hideLoading(),t.showToast({title:"网络错误",icon:"none"})}}))}}):t.showToast({title:"无效的船舶信息",icon:"none"}):t.showToast({title:"请先登录",icon:"none"})}}};e.default=s}).call(this,n(2)["default"])},280:function(t,e,n){"use strict";n.r(e);var i=n(281),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},281:function(t,e,n){}},[[274,"common/runtime","common/vendor"]]]);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/ship_detail.js.map
|