delete mine history 8.14
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<view class="collection">
|
||||
<view class="container">
|
||||
<view class="item-box" v-for="(item, index) in articleList" :key="index" @click="toDetailsPage(item.article_id)">
|
||||
<view class="item-box" v-for="(item, index) in articleList" :key="index" @click="toDetailsPage({ id: item.article_id, type: item.type })">
|
||||
<view class="video-item" v-if="item">
|
||||
<image class="head" :src="item.article_pic" mode="aspectFill" v-if="item.type == 1"></image>
|
||||
<view class="header_fist" v-else>
|
||||
<view class="backes"></view>
|
||||
<view class="backs">
|
||||
<image class="play-icon" src="/static/videoPlay.png"></image>
|
||||
</view>
|
||||
<image class="head" :src="item.article_pic"></image>
|
||||
</view>
|
||||
<view class="title u-line-1">{{ item.article_title }}</view>
|
||||
@@ -15,23 +17,14 @@
|
||||
<image :src="item.member_avatar"></image>
|
||||
<text>{{ item.member_nickname }}</text>
|
||||
</view>
|
||||
<view @click.stop="delArticle(item.article_id)">
|
||||
<u-icon name="trash" color="#333" size="36"></u-icon>
|
||||
<view @click.stop="viewAction(item.article_id)">
|
||||
<u-icon name="more-dot-fill" color="#333" size="36"></u-icon>
|
||||
</view>
|
||||
<!-- <image src="/static/image/common/4.png" @click.stop="showAction(item)"></image> -->
|
||||
<!-- <view class="action" v-if="show == item.article_id">
|
||||
<view class="bubble">
|
||||
<view @click.stop="delArticle(item.article_id)">
|
||||
<image src="/static/image/common/8.png"></image>
|
||||
<text>删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="layer" v-if="show == item.article_id" @click.stop="show=-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet :list="actionList" v-model="showAction" :cancel-btn="true" @click="delArticle" border-radius="20"></u-action-sheet>
|
||||
<u-empty mode="list" v-if="!articleList.length" color="#000" img-width="200" font-size="30" margin-top="120"></u-empty>
|
||||
</view>
|
||||
</template>
|
||||
@@ -39,8 +32,17 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tid: '',
|
||||
show: -1,
|
||||
articleList: [],
|
||||
showAction: false,
|
||||
actionList: [
|
||||
{
|
||||
text: '删除',
|
||||
color: '#000000',
|
||||
fontSize: 36
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
@@ -51,9 +53,6 @@ export default {
|
||||
this.articleCollectList();
|
||||
},
|
||||
methods: {
|
||||
showAction(item) {
|
||||
this.show = this.show > 0 ? -1 : item.article_id;
|
||||
},
|
||||
articleCollectList() {
|
||||
this.$u.api.articleCollectList().then(res => {
|
||||
uni.stopPullDownRefresh();
|
||||
@@ -64,8 +63,16 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
delArticle(id) {
|
||||
this.$u.api.articleCollect({ article_id: id }).then(res => {
|
||||
viewAction(id) {
|
||||
this.showAction = true;
|
||||
this.tid = id;
|
||||
},
|
||||
toDetailsPage({ id, type }) {
|
||||
let src = type == 1 ? 'pageB/photo/index' : 'pageB/video/video';
|
||||
this.$u.route(src, { id: id });
|
||||
},
|
||||
delArticle() {
|
||||
this.$u.api.articleCollect({ article_id: this.tid }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.articleCollectList();
|
||||
} else {
|
||||
@@ -73,11 +80,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/photo/index?id=' + id
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -88,11 +90,9 @@ export default {
|
||||
padding: 21rpx 30rpx 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
.item-box {
|
||||
&:not(:nth-child(2n)) {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.video-item{
|
||||
.video-item {
|
||||
width: 330rpx;
|
||||
height: 510rpx;
|
||||
margin-top: 20rpx;
|
||||
@@ -104,30 +104,28 @@ export default {
|
||||
height: 330rpx !important;
|
||||
}
|
||||
.title{
|
||||
margin:0 auto;
|
||||
margin-top: 20rpx;
|
||||
margin: 20rpx auto 0;
|
||||
font-size: 22rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
width: 300rpx;
|
||||
}
|
||||
.jianjie{
|
||||
// height: 60rpx;
|
||||
margin:0 auto;
|
||||
margin-top: 20rpx;
|
||||
height: 30rpx;
|
||||
margin: 20rpx auto 0;
|
||||
font-size: 22rpx;
|
||||
color: #666;
|
||||
line-height: 30rpx;
|
||||
width: 300rpx;
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
.user{
|
||||
.user {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin:0 auto;
|
||||
margin-top: 20rpx;
|
||||
margin: 20rpx auto 0;
|
||||
width: 300rpx;
|
||||
position: relative;
|
||||
.info {
|
||||
@@ -149,82 +147,27 @@ export default {
|
||||
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;
|
||||
}
|
||||
.header_fist {
|
||||
width: 330rpx;
|
||||
height: 330rpx;
|
||||
position: relative;
|
||||
.backs {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
.header_fist{
|
||||
position: relative;
|
||||
.backes{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
// background: rgba(0,0,0,0.6);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
.play-icon {
|
||||
z-index: 19;
|
||||
position: absolute;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user