update api
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
<template>
|
||||
<view class="nav">
|
||||
<text>dsadasdas</text>
|
||||
<image></image>
|
||||
<text>{{ value }}</text>
|
||||
<image src="/static/image/common/1.png"></image>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"navs"
|
||||
name:"navs",
|
||||
props: {
|
||||
value: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -2,24 +2,40 @@
|
||||
<view class="tloos">
|
||||
<view class="navs">
|
||||
<image></image>
|
||||
123
|
||||
店铺
|
||||
</view>
|
||||
<view class="navs" style="margin-right:30rpx">
|
||||
<image></image>
|
||||
123
|
||||
客服
|
||||
</view>
|
||||
<view class="button" style="background:rgba(253,211,96,0.6);">试穿试送</view>
|
||||
<view class="button" style="background:rgba(253,211,96,1);">加入购物车</view>
|
||||
<view class="button" style="background:rgba(253,211,96,1);" @click="addCart">加入购物车</view>
|
||||
<view class="button" style="background:rgba(255,120,15,1);">立即购买</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"tloos"
|
||||
name:"tloos",
|
||||
props: ['id'],
|
||||
methods: {
|
||||
addCart() {
|
||||
this.$u.api.addCart({
|
||||
goods_id: this.id,
|
||||
quantity: 1,
|
||||
}).then(res => {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: res.errCode == 0 ? 'success' : 'warning',
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tloos{
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
height: 98rpx;
|
||||
|
||||
@@ -3,27 +3,27 @@
|
||||
<u-swiper :list="list" height="500" border-radius="0"></u-swiper>
|
||||
<view class="info">
|
||||
<view class="title">
|
||||
<text>萨的环境</text>
|
||||
|
||||
套装新款小个子春季时尚韩版短袖衬衫套装
|
||||
新款小个子春季时尚韩版...
|
||||
|
||||
<text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }}
|
||||
</view>
|
||||
<view class="pic">
|
||||
<text>¥24</text>
|
||||
<s>¥12</s>
|
||||
<text>¥{{ goodsInfo.goods_price }}</text>
|
||||
<s>¥{{ goodsInfo.goods_marketprice }}</s>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hr"></view>
|
||||
<navs></navs>
|
||||
<navs></navs>
|
||||
<navs></navs>
|
||||
<!-- <navs :value="领券"></navs> -->
|
||||
<navs :value="产品规格"></navs>
|
||||
<navs :value="产品颜色"></navs>
|
||||
<navs :value="选择尺码"></navs>
|
||||
<view class="xiangqing">
|
||||
<view class="heng"></view>
|
||||
<view class="title">商品详情</view>
|
||||
<view class="heng"></view>
|
||||
</view>
|
||||
<tloos></tloos>
|
||||
<view class="rich">
|
||||
<rich-text :nodes="goodsInfo.mobile_body"></rich-text>
|
||||
</view>
|
||||
<tloos :id="goodsInfo.goods_commonid"></tloos>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -31,38 +31,46 @@ import navs from "../components/sdetails/navs"
|
||||
import tloos from "../components/sdetails/tloos"
|
||||
export default {
|
||||
name:"sdetails",
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
goodsInfo: {},
|
||||
}
|
||||
},
|
||||
components:{
|
||||
navs,
|
||||
tloos
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
image: '/static/uView/swiper/swiper1.jpg',
|
||||
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
|
||||
},
|
||||
{
|
||||
image: '/static/uView/swiper/swiper2.jpg',
|
||||
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
|
||||
},
|
||||
{
|
||||
image: '/static/uView/swiper/swiper3.jpg',
|
||||
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
onLoad(option) {
|
||||
this.getGoodsDetails(option.id);
|
||||
},
|
||||
methods: {
|
||||
getGoodsDetails(id) {
|
||||
this.$u.api.getGoodsDetails({ id: 169 }).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.goodsInfo = res.data;
|
||||
this.goodsInfo.goods_image_mobile.forEach(item => {
|
||||
let temp = {
|
||||
image: item
|
||||
}
|
||||
this.list.push(temp);
|
||||
})
|
||||
console.log(this.goodsInfo.mobile_body);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sdetails{
|
||||
/deep/image{
|
||||
background-color: #0f0;
|
||||
}
|
||||
padding-bottom: 98rpx;
|
||||
.info{
|
||||
padding: 30rpx;
|
||||
.title{
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 30rpx;
|
||||
>text{
|
||||
padding: 13rpx;
|
||||
font-size: 24rpx;
|
||||
@@ -109,5 +117,8 @@ export default {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
.rich {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user