<script setup>
|
import {ref,onMounted} from 'vue'
|
import { goodsGetByIdApi } from '../../../api/index.js'
|
import { onLoad } from '@dcloudio/uni-app'
|
import { BASE_URL } from '../../../config/baseUrl.js';
|
|
const baseUrl = ref(BASE_URL)
|
|
const detailInfo = ref({})
|
async function getGoodsDetail(goodsId){
|
await goodsGetByIdApi(goodsId).then((res) =>{
|
detailInfo.value = res.data
|
console.log('detailInfo',detailInfo.value)
|
})
|
}
|
let goodsId
|
onLoad(async(option) =>{
|
goodsId = option.goodsId
|
await getGoodsDetail(goodsId)
|
})
|
</script>
|
<template>
|
<view class="container">
|
<point-navbar title='商品详情'></point-navbar>
|
<view class="content">
|
<view class="image">
|
<image :src="baseUrl + '/upload'+ detailInfo.detailsUrl"></image>
|
</view>
|
<view class="detail">
|
<view class="detail-info">
|
<view class="detail-info-text">
|
<view>【{{detailInfo.name}}】</view>
|
<view>
|
<rich-text :nodes='detailInfo.describe'></rich-text>
|
</view>
|
</view>
|
<text>价值{{detailInfo.price}}¥</text>
|
</view>
|
<view class="detail-exchange">
|
<view class="detail-exchange-points">
|
<!-- <image></image> -->
|
<text>1000</text>
|
</view>
|
<view class="detail-exchange-points">兑换</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<style lang="scss" scoped>
|
|
.container{
|
width:100%;
|
height:100vh;
|
.content{
|
width:100%;
|
height:calc(100vh - 176rpx);
|
background:linear-gradient(to bottom,#fef7da,#FFF);
|
padding:50rpx 32rpx 100rpx;
|
box-sizing: border-box;
|
}
|
}
|
</style>
|