From 6910396a2cca8ab4a42188b3d0c43ebd86f7be06 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sun, 26 Sep 2021 09:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E4=BB=A3=E7=A0=81=E6=9A=82?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parkingAreaText/parkingAreaText.js | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/public/pages/property/parkingAreaText/parkingAreaText.js b/public/pages/property/parkingAreaText/parkingAreaText.js index 2b7bbcdf0..5b6e77d68 100644 --- a/public/pages/property/parkingAreaText/parkingAreaText.js +++ b/public/pages/property/parkingAreaText/parkingAreaText.js @@ -77,16 +77,48 @@ function (json, res) { var _parkingAreaTexts = JSON.parse(json); _parkingAreaTexts = _parkingAreaTexts.data; - if(_parkingAreaTexts.lenth < 1){ - return ; + if (_parkingAreaTexts.lenth < 1) { + return; } - + _parkingAreaTexts.forEach(text => { + $that.parkingAreaTextInfo.texts.forEach(item => { + if (text.typeCd == item.typeCd) { + vc.copyObject(text, item); + } + }) + }) }, function (errInfo, error) { console.log('请求失败处理'); }); }, - _saveParkingAreaText: function () { + _saveParkingAreaText: function (_item) { + + if (!_item.voice) { + vc.toast('语音不能为空'); + return; + } + _item.communityId = vc.getCurrentCommunity().communityId; + _item.paId = $that.parkingAreaTextInfo.paId; + vc.http.apiPost( + '/parkingAreaText.saveParkingAreaText', + JSON.stringify(_item), + { + emulateJSON: true + }, + function (json, res) { + let _json = JSON.parse(json); + console.log(_json) + vc.toast(_json.msg); + + + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.toast(errInfo); + + }); } }