comment 7.2
This commit is contained in:
100
components/comment/index.vue
Normal file
100
components/comment/index.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="comment-item">
|
||||
<view class="user">
|
||||
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
|
||||
<text class="name">{{ content.geval_frommembername }}</text>
|
||||
<u-rate v-if="reply" :disabled='true' count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="text">{{ content.geval_content }}</view>
|
||||
</view>
|
||||
<view class="reply" v-if="reply && content.geval_explain">
|
||||
<view class="title">掌柜回复:</view>
|
||||
<view class="content u-line-4">{{ content.geval_explain }}</view>
|
||||
</view>
|
||||
<view class="time" v-if="reply">
|
||||
<image src="/static/image/common/20.png"></image>
|
||||
<view class="value">{{ content.geval_addtime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
/*
|
||||
* @description 显示评价
|
||||
* @property {Boolean} reply 是否显示回复/时间/评分
|
||||
**/
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
count: 5,
|
||||
rate: 2,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
content: Object,
|
||||
reply: Boolean,
|
||||
},
|
||||
created() {
|
||||
if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.comment-item {
|
||||
background-color: #ffffff;
|
||||
.user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
.name {
|
||||
margin: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: rgba(153,153,153,1);
|
||||
}
|
||||
}
|
||||
.content {
|
||||
margin-bottom: 20rpx;
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
line-height: 40rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
> image {
|
||||
width: 210rpx;
|
||||
height: 210rpx;
|
||||
border-radius: 10px;
|
||||
&:not(:nth-child(3n)) {
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.reply {
|
||||
padding: 30rpx;
|
||||
background: rgba(240,238,238,1);
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
margin-bottom: 20rpx;
|
||||
.title {
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.content {
|
||||
line-height: 36rpx;
|
||||
}
|
||||
}
|
||||
.time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
> image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.value {
|
||||
font-size: 24rpx;
|
||||
color: rgba(153,153,153,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -11,7 +11,7 @@
|
||||
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
|
||||
<!-- 最多显示3个 -->
|
||||
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
|
||||
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty>
|
||||
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length" style="margin: 0 auto;"></u-empty>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -24,16 +24,33 @@ export default {
|
||||
sitem
|
||||
},
|
||||
props: {
|
||||
groupList: Array,
|
||||
classifyList: Array,
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
current: 0,
|
||||
current: -1,
|
||||
swiperCurrent: 0,
|
||||
groupList: [], // 拼团商品
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.getPinTuanList(this.classifyList[value].gc_id);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.current = 0;
|
||||
},
|
||||
methods: {
|
||||
// 拼团列表
|
||||
getPinTuanList(id) {
|
||||
this.$u.api.getPinTuanList({
|
||||
page: 0,
|
||||
gc_id: id,
|
||||
}).then(res => {
|
||||
this.groupList = res.data;
|
||||
})
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
@@ -52,7 +69,9 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.group{
|
||||
.top{
|
||||
background-color: #ffffff;
|
||||
.top {
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@@ -67,18 +86,11 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
// .label{
|
||||
// display: flex;
|
||||
// font-size: 24rpx;
|
||||
// color: #999;
|
||||
// >text{
|
||||
// margin-right: 34rpx;
|
||||
// }
|
||||
// }
|
||||
.list{
|
||||
.list {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 21rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -16,19 +16,26 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
this.$u.api.getPinTuanDetails({
|
||||
pintuan_id: this.info.pintuan_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.data,
|
||||
type: 2,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.info.pintuan_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// this.$u.api.getPinTuanDetails({
|
||||
// pintuan_id: this.info.pintuan_id,
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.data,
|
||||
// type: 2,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.info.pintuan_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.info.pintuan_id,
|
||||
type: 2,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
<template>
|
||||
<view class="list">
|
||||
<view class="top">
|
||||
商品推荐
|
||||
</view>
|
||||
<view class="top">商品推荐</view>
|
||||
<view>
|
||||
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
||||
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
|
||||
<view class="goods-item">
|
||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
||||
</view>
|
||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
|
||||
<!-- </scroll-view> -->
|
||||
<view class="goods-item">
|
||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
||||
</view>
|
||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 加载更多 -->
|
||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20"></u-loadmore>
|
||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20"></u-loadmore>
|
||||
<!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import item from "./item";
|
||||
@@ -124,29 +120,17 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.list{
|
||||
.top{
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx {
|
||||
top: 0;
|
||||
};
|
||||
.top {
|
||||
font-size: 30rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
// .label{
|
||||
// display: flex;
|
||||
// color: #999;
|
||||
// flex-wrap: wrap;
|
||||
// >text{
|
||||
// margin-right: 34rpx;
|
||||
// margin-bottom: 10rpx;
|
||||
// }
|
||||
// }
|
||||
// .item{
|
||||
// display: flex;
|
||||
// flex-wrap: wrap;
|
||||
// justify-content: space-between;
|
||||
// margin-top: 20rpx;
|
||||
|
||||
// }
|
||||
.goods-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -16,20 +16,27 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data,
|
||||
type: 1,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.info.goods_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// console.log(this.goodsInfo.mobile_body);
|
||||
// this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
|
||||
// if (res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data,
|
||||
// type: 1,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.info.goods_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// // console.log(this.goodsInfo.mobile_body);
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.info.goods_id,
|
||||
type: 1,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
props: ['recommendData', 'type'],
|
||||
created() {
|
||||
this.info = this.recommendData;
|
||||
console.log(this.recommendData);
|
||||
// console.log(this.recommendData);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -39,19 +39,26 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
this.$u.api.getPinTuanDetails({
|
||||
pintuan_id: this.recommendData.pintuan_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.data,
|
||||
type: 2,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// this.$u.api.getPinTuanDetails({
|
||||
// pintuan_id: this.recommendData.pintuan_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.data,
|
||||
// type: 2,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.recommendData.pintuan_id,
|
||||
type: 2,
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -60,7 +67,10 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.recommend{
|
||||
.top{
|
||||
margin-bottom: 20rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #ffffff;
|
||||
.top {
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -75,6 +85,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.connect{
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user {
|
||||
|
||||
@@ -45,6 +45,9 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.seckill{
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.top{
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
|
||||
@@ -26,20 +26,27 @@ export default {
|
||||
methods: {
|
||||
spikeGoods() {
|
||||
// console.log(this.item.groupbuy_id);
|
||||
this.$u.api.getSpikeInfo({
|
||||
groupbuy_id: this.item.groupbuy_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.goodsInfo,
|
||||
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// this.$u.api.getSpikeInfo({
|
||||
// groupbuy_id: this.item.groupbuy_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.goodsInfo,
|
||||
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.item.groupbuy_id,
|
||||
type: 3,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -42,37 +42,51 @@ export default {
|
||||
methods: {
|
||||
spikeGoods() {
|
||||
// console.log(this.item.groupbuy_id);
|
||||
this.$u.api.getSpikeInfo({
|
||||
groupbuy_id: this.item.groupbuy_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.goodsInfo,
|
||||
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// this.$u.api.getSpikeInfo({
|
||||
// groupbuy_id: this.item.groupbuy_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.goodsInfo,
|
||||
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.item.groupbuy_id,
|
||||
type: 3,
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage() {
|
||||
this.$u.api.getPinTuanDetails({
|
||||
pintuan_id: this.item.pintuan_id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
const goods = {
|
||||
goods: res.data.data,
|
||||
type: 2,
|
||||
}
|
||||
this.$store.commit('setGoodsDetails', goods);
|
||||
this.$store.commit('setGoodsId', this.item.pintuan_id);
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
})
|
||||
// this.$u.api.getPinTuanDetails({
|
||||
// pintuan_id: this.item.pintuan_id
|
||||
// }).then(res => {
|
||||
// if(res.errCode == 0) {
|
||||
// const goods = {
|
||||
// goods: res.data.data,
|
||||
// type: 2,
|
||||
// }
|
||||
// this.$store.commit('setGoodsDetails', goods);
|
||||
// this.$store.commit('setGoodsId', this.item.pintuan_id);
|
||||
// this.$u.route({
|
||||
// url: 'pageB/sdetails/index',
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.item.pintuan_id,
|
||||
type: 2,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ export default {
|
||||
num = this.couponList.length
|
||||
? this.couponList.length > 4 ? 4 : this.couponList.length
|
||||
: 1
|
||||
this.swiperHeight = (97 + 10) * num - 10 + 'px';
|
||||
this.swiperHeight = (97 + 10) * num + 'px';
|
||||
},
|
||||
toCouponPage() {
|
||||
this.$u.route({
|
||||
@@ -93,8 +93,11 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.coupon-swiper {
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 40rpx;
|
||||
.top {
|
||||
padding-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -109,11 +112,9 @@ export default {
|
||||
}
|
||||
}
|
||||
.swiper-coupon-item {
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
// padding: 30rpx {
|
||||
// top: 0;
|
||||
// };
|
||||
.coupon-item {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user