contentAllPage.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="container content-all-page">
  3. <view class="tab-content">
  4. <view class="item" v-for="item in tabList" :key="item.value" @click="tabClickHandler(item)">
  5. {{ item.name }}
  6. <view class="line-active" v-if="tabActive == item.value"> </view>
  7. </view>
  8. </view>
  9. <view class="content-ul" v-if="specialCenter && specialCenter.length > 0">
  10. <view class="content-li" v-for="item in specialCenter" :key="item.Id" @click="toExamineHandler(item)">
  11. <view class="type-time">
  12. <view class="type"> {{ item.Type == 1 ? "笔 记" : "观 点" }} </view>
  13. <view class="time"> {{ tabActive == 1 ? item.ModifyTime : item.PublishTime }}</view>
  14. </view>
  15. <view class="title-item"> {{ item.Title }}</view>
  16. <view class="btn-box">
  17. <view class="reject-box" v-if="tabActive == 1" @click.stop="deleteHandler(item)"> 删除</view>
  18. <view class="cancell-box" v-if="tabActive == 3" @click.stop="unpublishHandler(item)"> 取消发布</view>
  19. <view class="reject-box" v-if="tabActive == 4" @click.stop="rejectHandler(item)"> 驳回理由</view>
  20. <view class="edit-box" v-if="tabActive == 1 || tabActive == 4" @click.stop="modifyHandler(item)"> 修改 </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="nodata" v-else>
  25. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  26. <view class="nodata-text">暂无内容</view>
  27. </view>
  28. <Loading />
  29. </view>
  30. </template>
  31. <script>
  32. import { purchaserApi } from "@/config/api";
  33. export default {
  34. data() {
  35. return {
  36. tabList: [
  37. { name: "草稿箱", value: "1" },
  38. { name: "已发布", value: "3" },
  39. { name: "审核中", value: "2" },
  40. { name: "已驳回", value: "4" },
  41. ],
  42. tabActive: "1",
  43. specialCenter: [],
  44. };
  45. },
  46. methods: {
  47. // top标签点击事件
  48. tabClickHandler(item) {
  49. if (this.tabActive === item.value) return;
  50. this.specialCenter = [];
  51. this.tabActive = item.value;
  52. this.getDataList();
  53. },
  54. // 获取内容中心的数据
  55. async getDataList() {
  56. const res = await purchaserApi.yanxuanSpecialCenter({
  57. Status: this.tabActive,
  58. });
  59. if (res.Ret === 200) {
  60. this.specialCenter = res.Data || [];
  61. }
  62. },
  63. // 点击了修改
  64. modifyHandler(item) {
  65. uni.navigateTo({
  66. url: "/pages-purchaser/writeNote/writeNote?id=" + item.Id,
  67. });
  68. },
  69. // 点击驳回
  70. rejectHandler(item) {
  71. uni.showModal({
  72. title: "驳回理由",
  73. content: item.Reason,
  74. confirmColor: "#3385FF",
  75. confirmText: "知道了",
  76. showCancel: false,
  77. cancelColor: "#606266",
  78. });
  79. },
  80. // 取消发布
  81. unpublishHandler(item) {
  82. uni.showModal({
  83. title: "提醒",
  84. content: "取消发布后,内容将进入草稿箱想要重新发布需重新提交审核,确定要取消发布吗?",
  85. confirmColor: "#3385FF",
  86. cancelColor: "#606266",
  87. success: async (res) => {
  88. if (res.confirm) {
  89. const resCancel = await purchaserApi.yanxuanSpecialCancel({
  90. Id: item.Id,
  91. });
  92. if (resCancel.Ret == 200) {
  93. uni.showToast({
  94. title: "已取消发布",
  95. duration: 2000,
  96. });
  97. this.getDataList();
  98. }
  99. }
  100. },
  101. });
  102. },
  103. // 去往审核页面
  104. toExamineHandler(item) {
  105. if (item.Status == 2) {
  106. uni.navigateTo({
  107. url: "/pages-purchaser/toExamine/toExamine?id=" + item.Id,
  108. });
  109. }
  110. },
  111. // 删除
  112. async deleteHandler(item) {
  113. uni.showModal({
  114. content: "确定要删除此内容吗?",
  115. confirmColor: "#3385FF",
  116. cancelColor: "#606266",
  117. success: async (res) => {
  118. if (res.confirm) {
  119. const resCancel = await purchaserApi.yanxuanSpecialDel({
  120. Id: item.Id,
  121. });
  122. if (resCancel.Ret == 200) {
  123. this.$util.toast("已删除");
  124. this.getDataList();
  125. }
  126. }
  127. },
  128. });
  129. },
  130. },
  131. onLoad() {
  132. this.getDataList();
  133. },
  134. };
  135. </script>
  136. <style lang="scss" scope>
  137. .content-all-page {
  138. background-color: #f3f5f9;
  139. .tab-content {
  140. margin-top: 1rpx;
  141. background-color: #fff;
  142. height: 96rpx;
  143. display: flex;
  144. view {
  145. flex: 1;
  146. text-align: center;
  147. line-height: 96rpx;
  148. border-bottom: 2rpx solid #e7e7e7;
  149. }
  150. .item {
  151. position: relative;
  152. .line-active {
  153. position: absolute;
  154. left: 50%;
  155. bottom: 0rpx;
  156. width: 32rpx;
  157. height: 6rpx;
  158. border-radius: 6rpx;
  159. background-color: #376cbb;
  160. transform: translateX(-50%);
  161. }
  162. }
  163. }
  164. .content-ul {
  165. padding: 30rpx;
  166. .content-li {
  167. width: 100%;
  168. height: 256rpx;
  169. padding: 20rpx;
  170. border-radius: 16rpx;
  171. border-top: 10rpx solid #e7e0cd;
  172. background-color: #fff;
  173. .type-time {
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-between;
  177. color: #666666;
  178. .type {
  179. width: 110rpx;
  180. height: 42rpx;
  181. line-height: 42rpx;
  182. text-align: center;
  183. border-radius: 38rpx;
  184. color: #928563;
  185. background-color: #fff6de;
  186. font-weight: 500;
  187. }
  188. }
  189. .title-item {
  190. margin: 10rpx 0 20rpx;
  191. color: #333;
  192. font-size: 32rpx;
  193. font-weight: 500;
  194. line-height: 46rpx;
  195. }
  196. .btn-box {
  197. display: flex;
  198. justify-content: flex-end;
  199. padding-top: 5rpx;
  200. view {
  201. display: flex;
  202. align-items: center;
  203. height: 48rpx;
  204. padding: 0 24rpx;
  205. border-radius: 150rpx;
  206. margin-left: 10rpx;
  207. }
  208. .cancell-box {
  209. color: #376cbb;
  210. border: 2rpx solid #376cbb;
  211. }
  212. .edit-box {
  213. color: #fff;
  214. background-color: #376cbb;
  215. }
  216. .reject-box {
  217. color: #d54941;
  218. border: 2rpx solid #d54941;
  219. }
  220. }
  221. }
  222. }
  223. }
  224. </style>