From 5d41cbe3722ff40b65bfa4de82d62a79f171f5a5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 八月 2022 17:41:55 +0800 Subject: [PATCH] 2022-08-15 --- src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index c4a13c7..51dcbef 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -15,7 +15,6 @@ class NormalTimeline extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 @@ -36,13 +35,25 @@ * 1銆� initdata 涓烘墦鍗版椂浣跨敤鐨勬暟鎹泦 */ UNSAFE_componentWillMount () { - const { data, initdata, BID, BData } = this.props + const { data, initdata } = this.props let _config = fromJS(this.props.config).toJS() let _cols = new Map() let _data = null let card = null let _sync = _config.setting.sync === 'true' + + let BID = '' + let BData = '' + + if (_config.setting.supModule) { + BData = window.GLOB.CacheData.get(_config.setting.supModule) + } else { + BData = window.GLOB.CacheData.get(_config.$pageId) + } + if (BData) { + BID = BData.$BID || '' + } if (_config.setting.sync === 'true' && data) { _data = data[_config.dataName] || [] @@ -240,10 +251,10 @@ return } - // if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { - // this.getExpress() - // return - // } + if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { + this.getExpress() + return + } this.setState({ loading: true @@ -278,10 +289,33 @@ } getExpress = () => { + const { BData } = this.state + + let code = '' + let order = '' + if (BData) { + Object.keys(BData).forEach(key => { + if (key.toLowerCase() === 'expresscode') { + code = BData[key] + } else if (key.toLowerCase() === 'expressno') { + order = BData[key] + } + }) + } + + if (!code || !order) { + notification.warning({ + top: 92, + message: '鏈幏鍙栧埌蹇��' + (!code ? '鍏徃缂栫爜銆�' : '鍗曞彿銆�'), + duration: 5 + }) + return + } + this.setState({ loading: true }) - Api.wxNginxRequest(`express/yuantong/YT6590674317601`, 'get').then(res => { + Api.wxNginxRequest(`express/${code}/${order}`, 'get').then(res => { if (!res || typeof(res) !== 'string') { notification.error({ top: 92, -- Gitblit v1.8.0