引入日历前
This commit is contained in:
@@ -27,6 +27,12 @@
|
||||
</view>
|
||||
<!-- 详情 + 评价1 -->
|
||||
<view v-if="contentShow == 0">
|
||||
<!-- <view class="tingshuList">
|
||||
<h4>赠送内容:</h4>
|
||||
<view class="item flexbox">
|
||||
<text>中医免疫学</text><u-icon name="volume" color="#71d5a1" size="24">立即试听</u-icon>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="bookInfo" >
|
||||
<u-row customStyle="margin-bottom: 10px">
|
||||
<u-col ><span>书名:{{productInfo.productName}}</span></u-col>
|
||||
@@ -57,7 +63,7 @@
|
||||
</view>
|
||||
<view v-else >
|
||||
<!-- 商品评价 -->
|
||||
<view class="" v-if="commentsList && commentsList.length > 0">
|
||||
<view class="" v-if="commentsList && commentsList.length > 0">
|
||||
<view class="pingjiaBox" v-for="(item, index) in commentsList" :key="index">
|
||||
<view class="flexbox">
|
||||
<view class="touxiang">
|
||||
@@ -65,8 +71,32 @@
|
||||
<text class="username nowrap ">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="contentBox">
|
||||
<view class="content" v-html="item.content"></view>
|
||||
<text class="time">2023-07-28</text>
|
||||
<view class="mb30">
|
||||
<span :class="['star',item.starlevel >= 1 ? 'starLight':'starGray']"></span>
|
||||
<span :class="['star',item.starlevel >= 2 ? 'starLight':'starGray']"></span>
|
||||
<span :class="['star',item.starlevel >= 3 ? 'starLight':'starGray']"></span>
|
||||
<span :class="['star',item.starlevel >= 4 ? 'starLight':'starGray']"></span>
|
||||
<span :class="['star',item.starlevel >= 5 ? 'starLight':'starGray']"></span>
|
||||
</view>
|
||||
|
||||
<div class="pjimgs flexbox">
|
||||
<view class="item" v-for="(item1,index) in item.images">
|
||||
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1" mode="aspectFill" style="width:100%; height: 50px;"></image>
|
||||
</view>
|
||||
|
||||
</div>
|
||||
<view class="content" v-html="item.phtml"></view>
|
||||
<text class="time">{{item.createdate}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 显示追平 -->
|
||||
<view class="zhuiping item" v-if="item.zphtml != ''" style="padding-left: 50px;">
|
||||
<h5 style="color: #dbdbdb; margin:10px;">追评内容:</h5>
|
||||
<view class="flexbox">
|
||||
<view class="contentBox">
|
||||
<view class="content" v-html="item.zphtml"></view>
|
||||
<text class="time">{{item.followUpdate}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -78,11 +108,14 @@
|
||||
<view style="height: 120rpx;"></view>
|
||||
</view>
|
||||
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
|
||||
@buttonClick="buttonClick" />
|
||||
@buttonClick="buttonClick" />
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
@@ -91,6 +124,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
contentShow:0,
|
||||
options: [{
|
||||
icon: 'cart',
|
||||
@@ -111,7 +145,7 @@
|
||||
name: '商品详情'
|
||||
},
|
||||
{
|
||||
name: '商品评论'
|
||||
name: '商品评价'
|
||||
}
|
||||
],
|
||||
// 轮播图数据
|
||||
@@ -128,11 +162,38 @@
|
||||
this.productId = e.id
|
||||
this.getProDetail(e)
|
||||
this.getComments()
|
||||
// console.log(emojiList1,'emojiList1')
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
methods: {
|
||||
// 放大图片
|
||||
previewImage(url){
|
||||
console.log(url)
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
});
|
||||
},
|
||||
// 获取html格式的评论1
|
||||
getHtmlComment(comment){
|
||||
// 格式化html
|
||||
// console.log(comment,'comment')
|
||||
// 这里处理 链接 换行符
|
||||
let replacedStr = comment.replace(/\[([^(\]|\[)]*)\]/g, (item, index) => {
|
||||
// console.log(item, index)
|
||||
var indexss = emojiList1.findIndex(item1 => item1.alt === item)
|
||||
// console.log(indexss, 'indexss')
|
||||
return '<img src="https://www.nuttyreading.com/emojis/emojis/qq/' + emojiList1[indexss].url + '" width="18rpx">';
|
||||
});
|
||||
// console.log(replacedStr,'replacedStr')
|
||||
return replacedStr.replace(/(\r\n)|(\n)/g, '<br>');
|
||||
|
||||
|
||||
},
|
||||
// 获取评价
|
||||
getComments(){
|
||||
$http.request({
|
||||
@@ -145,10 +206,35 @@
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res,'评价')
|
||||
.then(res => {
|
||||
if(res.code == 0){
|
||||
this.commentsList = res.list
|
||||
console.log(res.list, 'res.list')
|
||||
this.commentsList = res.list.map(item => {
|
||||
var imgList = []
|
||||
if(item.images !== null){
|
||||
imgList = item.images.split(',')
|
||||
item.images = imgList
|
||||
return item
|
||||
}else {
|
||||
return item
|
||||
}
|
||||
})
|
||||
// 评论格式化
|
||||
var newarr = []
|
||||
this.commentsList.forEach((item1)=>{
|
||||
var pjstr = ''
|
||||
var zpstr = ''
|
||||
pjstr = this.getHtmlComment(item1.content)
|
||||
item1.followUpcontent == '' ? zpstr = '' : zpstr = this.getHtmlComment(item1.followUpcontent)
|
||||
//console.log(pjstr,'99999999999----------')
|
||||
item1.phtml = pjstr
|
||||
item1.zphtml = zpstr
|
||||
newarr.push(item1)
|
||||
|
||||
})
|
||||
this.commentsList = newarr
|
||||
// console.log(this.commentsList,'评价+++++')
|
||||
// this.commentsList = res.list
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -156,7 +242,8 @@
|
||||
// 获取商品详情
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
});
|
||||
console.log(e.id,'e.id')
|
||||
this.$http
|
||||
.post('/book/shopproduct/info/' + e.id)
|
||||
.then(res => {
|
||||
@@ -223,7 +310,7 @@
|
||||
"productId": this.productInfo.productId,
|
||||
"productAmount": this.productAmount,
|
||||
"price": this.productInfo.price
|
||||
}
|
||||
}
|
||||
// 判断列表是否为空
|
||||
if (this.cartList.length > 0) {
|
||||
let flag = ''
|
||||
@@ -367,6 +454,17 @@ formatRichText (html) { //控制小程序中图片大小
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tingshuList{margin-top: 20rpx;
|
||||
}
|
||||
.pjimgs{ margin: 10px 0;flex-wrap: wrap; display: flex; justify-content: space-between;
|
||||
.item{width: 23%; margin-right: 10px;
|
||||
image{ }
|
||||
}
|
||||
|
||||
}
|
||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
||||
.starLight{ background : url(../../static/icon/star_light.png) no-repeat; background-size: contain;}
|
||||
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91;}
|
||||
.pingjiaBox{color: #555; margin-bottom: 20rpx;}
|
||||
.flexbox{display: flex;}
|
||||
|
||||
Reference in New Issue
Block a user