You cannot 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
16 KiB
JavaScript

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.

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/consignment-painting/index"],{320:function(t,e,n){"use strict";(function(t,e){var i=n(4);n(26);i(n(25));var r=i(n(321));t.__webpack_require_UNI_MP_PLUGIN__=n,e(r.default)}).call(this,n(1)["default"],n(2)["createPage"])},321:function(t,e,n){"use strict";n.r(e);var i=n(322),r=n(324);for(var a in r)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n(329);var s,o=n(33),u=Object(o["default"])(r["default"],i["render"],i["staticRenderFns"],!1,null,"06cb0d30",null,!1,i["components"],s);u.options.__file="pages/consignment-painting/index.vue",e["default"]=u.exports},322:function(t,e,n){"use strict";n.r(e);var i=n(323);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"]}))},323:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return r})),n.d(e,"staticRenderFns",(function(){return s})),n.d(e,"recyclableRender",(function(){return a})),n.d(e,"components",(function(){return i}));try{i={titleBlock:function(){return n.e("components/title-block/title-block").then(n.bind(null,414))},uUpload:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-upload/u-upload")]).then(n.bind(null,388))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-popup/u-popup")]).then(n.bind(null,487))},uPicker:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-picker/u-picker")]).then(n.bind(null,495))},uLoadingPage:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-loading-page/u-loading-page")]).then(n.bind(null,503))}}}catch(o){if(-1===o.message.indexOf("Cannot find module")||-1===o.message.indexOf(".vue"))throw o;console.error(o.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.listPaintings.length),i=n>1?t.__map(t.listPaintings,(function(e,n){var i=t.__get_orig(e),r=t.listPaintings[n].warehouseID?t.addressList.find((function(e){return e.ID===t.listPaintings[n].warehouseID})):null;return{$orig:i,g1:r}})):null,r=n>1?t.listPaintings.length:null,a=n>1?t.listPaintings.length:null,s=t.listPaintings.length,o=t.listPaintings.length,u=t.__map(t.listPaintings,(function(e,n){var i=t.__get_orig(e),r=t.listPaintings[n].warehouseID?t.addressList.find((function(e){return e.ID===t.listPaintings[n].warehouseID})):null;return{$orig:i,g5:r}})),c=t.listPaintings.length;t._isMounted||(t.e0=function(){t.show_2=!0},t.e1=function(e){t.show_2=!1}),t.$mp.data=Object.assign({},{$root:{g0:n,l0:i,g2:r,g3:a,g4:s,g6:o,l1:u,g7:c}})},a=!1,s=[];r._withStripped=!0},324:function(t,e,n){"use strict";n.r(e);var i=n(325),r=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"]=r.a},325:function(t,e,n){"use strict";(function(t){var i=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(n(63)),a=i(n(5)),s=i(n(65)),o=i(n(11)),u=i(n(223)),c=n(262),l=i(n(326)),d=i(n(327));function f(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=h(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function h(t,e){if(t){if("string"===typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var v={name:"order-details",data:function(){return{itemHeight:0,scrollId:"item-0",columns:[[180],["*"],[1,2,3,4,5,6,7,8,9,10,11],["="],[180]],currentIndex:0,listPaintings:[{expectedPayment:"",fileList1:[],artworkNum:"",artworkName:"",artistName:"",artworkSquareSize:"",warehouseID:"",endAt:""}],contentListHeight:0,isExpand:!1,isExpand1:!1,listHeight:308,minDate:"",show:!1,value1:"",loading:!1,fileList1:[],dayMoney:"",expectedPayment:"",warehouseID:"",cycleId:"",cycleList:[],addressList:[],info:{},show_2:!1,data:[],show_1:!1,title:"picker-view",visible:!0,url:""}},computed:{totalMoney:function(){return this.listPaintings.reduce((function(t,e){return t+Number(e.expectedPayment)}),0)}},onLoad:function(e){var n;(e.url&&(this.url=e.url,this.getDetailUrl()),"detail"===e.type&&(this.getData(),this.type=e.type),"confirm"===e.type&&(this.listPaintings=t.getStorageSync("orderingInfo").listPaintings),"scan"===e.type)&&(this.listPaintings=null===(n=t.getStorageSync("scanlist"))||void 0===n?void 0:n.map((function(t){return m(m({},t),{},{expectedPayment:"",warehouseID:"",fileList1:[{url:t.artworkImg}]})})))},mounted:function(){var t=this;this.getCycle(),this.$mp.query.url&&(this.url=this.$mp.query.url,this.getDetailUrl()),this.getAddress(),this.$nextTick((0,s.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getElementHeight(".content-scroll");case 2:t.itemHeight=e.sent,t.getheight();case 4:case"end":return e.stop()}}),e)}))))},methods:{inputConfirm:d.default.debounce((function(t,e){this.listPaintings[e].artworkSquareSize=t.target.value.replace(/\D/g,"");var n=parseInt(this.listPaintings[e].artworkSquareSize,10);isNaN(n)||n<=0?this.listPaintings[e].artworkSquareSize="":this.obtainAmount(e)}),1e3),addDaysToCurrentDate:function(t){return(0,l.default)().add(t,"day").format("YYYY-MM-DD")},show2Click:function(t){this.currentIndex=t,this.show_2=!0},closeClick:function(){this.show_1=!1},getElementHeight:function(e){return new Promise((function(n,i){var r=t.createSelectorQuery();r.select(e).boundingClientRect((function(t){t?n(t.height):i(new Error("无法获取元素高度"))})).exec()}))},scrollDetail:function(t){var e=this;return(0,s.default)(r.default.mark((function n(){var i,a,s;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:i=t.detail.scrollTop,a=e.listPaintings.length*e.itemHeight,i/a*100,s=Math.floor(i/e.itemHeight),e.currentIndex=s;case 5:case"end":return n.stop()}}),n)})))()},getData:function(){var t=this;return(0,s.default)(r.default.mark((function e(){var n,i;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n={ID:Number(t.$mp.query.ID)},e.next=3,(0,c.postDataByParams)("/api/v2/warehouse/detail",n);case 3:i=e.sent,200===i.code&&(t.info=i.data);case 5:case"end":return e.stop()}}),e)})))()},changeHandler:function(t,e){var n=t.columnIndex,i=(t.value,t.values,t.index,t.picker),r=void 0===i?this.$refs.uPicker:i;2===n&&r.setColumnValues(this.columns.length-1,[this.columns[2][t.index]*this.columns[0][0]])},itemDelete:function(t){var e=this;this.listPaintings.splice(t,1),this.currentIndex=0,this.scrollId="item-0",1===this.listPaintings.length&&(this.contentListHeight=0),this.$nextTick((function(){e.getheight()}))},itemClick:function(t){this.scrollId="item-".concat(t),this.currentIndex=t},addPainting:function(){var t=this;this.listPaintings.push({expectedPayment:"",fileList1:[],artworkNum:"",artworkName:"",artistName:"",artworkSquareSize:"",warehouseID:this.listPaintings[0].warehouseID,endAt:this.listPaintings[0].endAt}),this.$nextTick((function(){t.getheight()})),this.currentIndex=this.currentIndex+1},getheight:function(){var e=this,n=t.createSelectorQuery().in(this);n.select(".content-list").boundingClientRect((function(n){if(n){var i=t.createSelectorQuery().in(e);i.select(".titile-d").boundingClientRect((function(t){t&&(e.contentListHeight=n.bottom-t.bottom)})).exec()}})).exec()},expand1:function(){this.isExpand&&(this.listHeight=308),this.isExpand&&(this.isExpand=!1),this.isExpand1=!this.isExpand1},expand:function(){this.isExpand?this.listHeight=308:this.listHeight=154*(this.listPaintings.length<=7?this.listPaintings.length:7),this.isExpand=!this.isExpand,this.isExpand1&&(this.isExpand1=!1)},confirmDate:function(t,e){if(this.listPaintings[this.currentIndex].endAt=t.value[t.value.length-1],0===this.currentIndex){var n,i=f(this.listPaintings);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.endAt=t.value[t.value.length-1]}}catch(a){i.e(a)}finally{i.f()}}this.obtainAmount(this.currentIndex,0===this.currentIndex),this.show_1=!1},openShow1:function(e){this.listPaintings[e].artworkSquareSize?(this.currentIndex=e,this.show_1=!0):t.showToast({title:"请先填写画作平尺数",duration:2e3,icon:"none"})},uploadFilePromise:function(e){return new Promise((function(n){t.uploadFile({url:u.default.baseUrl+"/api/wxuser/uploadpic",filePath:e,name:"file",success:function(t){var e=JSON.parse(t.data).data.path;n(e)}})}))},deletePic:function(){this.fileList1=[]},afterRead:function(t,e){var n=this;return(0,s.default)(r.default.mark((function i(){var a,s,o,u,c;return r.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:a=[].concat(t.file),s=n.listPaintings[e].fileList1.length,a.map((function(t){n.listPaintings[e].fileList1.push(m(m({},t),{},{status:"uploading",message:"上传中"}))})),o=0;case 4:if(!(o<a.length)){i.next=14;break}return i.next=7,n.uploadFilePromise(a[o].url,"check");case 7:u=i.sent,c=n.listPaintings[e].fileList1[s],n.listPaintings[e].fileList1.splice(s,1,Object.assign(c,{status:"success",message:"",url:u})),s++;case 11:o++,i.next=4;break;case 14:case"end":return i.stop()}}),i)})))()},signContract:function(){var e=this;return(0,s.default)(r.default.mark((function n(){var i,s,o,u,l,d,h,g,p,m,v;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:i=[{value:"fileList1",message:"画作图片"},{value:"artworkSquareSize",message:"画作平尺数"},{value:"artistName",message:"画家名称"},{value:"artworkName",message:"画作名称"},{value:"artworkNum",message:"画作编号"},{value:"warehouseID",message:"寄存地址"},{value:"endAt",message:"择寄存时长"}],s=f(e.listPaintings.entries()),n.prev=2,s.s();case 4:if((o=s.n()).done){n.next=33;break}u=(0,a.default)(o.value,2),l=u[0],d=u[1],h=f(i),n.prev=7,h.s();case 9:if((g=h.n()).done){n.next=23;break}if(p=g.value,!("fileList1"===p.value&&d.fileList1.length<1)){n.next=14;break}return t.showToast({title:"请完善第".concat(l+1,"条数据的").concat(p.message),icon:"none"}),n.abrupt("return");case 14:if(d[p.value]){n.next=17;break}return t.showToast({title:"请完善第".concat(l+1,"条数据的").concat(p.message),icon:"none"}),n.abrupt("return");case 17:if("artworkSquareSize"!==p.value){n.next=21;break}if(!(Number(d[p.value])<1)){n.next=21;break}return t.showToast({title:"第".concat(l+1,"条数据的").concat(p.message,"应大于0"),icon:"none"}),n.abrupt("return");case 21:n.next=9;break;case 23:n.next=28;break;case 25:n.prev=25,n.t0=n["catch"](7),h.e(n.t0);case 28:return n.prev=28,h.f(),n.finish(28);case 31:n.next=4;break;case 33:n.next=38;break;case 35:n.prev=35,n.t1=n["catch"](2),s.e(n.t1);case 38:return n.prev=38,s.f(),n.finish(38);case 41:return e.loading=!0,m={orders:e.listPaintings.map((function(t){var n,i;return{endAt:e.addDaysToCurrentDate(t.endAt),warehouseID:t.warehouseID,artworkSquareSize:Number(t.artworkSquareSize),artworkName:t.artworkName,artworkImg:null===(n=t.fileList1)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.url,artworkNum:t.artworkNum,artistName:t.artistName}}))},n.next=45,(0,c.postDataByParams)("/api/v2/warehouse/fdd/contract/h5",m);case 45:v=n.sent,200===v.code&&(t.setStorageSync("jumpUrl",v.data.jumpUrl),t.setStorageSync("orderingInfo",{listPaintings:e.listPaintings,transactionId:v.data.transactionId}),t.navigateTo({url:"/pages/signwebview/index"}),e.loading=!1);case 47:case"end":return n.stop()}}),n,null,[[2,35,38,41],[7,25,28,31]])})))()},obtainAmount:function(t){var e=arguments,n=this;return(0,s.default)(r.default.mark((function i(){var a,s,o,u,l;return r.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return a=e.length>1&&void 0!==e[1]&&e[1],s={orders:[{artworkSquareSize:Number(n.listPaintings[t].artworkSquareSize),endAt:n.addDaysToCurrentDate(n.listPaintings[t].endAt)}]},a&&(s={orders:n.listPaintings.map((function(t){return{artworkSquareSize:Number(t.artworkSquareSize),endAt:n.addDaysToCurrentDate(t.endAt)}}))}),i.next=5,(0,c.postDataByParams)("/api/v2/warehouse/calculate",s);case 5:o=i.sent,200===o.code&&(a?n.listPaintings.forEach((function(t,e){var n;null===(n=o.data.orders)||void 0===n||n.forEach((function(n,i){e===i&&(t.expectedPayment=Number(n.money))}))})):n.listPaintings[t].expectedPayment=Number(null===(u=o.data.orders)||void 0===u||null===(l=u[0])||void 0===l?void 0:l.money));case 7:case"end":return i.stop()}}),i)})))()},confirmCycle:function(){this.show_1=!1},confirmAddress:function(){this.show_2=!1},selectAddress:function(t){this.listPaintings[this.currentIndex].warehouseID=t.ID,0===this.currentIndex&&this.listPaintings.forEach((function(e){e.warehouseID=t.ID}))},selectionPeriod:function(t){this.cycleId=t.ID},getCycle:function(){var t=this;return(0,s.default)(r.default.mark((function e(){var n;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,c.postDataByParams)("/api/warehouse/cycle");case 2:n=e.sent,200===n.code&&(t.cycleList=n.data.data);case 4:case"end":return e.stop()}}),e)})))()},getAddress:function(){var t=this;return(0,s.default)(r.default.mark((function e(){var n;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,c.postDataByParams)("/api/warehouse/address");case 2:n=e.sent,200===n.code&&(t.addressList=n.data.data,console.log(t.addressList,"addressList"));case 4:case"end":return e.stop()}}),e)})))()},getDetailUrl:function(){var e=this;return(0,s.default)(r.default.mark((function n(){var i,a;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i={url:e.url},n.next=3,(0,c.postDataByParams)("/api/warehouse/ocr",i);case 3:a=n.sent,200===a.code?(e.info=a.data,e.fileList1=[{url:e.info.artworkImg}]):t.showToast({title:a.msg,icon:"none"}),console.log(a,"getDetailUrl");case 6:case"end":return n.stop()}}),n)})))()},isDateFont:function(t,e){if(Array.isArray&&3===this.data.length)return this.data[e]===t},changeData:function(t){this.data=[t.detail.value[0]+1990,t.detail.value[1]+1,t.detail.value[2]+1]},back:function(){t.navigateBack({delta:2})}}};e.default=v}).call(this,n(2)["default"])},329:function(t,e,n){"use strict";n.r(e);var i=n(330),r=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"]=r.a},330:function(t,e,n){}},[[320,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/consignment-painting/index.js.map