123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <template>
- <view class="container content-all-page">
- <view class="tab-content">
- <view class="item" v-for="item in tabList" :key="item.value" @click="tabClickHandler(item)">
- {{ item.name }}
- <view class="line-active" v-if="tabActive == item.value"> </view>
- </view>
- </view>
- <view class="content-ul" v-if="specialCenter && specialCenter.length > 0">
- <view class="content-li" v-for="item in specialCenter" :key="item.Id" @click="toExamineHandler(item)">
- <view class="type-time">
- <view class="type"> {{ item.Type == 1 ? "笔 记" : "观 点" }} </view>
- <view class="time"> {{ tabActive == 1 ? item.ModifyTime : item.PublishTime }}</view>
- </view>
- <view class="title-item" @click="goDetail(item)"> {{ item.Title }}</view>
- <view class="btn-box">
- <view class="reject-box" v-if="tabActive == 1" @click.stop="deleteHandler(item)"> 删除</view>
- <view class="cancell-box" v-if="tabActive == 3" @click.stop="unpublishHandler(item)"> 取消发布</view>
- <view class="reject-box" v-if="tabActive == 4" @click.stop="rejectHandler(item)"> 驳回理由</view>
- <view class="edit-box" v-if="tabActive == 1 || tabActive == 4" @click.stop="modifyHandler(item)"> 修改 </view>
- </view>
- </view>
- </view>
- <view class="nodata" v-else>
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
- <view class="nodata-text">暂无内容</view>
- </view>
- <Loading />
- </view>
- </template>
- <script>
- import { purchaserApi } from "@/config/api";
- export default {
- data() {
- return {
- tabList: [
- { name: "草稿箱", value: "1" },
- { name: "已发布", value: "3" },
- { name: "审核中", value: "2" },
- { name: "已驳回", value: "4" },
- ],
- tabActive: "",
- specialCenter: [],
- };
- },
- methods: {
- // top标签点击事件
- tabClickHandler(item) {
- if (this.tabActive === item.value) return;
- this.specialCenter = [];
- this.tabActive = item.value;
- this.getDataList();
- },
- // 获取内容中心的数据
- async getDataList() {
- const res = await purchaserApi.yanxuanSpecialCenter({
- Status: this.tabActive,
- });
- if (res.Ret === 200) {
- this.specialCenter = res.Data || [];
- }
- },
- // 点击了修改
- modifyHandler(item) {
- if (item.ContentHasStyle) {
- uni.showModal({
- content: "此内容包含较多文本格式或文档,请前往网页版编辑",
- confirmColor: "#376cbb",
- confirmText: "知道了",
- showCancel: false,
- cancelColor: "#606266",
- });
- return;
- }
- uni.navigateTo({
- url: "/pages-purchaser/writeNote/writeNote?id=" + item.Id,
- });
- },
- // 点击驳回
- rejectHandler(item) {
- uni.showModal({
- title: "驳回理由",
- content: item.Reason,
- confirmColor: "#376cbb",
- confirmText: "知道了",
- showCancel: false,
- cancelColor: "#606266",
- });
- },
- // 取消发布
- unpublishHandler(item) {
- uni.showModal({
- title: "提醒",
- content: "取消发布后,内容将进入草稿箱,想要重新发布需重新提交审核,确定要取消发布吗?",
- confirmColor: "#376cbb",
- cancelColor: "#606266",
- success: async (res) => {
- if (res.confirm) {
- const resCancel = await purchaserApi.yanxuanSpecialCancel({
- Id: item.Id,
- });
- if (resCancel.Ret == 200) {
- uni.showToast({
- title: "已取消发布",
- duration: 2000,
- });
- this.getDataList();
- }
- }
- },
- });
- },
- // 去往审核页面
- toExamineHandler(item) {
- if (item.Status == 2) {
- uni.navigateTo({
- url: "/pages-purchaser/toExamine/toExamine?id=" + item.Id,
- });
- }
- },
- // 删除
- async deleteHandler(item) {
- uni.showModal({
- content: "确定要删除此内容吗?",
- confirmColor: "#376cbb",
- cancelColor: "#606266",
- success: async (res) => {
- if (res.confirm) {
- const resCancel = await purchaserApi.yanxuanSpecialDel({
- Id: item.Id,
- });
- if (resCancel.Ret == 200) {
- this.$util.toast("已删除");
- this.getDataList();
- }
- }
- },
- });
- },
- // 去往详情
- goDetail(item) {
- if (item.Status == 2) {
- uni.navigateTo({
- url: "/pages-purchaser/toExamine/toExamine?id=" + item.Id,
- });
- } else {
- uni.navigateTo({ url: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + item.Id });
- }
- },
- },
- onLoad(options) {
- this.tabActive = options.Status || "1";
- this.getDataList();
- },
- };
- </script>
- <style lang="scss" scope>
- .content-all-page {
- background-color: $uni-bg-color;
- .tab-content {
- margin-top: 1rpx;
- background-color: #fff;
- height: 96rpx;
- display: flex;
- view {
- flex: 1;
- text-align: center;
- line-height: 96rpx;
- border-bottom: 2rpx solid #e7e7e7;
- }
- .item {
- position: relative;
- .line-active {
- position: absolute;
- left: 50%;
- bottom: 0rpx;
- width: 32rpx;
- height: 6rpx;
- border-radius: 6rpx;
- background-color: #376cbb;
- transform: translateX(-50%);
- }
- }
- }
- .content-ul {
- padding: 30rpx;
- .content-li {
- width: 100%;
- height: 256rpx;
- padding: 20rpx;
- border-radius: 16rpx;
- border-top: 10rpx solid #e7e0cd;
- background-color: #fff;
- .type-time {
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: #666666;
- .type {
- width: 110rpx;
- height: 42rpx;
- line-height: 42rpx;
- text-align: center;
- border-radius: 38rpx;
- color: #928563;
- background-color: #fff6de;
- font-weight: 500;
- }
- }
- .title-item {
- margin: 10rpx 0 20rpx;
- color: #333;
- font-size: 32rpx;
- font-weight: 500;
- line-height: 46rpx;
- }
- .btn-box {
- display: flex;
- justify-content: flex-end;
- padding-top: 5rpx;
- view {
- display: flex;
- align-items: center;
- height: 48rpx;
- padding: 0 24rpx;
- border-radius: 150rpx;
- margin-left: 10rpx;
- }
- .cancell-box {
- color: #376cbb;
- border: 2rpx solid #376cbb;
- }
- .edit-box {
- color: #fff;
- background-color: #376cbb;
- }
- .reject-box {
- color: #d54941;
- border: 2rpx solid #d54941;
- }
- }
- }
- }
- }
- </style>
|