Browse Source

标的详情

master
453530270@qq.com 2 years ago
parent
commit
edbf34fab3
  1. 25
      pages/goods/detail.scss
  2. 61
      pages/goods/detail.vue

25
pages/goods/detail.scss

@ -153,6 +153,31 @@
}
}
// 店铺详情
.dpxq{
position: fixed;
bottom: var(--window-bottom);
left: 0;
right: 0;
display: flex;
z-index: 11;
height: 86rpx;
box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
background: #fff;
// 设置ios刘海屏底部横线安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.xqbtn{
margin:20rpx auto;
line-height: 62rpx;
width: 40%;
height: 62rpx;
text-align: center;
color: #5500ff;
}
}
// 底部操作栏
.footer-fixed {
position: fixed;

61
pages/goods/detail.vue

@ -130,7 +130,7 @@
</view>
<!-- 资源信息 -->
<view v-if="!isLoading" class="bdcontent m-top20">
<view v-if="!isLoading || goods.source" class="bdcontent m-top20">
<view class="item-title b-f">
<text>资源信息</text>
</view>
@ -153,25 +153,20 @@
</view>
</view>
</view>
<!-- 店铺详情 -->
<view class="dpxq">
<view class="xqbtn" @click="goteshop()">进入店铺</view>
</view>
</view>
</template>
<script>
import * as GoodsApi from '@/api/goods'
import * as CartApi from '@/api/cart'
// import Shortcut from '@/components/shortcut'
import SlideImage from './components/SlideImage'
import SkuPopup from './components/SkuPopup'
import Comment from './components/Comment'
export default {
components: {
// Shortcut,
SlideImage,
SkuPopup,
Comment
},
data() {
return {
@ -233,49 +228,25 @@
}else{
this.bdprice = '¥'+this.goods.price
}
resolve(result)
resolve(res)
}).catch(reject);
})
},
//
getCartTotal() {
const app = this
return new Promise((resolve, reject) => {
CartApi.total()
.then(result => {
app.cartTotal = result.data.cartTotal
resolve(result)
})
.catch(reject)
})
},
//
onAddCart(total) {
this.cartTotal = total
},
/**
* 显示/隐藏SKU弹窗
* @param {skuMode} 模式 1:都显示 2:只显示购物车 3:只显示立即购买
*/
onShowSkuPopup(skuMode = 1) {
this.skuMode = skuMode
this.showSkuPopup = !this.showSkuPopup
},
//
goteshop(){
const app = this
let spname = this.goods.username
this.$navTo("pages/goods/list?k="+spname+'&dt='+new Date().getTime())
},
//
onTargetHome(e) {
this.$navTo('pages/index/index')
},
//
onTargetCart() {
this.$navTo('pages/cart/index')
},
},
/**

Loading…
Cancel
Save