martial-arts/components/list.vue

56 lines
1.7 KiB
Vue

<template>
<view class="">
<view class="disjbac fw">
<view @tap="goDetail(item.id)" class="radius8 bacf pad12 boxshow1 width48_6 mar-s20" v-for="(item,index) in list" :key="index">
<image :src="item.cover" style="height: 226rpx;" mode="aspectFill" class="width100 animated fadeIn" lazy-load></image>
<view class="fon24 pad-zy8 disjb fc" style="color: #262626;">
<view class="clips2 mar-sx10" style="height: 64rpx;">{{item.name}}</view>
<view class="disjbac ae pad-x10">
<view class="">
<span class="bold colf8">{{item.price}}</span>
<span class="fon20 mar-z10 tline-through" style="color: #969696;">{{item.original_price}}</span>
</view>
<view @tap.stop="buyPopu(item.id,item.is_buy)" v-if="item.is_buy!=1" class="radius18 pad-zy12 disjcac flexs fon20" style="color: #f37617;border: 2rpx solid #f37617;">购买</view>
<view v-if="item.is_buy==1" class="radius16 pad-zy10 disjcac colf flexs fon20" style="border: 2rpx solid #f37617;background-color: #f37617;">去学习</view>
</view>
</view>
</view>
</view>
<buy-popu ref="refbuy"></buy-popu>
</view>
</template>
<script>
import buyPopu from '@/components/buy-popu.vue';
export default {
name:"list",
components:{
buyPopu
},
data() {
return {
list:[]
};
},
methods:{
goDetail(id){
this.$emit('goDetail',id);
},
// 调起弹框
buyPopu(id,is_buy){
if(is_buy==undefined){
this.$refs.refbuy.ifMask = true;
this.$refs.refbuy.ifAnimated = true;
this.$refs.refbuy.isLoading = true;
this.$refs.refbuy.getSpec(id);
} else {
this.$emit('goDetail',id);
}
}
}
}
</script>
<style>
</style>