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
38 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-ship_add"],{"00ec":function(e,t,i){"use strict";i.r(t);var a=i("64b0"),n=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(r);t["default"]=n.a},1296:function(e,t,i){var a=i("b6a9");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var n=i("967d").default;n("e92a56d2",a,!0,{sourceMap:!1,shadowMode:!1})},"291a":function(e,t,i){var a=i("9098");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var n=i("967d").default;n("2fa82ad0",a,!0,{sourceMap:!1,shadowMode:!1})},3627:function(e,t,i){"use strict";i.r(t);var a=i("b47a"),n=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(r);t["default"]=n.a},"561e":function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("v-uni-view",{staticClass:"nav-bar",style:{paddingTop:e.statusBarHeight+"px"}},[i("v-uni-view",{staticClass:"nav-content"},[i("v-uni-image",{staticClass:"back-btn",attrs:{src:"/static/back.png",mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.onBack.apply(void 0,arguments)}}}),i("v-uni-text",{staticClass:"nav-title"},[e._v(e._s(e.title))]),i("v-uni-view",{staticClass:"right-slot"},[e._t("right")],2)],1),e._t("default")],2)},n=[]},"64b0":function(e,t,i){"use strict";i("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.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()}}};t.default=a},7645:function(e,t,i){"use strict";var a=i("291a"),n=i.n(a);n.a},"7e37":function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("v-uni-view",{staticClass:"ship-detail-bg",class:{"wechat-browser":e.isWeixinBrowser}},[e.isWeixinBrowser?e._e():i("v-uni-view",{staticClass:"fixed-nav"},[i("NavBar",{attrs:{title:e.isEdit?"编辑船只":"添加船只"}})],1),i("v-uni-view",{staticClass:"content-area"},[i("v-uni-view",{staticClass:"step-bar"},e._l(e.steps,(function(t,a){return i("v-uni-view",{key:a,staticClass:"step-group"},[i("v-uni-view",{staticClass:"step-circle",class:{active:a+1===e.currentStep}},[e._v(e._s(a+1))]),i("v-uni-view",{staticClass:"step-label",class:{active:a+1===e.currentStep}},[e._v(e._s(t))]),a<e.steps.length-1?i("v-uni-view",{staticClass:"step-line"}):e._e()],1)})),1),1===e.currentStep?i("v-uni-view",{staticClass:"info-card"},[i("v-uni-view",{staticClass:"info-title"},[e._v("基本信息")]),i("v-uni-view",{staticClass:"info-form"},[i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("船舶所有人")]),i("v-uni-input",{staticClass:"form-input",attrs:{placeholder:"姓名与身份证一致"},model:{value:e.form.owner,callback:function(t){e.$set(e.form,"owner",t)},expression:"form.owner"}})],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("身份证号")]),i("v-uni-input",{staticClass:"form-input",attrs:{placeholder:"输入正确的18位身份证号码"},model:{value:e.form.idCard,callback:function(t){e.$set(e.form,"idCard",t)},expression:"form.idCard"}})],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("联系电话")]),i("v-uni-input",{staticClass:"form-input",attrs:{placeholder:"11位常用的手机号"},model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone",t)},expression:"form.phone"}})],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("船名")]),i("v-uni-input",{staticClass:"form-input",attrs:{placeholder:"请输入船名"},model:{value:e.form.shipNo,callback:function(t){e.$set(e.form,"shipNo",t)},expression:"form.shipNo"}})],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("船舶类型")]),i("v-uni-view",{staticClass:"fee-type-group"},e._l(e.feeTypeEnum,(function(t,a){return i("v-uni-view",{key:t.value,staticClass:"fee-type-item"},[i("v-uni-radio",{staticClass:"form-radio",attrs:{value:String(t.value),checked:e.form.feeType===t.value},on:{click:function(i){arguments[0]=i=e.$handleEvent(i),e.onFeeTypeChange({detail:{value:t.value}})}}}),i("v-uni-view",{staticClass:"fee-type-info"},[i("v-uni-text",{staticClass:"fee-type-label"},[e._v(e._s(a))]),i("v-uni-text",{staticClass:"fee-type-desc"},[e._v(e._s(t.desc))])],1)],1)})),1)],1)],1)],1):e._e(),2===e.currentStep?i("v-uni-view",{staticClass:"info-card"},[i("v-uni-view",{staticClass:"info-title"},[e._v("船舶参数"),i("v-uni-text",{staticClass:"info-desc"},[e._v("(请按船舶检验证书填写)")])],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("载重吨位")]),i("v-uni-input",{staticClass:"form-input",attrs:{type:"digit",placeholder:"请输入载重吨位"},model:{value:e.form.ton,callback:function(t){e.$set(e.form,"ton",t)},expression:"form.ton"}}),i("v-uni-text",{staticClass:"form-unit"},[e._v("吨")])],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("总长度")]),i("v-uni-input",{staticClass:"form-input",attrs:{type:"digit",placeholder:"请输入总长度"},model:{value:e.form.length,callback:function(t){e.$set(e.form,"length",t)},expression:"form.length"}}),i("v-uni-text",{staticClass:"form-unit"},[e._v("米")])],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("总宽")]),i("v-uni-input",{staticClass:"form-input",attrs:{type:"digit",placeholder:"请输入总宽"},model:{value:e.form.width,callback:function(t){e.$set(e.form,"width",t)},expression:"form.width"}}),i("v-uni-text",{staticClass:"form-unit"},[e._v("米")])],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("型深")]),i("v-uni-input",{staticClass:"form-input",attrs:{type:"digit",placeholder:"请输入型深"},model:{value:e.form.depth,callback:function(t){e.$set(e.form,"depth",t)},expression:"form.depth"}}),i("v-uni-text",{staticClass:"form-unit"},[e._v("米")])],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("参考载重吨位")]),i("v-uni-radio-group",{staticClass:"form-radio-group",on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.onTonLevelChange.apply(void 0,arguments)}},model:{value:e.form.tonLevel,callback:function(t){e.$set(e.form,"tonLevel",t)},expression:"form.tonLevel"}},e._l(e.tonnageClassEnum,(function(t,a){return i("v-uni-radio",{key:t,staticClass:"form-radio",attrs:{value:String(t),checked:e.form.tonLevel===t}},[e._v(e._s(a))])})),1)],1),i("v-uni-view",{staticClass:"form-row"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("船型")]),i("v-uni-radio-group",{staticClass:"form-radio-group",on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.onShipTypeChange.apply(void 0,arguments)}},model:{value:e.form.shipType,callback:function(t){e.$set(e.form,"shipType",t)},expression:"form.shipType"}},e._l(e.shipTypeEnum,(function(t,a){return i("v-uni-radio",{key:t,staticClass:"form-radio",attrs:{value:t.toString(),checked:e.form.shipType===t.toString()}},[e._v(e._s(a))])})),1)],1)],1):e._e(),3===e.currentStep?i("v-uni-view",{staticClass:"info-card"},[i("v-uni-view",{staticClass:"info-title-row"},[i("v-uni-view",{staticClass:"info-title"},[e._v("船检簿上传")])],1),i("v-uni-view",{staticClass:"upload-section"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("第一页")]),i("v-uni-view",{staticClass:"upload-row"},[i("v-uni-view",{staticClass:"upload-img-box"},[e.page1Img?i("v-uni-image",{staticClass:"upload-img",attrs:{src:e.page1Img}}):i("v-uni-view",{staticClass:"upload-add",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.chooseImage("page1")}}},[i("v-uni-text",[e._v("+")]),i("v-uni-text",[e._v("添加图片")])],1),e.page1Img?i("v-uni-view",{staticClass:"upload-del",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.deleteImage("page1")}}},[e._v("×")]):e._e()],1),i("v-uni-view",{staticClass:"upload-desc"},[e.getExampleByIndex(0)?i("v-uni-view",{staticClass:"example-info"},[e.getExampleByIndex(0).image_url?i("v-uni-image",{staticClass:"example-img",attrs:{src:e.getExampleByIndex(0).image_url,mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewExample(e.getExampleByIndex(0).image_url)}}}):e._e(),i("v-uni-text",{staticClass:"example-text"},[e._v(e._s(e.getExampleByIndex(0).description||"第一页相关说明"))])],1):i("v-uni-text",{staticClass:"example-text"},[e._v("第一页相关说明")])],1)],1)],1),i("v-uni-view",{staticClass:"divider"}),i("v-uni-view",{staticClass:"upload-section"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("第二页")]),i("v-uni-view",{staticClass:"upload-row"},[i("v-uni-view",{staticClass:"upload-img-box"},[e.page2Img?i("v-uni-image",{staticClass:"upload-img",attrs:{src:e.page2Img}}):i("v-uni-view",{staticClass:"upload-add",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.chooseImage("page2")}}},[i("v-uni-text",[e._v("+")]),i("v-uni-text",[e._v("添加图片")])],1),e.page2Img?i("v-uni-view",{staticClass:"upload-del",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.deleteImage("page2")}}},[e._v("×")]):e._e()],1),i("v-uni-view",{staticClass:"upload-desc"},[e.getExampleByIndex(1)?i("v-uni-view",{staticClass:"example-info"},[e.getExampleByIndex(1).image_url?i("v-uni-image",{staticClass:"example-img",attrs:{src:e.getExampleByIndex(1).image_url,mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewExample(e.getExampleByIndex(1).image_url)}}}):e._e(),i("v-uni-text",{staticClass:"example-text"},[e._v(e._s(e.getExampleByIndex(1).description||"第二页相关说明"))])],1):i("v-uni-text",{staticClass:"example-text"},[e._v("第二页相关说明")])],1)],1)],1),i("v-uni-view",{staticClass:"divider"}),i("v-uni-view",{staticClass:"upload-section"},[i("v-uni-text",{staticClass:"form-label required"},[e._v("第三页")]),i("v-uni-view",{staticClass:"upload-row"},[i("v-uni-view",{staticClass:"upload-img-box"},[e.page3Img?i("v-uni-image",{staticClass:"upload-img",attrs:{src:e.page3Img}}):i("v-uni-view",{staticClass:"upload-add",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.chooseImage("page3")}}},[i("v-uni-text",[e._v("+")]),i("v-uni-text",[e._v("添加图片")])],1),e.page3Img?i("v-uni-view",{staticClass:"upload-del",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.deleteImage("page3")}}},[e._v("×")]):e._e()],1),i("v-uni-view",{staticClass:"upload-desc"},[e.getExampleByIndex(2)?i("v-uni-view",{staticClass:"example-info"},[e.getExampleByIndex(2).image_url?i("v-uni-image",{staticClass:"example-img",attrs:{src:e.getExampleByIndex(2).image_url,mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewExample(e.getExampleByIndex(2).image_url)}}}):e._e(),i("v-uni-text",{staticClass:"example-text"},[e._v(e._s(e.getExampleByIndex(2).description||"第三页相关说明"))])],1):i("v-uni-text",{staticClass:"example-text"},[e._v("第三页相关说明")])],1)],1)],1)],1):e._e(),4===e.currentStep?i("v-uni-view",{staticClass:"info-card"},[i("v-uni-view",{staticClass:"info-title"},[e._v("签名确认")]),i("v-uni-view",{staticClass:"sign-declare-row"},[i("v-uni-view",{staticStyle:{position:"relative",display:"flex","align-items":"center"}},[i("v-uni-checkbox",{attrs:{checked:e.signChecked}}),i("v-uni-view",{staticStyle:{position:"absolute",left:"0",top:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0)"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.toggleSignChecked.apply(void 0,arguments)}}})],1),i("v-uni-text",{staticClass:"sign-declare-text"},[e._v("本人承诺所提供材料皆真实有效;如有虚假,本人承担因此造成的全部责任。")])],1),i("v-uni-view",{staticClass:"divider"}),i("v-uni-view",{staticClass:"form-label required",staticStyle:{"margin-bottom":"16rpx",color:"#217aff"}},[e._v("手写签名")]),i("v-uni-view",{staticClass:"sign-area"},[e.signImg?e._e():i("v-uni-canvas",{staticClass:"sign-canvas",attrs:{id:"signCanvas","canvas-id":"signCanvas","disable-scroll":"true"},on:{touchstart:function(t){arguments[0]=t=e.$handleEvent(t),e.startSign.apply(void 0,arguments)},touchmove:function(t){arguments[0]=t=e.$handleEvent(t),e.moveSign.apply(void 0,arguments)},touchend:function(t){arguments[0]=t=e.$handleEvent(t),e.endSign.apply(void 0,arguments)}}}),e.signImg||e.hasSigned?e._e():i("v-uni-text",{staticClass:"sign-placeholder"},[e._v("此处签名")]),e.signImg?i("v-uni-image",{staticClass:"sign-img",attrs:{src:e.signImg}}):e._e()],1),i("v-uni-view",{staticClass:"sign-btn-bar"},[i("v-uni-button",{staticClass:"sign-btn reset-btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.resetSign.apply(void 0,arguments)}}},[e._v("重新签名")]),i("v-uni-button",{staticClass:"sign-btn preview-btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewSign.apply(void 0,arguments)}}},[e._v("预览签名")])],1)],1):e._e()],1),i("v-uni-view",{staticClass:"step-btn-bar"},[e.currentStep>1?i("v-uni-button",{staticClass:"step-btn prev-btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.prevStep.apply(void 0,arguments)}}},[e._v("上一步")]):e._e(),e.currentStep<4?i("v-uni-button",{staticClass:"step-btn next-btn",class:{"single-btn":1===e.currentStep},style:1===e.currentStep?"margin: 0 auto;":"",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.nextStep.apply(void 0,arguments)}}},[e._v("下一步")]):e._e(),4===e.currentStep?i("v-uni-button",{staticClass:"step-btn next-btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.submit.apply(void 0,arguments)}}},[e._v("提交")]):e._e()],1)],1)},n=[]},9098:function(e,t,i){var a=i("c86c");t=a(!1),t.push([e.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}",""]),e.exports=t},9530:function(e,t,i){"use strict";var a=i("1296"),n=i.n(a);n.a},b47a:function(e,t,i){"use strict";i("6a54");var a=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(i("fcf3")),r=a(i("2634")),o=a(i("2fdc"));i("5c47"),i("0506"),i("bf0f"),i("c223"),i("c9b5"),i("ab80"),i("22b6"),i("7a76");var s=a(i("efbe")),l=i("bd31"),c={name:"ShipManagerPage",components:{NavBar:s.default},data:function(){return{steps:["基本信息","船舶参数","船检簿上传","签名确认"],currentStep:1,page1Img:"",page2Img:"",page3Img:"",originalPage1Img:"",originalPage2Img:"",originalPage3Img:"",signChecked:!1,signImg:"",isSigning:!1,lastPoint:null,canvasWidth:0,canvasHeight:0,hasDrawn:!1,hasSigned:!1,originalSignature:"",isEdit:!1,shipTypeEnum:{},tonnageClassEnum:{},feeTypeEnum:{},unitPrice:"",calculationDescription:"",shipInspectionExamples:[],form:{owner:"",idCard:"",phone:"",shipNo:"",feeType:1,ton:"",length:"",width:"",depth:"",tonLevel:"B",shipType:"1",page1FileId:"",page2FileId:"",page3FileId:""},isWeixinBrowser:!1}},onLoad:function(e){var t=this;this.fetchShipInspectionExample(),this.fetchShipPropertyEnum().then((function(i){if(i){if(e&&"1"===e.edit)if(t.isEdit=!0,e.id)t.fetchShipDetailForEdit(e.id);else if(e.ship)try{var a=JSON.parse(decodeURIComponent(e.ship));console.log("填充数据(兼容旧参数 ship):",a.fee_type),t.form.id=a.id||"",t.form.owner=a.owner_name||"",t.form.idCard=a.id_card||"",t.form.phone=a.phone||"",t.form.shipNo=a.ship_number||"",t.form.ton=a.total_tonnage||"",t.form.length=a.total_length||"",t.form.width=a.total_width||"",t.form.depth=a.molded_depth||"",t.form.tonLevel=a.tonnage_class||"",t.form.shipType=a.ship_type||"",t.form.feeType=a.fee_type||1,t.form.page1FileId=a.picture1||"",t.form.page2FileId=a.picture2||"",t.form.page3FileId=a.picture3||"",t.page1Img=t.getFileUrl(a.picture1),t.page2Img=t.getFileUrl(a.picture2),t.page3Img=t.getFileUrl(a.picture3),t.originalPage1Img=t.page1Img,t.originalPage2Img=t.page2Img,t.originalPage3Img=t.page3Img}catch(n){console.error("解析 ship 参数失败:",n)}}else setTimeout((function(){uni.navigateBack()}),1500)})),this.isWeixinBrowser=/MicroMessenger/i.test(navigator.userAgent)},methods:{fetchUnitPrice:function(){var e=this;return(0,o.default)((0,r.default)().mark((function t(){var i,a,n;return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=uni.getStorageSync("token"),i){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,new Promise((function(e,t){uni.request({url:"".concat(l.API.GET_UNIT_PRICE,"?token=").concat(i),method:"get",success:e,fail:t})}));case 5:a=t.sent,a.data&&0===a.data.errcode&&(n=a.data.data,e.unitPrice=n.price||"",e.calculationDescription=n.price_desc||"");case 7:case"end":return t.stop()}}),t)})))()},fetchShipInspectionExample:function(){var e=this;return(0,o.default)((0,r.default)().mark((function t(){var i,a,n;return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=uni.getStorageSync("token"),i){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,new Promise((function(e,t){uni.request({url:"".concat(l.API.GET_SHIP_INSPECTION_EXAMPLES,"?token=").concat(i),method:"get",success:e,fail:t})}));case 5:a=t.sent,a.data&&0===a.data.errcode&&(n=a.data.data,e.shipInspectionExamples=n||[]);case 7:case"end":return t.stop()}}),t)})))()},fetchShipDetailForEdit:function(e){var t=this;return(0,o.default)((0,r.default)().mark((function i(){var a,n,o,s,c,u;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a=uni.getStorageSync("token"),a){i.next=4;break}return uni.showToast({title:"请先登录",icon:"none"}),i.abrupt("return");case 4:if(e){i.next=7;break}return uni.showToast({title:"无效的船舶ID",icon:"none"}),i.abrupt("return");case 7:return uni.showLoading({title:"加载中..."}),i.prev=8,i.next=11,new Promise((function(t,i){uni.request({url:"".concat(l.API.SHIP_DETAIL,"/").concat(e),method:"GET",data:{token:a},success:t,fail:i})}));case 11:n=i.sent,uni.hideLoading(),n.data&&0===n.data.errcode&&n.data.data?(o=n.data.data,console.log("编辑模式-详情数据:",o),t.isEdit=!0,t.form.id=o.id||e,t.form.owner=o.owner_name||"",t.form.idCard=o.id_card||"",t.form.phone=o.phone||"",t.form.shipNo=o.ship_number||"",t.form.ton=o.total_tonnage||"",t.form.length=o.total_length||"",t.form.width=o.total_width||"",t.form.depth=o.molded_depth||"",t.form.tonLevel=o.tonnage_class||"",t.form.shipType=(o.ship_type||"").toString(),t.form.feeType=o.fee_type||1,t.form.page1FileId=o.picture1||"",t.form.page2FileId=o.picture2||"",t.form.page3FileId=o.picture3||"",s=o.picture1_file&&o.picture1_file.url?o.picture1_file.url:t.getFileUrl(o.picture1),c=o.picture2_file&&o.picture2_file.url?o.picture2_file.url:t.getFileUrl(o.picture2),u=o.picture3_file&&o.picture3_file.url?o.picture3_file.url:t.getFileUrl(o.picture3),t.page1Img=s,t.page2Img=c,t.page3Img=u,t.originalPage1Img=s,t.originalPage2Img=c,t.originalPage3Img=u,o.signature&&(t.signImg=o.signature,t.originalSignature=o.signature,t.hasSigned=!0)):uni.showToast({title:n.data&&n.data.errmsg||"获取船舶详情失败",icon:"none"}),i.next=21;break;case 16:i.prev=16,i.t0=i["catch"](8),uni.hideLoading(),console.error("获取船舶详情异常:",i.t0),uni.showToast({title:i.t0.message||"网络错误",icon:"none"});case 21:case"end":return i.stop()}}),i,null,[[8,16]])})))()},fetchShipPropertyEnum:function(){var e=this;return(0,o.default)((0,r.default)().mark((function t(){var i,a,n;return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=uni.getStorageSync("token"),i){t.next=4;break}return uni.showToast({title:"请先登录",icon:"none"}),t.abrupt("return",!1);case 4:return uni.showLoading({title:"加载中..."}),t.prev=5,t.next=8,new Promise((function(e,t){uni.request({url:l.API.SHIP_PROPERTY_ENUM,method:"GET",data:{token:i},success:e,fail:t})}));case 8:if(a=t.sent,uni.hideLoading(),!a.data||0!==a.data.errcode){t.next=19;break}return n=a.data.data,e.shipTypeEnum=n.ship_type,e.tonnageClassEnum=n.tonnage_class,e.feeTypeEnum=n.fee_type,e.isEdit||(e.form.shipType=Object.values(e.shipTypeEnum)[0].toString(),e.form.tonLevel=Object.values(e.tonnageClassEnum)[0],e.form.feeType=1),t.abrupt("return",!0);case 19:return uni.showToast({title:a.data.errmsg||"获取枚举失败",icon:"none"}),t.abrupt("return",!1);case 21:t.next=28;break;case 23:return t.prev=23,t.t0=t["catch"](5),uni.hideLoading(),uni.showToast({title:t.t0.message||"网络错误",icon:"none"}),t.abrupt("return",!1);case 28:case"end":return t.stop()}}),t,null,[[5,23]])})))()},getFileUrl:function(e){return e?"".concat(l.API.BASE_URL,"/api/customer/upload-file/preview?id=").concat(e):""},uploadFile:function(e){return(0,o.default)((0,r.default)().mark((function t(){return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){var a=uni.getStorageSync("token");a?uni.uploadFile({url:l.API.UPLOAD_FILE,filePath:e,name:"file",formData:{token:a},success:function(e){if(200===e.statusCode){var a=JSON.parse(e.data);a.errcode&&0!==a.errcode?i(new Error(a.errmsg||"Upload failed")):t(a)}else i(new Error("Upload failed"))},fail:function(e){i(e)}}):i(new Error("未登录或登录已过期"))})));case 1:case"end":return t.stop()}}),t)})))()},isValidNumber:function(e){return!!e&&/^\d+(\.\d+)?$/.test(e)},nextStep:function(){var e=this;return(0,o.default)((0,r.default)().mark((function t(){var i,a,n;return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(1!==e.currentStep){t.next=16;break}if(e.form.owner){t.next=4;break}return uni.showToast({title:"请填写船舶所有人",icon:"none"}),t.abrupt("return");case 4:if(e.form.idCard){t.next=7;break}return uni.showToast({title:"请填写身份证号",icon:"none"}),t.abrupt("return");case 7:if(e.form.phone){t.next=10;break}return uni.showToast({title:"请填写联系电话",icon:"none"}),t.abrupt("return");case 10:if(/^\d{11}$/.test(e.form.phone)){t.next=13;break}return uni.showToast({title:"联系电话格式不正确",icon:"none"}),t.abrupt("return");case 13:if(e.form.shipNo){t.next=16;break}return uni.showToast({title:"请填写船名",icon:"none"}),t.abrupt("return");case 16:if(2!==e.currentStep){t.next=47;break}if(e.form.ton){t.next=20;break}return uni.showToast({title:"请填写载重吨位",icon:"none"}),t.abrupt("return");case 20:if(e.isValidNumber(e.form.ton)){t.next=23;break}return uni.showToast({title:"载重吨位必须是数字",icon:"none"}),t.abrupt("return");case 23:if(e.form.length){t.next=26;break}return uni.showToast({title:"请填写总长度",icon:"none"}),t.abrupt("return");case 26:if(e.isValidNumber(e.form.length)){t.next=29;break}return uni.showToast({title:"总长度必须是数字",icon:"none"}),t.abrupt("return");case 29:if(e.form.width){t.next=32;break}return uni.showToast({title:"请填写总宽",icon:"none"}),t.abrupt("return");case 32:if(e.isValidNumber(e.form.width)){t.next=35;break}return uni.showToast({title:"总宽必须是数字",icon:"none"}),t.abrupt("return");case 35:if(e.form.depth){t.next=38;break}return uni.showToast({title:"请填写型深",icon:"none"}),t.abrupt("return");case 38:if(e.isValidNumber(e.form.depth)){t.next=41;break}return uni.showToast({title:"型深必须是数字",icon:"none"}),t.abrupt("return");case 41:if(e.form.tonLevel){t.next=44;break}return uni.showToast({title:"请选择参考载重吨位",icon:"none"}),t.abrupt("return");case 44:if(e.form.shipType){t.next=47;break}return uni.showToast({title:"请选择船型",icon:"none"}),t.abrupt("return");case 47:if(3!==e.currentStep){t.next=82;break}if(e.page1Img){t.next=51;break}return uni.showToast({title:"请上传第一页图片",icon:"none"}),t.abrupt("return");case 51:if(e.page2Img){t.next=54;break}return uni.showToast({title:"请上传第二页图片",icon:"none"}),t.abrupt("return");case 54:if(e.page3Img){t.next=57;break}return uni.showToast({title:"请上传第三页图片",icon:"none"}),t.abrupt("return");case 57:if(t.prev=57,uni.showLoading({title:"上传中..."}),e.page1Img===e.originalPage1Img&&e.form.page1FileId){t.next=64;break}return t.next=62,e.uploadFile(e.page1Img);case 62:i=t.sent,e.form.page1FileId=i.data.id;case 64:if(e.page2Img===e.originalPage2Img&&e.form.page2FileId){t.next=69;break}return t.next=67,e.uploadFile(e.page2Img);case 67:a=t.sent,e.form.page2FileId=a.data.id;case 69:if(e.page3Img===e.originalPage3Img&&e.form.page3FileId){t.next=74;break}return t.next=72,e.uploadFile(e.page3Img);case 72:n=t.sent,e.form.page3FileId=n.data.id;case 74:uni.hideLoading(),t.next=82;break;case 77:return t.prev=77,t.t0=t["catch"](57),uni.hideLoading(),uni.showToast({title:t.t0.message||"上传失败,请重试",icon:"none"}),t.abrupt("return");case 82:e.currentStep<4&&e.currentStep++;case 83:case"end":return t.stop()}}),t,null,[[57,77]])})))()},submit:function(){var e=this;return(0,o.default)((0,r.default)().mark((function t(){var i,a,o,s,c,u,d,f,p;return(0,r.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.signChecked){t.next=3;break}return uni.showToast({title:"请勾选承诺声明",icon:"none"}),t.abrupt("return");case 3:if(e.hasSigned){t.next=6;break}return uni.showToast({title:"请完成签名",icon:"none"}),t.abrupt("return");case 6:if(t.prev=6,uni.showLoading({title:"处理中..."}),i="",!e.isEdit||!e.originalSignature||e.hasDrawn){t.next=13;break}i=e.originalSignature,t.next=16;break;case 13:return t.next=15,e.getSignBase64();case 15:i=t.sent;case 16:if(a=uni.getStorageSync("token"),a){t.next=21;break}return uni.hideLoading(),uni.showToast({title:"登录已失效",icon:"none"}),t.abrupt("return");case 21:return o={token:a,owner_name:e.form.owner,id_card:e.form.idCard,phone:e.form.phone,ship_number:e.form.shipNo,total_tonnage:e.form.ton,total_length:e.form.length,total_width:e.form.width,molded_depth:e.form.depth,tonnage_class:e.form.tonLevel,ship_type:e.form.shipType,fee_type:e.form.feeType,picture1:e.form.page1FileId,picture2:e.form.page2FileId,picture3:e.form.page3FileId,signature:i},s=l.API.SHIP_CREATE,c="POST",e.isEdit&&e.form.id&&(s="".concat(l.API.SHIP_UPDATE,"/").concat(encodeURIComponent(e.form.id)),c="POST"),console.log("提交参数:",o,s),t.next=28,new Promise((function(e,t){uni.request({url:s,method:c,data:o,header:{"Content-Type":"application/json"},success:e,fail:t})}));case 28:u=t.sent,uni.hideLoading(),u.data&&0===u.data.errcode?(uni.showToast({title:"提交成功",icon:"success"}),setTimeout((function(){uni.navigateBack()}),800)):(console.log("提交失败返回:",u.data),d=u.data||{},f=d.data||{},p="",f&&"object"===(0,n.default)(f)&&Array.isArray(f.signature)&&f.signature.length&&(p="签名:".concat(f.signature.join(""))),p||(p=d.errmsg||"提交失败"),uni.showToast({title:p,icon:"none"})),t.next=37;break;case 33:t.prev=33,t.t0=t["catch"](6),uni.hideLoading(),uni.showToast({title:t.t0.message||"提交失败,请重试",icon:"none"});case 37:case"end":return t.stop()}}),t,null,[[6,33]])})))()},prevStep:function(){this.currentStep>1&&this.currentStep--},chooseImage:function(e){var t=this;uni.chooseImage({count:1,success:function(i){"page1"===e&&(t.page1Img=i.tempFilePaths[0],t.originalPage1Img=i.tempFilePaths[0]),"page2"===e&&(t.page2Img=i.tempFilePaths[0],t.originalPage2Img=i.tempFilePaths[0]),"page3"===e&&(t.page3Img=i.tempFilePaths[0],t.originalPage3Img=i.tempFilePaths[0])}})},deleteImage:function(e){"page1"===e&&(this.page1Img="",this.originalPage1Img="",this.form.page1FileId=""),"page2"===e&&(this.page2Img="",this.originalPage2Img="",this.form.page2FileId=""),"page3"===e&&(this.page3Img="",this.originalPage3Img="",this.form.page3FileId="")},viewExample:function(){uni.showToast({title:"查看示例",icon:"none"})},getExampleByIndex:function(e){return Array.isArray(this.shipInspectionExamples)&&0!==this.shipInspectionExamples.length?e<0||e>=3||e>=this.shipInspectionExamples.length?null:this.shipInspectionExamples[e]||null:null},previewExample:function(e){e&&uni.previewImage({urls:[e],current:e})},startSign:function(e){this.isSigning=!0,this.hasSigned=!0;var t=uni.createCanvasContext("signCanvas",this),i=e.touches[0],a=i.x,n=i.y;this.hasDrawn||(t.setFillStyle("#fff"),t.fillRect(0,0,this.canvasWidth,this.canvasHeight),this.hasDrawn=!0),t.moveTo(a,n),t.setStrokeStyle("#222"),t.setLineWidth(4),this.lastPoint={x:a,y:n},t.beginPath(),t.draw(!0)},moveSign:function(e){if(this.isSigning){var t=uni.createCanvasContext("signCanvas",this),i=e.touches[0],a=i.x,n=i.y;t.moveTo(this.lastPoint.x,this.lastPoint.y),t.lineTo(a,n),t.setStrokeStyle("#222"),t.setLineWidth(4),t.stroke(),t.draw(!0),this.lastPoint={x:a,y:n}}},endSign:function(){this.isSigning=!1},resetSign:function(){this.signImg="",this.hasDrawn=!1,this.hasSigned=!1;var e=uni.createCanvasContext("signCanvas",this);e.setFillStyle("#fff"),e.fillRect(0,0,this.canvasWidth,this.canvasHeight),e.draw()},previewSign:function(){var e=this;uni.createSelectorQuery().select("#signCanvas").boundingClientRect((function(t){uni.canvasToTempFilePath({canvasId:"signCanvas",width:t.width,height:t.height,success:function(e){uni.previewImage({urls:[e.tempFilePath]})},fail:function(e){uni.showToast({title:"签名生成失败",icon:"none"})}},e)})).exec()},onTonLevelChange:function(e){this.form.tonLevel=e.detail.value,console.log(e.detail.value)},onShipTypeChange:function(e){this.form.shipType=e.detail.value},onFeeTypeChange:function(e){this.form.feeType=e.detail.value},toggleSignChecked:function(){this.signChecked=!this.signChecked},getSignBase64:function(){var e=this;return new Promise((function(t,i){uni.canvasToTempFilePath({canvasId:"signCanvas",success:function(e){t(e.tempFilePath)},fail:i},e)}))}}};t.default=c},b6a9:function(e,t,i){var a=i("c86c");t=a(!1),t.push([e.i,'@charset "UTF-8";\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* uni.scss */[data-v-047d5b91] uni-input::-webkit-input-placeholder{font-size:%?24?%!important;color:#b0b8c6}[data-v-047d5b91] uni-input::placeholder{font-size:%?24?%!important;color:#b0b8c6}.ship-detail-bg[data-v-047d5b91]{min-height:100vh;background:linear-gradient(180deg,#cbe6ff,#f6faff);padding-bottom:%?32?%}.wechat-browser[data-v-047d5b91]{padding-top:%?10?%}.wechat-browser .content-area[data-v-047d5b91]{padding-top:0}.fixed-nav[data-v-047d5b91]{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-047d5b91]{padding-top:90px}.step-bar[data-v-047d5b91]{display:flex;align-items:flex-start;justify-content:space-between;width:100%;margin:%?64?% auto 0 auto;padding:0 %?32?%;position:relative}.step-group[data-v-047d5b91]{display:flex;flex-direction:column;align-items:center;flex:1;position:relative}.step-circle[data-v-047d5b91]{width:%?60?%;height:%?60?%;border-radius:50%;background:#e3eaf7;color:#b0b8c6;display:flex;align-items:center;justify-content:center;font-size:%?32?%;font-weight:700;transition:background .2s,color .2s;z-index:1}.step-circle.active[data-v-047d5b91]{background:#fff;color:#217aff;border:%?4?% solid #217aff}.step-label[data-v-047d5b91]{margin-top:%?18?%;font-size:%?24?%;color:#222;font-weight:400;text-align:center;min-width:%?60?%;white-space:nowrap}.step-label.active[data-v-047d5b91]{color:#217aff;font-weight:700}.step-line[data-v-047d5b91]{position:absolute;top:%?30?%;left:50%;width:100%;height:%?4?%;background:#e3eaf7;z-index:0}.info-card[data-v-047d5b91]{background:#fff;border-radius:%?24?%;margin:0 %?32?%;padding:%?32?% %?24?%;box-shadow:0 %?4?% %?16?% rgba(0,0,0,.06);margin-top:%?60?%}.info-title[data-v-047d5b91]{font-size:%?32?%;font-weight:700;margin-bottom:%?24?%;color:#222}.info-form[data-v-047d5b91]{display:flex;flex-direction:column;gap:%?18?%}.form-row[data-v-047d5b91]{display:flex;align-items:center;border-bottom:1px solid #f0f0f0;padding:%?16?% 0}.form-label[data-v-047d5b91]{width:%?200?%;font-size:%?28?%;color:#222}.form-label.required[data-v-047d5b91]::before{content:"*";color:#ff5c5c;margin-right:%?6?%}.form-input[data-v-047d5b91]{flex:1;font-size:%?28?%;color:#333;border:none;outline:none;background:transparent}.form-static[data-v-047d5b91]{flex:1;font-size:%?28?%;color:#222;text-align:left}.step-btn-bar[data-v-047d5b91]{display:flex;justify-content:center;gap:%?32?%;margin:%?64?% 0 0 0;margin-top:%?100?%}.step-btn[data-v-047d5b91]{min-width:%?270?%;height:%?80?%;border-radius:%?40?%;font-size:%?28?%;font-weight:500;border:none;outline:none;background:#217aff;color:#fff;box-shadow:0 %?4?% %?16?% rgba(33,122,255,.08);transition:background .2s;display:flex;align-items:center;justify-content:center}.step-btn.single-btn[data-v-047d5b91]{min-width:%?420?%}.prev-btn[data-v-047d5b91]{background:#e3eaf7;color:#000;border:none;outline:none}.prev-btn[data-v-047d5b91]::after{border:none}.next-btn[data-v-047d5b91]{background:#217aff;color:#fff}.info-desc[data-v-047d5b91]{font-size:%?24?%;color:#888;margin-left:%?12?%;font-weight:400}.form-unit[data-v-047d5b91]{font-size:%?24?%;color:#888;margin-left:%?8?%}.form-tip[data-v-047d5b91]{font-size:%?24?%;color:#b0b8c6;margin-bottom:%?8?%;margin-left:%?180?%}.form-radio-group[data-v-047d5b91]{display:flex;gap:%?32?%;margin-left:%?24?%}.form-radio[data-v-047d5b91]{font-size:%?28?%;color:#222;display:flex;align-items:center}\n/* 船舶类型特殊样式 */.fee-type-group[data-v-047d5b91]{display:flex;flex-direction:column;gap:%?24?%;margin-left:%?24?%;width:100%}.fee-type-item[data-v-047d5b91]{display:flex;align-items:flex-start;width:100%}.fee-type-info[data-v-047d5b91]{display:flex;flex-direction:column;margin-left:%?8?%;flex:1}.fee-type-label[data-v-047d5b91]{font-size:%?28?%;color:#222}.fee-type-desc[data-v-047d5b91]{font-size:%?24?%;color:#888;margin-top:%?4?%}.info-title-row[data-v-047d5b91]{display:flex;justify-content:space-between;align-items:center;margin-bottom:%?24?%}.example-btn[data-v-047d5b91]{background:#edf0f5;font-size:%?28?%;color:#222;border-radius:%?40?%;font-weight:500;padding:%?18?% %?78?%;border:none;height:%?64?%;line-height:1;box-shadow:none;margin-right:%?20?%}.upload-section[data-v-047d5b91]{margin-bottom:%?32?%}.upload-row[data-v-047d5b91]{display:flex;align-items:center;gap:%?24?%;margin-top:%?12?%}.upload-img-box[data-v-047d5b91]{position:relative;width:%?140?%;height:%?140?%;background:#f0f0f0;border-radius:%?12?%;display:flex;align-items:center;justify-content:center;overflow:hidden}.upload-img[data-v-047d5b91]{width:100%;height:100%;object-fit:cover;border-radius:%?12?%}.upload-add[data-v-047d5b91]{width:%?140?%;height:%?140?%;color:#fff;font-size:%?28?%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#a6a8ab;border-radius:%?12?%;cursor:pointer;font-weight:500;letter-spacing:%?1?%;margin-bottom:%?20?%}.upload-add uni-text[data-v-047d5b91]:first-child{font-size:%?48?%}.upload-add uni-text[data-v-047d5b91]:last-child{font-size:%?24?%}.upload-del[data-v-047d5b91]{position:absolute;top:0;right:0;width:%?36?%;height:%?36?%;background:rgba(0,0,0,.5);color:#fff;font-size:%?24?%;display:flex;align-items:center;justify-content:center;border-radius:0 %?12?% 0 %?12?%;cursor:pointer}.upload-desc[data-v-047d5b91]{flex:1;background:#f5f7fa;font-size:%?24?%;color:#b0b8c6;border-radius:%?12?%;padding:0 %?24?%;min-height:%?140?%;display:flex;align-items:center}.example-info[data-v-047d5b91]{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;width:100%;gap:%?24?%}.example-img[data-v-047d5b91]{width:%?120?%;height:%?120?%;border-radius:%?8?%;cursor:pointer;object-fit:contain;background:#fff;flex-shrink:0}.example-text[data-v-047d5b91]{font-size:%?24?%;color:#666;text-align:left;line-height:1.5;font-size:%?24?%;flex:1}.divider[data-v-047d5b91]{height:%?2?%;background:#f0f0f0;margin:%?32?% 0}.sign-declare-row[data-v-047d5b91]{display:flex;align-items:flex-start;margin-bottom:%?24?%}.sign-declare-text[data-v-047d5b91]{font-size:%?28?%;color:#666;margin-left:%?16?%;line-height:1.6}.sign-area[data-v-047d5b91]{width:100%;min-height:%?460?%;background:#f5f7fa;border-radius:%?16?%;display:flex;align-items:center;justify-content:center;margin-bottom:%?32?%;position:relative}.sign-placeholder[data-v-047d5b91]{font-size:%?24?%;color:#b0b8c6}.sign-img[data-v-047d5b91]{width:100%;height:%?460?%;object-fit:contain;border-radius:%?16?%}.sign-btn-bar[data-v-047d5b91]{display:flex;justify-content:center;gap:%?32?%;margin-top:%?48?%}.sign-btn[data-v-047d5b91]{min-width:%?220?%;height:%?70?%;border-radius:%?35?%;font-size:%?28?%;font-weight:500;border:none;outline:none;transition:background .2s}.reset-btn[data-v-047d5b91]{background:#f5f7fa;color:#888}.preview-btn[data-v-047d5b91]{background:#217aff;color:#fff}.sign-canvas[data-v-047d5b91]{width:100%;height:%?460?%;background:transparent;border-radius:%?16?%;position:absolute;left:0;top:0}[data-v-047d5b91] uni-input::-webkit-input-placeholder{font-size:%?24?%!important;color:#b0b8c6}[data-v-047d5b91] uni-input::placeholder{font-size:%?24?%!important;color:#b0b8c6}.price-info-section[data-v-047d5b91]{background:#fff;border-radius:%?24?%;margin:0 %?24?% %?32?% %?24?%;box-shadow:0 %?4?% %?16?% rgba(59,124,255,.08);padding:%?32?% %?24?%;margin-top:20px}.price-info-item[data-v-047d5b91]{display:flex;align-items:flex-start;margin-bottom:%?16?%;font-size:%?28?%}.price-info-item[data-v-047d5b91]:last-child{margin-bottom:0}.price-label[data-v-047d5b91]{color:#666;min-width:%?140?%;flex-shrink:0}.price-value[data-v-047d5b91]{color:#217aff;font-weight:600;flex:1}.price-desc[data-v-047d5b91]{color:#222;flex:1;line-height:1.6}',""]),e.exports=t},cf75:function(e,t,i){"use strict";i.r(t);var a=i("7e37"),n=i("3627");for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);i("9530");var o=i("828b"),s=Object(o["a"])(n["default"],a["b"],a["c"],!1,null,"047d5b91",null,!1,a["a"],void 0);t["default"]=s.exports},efbe:function(e,t,i){"use strict";i.r(t);var a=i("561e"),n=i("00ec");for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);i("7645");var o=i("828b"),s=Object(o["a"])(n["default"],a["b"],a["c"],!1,null,"28453a18",null,!1,a["a"],void 0);t["default"]=s.exports}}]);