toExamine.vue 7.7 KB

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