preferential.vue
1.63 KB
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
<template>
<div v-if="preferentialInfo">
<titleBox v-if="preferentialInfo" @more="more"
:titles="preferentialInfo">
</titleBox>
<div v-if="preferentialInfo" class="item_box">
<div class="left">
<img class="item" v-lazy="item.simg + SIGN.MIDDLE" v-if="index < 3" v-for="(item,index) in preferentialInfo.img" :key="index" @click="toDetail(item)" />
</div>
<div class="right">
<img class="first" v-lazy="preferentialInfo.img[3].simg + SIGN.MIDDLE" @click="toDetail(preferentialInfo.img[3])" />
<img class="item" v-lazy="preferentialInfo.img[4].simg + SIGN.MIDDLE" @click="toDetail(preferentialInfo.img[4])" />
</div>
</div>
</div>
</template>
<script>
// 引入组件
import titleBox from "@/components/titleBox/titleBox";
export default {
name: 'preferential',
data() {
return {
}
},
props:["preferentialInfo"],
components:{
titleBox
},
methods: {
/**
* 详情
* @param {object} item [详情数据]
*/
toDetail(item) {
this.$emit("toDetail", item);
},
/**
* 更多
* @param {object} item [详情数据]
*/
more(item) {
this.$emit("more", item);
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less" scoped>
@import "preferential";
</style>