1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
<div class="my-goods-list">
<div v-for="data in goodsList" :key="data.id" class="card-block" @click="toMap(data)">
<img class="banner" :src="data.goods_info.goods_desc.img[0].url">
<div class="content">
{{data.goods_info.name}}
<div class="start-time">
开课时间:{{data.periods_info.start_at}}
</div>
</div>
</div>
</div>
</template>
<script>
import {getUserLessonApi} from "../service/api";
import {IndexImage} from "../util/imgUrl";
export default {
name: "myGoodsList",
data(){
return {
goodsList:[],
imgUrl:IndexImage
}
},
mounted(){
this.initPage()
},
methods:{
initPage(){
getUserLessonApi().then(res=>{
res.forEach(i=>{
i.goods_info.desc = JSON.parse(i.goods_info.desc);
i.goods_info.share_desc = JSON.parse(i.goods_info.share_desc);
i.goods_info.goods_desc = JSON.parse(i.goods_info.goods_desc)
});
this.goodsList = res
})
},
toMap(data){
this.$router.push({
name:'map',
query:
{
periods_id:data.periods_id,
parent_category_id:data.periods_info.parent_category_id
}
})
}
}
}
</script>
<style scoped lang="less">
@import "../util/public";
.my-goods-list{
height: 100%;
overflow: auto;
padding: 20*@toVw 0;
.card-block{
width: 335* @toVw;
box-shadow:0px 2px 4px 0px rgba(191,191,191,0.5);
border-radius:8*@toVw;
margin-bottom: 10 * @toVw;
.banner{
width: 100%;
height: 236 * @toVw;
border-radius:8*@toVw;
}
.content{
font-size:20 * @toVw;
font-family:PingFang-SC-Medium;
font-weight:normal;
color:rgba(51,51,51,1);
padding: 8 * @toVw;
line-height:28 * @toVw;
.start-time{
font-size:12 * @toVw;
font-family:PingFang-SC-Medium;
font-weight:normal;
color:rgba(51,51,51,1);
line-height:17 * @toVw;
}
}
}
}
</style>