|
...
|
...
|
@@ -25,7 +25,7 @@ Component({ |
|
|
|
observers: {
|
|
|
|
'post': function(post) {
|
|
|
|
this.setData({
|
|
|
|
enclosure:JSON.parse(post.enclosure||null)
|
|
|
|
enclosure:this.isJSON(post.enclosure)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
...
|
...
|
@@ -33,6 +33,14 @@ Component({ |
|
|
|
* 组件的方法列表
|
|
|
|
*/
|
|
|
|
methods: {
|
|
|
|
isJSON(str) {
|
|
|
|
try {
|
|
|
|
let data=JSON.parse(str);
|
|
|
|
return data;
|
|
|
|
} catch (e) {
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
displayImage(e){
|
|
|
|
let index=util.attr(e,'index')
|
|
|
|
if(this.data.enclosure[index].avinfo){//video
|
...
|
...
|
|