visitimg.js 6.3 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/agent/recommend/visitimg"],{"113b":function(e,n,t){"use strict";var r=t("328e"),u=t.n(r);u.a},"11fe":function(e,n,t){"use strict";(function(e){function t(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function r(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(n){u(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e){return s(e)||c(e)||a(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,n){if(e){if("string"===typeof e)return l(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,n):void 0}}function c(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function s(e){if(Array.isArray(e))return l(e)}function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var f={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=i(u);var o=t.more?JSON.parse(t.more):[],a={};if(u.forEach((function(e,n){a["key"+n]=o[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=r(r({},a),c),n.cObj=r({},t)}else n.form=r({},a)}))},uploadImgHandle:function(n){e.chooseImage({count:1,sizeType:["compressed"],success:function(t){var r=t.tempFilePaths[0],u=e.getStorageSync("MD_token")||"";e.uploadFile({url:e.baseUrl+"api/upload/cloud",filePath:r,name:"upload",formData:{token:u},success:function(t){var r=JSON.parse(t.data);0===r.errno?n&&"function"===typeof n&&n(r.data):e.$msg(r.errmsg||"未知错误-".concat(r.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 r={visit_des:n.form.visit_des,img1:n.form.img1,img2:n.form.img2},u="",i=[];if(n.ercArr.forEach((function(e,t){n.form["key"+t]?i.push(n.form["key"+t]):u=e})),u)return void e.$msg("请上传"+u);i.length>0&&(r.more=JSON.stringify(i)),r.report_id=n.curId,e.api.cust.apireportvisitchange(r).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=f}).call(this,t("543d")["default"])},1223:function(e,n,t){"use strict";t.d(n,"b",(function(){return u})),t.d(n,"c",(function(){return i})),t.d(n,"a",(function(){return r}));var r={uAlertTips:function(){return t.e("uni_modules/vk-uview-ui/components/u-alert-tips/u-alert-tips").then(t.bind(null,"98cb"))},uForm:function(){return t.e("uni_modules/vk-uview-ui/components/u-form/u-form").then(t.bind(null,"ce96"))},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,"23cb"))},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,"6943"))},uIcon:function(){return t.e("uni_modules/vk-uview-ui/components/u-icon/u-icon").then(t.bind(null,"ba35"))},uGap:function(){return t.e("uni_modules/vk-uview-ui/components/u-gap/u-gap").then(t.bind(null,"dc7f"))},uButton:function(){return t.e("uni_modules/vk-uview-ui/components/u-button/u-button").then(t.bind(null,"ce9e"))},uModal:function(){return t.e("uni_modules/vk-uview-ui/components/u-modal/u-modal").then(t.bind(null,"f813"))},uMask:function(){return t.e("uni_modules/vk-uview-ui/components/u-mask/u-mask").then(t.bind(null,"fb76"))},uToast:function(){return t.e("uni_modules/vk-uview-ui/components/u-toast/u-toast").then(t.bind(null,"934c"))}},u=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=[]},"328e":function(e,n,t){},"4f51":function(e,n,t){"use strict";t.r(n);var r=t("11fe"),u=t.n(r);for(var i in r)"default"!==i&&function(e){t.d(n,e,(function(){return r[e]}))}(i);n["default"]=u.a},"733d":function(e,n,t){"use strict";t.r(n);var r=t("1223"),u=t("4f51");for(var i in u)"default"!==i&&function(e){t.d(n,e,(function(){return u[e]}))}(i);t("113b");var o,a=t("f0c5"),c=Object(a["a"])(u["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],o);n["default"]=c.exports},dc8e:function(e,n,t){"use strict";(function(e){t("3690");r(t("66fd"));var n=r(t("733d"));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])}},[["dc8e","common/runtime","common/vendor"]]]);