This commit is contained in:
Gdpao
2020-08-01 17:22:46 +08:00
parent 223dd51db7
commit 8a213ba094
7 changed files with 330 additions and 103 deletions

View File

@@ -27,18 +27,12 @@ export default {
data(){
return {
show: true,
cartList: this.list || [],
cartList: [],
}
},
watch: {
list() {
this.cartList = this.list;
}
},
methods: {
toggerList() {
this.show = false;
this.$emit("hideCart",this.show);
}
}
}

View File

@@ -1,48 +1,89 @@
<template>
<view class="shopone">
<image></image>
<view>
<text>sadas</text>
<text>dasadas</text>
<text>dsadas</text>
</view>
</view>
<view>
<u-popup v-model="is_comment" mode="bottom" border-radius="10" height="700rpx">
<view class="top">
<text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="close"></u-icon>
</view>
<scroll-view class="scroll-box" scroll-y="true" >
<view></view>
</scroll-view>
<view class="editing">
<input type="text" value="" />
<text>发送</text>
</view>
</u-popup>
</view>
</template>
<style lang="scss" scoped>
.shopone{
display: flex;
width: 442rpx;
height: 200rpx;
padding: 20rpx;
border-radius: 10rpx;
background:rgba(0,0,0,0.4);
>image{
width: 160rpx;
height: 160rpx;
}
>view{
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
>text{
font-size: 24rpx;
color: #fff;
line-height: 36rpx;
}
>text:first-child{
font-size: 28rpx;
}
>text:last-child{
font-size: 28rpx;
color: #FF3131;
}
}
}
</style>
<script>
export default {
name:"shopone"
name: "shopone",
props: ['comment'],
data() {
return {
is_comment: true
}
},
onReady() {
this.getComment(); // 获取评论
},
watch: {
comment(newValue,old) {
console.log(newValue,old);
},
deep: true
},
methods: {
getComment() {
this.$u.post("Specialci/getAllEvalue", {
goods_id: goods_id,
page: 1
}).then(res => {
console.log(res);
})
},
close() {
this.is_comment = false;
}
}
}
</script>
</script>
<style lang="scss" scoped>
.top {
position: fixed;
top: 0;
width: 100%;
height: 88rpx;
padding: 0 20rpx;
line-height: 88rpx;
background-color: #ECECEC;
& > text {
margin-right: 280rpx;
color: #333;
font-size: 30rpx;
font-weight: 500;
}
}
.scroll-box {
margin: 88rpx 0 100rpx 0;
height: 100%;
}
.editing {
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 90rpx;
padding: 0 30rpx;
background-color: #ECECEC;
& > input {
width: 80%;
height: 60rpx;
padding: 0 20rpx;
border-radius: 30rpx;
background-color: #fff;
}
}
</style>

View File

@@ -3,7 +3,7 @@
<view class="userhead">
<image :src="item.member_avatar"></image>
<text class="follow" v-if="!is_follow" @click="following(item.member_id)">+</text>
<u-icon v-else name="checkbox-mark" color="#ffffff" :size="28" class="follow" @click="following(item.member_id)"></u-icon>
<u-icon v-else name="checkmark" color="#ffffff" :size="28" class="follow" @click="following(item.member_id)"></u-icon>
</view>
<!-- 点赞 -->
<view class="operat zan">
@@ -17,7 +17,7 @@
</view>
<!-- 评论 -->
<view class="operat pinglun">
<u-icon name="more-circle-fill" color="#ffffff" :size="50" @click="editing()"></u-icon>
<u-icon name="more-circle-fill" :color=" is_content ? '#FF7807' : '#ffffff' " :size="50" @click="editing()"></u-icon>
<text>{{item.comment_num}}</text>
</view>
<!-- 购物车 -->
@@ -74,25 +74,33 @@
<script>
export default {
name:'userinfo',
props:['list','cart'],
props:['list','cart','comment'],
data(){
return {
is_follow: this.list.is_attention || false,
is_like: this.list.is_like || false,
is_collect: this.list.is_collect || false,
is_content: false,
is_cart: this.cart || false,
item: this.list || []
is_cart: false,
item: this.list || {}
}
},
watch: {
list(newValue,old) {
console.log(newValue,old);
// console.log(newValue,old);
this.item = newValue || {};
this.is_follow = this.list.is_attention || false;
this.is_like = this.list.is_like || false;
this.is_collect = this.list.is_collect || false;
},
cart(newValue,old) {
// console.log(newValue,old);
this.is_cart = newValue;
},
comment(newValue,old) {
console.log(newValue,old);
this.is_content = newValue;
},
deep: true
},
methods: {
@@ -131,12 +139,16 @@ export default {
})
},
// 评论
editing() {},
editing() {
this.is_content = !this.is_content;
// console.log(this.is_content);
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
},
// 购物车
carting() {
this.is_cart = !this.is_cart;
// console.log(this.is_cart);
this.$emit("openCart",this.is_cart);
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
},
}
}