2023-11-27 09:24:16 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="container">
|
|
|
|
|
<view class="my-header">
|
|
|
|
|
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
|
|
|
|
|
<view class="my-text">商品详情</view>
|
|
|
|
|
<view class="my-icons"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 顶部区域 -->
|
|
|
|
|
<view class="">
|
2023-11-30 18:11:49 +08:00
|
|
|
|
<u-swiper :list="giftImages" height="390" @change="change" @click="click"></u-swiper>
|
2023-11-27 09:24:16 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="bai-box">
|
2023-11-30 18:11:49 +08:00
|
|
|
|
<view class="box-title">{{goodsInfo.giftName}}</view>
|
|
|
|
|
<view class="box-jg">
|
|
|
|
|
<span
|
|
|
|
|
v-if="goodsInfo.exchangeMethod == '积分' || goodsInfo.exchangeMethod == '积分+金额' || goodsInfo.exchangeMethod == '积分+加钱购'">{{goodsInfo.exchangePoints}}积分</span>
|
|
|
|
|
<span v-if="goodsInfo.exchangeMethod == '积分+金额'">+</span>
|
|
|
|
|
<span
|
|
|
|
|
v-if="goodsInfo.exchangeMethod == '金额' || goodsInfo.exchangeMethod == '积分+金额'">¥{{goodsInfo.exchangeAmount}}</span>
|
|
|
|
|
|
|
|
|
|
</view>
|
2023-11-27 09:24:16 +08:00
|
|
|
|
<view class="dt-box">
|
2023-11-30 18:11:49 +08:00
|
|
|
|
<view class=""><u-tag :text='deliveryMethod' type="error" shape="circle"></u-tag></view>
|
|
|
|
|
<view class="hui-time">市场价:{{goodsInfo.market}}</view>
|
2023-11-27 09:24:16 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="bai-box">
|
|
|
|
|
<view style="margin-bottom: 10px;">商品详情</view>
|
2023-11-30 18:11:49 +08:00
|
|
|
|
<u-line v-html="goodsInfo.detailedDescription"></u-line>
|
2023-11-27 09:24:16 +08:00
|
|
|
|
<!-- <view class="" v-html="html" ></view> -->
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="bottom-d">
|
|
|
|
|
<view class="anniux" @click="goorder()">
|
|
|
|
|
<text>立即兑换</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-11-30 18:11:49 +08:00
|
|
|
|
import config from '@/config'
|
|
|
|
|
import request from '../../utils/request'
|
2023-11-27 09:24:16 +08:00
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
title: '',
|
2023-11-30 18:11:49 +08:00
|
|
|
|
goodsInfo: '',
|
|
|
|
|
baseUrl: config.baseUrl,
|
|
|
|
|
deliveryMethod: '',
|
|
|
|
|
giftImages: [],
|
2023-11-27 09:24:16 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
components: {
|
|
|
|
|
|
|
|
|
|
},
|
2023-11-30 18:11:49 +08:00
|
|
|
|
onLoad() {
|
2023-12-01 15:29:00 +08:00
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
2023-11-30 18:11:49 +08:00
|
|
|
|
uni.$on('goodsInfo', (data) => {
|
|
|
|
|
this.goodsInfo = data
|
|
|
|
|
if (this.goodsInfo != null) {
|
|
|
|
|
this.dataProcessing()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
uni.$emit('un')
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2023-11-27 09:24:16 +08:00
|
|
|
|
methods: {
|
|
|
|
|
change() {},
|
|
|
|
|
click() {},
|
2023-11-30 18:11:49 +08:00
|
|
|
|
dataProcessing() {
|
2023-12-01 15:29:00 +08:00
|
|
|
|
this.giftImages = []
|
2023-11-30 18:11:49 +08:00
|
|
|
|
if (this.goodsInfo.giftImages != null && this.goodsInfo.giftImages != undefined) {
|
|
|
|
|
const myGiftImages = JSON.parse(this.goodsInfo.giftImages);
|
|
|
|
|
myGiftImages.forEach(res => {
|
|
|
|
|
if (res.fileName == undefined || res.fileName == null) {
|
|
|
|
|
this.giftImages.push(res.url)
|
|
|
|
|
} else {
|
|
|
|
|
let url = this.baseUrl + res.fileName
|
|
|
|
|
this.giftImages.push(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (this.goodsInfo.deliveryMethod != null && this.goodsInfo.deliveryMethod != undefined) {
|
|
|
|
|
const deliveryData = JSON.parse(this.goodsInfo.deliveryMethod);
|
|
|
|
|
|
|
|
|
|
this.deliveryMethod = deliveryData.join('+');
|
|
|
|
|
} else {
|
|
|
|
|
this.deliveryMethod = '无配送信息'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
2023-11-27 09:24:16 +08:00
|
|
|
|
goorder() {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pagesHome/order/order'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
goback() {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.content {
|
|
|
|
|
background: #f4f5f6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding-top: 88px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.my-header {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 88px;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
color: #000;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 0px 15px;
|
|
|
|
|
padding-top: 40px;
|
|
|
|
|
|
|
|
|
|
.my-icons {
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bai-box {
|
|
|
|
|
width: 100%;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
margin: 10px auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dt-box {
|
|
|
|
|
width: 92%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.box-title {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.box-jg {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: red;
|
|
|
|
|
margin: 10px auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hui-time {
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-d {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 88px;
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
z-index: 99999;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.anniux {
|
|
|
|
|
width: 90%;
|
|
|
|
|
background: #1678ff;
|
|
|
|
|
color: white;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
color: white;
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|