|
@@ -234,14 +234,24 @@ const sceneView = {
|
|
|
html += `<option value="${pageData.sceneData[i].id}" ${id && id == pageData.sceneData[i].id ? 'selected': ''}>
|
|
|
${pageData.sceneData[i].sceneName}</option>`
|
|
|
if (id && id == pageData.sceneData[i].id && img) {
|
|
|
- _this.renderImgView(pageData.sceneData[i].imgs, function(imgJson) {
|
|
|
- let imgUrl = imgJson.sceneImg
|
|
|
- if (!imgJson.sceneImg.startsWith('http')) {
|
|
|
- imgUrl = pageData.path() + imgJson.sceneImg
|
|
|
- }
|
|
|
- $('#sceneImg').attr('src', imgUrl)
|
|
|
- _this.getSceneByIdApi()
|
|
|
- })
|
|
|
+ let imgJson = {};
|
|
|
+ if(pageData.sceneData[i].imgs.length>0){
|
|
|
+ imgJson = pageData.sceneData[i].imgs[0]
|
|
|
+ }
|
|
|
+ console.log(imgJson);
|
|
|
+ if(imgJson!=null){
|
|
|
+ _this.renderImgView(pageData.sceneData[i].imgs, function(imgJson) {
|
|
|
+ if(imgJson!=undefined){
|
|
|
+ let imgUrl = imgJson.sceneImg
|
|
|
+ if (!imgJson.sceneImg.startsWith('http')) {
|
|
|
+ imgUrl = pageData.path() + imgJson.sceneImg
|
|
|
+ }
|
|
|
+ $('#sceneImg').attr('src', imgUrl)
|
|
|
+ _this.getSceneByIdApi()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
$('#sceneList').empty().append(html)
|
|
@@ -253,7 +263,7 @@ const sceneView = {
|
|
|
},
|
|
|
renderImgView: function(arr, callback) {
|
|
|
const img = pageData.getParam('img')
|
|
|
- let html = '<option value="">请选择</option>'
|
|
|
+ let html = ''//'<option value="">请选择</option>'
|
|
|
let data;
|
|
|
for (var j = 0; j < arr.length; j++) {
|
|
|
if (img && img == arr[j].id) {
|