Commit 3a502861 authored by 罗林杰's avatar 罗林杰

修改动态删除

parent 860abf0d
...@@ -9,6 +9,15 @@ export function activityList(data) { ...@@ -9,6 +9,15 @@ export function activityList(data) {
}) })
} }
// 活动列表
export function userActivityList(data) {
return request({
url:'/app/cmsApplication/queryCmsApplicationByPagination',
data: data,
method: 'GET',
})
}
//活动详情 //活动详情
export function activityDetail(id) { export function activityDetail(id) {
return request({ return request({
......
...@@ -70,3 +70,12 @@ export function comment(data) { ...@@ -70,3 +70,12 @@ export function comment(data) {
method: 'POST', method: 'POST',
}) })
} }
//删除动态
export function delArticle(id) {
return request({
url: '/app/delete/' + id,
method: 'delete',
headers: {}
})
}
\ No newline at end of file
...@@ -85,16 +85,16 @@ ...@@ -85,16 +85,16 @@
</view> </view>
</view> </view>
<view class="right"> <view v-if="info.userId == userInfo.businessId" class="right">
<!-- 右上角的三个点--> <!-- 右上角的三个点-->
<view v-if="info.isDelete" @click="showSelect(info)"> <view @click="showSelect(info)">
<text></text> <text></text>
<text></text> <text></text>
<text></text> <text></text>
</view> </view>
</view> </view>
<!-- 右上角三个点的选项--> <!-- 右上角三个点的选项-->
<u-action-sheet :actions="list" :closeOnClickOverlay="true" :safeAreaInsetBottom="true" cancelText="取消" <u-action-sheet :actions="list" :closeOnClickOverlay="true" :safeAreaInsetBottom="false" cancelText="取消"
@select="selectClick" @close="show = false" :show="show"></u-action-sheet> @select="selectClick" @close="show = false" :show="show"></u-action-sheet>
</view> </view>
</template> </template>
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
import imageAdaptation from '@/components/images-adaptation/imageAdaptation.vue' import imageAdaptation from '@/components/images-adaptation/imageAdaptation.vue'
import xzjReadMore from "@/components/xzj-readMore/xzj-readMore.vue" import xzjReadMore from "@/components/xzj-readMore/xzj-readMore.vue"
import {isStopAccount, userDetail} from "../../../api/user"; import {isStopAccount, userDetail} from "../../../api/user";
import {delArticle} from "../../../api/article";
export default { export default {
name:'ArticleItem', name:'ArticleItem',
options: { options: {
...@@ -137,6 +138,8 @@ ...@@ -137,6 +138,8 @@
imgLayout2: [220, 220], imgLayout2: [220, 220],
imgLayout3: [160, 160], imgLayout3: [160, 160],
show: false, show: false,
userInfo: uni.getStorageSync('userInfo'),
selectId:'',
//右上角三个点的操作项 //右上角三个点的操作项
list: [{ list: [{
name: '删除', name: '删除',
...@@ -199,7 +202,20 @@ ...@@ -199,7 +202,20 @@
}, },
// 删除 // 删除
selectClick(item) { selectClick(item) {
delArticle(this.selectId).then(res => {
if (res.data.code == 200) {
uni.showToast({
title: '删除成功',
icon: 'none'
})
this.$emit('refresh')
} else if (res.data.code == 1001 || res.data.code == 1002){
uni.showToast({
title: res.data.message,
icon: 'none'
})
}
})
}, },
// //
preview({ preview({
...@@ -255,14 +271,8 @@ ...@@ -255,14 +271,8 @@
this.$emit("close") this.$emit("close")
}, },
showSelect(info) { showSelect(info) {
if (info.isDelete != true) {
const index = this.list.findIndex(i => i.name === '删除');
if (index !== -1) {
this.list.splice(index, 1);
}
}
this.show = true; this.show = true;
this.selectId = info.businessId
} }
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</u-tabs> </u-tabs>
</view> </view>
<view v-for="(item,index) in dataList" :key="item.id"> <view v-for="(item,index) in dataList" :key="item.id">
<ItemVue :info="item" @praise="praise"/> <ItemVue :info="item" @praise="praise" @refresh="refresh"/>
</view> </view>
<empty v-if="firstLoaded && !dataList.length"/> <empty v-if="firstLoaded && !dataList.length"/>
</z-paging> </z-paging>
...@@ -143,6 +143,12 @@ ...@@ -143,6 +143,12 @@
this.topicId = id this.topicId = id
this.$emit('topicId', this.topicId) this.$emit('topicId', this.topicId)
this.reload() this.reload()
},
refresh(){
this.$nextTick(() => {
// 刷新列表数据
this.$refs.paging && this.$refs.paging.reload();
})
}, },
//查询话题列表 //查询话题列表
getTopicList(){ getTopicList(){
......
...@@ -149,6 +149,28 @@ ...@@ -149,6 +149,28 @@
</view> </view>
</view> </view>
<!-- 活动 -->
<view class="content-2" v-if="(activityInfo !== null && activityInfo !== undefined) && (activityInfo.title !== null && activityInfo.title !== undefined)">
<view class="my-article">
<view class="my-article-title">
<image class="title-image" :src="baseUrl+'/user/106.svg'" mode="aspectFill"/>
<view class="title-text">
我的活动
</view>
</view>
<view class="my-article-more" @click="gotomore">
查看更多
<u-icon name="arrow-right" size="13" bold="true"></u-icon>
</view>
</view>
<view class="my-article-content" v-if="activityInfo.title !== null">
{{activityInfo.title}}
</view>
<view class="my-article-image-1">
<image :src="activityInfo.pictureUrl" mode="aspectFill"></image>
</view>
</view>
<!-- 操作项 第三部分--> <!-- 操作项 第三部分-->
<view class="content-3"> <view class="content-3">
<view class="box-bottom" v-for="(item,index) in button" :key="index" @click="whether(index)"> <view class="box-bottom" v-for="(item,index) in button" :key="index" @click="whether(index)">
...@@ -209,6 +231,7 @@ ...@@ -209,6 +231,7 @@
import {login, phoneLogin, setUserProfile} from '../../api/login/index' import {login, phoneLogin, setUserProfile} from '../../api/login/index'
import {getUserInfo, noReadMessageAllCount, userDetail} from "../../api/user"; import {getUserInfo, noReadMessageAllCount, userDetail} from "../../api/user";
import {articleList, getOssUrl, userArticleList} from "../../api/article"; import {articleList, getOssUrl, userArticleList} from "../../api/article";
import {activityList, userActivityList} from "../../api/activity";
export default { export default {
data() { data() {
return { return {
...@@ -227,6 +250,7 @@ import {articleList, getOssUrl, userArticleList} from "../../api/article"; ...@@ -227,6 +250,7 @@ import {articleList, getOssUrl, userArticleList} from "../../api/article";
userInfo:{},//用户信息 userInfo:{},//用户信息
token:'',//token token:'',//token
articleInfo:{}, articleInfo:{},
activityInfo:{},
noReadMessageAllCount:'', noReadMessageAllCount:'',
info:{}, info:{},
button: [ button: [
...@@ -510,6 +534,7 @@ import {articleList, getOssUrl, userArticleList} from "../../api/article"; ...@@ -510,6 +534,7 @@ import {articleList, getOssUrl, userArticleList} from "../../api/article";
this.authorizeShow = true this.authorizeShow = true
} }
this.getArticleList() this.getArticleList()
this.getActivityList()
this.getnoReadMessageAllCount() this.getnoReadMessageAllCount()
}) })
}, },
...@@ -539,6 +564,24 @@ import {articleList, getOssUrl, userArticleList} from "../../api/article"; ...@@ -539,6 +564,24 @@ import {articleList, getOssUrl, userArticleList} from "../../api/article";
} }
}) })
}, },
getActivityList(){
const query = {
page:1,
rows:1,
publishStatus:'1'
}
userActivityList(query).then(res =>{
this.activityInfo = res.data.data[0]
getOssUrl(this.activityInfo.pictureId).then(imgRes => {
if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/");
this.activityInfo.pictureUrl = imgRes.data.data
}
})
}).catch(e => {
console.log(e)
})
},
//查看更多动态 //查看更多动态
gotomore(){ gotomore(){
uni.navigateTo({ uni.navigateTo({
......
...@@ -85,22 +85,22 @@ ...@@ -85,22 +85,22 @@
</view> </view>
</view> </view>
<view class="right" v-if="userInfoId == userId"> <view class="right" style="margin-top: 40rpx;" v-if="userInfoId == userId">
<u-tag v-if="info.examStatus === '0'" plain plainFill text="审核中" type="info"/> <u-tag v-if="info.examStatus === '0'" plain plainFill text="审核中" type="info"/>
<u-tag v-if="info.examStatus === '1'" plain plainFill text="审核通过" type="success"/> <u-tag v-if="info.examStatus === '1'" plain plainFill text="审核通过" type="success"/>
<u-tag @click="showRemarks(info)" v-if="info.examStatus === '2' || info.examStatus === '3'" plain plainFill text="未通过" type="error"/> <u-tag @click="showRemarks(info)" v-if="info.examStatus === '2' || info.examStatus === '3'" plain plainFill text="未通过" type="error"/>
</view> </view>
<!-- <view class="right">--> <view class="right">
<!-- 右上角的三个点--> <!-- 右上角的三个点-->
<!-- <view v-if="info.isDelete" @click="showSelect(info)">--> <view @click="showSelect(info)">
<!-- <text></text>--> <text></text>
<!-- <text></text>--> <text></text>
<!-- <text></text>--> <text></text>
<!-- </view>--> </view>
<!-- </view>--> </view>
<!-- 右上角三个点的选项--> <!-- 右上角三个点的选项-->
<!-- <u-action-sheet :actions="list" :closeOnClickOverlay="true" :safeAreaInsetBottom="true" cancelText="取消"--> <u-action-sheet :actions="list" :closeOnClickOverlay="true" :safeAreaInsetBottom="false" cancelText="取消"
<!-- @select="selectClick" @close="show = false" :show="show"></u-action-sheet>--> @select="selectClick" @close="show = false" :show="show"></u-action-sheet>
<!-- 登录弹窗--> <!-- 登录弹窗-->
<!-- <login @change="getToLogin" :isLoginPop="isLoginPop" class="my-select"></login>--> <!-- <login @change="getToLogin" :isLoginPop="isLoginPop" class="my-select"></login>-->
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
import imageAdaptation from '@/components/images-adaptation/imageAdaptation.vue' import imageAdaptation from '@/components/images-adaptation/imageAdaptation.vue'
import xzjReadMore from "@/components/xzj-readMore/xzj-readMore.vue" import xzjReadMore from "@/components/xzj-readMore/xzj-readMore.vue"
import ELM from '@/components/elm-toast/index.vue'; import ELM from '@/components/elm-toast/index.vue';
import {delArticle} from "../../api/article";
export default { export default {
name:'ArticleItem', name:'ArticleItem',
options: { options: {
...@@ -164,6 +165,7 @@ ...@@ -164,6 +165,7 @@
imgLayout2: [220, 220], imgLayout2: [220, 220],
imgLayout3: [160, 160], imgLayout3: [160, 160],
show: false, show: false,
selectId:'',
tipMsg: '', tipMsg: '',
isConfirm: false, isConfirm: false,
userInfoId: uni.getStorageSync('userInfo').businessId, userInfoId: uni.getStorageSync('userInfo').businessId,
...@@ -221,8 +223,16 @@ ...@@ -221,8 +223,16 @@
} }
}, },
// 删除 // 删除
selectClick(item) { selectClick() {
delArticle(this.selectId).then(res => {
if (res.data.code == 200) {
uni.showToast({
title: '删除成功',
icon: 'none'
})
this.$emit('refresh')
}
})
}, },
// //
preview({ preview({
...@@ -278,14 +288,8 @@ ...@@ -278,14 +288,8 @@
this.$emit("close") this.$emit("close")
}, },
showSelect(info) { showSelect(info) {
if (info.isDelete != true) {
const index = this.list.findIndex(i => i.name === '删除');
if (index !== -1) {
this.list.splice(index, 1);
}
}
this.show = true; this.show = true;
this.selectId = info.businessId
}, },
showRemarks(info){ showRemarks(info){
const remarks = JSON.parse(info.remarks) const remarks = JSON.parse(info.remarks)
...@@ -419,19 +423,19 @@ ...@@ -419,19 +423,19 @@
.right { .right {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
//view { view {
// display: flex; display: flex;
// height: 30rpx; height: 30rpx;
// padding-top: 14rpx; padding-top: 6rpx;
//
// text { text {
// width: 8rpx; width: 8rpx;
// height: 8rpx; height: 8rpx;
// background-color: #333; background-color: #333;
// border-radius: 50%; border-radius: 50%;
// margin-right: 6rpx; margin-right: 6rpx;
// } }
//} }
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<z-paging ref="paging" v-model="dataList" @query="queryList" :fixed="true"> <z-paging ref="paging" v-model="dataList" @query="queryList" :fixed="true">
<view :style="{'margin-top':navHeight+'px'}"> <view :style="{'margin-top':navHeight+'px'}">
<view v-for="(item,index) in dataList" :key="item.id"> <view v-for="(item,index) in dataList" :key="item.id">
<ItemVue :info="item" @praise="praise" :userId="userId"/> <ItemVue :info="item" @praise="praise" :userId="userId" @refresh="refresh"/>
</view> </view>
</view> </view>
</z-paging> </z-paging>
...@@ -99,6 +99,12 @@ export default { ...@@ -99,6 +99,12 @@ export default {
this.$refs.paging && this.$refs.paging.reload(); this.$refs.paging && this.$refs.paging.reload();
}) })
}, },
refresh(){
this.$nextTick(() => {
// 刷新列表数据
this.$refs.paging && this.$refs.paging.reload();
})
},
//分页查询方法 //分页查询方法
queryList(pageNo, pageSize) { queryList(pageNo, pageSize) {
const params = { const params = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment