f+Math.floor(c/2)?f:h;default:return r>=p&&r<=d?r:rn.length){var r=new Array(i-n.length).fill(-1);n.push.apply(n,(0,a.Z)(r))}else i0&&void 0!==arguments[0]&&arguments[0];if(null===S||e){var t=v.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var n=v.createElement("div"),r=n.style;return r.width="100px",r.height="100px",t.appendChild(n),v.body.appendChild(t),t.scrollLeft>0?S="positive-descending":(t.scrollLeft=1,S=0===t.scrollLeft?"negative":"positive-ascending"),v.body.removeChild(t),S}return S}function areInputsEqual(e,t){if(e.length!==t.length)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=(0,g.createSelectorQuery)();n.select(e).boundingClientRect((function(e){e?t(e):i()})).exec()}function createListComponent(e){var t,i,o=e.getItemOffset,s=e.getEstimatedTotalSize,g=e.getItemSize,v=e.getOffsetForIndexAndAlignment,S=e.getStartIndexForOffset,T=e.getStopIndexForStartIndex,C=e.initInstanceProps,O=e.shouldResetStyleCacheOnItemSizeChange,R=e.validateProps;return i=t=function(e){(0,h.Z)(List,e);var t=(0,m.Z)(List);function List(e){var i;return(0,f.Z)(this,List),(i=t.call(this,e))._instanceProps=C(i.props,(0,p.Z)(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={id:i.props.id||"virtual-list-".concat(I++),instance:(0,p.Z)(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof i.props.initialScrollOffset?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1,sizeList:[]},i.props.unlimitedSize&&(i.state.sizeList=new Array(i.props.itemCount).fill(-1)),i.field={scrollLeft:0,scrollTop:0,scrollHeight:0,scrollWidth:0,clientHeight:0,clientWidth:0},i._callOnItemsRendered=void 0,i._callOnItemsRendered=memoizeOne((function(e,t,n,r){return i.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:r})})),i._callOnScroll=void 0,i._callOnScroll=memoizeOne((function(e,t,n,r){return i.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n,detail:r})})),i._getSize=void 0,i._getSize=function(e){return"number"==typeof e&&e>=0?e:i.props.itemSize},i._getSizeUploadSync=void 0,i._getSizeUploadSync=function(e,t){var n="#".concat(i.state.id,"-").concat(e);return new Promise((function(r){var o=function success(n){var o=n.width,l=n.height,s=i.state.sizeList,c=t?o:l;c!==s[e]&&(s[e]=i._getSize(c),i.setState({sizeList:(0,a.Z)(s)},(function(){r(i._getSize(c))})))};getRectSize(n,o,(function fail(){var t=i._getRangeToRender(),r=(0,u.Z)(t,2),l=r[0],s=r[1];e>=l&&e<=s&&setTimeout((function(){getRectSize(n,o,fail)}),100)}))}))},i._getSizeUpload=function(e,t){i._getSizeUploadSync(e,t);var n=i.state.sizeList;return i._getSize(n[e])},i._getCountSize=void 0,i._getCountSize=function(e,t){return e.unlimitedSize?i.state.sizeList.slice(0,t).reduce((function(e,t){return e+i._getSize(t)}),0):e.itemSize*t},i._getSizeCount=void 0,i._getSizeCount=function(e,t){if(0===t)return 0;if(!e.unlimitedSize)return Math.min(e.itemCount-1,Math.floor(t/e.itemSize));var n=0;return i.state.sizeList.reduce((function(e,r){return r=i._getSize(r),n=t?e.call(null):n.id=(0,y.requestAnimationFrame)(tick)}))};return n}(i._resetIsScrolling,200)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},(function(){i._getItemStyleCache(-1,null)}))},i}return(0,d.Z)(List,[{key:"scrollTo",value:function scrollTo(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset1&&void 0!==arguments[1]?arguments[1]:"auto",i=this.props.itemCount,n=this.state.scrollOffset;e=Math.max(0,Math.min(e,i-1)),this.scrollTo(v(this.props,this.state.id,e,t,n,this))}},{key:"componentDidMount",value:function componentDidMount(){var e=this.props.initialScrollOffset;if("number"==typeof e&&null!=this._outerRef){var t=this._outerRef;isHorizontalFunc(this.props)?t.scrollLeft=e:t.scrollTop=e}this._callPropsCallbacks()}},{key:"componentDidUpdate",value:function componentDidUpdate(e,t){var i=this,n=this.state,r=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if(isHorizontalFunc(this.props))if(isRtlFunc(this.props))switch(getRTLOffsetType()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var l=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-l-r}else o.scrollLeft=r;else o.scrollTop=r}this._callPropsCallbacks(e,t),setTimeout((function(){for(var e=i._getRangeToRender(),t=(0,u.Z)(e,2),n=t[0],r=t[1],o=isHorizontalFunc(i.props),l=n;l<=r;l++)i._getSizeUploadSync(l,o)}),0)}},{key:"componentWillUnmount",value:function componentWillUnmount(){null!==this._resetIsScrollingTimeoutId&&cancelTimeout(this._resetIsScrollingTimeoutId)}},{key:"render",value:function render(){var e=this.props,t=e.children,i=e.className,a=e.direction,c=e.height,f=e.innerRef,d=e.innerElementType,p=e.innerTagName,h=e.itemElementType,m=e.itemTagName,v=e.itemCount,S=e.itemData,y=e.itemKey,I=void 0===y?z:y,T=e.layout,C=e.outerElementType,O=e.outerTagName,R=e.style,w=e.useIsScrolling,x=e.width,L=e.position,b=e.renderTop,E=e.renderBottom,k=(0,r.Z)(e,_),Z=this.state,M=Z.id,F=Z.isScrolling,W=Z.scrollOffset,P=Z.scrollUpdateWasRequested,D=isHorizontalFunc(this.props),H=D?this._onScrollHorizontal:this._onScrollVertical,U=this._getRangeToRender(),q=(0,u.Z)(U,2),N=q[0],V=q[1],A=[];if(v>0)for(var G=N;G<=V;G++){var K=I(G,S),B=void 0;if("relative"===L){var J=g(this.props,G,this);B={height:this._getStyleValue(D?"100%":J),width:this._getStyleValue(D?J:"100%")}}else B=this._getItemStyle(G);A.push((0,l.createElement)(h||m||"div",{key:K,style:B},(0,l.createElement)(t,{id:"".concat(M,"-").concat(G),data:S,index:G,isScrolling:w?F:void 0})))}var $=s(this.props,this),j=(0,n.Z)((0,n.Z)({},k),{},{id:M,className:i,onScroll:H,ref:this._outerRefSetter,layout:T,style:(0,n.Z)({position:"relative",height:this._getStyleValue(c),width:this._getStyleValue(x),overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:a},R)});if(P&&(D?j.scrollLeft=W:j.scrollTop=W),"relative"===L){var Q=o(this.props,N,this);return(0,l.createElement)(C||O||"div",j,b,(0,l.createElement)(h||m||"div",{key:"".concat(M,"-pre"),id:"".concat(M,"-pre"),style:{height:D?"100%":this._getStyleValue(Q),width:D?this._getStyleValue(Q):"100%"}}),(0,l.createElement)(d||p||"div",{ref:f,key:"".concat(M,"-inner"),id:"".concat(M,"-inner"),style:{pointerEvents:F?"none":"auto"}},A),E)}return(0,l.createElement)(C||O||"div",j,b,(0,l.createElement)(d||p||"div",{ref:f,key:"".concat(M,"-inner"),id:"".concat(M,"-inner"),style:{height:this._getStyleValue(D?"100%":$),pointerEvents:F?"none":"auto",width:this._getStyleValue(D?$:"100%")}},A),E)}},{key:"_callPropsCallbacks",value:function _callPropsCallbacks(e,t){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0&&!e&&e.itemCount!==this.props.itemCount){var i=this._getRangeToRender(),n=(0,u.Z)(i,4),r=n[0],o=n[1],l=n[2],s=n[3];this._callOnItemsRendered(r,o,l,s)}"function"==typeof this.props.onScroll&&(t&&t.scrollDirection===this.state.scrollDirection&&t.scrollOffset===this.state.scrollOffset&&t.scrollUpdateWasRequested===this.state.scrollUpdateWasRequested||this._callOnScroll(this.state.scrollDirection,this.state.scrollOffset,this.state.scrollUpdateWasRequested,this.field))}},{key:"_getRangeToRender",value:function _getRangeToRender(){var e=this.props,t=e.itemCount,i=e.overscanCount,n=this.state,r=n.isScrolling,o=n.scrollDirection,l=n.scrollOffset;if(0===t)return[0,0,0,0];var s=S(this.props,l,this),a=T(this.props,l,s,this),c=r&&"backward"!==o?1:Math.max(1,i),u=r&&"forward"!==o?1:Math.max(1,i);return[Math.max(0,s-c),Math.max(0,Math.min(t-1,a+u)),s,a]}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(e,t){return R(e,t),null}}]),List}(l.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},i}var T=createListComponent({getItemOffset:function getItemOffset(e,t,i){return e.unlimitedSize?i._getCountSize(e,t):t*e.itemSize},getItemSize:function getItemSize(e,t,i){return e.unlimitedSize?i._getSizeUpload(t,isHorizontalFunc(e)):e.itemSize},getEstimatedTotalSize:function getEstimatedTotalSize(e,t){return t._getCountSize(e,e.itemCount)},getOffsetForIndexAndAlignment:function getOffsetForIndexAndAlignment(e,t,i,n,r,o){var l=e.height,s=e.width,a=o.state.sizeList,c=isHorizontalFunc(e)?s:l,u=o._getSize(a[i]),f=Math.max(0,o._getCountSize(e,e.itemCount)-c),d=Math.min(f,o._getCountSize(e,i)),p=Math.max(0,o._getCountSize(e,i)-c+u);switch("smart"===n&&(n=r>=p-c&&r<=d+c?"auto":"center"),n){case"start":return d;case"end":return p;case"center":var h=Math.round(p+(d-p)/2);return hf+Math.floor(c/2)?f:h;default:return r>=p&&r<=d?r:rn.length){var r=new Array(i-n.length).fill(-1);n.push.apply(n,(0,a.Z)(r))}else it.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(a&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),u}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,e,r){return this.delegate={iterator:values(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}},885:function(t,e,r){r.d(e,{Z:function(){return _slicedToArray}});var n=r(181);function _slicedToArray(t,e){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}}(t,e)||(0,n.Z)(t,e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},2982:function(t,e,r){r.d(e,{Z:function(){return _toConsumableArray}});var n=r(907);var o=r(181);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return(0,n.Z)(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,o.Z)(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},1002:function(t,e,r){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}r.d(e,{Z:function(){return _typeof}})},181:function(t,e,r){r.d(e,{Z:function(){return _unsupportedIterableToArray}});var n=r(907);function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return(0,n.Z)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(t,e):void 0}}}}]);
\ No newline at end of file
+"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[1216],{907:function(t,e,r){function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}r.d(e,{Z:function(){return _objectWithoutProperties}})},4165:function(t,e,r){r.d(e,{Z:function(){return _regeneratorRuntime}});var n=r(1002);function _regeneratorRuntime(){_regeneratorRuntime=function _regeneratorRuntime(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var o=e&&e.prototype instanceof Generator?e:Generator,i=Object.create(o.prototype),a=new Context(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=maybeInvokeDelegate(a,r);if(c){if(c===u)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=tryCatch(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===u)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var u={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var f={};define(f,i,(function(){return this}));var l=Object.getPrototypeOf,s=l&&l(l(values([])));s&&s!==e&&r.call(s,i)&&(f=s);var y=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(f);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(o,i,a,c){var u=tryCatch(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==(0,n.Z)(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){invoke("next",t,a,c)}),(function(t){invoke("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return invoke("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function callInvokeWithMethodAndArg(){return new e((function(e,n){invoke(t,r,e,n)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,maybeInvokeDelegate(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=tryCatch(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function next(){for(;++n=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(a&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),u}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,e,r){return this.delegate={iterator:values(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}},885:function(t,e,r){r.d(e,{Z:function(){return _slicedToArray}});var n=r(181);function _slicedToArray(t,e){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,c=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}}(t,e)||(0,n.Z)(t,e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},2982:function(t,e,r){r.d(e,{Z:function(){return _toConsumableArray}});var n=r(907);var o=r(181);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return(0,n.Z)(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,o.Z)(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},1002:function(t,e,r){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}r.d(e,{Z:function(){return _typeof}})},181:function(t,e,r){r.d(e,{Z:function(){return _unsupportedIterableToArray}});var n=r(907);function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return(0,n.Z)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(t,e):void 0}}}}]);
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
index 772adba..964d902 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -9,6 +9,13 @@
"condition": {
"miniprogram": {
"list": [
+ {
+ "name": "发货详情",
+ "pathName": "pages/deliveryDetail/index",
+ "query": "",
+ "launchMode": "default",
+ "scene": null
+ },
{
"name": "发货列表",
"pathName": "pages/delivery/index",
@@ -115,9 +122,9 @@
"scene": null
},
{
- "name": "",
- "pathName": "pages/applyMoney/index",
- "query": "orderId=28411",
+ "name": "我的",
+ "pathName": "pages/user/index",
+ "query": "",
"launchMode": "default",
"scene": null
}
diff --git a/src/common/format.js b/src/common/format.js
index 0b3f074..280a7d0 100644
--- a/src/common/format.js
+++ b/src/common/format.js
@@ -32,6 +32,11 @@ const Digit = 10 * 10
*/
export const weightDigit = 1000
+/**
+ * 厘米进退位单位
+ */
+export const meterDigit = 100
+
/**
* 除以
* @param {*} val
@@ -53,6 +58,23 @@ export const formatPriceMul = (val, digit = Digit) => {
return strip(Number(val * digit)) || 0
}
+/**
+ * 格式化长度 (乘以)
+ * @param {Number} val
+ * @returns
+ */
+export const formatMeterMul = (val, digit = meterDigit) => {
+ return strip(Number(val * digit)) || 0
+}
+
+/**
+ * 格式化长度 (除以)
+ * @param {*} val
+ */
+export const formatMeterDiv = (val, digit = meterDigit) => {
+ return strip(Number(val / digit)) || 0
+}
+
/**
* 格式化重量单位 (乘以)
* @param {Number} val
diff --git a/src/components/cell/index.module.scss b/src/components/cell/index.module.scss
new file mode 100644
index 0000000..f0703d7
--- /dev/null
+++ b/src/components/cell/index.module.scss
@@ -0,0 +1,24 @@
+.cell {
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 28px;
+ padding: 12px 0;
+ .title {
+ min-width: 140px;
+ flex: none;
+ color: #a9a9a9;
+ }
+ .desc {
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+ justify-content: flex-end;
+ flex: 1 1 auto;
+ color: $color_font_one;
+ }
+}
+.descText {
+ @include common_ellipsis(2);
+}
diff --git a/src/components/cell/index.tsx b/src/components/cell/index.tsx
new file mode 100644
index 0000000..f5c65ee
--- /dev/null
+++ b/src/components/cell/index.tsx
@@ -0,0 +1,43 @@
+import { View, Text } from '@tarojs/components'
+import classNames from "classnames"
+import { FC, useCallback, useMemo, useRef } from "react"
+import IconFont, { IconNames } from "../iconfont/iconfont"
+import styles from './index.module.scss'
+
+interface CellPropsType {
+ title: string
+ desc: string
+ isLink?: boolean
+ onClick?: () => void
+ customStyle?: React.CSSProperties
+ customClassName?: string
+ iconName?: IconNames
+}
+const Cell:FC = (props) => {
+ const {title, desc, isLink = false, customClassName, customStyle, onClick, iconName} = props
+
+ const onClickRef = useRef(onClick)
+ onClickRef.current = onClick
+ // 防止函数的引用改变
+ const handleClick = useCallback(() => {
+ return isLink && onClickRef.current?.()
+ }, [isLink])
+
+ const CellElement = useMemo(() => {
+ return (
+
+
+ {iconName && }
+ {title}
+
+
+ {desc}
+ {isLink && }
+
+
+ )
+ }, [title, desc, handleClick, customStyle])
+
+ return <>{CellElement}>
+}
+export default Cell
diff --git a/src/components/iconText/index.tsx b/src/components/iconText/index.tsx
index 3b2530e..73a65c8 100644
--- a/src/components/iconText/index.tsx
+++ b/src/components/iconText/index.tsx
@@ -1,13 +1,11 @@
import { FC } from "react"
import { View, Text } from '@tarojs/components'
-import IconFont from '../iconfont/iconfont'
+import IconFont, { IconNames } from '../iconfont/iconfont'
import styles from './index.module.scss'
import classnames from 'classnames'
-type IconfontName = Parameters['0']['name']
-
type PropsType = {
- iconName: IconfontName
+ iconName: IconNames
iconSize?: number
svg?: boolean
text?: string
diff --git a/src/components/layoutBlock/index.module.scss b/src/components/layoutBlock/index.module.scss
index 0e3b807..e5ebee7 100644
--- a/src/components/layoutBlock/index.module.scss
+++ b/src/components/layoutBlock/index.module.scss
@@ -4,6 +4,8 @@
background-color: #fff;
padding: 32px;
margin-bottom: 20px;
+ margin-left: 24px;
+ margin-right: 24px;
&--row {
flex-flow: row nowrap;
}
diff --git a/src/components/saleModeTag/index.module.scss b/src/components/saleModeTag/index.module.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/components/saleModeTag/index.tsx b/src/components/saleModeTag/index.tsx
new file mode 100644
index 0000000..89195ad
--- /dev/null
+++ b/src/components/saleModeTag/index.tsx
@@ -0,0 +1,33 @@
+import { EnumSaleMode } from "@/common/Enumerate"
+import { FC } from "react"
+import Tag, { TagSize } from "../tag"
+
+interface SaleModeProps {
+ saleMode: number
+ size?: TagSize
+ children?: React.ReactNode
+}
+
+const SaleModeTag: FC = (props) => {
+ const { saleMode, size = 'small' } = props
+ return (
+ <>
+ {saleMode === EnumSaleMode.Bulk && (
+
+ 大货
+
+ )}
+ {saleMode === EnumSaleMode.Plate && (
+
+ 剪板
+
+ )}
+ {saleMode === EnumSaleMode.BulkCut && (
+
+ 散剪
+
+ )}
+ >
+ )
+}
+export default SaleModeTag
diff --git a/src/components/tag/index.tsx b/src/components/tag/index.tsx
index 4300a89..5d72ffb 100644
--- a/src/components/tag/index.tsx
+++ b/src/components/tag/index.tsx
@@ -3,7 +3,7 @@ import { FC, ReactNode } from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
-type TagSize = 'small' | 'normal'
+export type TagSize = 'small' | 'normal'
type TagType = 'primary' | 'danger' | 'warning' | 'info'
interface PropsType {
diff --git a/src/components/uploadImage/index.tsx b/src/components/uploadImage/index.tsx
index a26ab86..15fd7b3 100644
--- a/src/components/uploadImage/index.tsx
+++ b/src/components/uploadImage/index.tsx
@@ -1,4 +1,4 @@
-import Taro, { FC } from '@tarojs/taro'
+import Taro from '@tarojs/taro'
import { memo, useEffect, useState } from 'react'
import useUploadCDNImg from '@/use/useUploadImage'
import { Image, Text, View } from '@tarojs/components'
@@ -10,9 +10,9 @@ import styles from './index.module.scss'
type ImageParam = {
onChange?: (val: string[]) => void
defaultList?: string[]
- onlyRead?: false | true
+ onlyRead?: boolean
}
-const PictureItem: FC = memo(({ onChange, defaultList, onlyRead = false }) => {
+const PictureItem = memo(({ onChange, defaultList, onlyRead = false }) => {
const { getWxPhoto } = useUploadCDNImg()
const [imageList, setImageLise] = useState([])
diff --git a/src/pages/delivery/components/ItemList/index.tsx b/src/pages/delivery/components/ItemList/index.tsx
index 1d9383d..aad66eb 100644
--- a/src/pages/delivery/components/ItemList/index.tsx
+++ b/src/pages/delivery/components/ItemList/index.tsx
@@ -20,9 +20,10 @@ type PropsType = {
const ItemList:FC = (props) => {
const { itemData, onSuccess } = props
// 查看详情
- const handleDetail = (id: number) => {
+ const handleDetail = (itemData: Record) => {
goLink('/pages/deliveryDetail/index', {
- id
+ id: itemData.id,
+ order_no: itemData.order_no,
})
}
@@ -95,7 +96,7 @@ const ItemList:FC = (props) => {
type='info'
customStyles={{ color: '#8e8e8e', borderColor: '#8e8e8e' }}
round
- onClick={() => handleDetail(itemData?.id)}>
+ onClick={() => handleDetail(itemData)}>
查看详情
{itemData?.status === 0 && (
diff --git a/src/pages/deliveryDetail/index.config.ts b/src/pages/deliveryDetail/index.config.ts
index 45c6544..050034c 100644
--- a/src/pages/deliveryDetail/index.config.ts
+++ b/src/pages/deliveryDetail/index.config.ts
@@ -1,3 +1,3 @@
export default {
- navigationBarTitleText: '发货详情',
+ navigationBarTitleText: '销售发货',
}
diff --git a/src/pages/deliveryDetail/index.module.scss b/src/pages/deliveryDetail/index.module.scss
index 57cfd8c..9023243 100644
--- a/src/pages/deliveryDetail/index.module.scss
+++ b/src/pages/deliveryDetail/index.module.scss
@@ -1,3 +1,101 @@
-.deliveryDetail{
-
+page {
+ display: flex;
+ flex-flow: column nowrap;
+ height: 100%;
+}
+.deliveryDetail {
+ display: flex;
+ flex-flow: column nowrap;
+ height: 100%;
+ .content {
+ padding-top: 24px;
+ flex: 1 1 auto;
+ overflow: scroll;
+ .detailTop {
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: space-between;
+ align-items: center;
+ }
+ }
+ .bottomBar {
+ flex: none;
+ margin: 0 24px;
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: space-between;
+ align-items: center;
+ padding-top: 24px;
+ padding-bottom: calc(20px + constant(safe-area-inset-bottom));
+ padding-bottom: calc(20px + env(safe-area-inset-bottom));
+ }
+}
+.detailInfo {
+ .detailInfoItem {
+ &--title {
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 28px;
+ padding: 10px 0;
+ }
+ &--detail {
+ &--row{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 10px 0;
+ font-size: 28px;
+ }
+ &--name{
+
+ }
+ &--count{
+
+ }
+ &--weight{
+
+ }
+ }
+ }
+}
+.orderInfoTop{
+ font-size: 28px;
+ color: $color_font_one;
+ font-weight: 550;
+}
+
+.orderNo {
+ font-size: 28px;
+ font-weight: 550;
+}
+.status {
+ font-size: 28px;
+ &--toBeAudit {
+ color: $color_danger;
+ }
+ &--audited {
+ color: $color_main;
+ }
+}
+
+.divider {
+ margin: 24px 0;
+}
+.total {
+ margin-top: 24px;
+ padding: 15px 24px;
+ font-size: 24px;
+ line-height: 30px;
+ font-weight: 600;
+ color: #f79b31;
+ background: #fef9f4;
+ border-radius: 8px;
+ display: flex;
+ .totalContent{
+ flex: 1 1 auto;
+ display: inline-block;
+ text-align: right;
+ }
}
diff --git a/src/pages/deliveryDetail/index.tsx b/src/pages/deliveryDetail/index.tsx
index 9802d02..8b17b92 100644
--- a/src/pages/deliveryDetail/index.tsx
+++ b/src/pages/deliveryDetail/index.tsx
@@ -1,8 +1,170 @@
-import { View } from "@tarojs/components"
-import { FC } from "react"
+import { DeliverNoticeOrder, DeliveryNoticeOrderAudit, DeliveryNoticeOrderUpload } from '@/api'
+import { formatDateTime, formatMeterDiv, formatWeightDiv } from '@/common/format'
+import Cell from '@/components/cell'
+import Divider from '@/components/divider'
+import LayoutBlock from '@/components/layoutBlock'
+import NormalButton from '@/components/normalButton'
+import SaleModeTag from '@/components/saleModeTag'
+import UploadImage from '@/components/uploadImage'
+import { View, Text } from '@tarojs/components'
+import Taro from '@tarojs/taro'
+import { useRouter } from '@tarojs/taro'
+import { alert } from '@/common/common'
+import { FC, useCallback, useEffect, useMemo, useState } from 'react'
import styles from './index.module.scss'
const DeliveryDetail: FC = () => {
- return 发货详情
+ const router = useRouter()
+
+ const { fetchData } = DeliverNoticeOrder()
+
+ const [detailInfo, setDetailInfo] = useState>({})
+
+ const getData = async () => {
+ const { id, order_no } = router.params
+ const res = await fetchData({
+ id,
+ order_no,
+ })
+ console.log('res==>', res.data)
+ setDetailInfo(res.data)
+ }
+
+ useEffect(() => {
+ getData()
+ }, [])
+
+ const { fetchData: uploadData } = DeliveryNoticeOrderUpload()
+
+ const { fetchData: FetchAudit } = DeliveryNoticeOrderAudit()
+
+ const DetailItem = useMemo(() => {
+ const element =
+ !!detailInfo?.weight_list?.length &&
+ detailInfo?.weight_list.map((weightItem) => {
+ return (
+
+
+
+
+
+
+ {weightItem.product_code} {weightItem.product_name}
+
+
+
+ 共 {weightItem?.sale_mode === 0 ? `${weightItem.roll} 条` : `${formatMeterDiv(weightItem?.length || 0)} 米`}
+
+
+
+
+ {weightItem.product_color_code} {weightItem.product_color_name}
+
+
+ x{weightItem?.sale_mode === 0 ? `${weightItem.roll} 条` : `${formatMeterDiv(weightItem?.length || 0)} 米`}
+
+ {formatWeightDiv(weightItem.weight)}/kg
+
+
+
+
+ )
+ })
+ return <>{element}>
+ }, [detailInfo])
+
+ const [readyToUploadList, setReadyToUploadList] = useState([])
+
+ const handleUploadChange = (imageList: string[]) => {
+ console.log('imageList===>', imageList)
+ setReadyToUploadList((prev) => [...prev, ...imageList])
+ }
+ // 上传附件
+ const handleUploadPic = useCallback(async () => {
+ const res = await uploadData({
+ id: Number(router.params.id),
+ delivery_appendix: readyToUploadList,
+ })
+ if (res.success) {
+ alert.success('上传成功')
+ } else {
+ alert.error('上传核失败')
+ }
+ }, [readyToUploadList])
+
+ // 审核
+ const handleAudit = useCallback(() => {
+ if (readyToUploadList.length === 0 ) {
+ alert.error('请先上传附件')
+ return
+ }
+ Taro.showModal({
+ confirmColor: '#337FFF',
+ title: '确定审核?',
+ success: async function (res) {
+ if (res.confirm) {
+ const res = await FetchAudit({ id: Number(router.params.id) })
+ if (res.success) {
+ alert.success('审核成功')
+ getData()
+ } else {
+ alert.error('审核失败')
+ }
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ },
+ })
+ }, [readyToUploadList])
+
+ const BottomBar = useMemo(() => {
+ return (
+
+
+ 上传附件
+
+
+ 确认审核
+
+
+ )
+ }, [handleUploadPic, handleAudit])
+ return (
+
+
+
+
+ 发货单号:{detailInfo?.order_no}
+ {detailInfo?.status === 0 ? 待审核 : 已完成}
+
+ {DetailItem}
+
+ 汇总:
+
+ 共{detailInfo?.weight_list?.length || 0}种面料,4种颜色,共
+ {detailInfo?.sale_mode === 0 ? `${detailInfo?.total_roll}条` : `${formatMeterDiv(detailInfo?.total_length)}米`}
+ ,重量{detailInfo?.total_weight}kg
+
+
+
+
+ 订单信息
+
+
+ |
+ |
+ |
+ |
+
+
+
+ 附件
+
+
+
+
+ {detailInfo?.status === 0 && BottomBar}
+
+ )
}
export default DeliveryDetail
diff --git a/src/pages/user/index.module.scss b/src/pages/user/index.module.scss
index 66c0f14..61d97de 100644
--- a/src/pages/user/index.module.scss
+++ b/src/pages/user/index.module.scss
@@ -4,7 +4,6 @@ page{
}
.main {
background: linear-gradient(to bottom, $color_main 25%, $color_bg_one 42%);
- padding: 24px;
padding-bottom: 0;
box-sizing: border-box;
overflow-y: scroll;