update api
This commit is contained in:
@@ -1,16 +1,31 @@
|
||||
<template>
|
||||
<view class="video-item">
|
||||
<image class="head">
|
||||
|
||||
</image>
|
||||
<view class="title" v-if="!isguanzhu">这是标题这是标题这是标题</view>
|
||||
<view class="video-item" v-if="item">
|
||||
<image class="head" :src="item.article_pic"></image>
|
||||
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
|
||||
<view class="jianjie">这是简介这是简介这是简介</view>
|
||||
<view class="user">
|
||||
<view>
|
||||
<image></image>
|
||||
<text>这是名字</text>
|
||||
<view class="info">
|
||||
<image :src="item.member_avatar"></image>
|
||||
<text>{{ item.member_nickname }}</text>
|
||||
</view>
|
||||
<image></image>
|
||||
<image src="/static/image/common/4.png" @click="showAction"></image>
|
||||
<view class="action" v-if="show == item.article_id">
|
||||
<view class="bubble">
|
||||
<view>
|
||||
<image src="/static/image/common/5.png"></image>
|
||||
<text>点赞</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="/static/image/common/6.png"></image>
|
||||
<text>收藏</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="/static/image/common/7.png"></image>
|
||||
<text>屏蔽用户</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="layer" v-if="show == item.article_id" @click.stop="show=-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -33,7 +48,7 @@
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
line-height: 30rpx;
|
||||
width: 307rpx;
|
||||
width: 300rpx;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
display:-webkit-box;
|
||||
@@ -46,7 +61,7 @@
|
||||
font-size: 22rpx;
|
||||
color: #666;
|
||||
line-height: 30rpx;
|
||||
width: 307rpx;
|
||||
width: 300rpx;
|
||||
margin-left: 18rpx;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
@@ -61,8 +76,9 @@
|
||||
align-items: center;
|
||||
margin:0 auto;
|
||||
margin-top: 20rpx;
|
||||
width: 307rpx;
|
||||
>view{
|
||||
width: 300rpx;
|
||||
position: relative;
|
||||
.info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
>image{
|
||||
@@ -81,6 +97,70 @@
|
||||
width: 37rpx;
|
||||
height: 8rpx;
|
||||
}
|
||||
.action {
|
||||
z-index: 19;
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
bottom: 55rpx;
|
||||
// width: 234rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
|
||||
border-radius: 6rpx;
|
||||
.bubble {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
&::after {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
width: 60rpx;
|
||||
height: 40rpx;
|
||||
background-color: inherit;
|
||||
transform: rotate(45deg);
|
||||
margin-top: -10rpx;
|
||||
z-index: -1;
|
||||
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
|
||||
}
|
||||
> view {
|
||||
padding: 9rpx 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&:not(:last-child) {
|
||||
border-bottom: 2rpx #ECECEC solid;
|
||||
}
|
||||
@mixin image-class($width, $height, $right) {
|
||||
width: $width;
|
||||
height: $height;
|
||||
margin-right: $right;
|
||||
}
|
||||
> image {
|
||||
&:first-child {
|
||||
@include image-class($width: 21rpx, $height: 22rpx, $right: 12rpx);
|
||||
}
|
||||
&:nth-child(2) {
|
||||
@include image-class($width: 22rpx, $height: 22rpx, $right: 12rpx);
|
||||
}
|
||||
&:last-child {
|
||||
@include image-class($width: 24rpx, $height: 20rpx, $right: 9rpx);
|
||||
}
|
||||
}
|
||||
> text {
|
||||
font-size: 20rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.layer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -89,9 +169,18 @@ export default {
|
||||
name:"index-item",
|
||||
data(){
|
||||
return {
|
||||
|
||||
show: -1,
|
||||
}
|
||||
},
|
||||
props:["isguanzhu"]
|
||||
props:["isguanzhu", "item"],
|
||||
mounted() {
|
||||
// console.log(this.item);
|
||||
this.show = -1;
|
||||
},
|
||||
methods: {
|
||||
showAction() {
|
||||
this.show = this.show > 0 ? -1 : this.item.article_id;
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="item" @click="addCart">
|
||||
<view class="item" @click="toDetailsPage">
|
||||
<image :src="info.goods_image" class="img"></image>
|
||||
<view class="info">
|
||||
<text class="title u-line-1">{{ info.goods_name }}</text>
|
||||
@@ -15,14 +15,11 @@ export default {
|
||||
info: Object
|
||||
},
|
||||
methods: {
|
||||
addCart() {
|
||||
console.log(1);
|
||||
|
||||
this.$u.api.addCart({
|
||||
goods_id: this.info.goods_id,
|
||||
quantity: 1
|
||||
}).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
toDetailsPage() {
|
||||
this.$u.route({
|
||||
url: 'pageB/sdetails/index',
|
||||
params: {
|
||||
id: this.info.goods_id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user