Skip to content

Commit

Permalink
recomend
Browse files Browse the repository at this point in the history
  • Loading branch information
zoyopo committed Aug 7, 2018
1 parent f9bf9e7 commit bb3649b
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/components/Recomend.vue
Original file line number Diff line number Diff line change
@@ -24,13 +24,28 @@

</grid>
</div>
<div class="song-sheets">
<sheet-label :title="'最新音乐'"></sheet-label>
<grid :col=2 :cols=3>
<grid-item :classes="classes" label="Grid" v-for="item in newsongs" :key="item.id">
<img slot="icon" :src="item.coverImgUrl">
<div slot="label">{{item.name}}</div>
<div class="right-top">
<i class="fa fa-headphones"></i>
<!-- <span>{{(item.playCount/10000).toFixed(2)+"W" }}
</span> -->
</div>
</grid-item>

</grid>
</div>
</div>
</template>

<script>
// import { Group, Cell } from 'vux'
import Slide from "components/Index/Slider.vue";
import { getFirstScreenData } from "api/api.js";
import { getFirstScreenData,getSongSheetsData} from "api/api.js";
import { Grid, GridItem } from "vux";
import CircleIcon from "components/Recomend/CircleIcon";
import SheetLabel from "components/Recomend/SheetLabel";
@@ -67,14 +82,26 @@ export default {
width: "auto",
height: "auto"
}
}
},
newsongs:[]
};
},
methods: {
async getAllData() {
//let vm = this;
let res = await getFirstScreenData();
let opts={
order:'new',
limit:6
}
let newsongs=await getSongSheetsData(opts,['playlistData'])
console.log(res);
console.log(newsongs)
let newsong=newsongs[0];
if(newsong.data.code==200){
this.newsongs=newsong.data.playlists;
}
//封装了获取数据的方法
// .then(function(res) {
let banner = res[1];
@@ -95,6 +122,7 @@ export default {
this.videoArray = privateContent.data.result;
}
}
},
mounted() {
this.getAllData();

0 comments on commit bb3649b

Please sign in to comment.