toExamine.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <!-- 笔记审核 -->
  3. <view class="container to-examine">
  4. <view class="content-item">
  5. <view class="author-name">
  6. <view class="img-box">
  7. <image :src="detailDataForm.HeadImg" @click="goDetailPages"></image>
  8. </view>
  9. <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
  10. </view>
  11. <view class="type-time">
  12. <view class="type"> {{ detailDataForm.Type == 1 ? "笔 记" : "观 点" }} </view>
  13. <view class="time">{{ detailDataForm.PublishTime }}</view>
  14. </view>
  15. <view class="title-item"> {{ detailDataForm.Title }}</view>
  16. <view class="text-conten">
  17. <mp-html :content="detailDataForm.Content" />
  18. </view>
  19. <block v-if="detailDataForm.Docs && detailDataForm.Docs.length > 0">
  20. <view @click="goFilePages(item)" class="file-item" v-for="(item, index) in detailDataForm.Docs" :key="index">
  21. <image :src="item.DocIcon"></image> {{ item.DocName }}.{{ item.DocSuffix }}
  22. </view>
  23. </block>
  24. <view class="image-conten">
  25. <image v-for="key in dataProcessing(detailDataForm.ImgUrl)" :key="key" :src="key" @click="previewImageMediahandler(key)"></image>
  26. </view>
  27. <view class="lable-conten">
  28. <view class="item" v-for="key in dataProcessing(detailDataForm.Tags)" :key="key">{{ key }}</view>
  29. </view>
  30. </view>
  31. <view class="bottom-btn" v-if="isShow">
  32. <view @click="rejectTextShow = true">驳回</view>
  33. <view @click="passRhrouhg">通过</view>
  34. </view>
  35. <u-modal
  36. v-model="rejectTextShow"
  37. :show-title="false"
  38. show-cancel-button
  39. confirm-text="确定"
  40. cancel-text="取消"
  41. :content-style="{ fontSize: '32rpx' }"
  42. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  43. :confirm-style="{ fontWeight: '700' }"
  44. @confirm="confirmModal"
  45. @cancel="cancelModal"
  46. >
  47. <view class="slot-content slot-content-text">
  48. <text class="add-lable-txt">驳回理由</text>
  49. <input v-model="rejectText" placeholder="请输入驳回理由" />
  50. </view>
  51. </u-modal>
  52. <Loading />
  53. </view>
  54. </template>
  55. <script>
  56. import { purchaserApi } from "@/config/api";
  57. export default {
  58. data() {
  59. return {
  60. rejectTextShow: false,
  61. rejectText: "",
  62. detailDataForm: "",
  63. detailId: 0,
  64. isShow: false,
  65. };
  66. },
  67. methods: {
  68. previewImageMediahandler(key) {
  69. uni.previewImage({
  70. urls: [key], //查看图片的数组
  71. });
  72. },
  73. passRhrouhg() {
  74. uni.showModal({
  75. title: "提醒",
  76. content: "确定通过此内容在小程序展示吗?",
  77. confirmColor: "#3385FF",
  78. cancelColor: "#606266",
  79. success: async (res) => {
  80. if (res.confirm) {
  81. const res = await purchaserApi.yanxuanSpecialEnable({
  82. Id: this.detailId,
  83. Status: 1, //1通过2驳回
  84. });
  85. if (res.Ret === 200) {
  86. this.$util.toast("审核通过");
  87. uni.navigateBack();
  88. }
  89. }
  90. },
  91. });
  92. },
  93. // 数据处理
  94. dataProcessing(item) {
  95. return item ? item.split(",") : [];
  96. },
  97. // 弹框关闭事件
  98. cancelModal() {
  99. this.rejectTextShow = false;
  100. this.rejectText = "";
  101. },
  102. // 弹框确定事件
  103. async confirmModal() {
  104. const res = await purchaserApi.yanxuanSpecialEnable({
  105. Id: this.detailId,
  106. Status: 2, //1通过2驳回
  107. Reason: this.rejectText,
  108. });
  109. if (res.Ret === 200) {
  110. this.cancelModal();
  111. uni.navigateBack();
  112. }
  113. },
  114. // 获取专栏详情
  115. async getDetaliData() {
  116. const res = await purchaserApi.yanxuanSpecialDetail({
  117. Id: this.detailId,
  118. });
  119. if (res.Ret === 200) {
  120. this.detailDataForm = res.Data;
  121. }
  122. },
  123. // 去往预览文件
  124. goFilePages(item) {
  125. wx.downloadFile({
  126. // 示例 url,并非真实存在
  127. url: item.DocUrl,
  128. success: function (res) {
  129. const filePath = res.tempFilePath;
  130. wx.openDocument({
  131. filePath: filePath,
  132. success: function (res) {
  133. console.log("打开文档成功");
  134. },
  135. });
  136. },
  137. });
  138. },
  139. goDetailPages() {
  140. uni.navigateTo({ url: "/pages-purchaser/columnDetail/columnDetail?id=" + this.detailDataForm.UserId });
  141. },
  142. },
  143. onLoad(options) {
  144. this.detailId = Number(options.id) || 0;
  145. this.detailId > 0 && this.getDetaliData();
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scope>
  150. .to-examine {
  151. padding: 30rpx;
  152. background: #f3f5f9;
  153. .content-item {
  154. padding: 40rpx;
  155. background-color: #fff;
  156. .type-time {
  157. display: flex;
  158. align-items: center;
  159. justify-content: space-between;
  160. color: #666666;
  161. .type {
  162. width: 110rpx;
  163. height: 42rpx;
  164. line-height: 42rpx;
  165. text-align: center;
  166. border-radius: 38rpx;
  167. color: #928563;
  168. background-color: #fff6de;
  169. font-weight: 500;
  170. }
  171. }
  172. .title-item {
  173. margin: 10rpx 0 20rpx;
  174. color: #333;
  175. font-size: 32rpx;
  176. font-weight: 500;
  177. line-height: 46rpx;
  178. }
  179. .file-item {
  180. width: 100%;
  181. height: 42rpx;
  182. margin: 20rpx 0;
  183. display: flex;
  184. align-items: center;
  185. background-color: #f8f8fa;
  186. color: #376cbb;
  187. image {
  188. margin-right: 15rpx;
  189. width: 27rpx;
  190. height: 27rpx;
  191. }
  192. }
  193. .image-conten {
  194. display: flex;
  195. flex-wrap: wrap;
  196. image {
  197. width: 144rpx;
  198. height: 144rpx;
  199. margin-right: 20rpx;
  200. }
  201. }
  202. .lable-conten {
  203. display: flex;
  204. flex-wrap: wrap;
  205. margin: 20rpx 0;
  206. font-size: 24rpx;
  207. .item {
  208. display: flex;
  209. align-items: center;
  210. height: 34rpx;
  211. border-radius: 44rpx;
  212. padding: 0 35rpx;
  213. background-color: #f0f1f3;
  214. margin: 0 20rpx 20rpx 0;
  215. }
  216. }
  217. .collect-conten {
  218. display: flex;
  219. justify-content: flex-end;
  220. align-items: center;
  221. color: #666666;
  222. image {
  223. width: 27rpx;
  224. height: 26rpx;
  225. margin-right: 8rpx;
  226. }
  227. }
  228. .author-name {
  229. display: flex;
  230. align-items: center;
  231. margin-bottom: 50rpx;
  232. .img-box {
  233. width: 48rpx;
  234. height: 48rpx;
  235. overflow: hidden;
  236. font-size: 28rpx;
  237. color: #333;
  238. image {
  239. width: 100%;
  240. height: 100%;
  241. }
  242. }
  243. }
  244. }
  245. .bottom-btn {
  246. position: fixed;
  247. bottom: 0;
  248. left: 0;
  249. width: 100%;
  250. background-color: #fff;
  251. padding: 48rpx 25rpx;
  252. padding-bottom: constant(safe-area-inset-bottom);
  253. padding-bottom: env(safe-area-inset-bottom);
  254. display: flex;
  255. view {
  256. width: 345rpx;
  257. height: 84rpx;
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. border-radius: 9rpx;
  262. background-color: #2ba471;
  263. color: #fff;
  264. font-weight: 600;
  265. }
  266. view:nth-child(1) {
  267. background-color: #d54941;
  268. margin-right: 12rpx;
  269. }
  270. }
  271. .add-lable-txt {
  272. color: #000;
  273. font-size: 36rpx;
  274. flex-wrap: 600;
  275. margin-bottom: 30rpx;
  276. width: 100%;
  277. text-align: center;
  278. }
  279. .slot-content-text {
  280. text-align: left;
  281. input {
  282. height: 96rpx;
  283. background-color: #f8f8fa;
  284. }
  285. }
  286. }
  287. </style>