visitimg.js 5.6 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/agent/recommend/visitimg"],{"3a57":function(e,n,t){"use strict";(function(e,n){var u=t("4ea4");t("2ab2");u(t("66fd"));var r=u(t("565f"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(r.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},"565f":function(e,n,t){"use strict";t.r(n);var u=t("e68c"),r=t("6123");for(var i in r)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(i);t("dbb2");var o=t("f0c5"),a=Object(o["a"])(r["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],void 0);n["default"]=a.exports},6123:function(e,n,t){"use strict";t.r(n);var u=t("a476"),r=t.n(u);for(var i in u)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return u[e]}))}(i);n["default"]=r.a},a476:function(e,n,t){"use strict";(function(e){var u=t("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=u(t("9523")),i=u(t("448a"));function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);n&&(u=u.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,u)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){(0,r.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var c={data:function(){return{maskShow:!1,idCardFront:"",idCardRevers:"",form:{visit_des:"",img1:null,img2:null},curId:"",cObj:{},ercArr:[],submitButtonDisabled:!1,rules:{visit_des:[{required:!0,message:"备注不得为空",trigger:["change","blur"]}],img1:[{required:!0,message:"第三方水印照片不得为空",trigger:["change","blur"]}],img2:[{required:!0,message:"带看单照片不得为空",trigger:["change","blur"]}]},submitModalShow:!1}},onLoad:function(e){this.curId=e.id,this.getData()},onReady:function(){this.$refs.uForm.setRules(this.rules)},methods:{getData:function(){var n=this;e.api.cust.apireportvisitdetail({report_id:this.curId}).then((function(e){var t=e||{},u=t.estate_report_conf?t.estate_report_conf.split(","):[];n.ercArr=(0,i.default)(u);var r=t.more?JSON.parse(t.more):[],o={};if(u.forEach((function(e,n){o["key"+n]=r[n]||"https://img.fangpiaovip.com/20221116045017-4379.png"})),t.id){n.idCardFront=t.img1,n.idCardRevers=t.img2;var c={visit_des:t.visit_des,img1:t.img1,img2:t.img2};n.form=a(a({},o),c),n.cObj=a({},t)}else n.form=a({},o)}))},uploadImgHandle:function(n){e.chooseImage({count:1,sizeType:["compressed"],success:function(t){var u=t.tempFilePaths[0],r=e.getStorageSync("MD_token")||"";e.uploadFile({url:e.baseUrl+"api/upload/cloud",filePath:u,name:"upload",formData:{token:r},success:function(t){var u=JSON.parse(t.data);0===u.errno?n&&"function"===typeof n&&n(u.data):e.$msg(u.errmsg||"未知错误-".concat(u.errno))}})}})},uploadOneImage:function(){var e=this;this.uploadImgHandle((function(n){e.form.img1=n.url,e.idCardFront=n.url}))},uploadTwoImage:function(){var e=this;this.uploadImgHandle((function(n){e.form.img2=n.url,e.idCardRevers=n.url}))},uploadDefineImage:function(e){var n=this;this.uploadImgHandle((function(t){n.form["key"+e]=t.url}))},submitHandle:function(){var n=this;this.$refs.uForm.validate((function(t){if(t){var u={visit_des:n.form.visit_des,img1:n.form.img1,img2:n.form.img2},r="",i=[];if(n.ercArr.forEach((function(e,t){n.form["key"+t]?i.push(n.form["key"+t]):r=e})),r)return void e.$msg("请上传"+r);i.length>0&&(u.more=JSON.stringify(i)),u.report_id=n.curId,e.api.cust.apireportvisitchange(u).then((function(t){e.$msgConfirm("编辑成功",(function(){e.reLaunch({url:"/pages/agent/recommend/detail?id=".concat(n.curId)})}),(function(){e.reLaunch({url:"/pages/agent/recommend/detail?id=".concat(n.curId)})}))}))}}))},getFormatDate:function(e){if(void 0==e||""==e)return"";var n=e;return parseInt(e)<10&&(n="0"+e),n}}};n.default=c}).call(this,t("543d")["default"])},cb8a:function(e,n,t){},dbb2:function(e,n,t){"use strict";var u=t("cb8a"),r=t.n(u);r.a},e68c:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){return u}));var u={uAlertTips:function(){return t.e("uni_modules/vk-uview-ui/components/u-alert-tips/u-alert-tips").then(t.bind(null,"dcd2"))},uForm:function(){return t.e("uni_modules/vk-uview-ui/components/u-form/u-form").then(t.bind(null,"e893"))},uFormItem:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-form-item/u-form-item")]).then(t.bind(null,"a81d"))},uInput:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/vk-uview-ui/components/u-input/u-input")]).then(t.bind(null,"830c"))},uIcon:function(){return t.e("uni_modules/vk-uview-ui/components/u-icon/u-icon").then(t.bind(null,"ccaa"))},uGap:function(){return t.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(t.bind(null,"9db7"))},uButton:function(){return t.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(t.bind(null,"51b1b"))},uModal:function(){return t.e("uni_modules/vk-uview-ui/components/u-modal/u-modal").then(t.bind(null,"85bf"))},uMask:function(){return t.e("uni_modules/vk-uview-ui/components/u-mask/u-mask").then(t.bind(null,"4390"))},uToast:function(){return t.e("uni_modules/vk-uview-ui/components/u-toast/u-toast").then(t.bind(null,"9568"))}},r=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){e.submitModalShow=!0},e.e1=function(n){e.maskShow=!1},e.e2=function(n){e.maskShow=!1})},i=[]}},[["3a57","common/runtime","common/vendor"]]]);