|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<skeleton :loading="skeletonLoading" :row="12" :showAvatar="false" :showTitle="true"> |
|
|
|
<block v-if="isRight(goods_detail)"> |
|
|
|
<!-- 商品图片轮播 --> |
|
|
|
<swiper :current="current" :indicator-dots="true" :circular="true" class="swiper-box" indicator-active-color="#FE9903"> |
|
|
|
@ -81,19 +82,19 @@ |
|
|
|
<button class="btn" @click="toAddOrder">立即抢购</button> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
</skeleton> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
let time = null; |
|
|
|
|
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
current: 0, // 轮播下标 |
|
|
|
goods_id: 0, |
|
|
|
goods_detail: {}, |
|
|
|
is_collect: 0 // 1为当前收藏商品了,0为否 |
|
|
|
is_collect: 0, // 1为当前收藏商品了,0为否 |
|
|
|
skeletonLoading: true |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -112,11 +113,13 @@ |
|
|
|
let that = this; |
|
|
|
this.$http(this.API.API_GOODS_DETAIL, {goods_id: this.goods_id}).then(res => { |
|
|
|
console.log("res", res); |
|
|
|
this.skeletonLoading = false; |
|
|
|
this.goods_detail = res.data; |
|
|
|
this.is_collect = Boolean(res.data.user.is_collect); |
|
|
|
}).catch(err => { |
|
|
|
this.skeletonLoading = false; |
|
|
|
that.$msg(err.msg); |
|
|
|
time = setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
that.$toBack(); |
|
|
|
}, 1000); |
|
|
|
}) |
|
|
|
|