1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <template>
- <div v-on:click="toDetail">
- <van-card
- :thumb="presentImg"
- >
- <div slot="title" style="position: absolute; text-align: left; top: 0;">
- <p style="margin: 10px 0 0"><strong>{{presentName}}</strong></p>
- <p style="margin-top: 5px">{{presentDesc}}</p>
- </div>
- <div slot="tags" style="position: absolute; bottom: 0; text-align: left">
- <p>{{publishTime}}</p>
- </div>
- <div slot="footer" style="width: 100%">
- <van-tag class="present_tag" :color="statusColor[status]">{{statusString[status]}}</van-tag>
- </div>
- </van-card>
- </div>
- </template>
- <script>
- import { Card, Tag } from 'vant';
- export default {
- name: "IndexPresent",
- components: {
- [Card.name]: Card, [Tag.name]: Tag,
- },
- data() {
- return {
- statusString: ['审核中', '匹配中', '匹配成功', '交换成功', '审核失败'],
- statusColor: ['#f43736', '#00ff00', '#00bfff', '#00fa9a', 'ff0000']
- }
- },
- props: {
- presentImg: {
- type: String,
- default: require('../assets/image_load_fail.jpg')
- },
- presentName: {
- type: String,
- default: '礼物名称'
- },
- presentDesc: {
- type: String,
- default: '礼物描述'
- },
- publishTime: {
- type: String,
- default: '1970-01-01'
- },
- status: {
- type: Number,
- default: 0
- }
- },
- methods: {
- toDetail() {
- this.$emit('to-detail')
- }
- }
- }
- </script>
- <style scoped>
- div {
- background-color: #fff6e3;
- }
- </style>
|