check.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <style>
  2. .table-body {
  3. padding: 20px;
  4. background-color: #fff;
  5. }
  6. .input-item {
  7. display: inline-block;
  8. width: 250px;
  9. margin: 0 0 20px;
  10. }
  11. .input-item .el-input__inner {
  12. border-right: 0;
  13. }
  14. .input-item .el-input__inner:hover {
  15. border: 1px solid #dcdfe6;
  16. border-right: 0;
  17. outline: 0;
  18. }
  19. .input-item .el-input__inner:focus {
  20. border: 1px solid #dcdfe6;
  21. border-right: 0;
  22. outline: 0;
  23. }
  24. .input-item .el-input-group__append {
  25. background-color: #fff;
  26. border-left: 0;
  27. width: 10%;
  28. padding: 0;
  29. }
  30. .input-item .el-input-group__append .el-button {
  31. padding: 0;
  32. }
  33. .input-item .el-input-group__append .el-button {
  34. margin: 0;
  35. }
  36. .table-body .el-button {
  37. padding: 0 !important;
  38. border: 0;
  39. margin: 0 5px;
  40. }
  41. .el-table th > .cell {
  42. color: #333;
  43. font-weight: bold;
  44. font-size: 14px;
  45. }
  46. .el-table__footer-wrapper, .el-table__header-wrapper {
  47. border-bottom: 1.4px solid #D6D6D6;
  48. }
  49. .label {
  50. margin-right: 10px;
  51. }
  52. .line-clamp {
  53. text-overflow: -o-ellipsis-lastline;
  54. overflow: hidden;
  55. text-overflow: ellipsis;
  56. display: -webkit-box;
  57. -webkit-line-clamp: 2;
  58. line-clamp: 2;
  59. -webkit-box-orient: vertical;
  60. }
  61. /*头像样式 start*/
  62. .default-avatar{
  63. width: 50px;
  64. height: 50px;
  65. border-radius: 50%;
  66. }
  67. .user_img{
  68. position: relative;
  69. margin-right: 8px;
  70. height: 50px;
  71. width: 50px;
  72. }
  73. .el-table_1_column_2 .cell { /*-2 表示在第二行*/
  74. display: flex;
  75. }
  76. /*头像样式 end*/
  77. .preview-model{
  78. flex: 1;
  79. padding: 20px;
  80. }
  81. .preview-model-left{
  82. max-width: 375px;
  83. padding: 16px 11px;
  84. height: 457px;
  85. overflow: overlay;
  86. }
  87. .preview-model-left .left-title{
  88. font-size: 20px;
  89. font-weight: bold;
  90. color: #000000;
  91. margin-bottom: 16px;
  92. }
  93. .preview-model-left .left-center{
  94. font-size: 18px;
  95. font-weight: 400;
  96. line-height: 20px;
  97. color: #707070;
  98. margin: 16px 0;
  99. }
  100. .preview-model:last-child{
  101. border-left: 1px solid #e8e7e9;
  102. }
  103. .preview-goods{
  104. background: #F6F5F8;
  105. padding: 10px;
  106. }
  107. .preview-goods-right{
  108. margin-left: 15px;
  109. line-height: initial;
  110. }
  111. </style>
  112. <div id="app" v-cloak>
  113. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  114. <div slot="header">
  115. <div>
  116. <span>审核管理</span>
  117. </div>
  118. </template>
  119. </div>
  120. <el-card shadow="never" style="border:0;min-width: 800px;">
  121. <template>
  122. <el-tabs v-model="check_status" type="card" @tab-click="change_tab">
  123. <el-tab-pane label="待审核" name="yes">
  124. </el-tab-pane>
  125. <el-tab-pane label="审核不通过" name="no">
  126. </el-tab-pane>
  127. </el-tabs>
  128. </template>
  129. </el-card>
  130. <div class="table-body el-input--small">
  131. <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  132. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  133. <div class="label">标题</div>
  134. <el-input style="width: 150px" v-model="search.title" placeholder="标题"></el-input>
  135. </div>
  136. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  137. <div class="label">会员昵称</div>
  138. <el-input style="width: 200px" v-model="search.user_name" placeholder="会员昵称"></el-input>
  139. </div>
  140. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  141. <div class="label">会员手机号码</div>
  142. <el-input style="width: 200px" v-model="search.mobile" placeholder="会员手机号码"></el-input>
  143. </div>
  144. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  145. <div class="label">会员ID</div>
  146. <el-input style="width: 200px" v-model="search.user_id" placeholder="会员ID"></el-input>
  147. </div>
  148. <div class="item-box" flex="dir:left cross:center">
  149. <div class="label">创建时间</div>
  150. <el-date-picker
  151. v-model="time"
  152. type="datetimerange"
  153. value-format="yyyy-MM-dd HH:mm:ss"
  154. range-separator="至"
  155. start-placeholder="开始日期"
  156. end-placeholder="结束日期">
  157. </el-date-picker>
  158. </div>
  159. <div class="item-box" flex="dir:left cross:center">
  160. <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
  161. </el-button>
  162. </div>
  163. </el-form>
  164. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  165. <el-table-column prop="id" label="ID" align="center"></el-table-column>
  166. <el-table-column label="会员" width="200">
  167. <template slot-scope="scope">
  168. <div class="user_img">
  169. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  170. <div slot="error" class="image-slot">
  171. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  172. </div>
  173. </el-image>
  174. </div>
  175. <div>
  176. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  177. <div style="font-size: 12px;">{{scope.row.user.mobile}}</div>
  178. </div>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="标题" min-width="150" align="center">
  182. <template slot-scope="scope">
  183. <com-ellipsis :line="1">{{scope.row.title}}</com-ellipsis>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="发布类型" min-width="80" align="center">
  187. <template slot-scope="scope">
  188. <p>{{scope.row.note_type_name}}</p>
  189. </template>
  190. </el-table-column>
  191. <el-table-column prop="scope" width="160" label="发布时间">
  192. <template slot-scope="scope">
  193. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  194. </template>
  195. </el-table-column>
  196. <el-table-column
  197. label="操作"
  198. min-width="180"
  199. align="center">
  200. <template slot-scope="scope">
  201. <el-button circle size="mini" type="text" @click="addgsForm(scope.row, scope.$index)">审核
  202. </el-button>
  203. </template>
  204. </el-table-column>
  205. </el-table>
  206. <div style="text-align: right;margin: 20px 0;">
  207. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  208. style="display: inline-block;float: right;" background @current-change="pageChange"
  209. layout="prev, pager, next" :total="pagination.total_count">
  210. </el-pagination>
  211. </div>
  212. </div>
  213. <!-- 弹框添加中心开始-->
  214. <el-dialog :title="title" width="45%%" :visible.sync="dialogAddgsVisible"
  215. @close="closeDialogAddgsVisible" :modal-append-to-body="false">
  216. <div flex v-if="list[selIndex]">
  217. <div class="preview-model preview-model-left">
  218. <template v-if="list[selIndex].note_type == 1">
  219. <div class="left-title">
  220. {{list[selIndex].title}}
  221. </div>
  222. <div class="left-cover">
  223. <el-image style="width: 100%;" v-for="(url,urlIndex) in JSON.parse(list[selIndex].cover_img)" :key="urlIndex" :src="url" fit="cover"></el-image>
  224. </div>
  225. <div class="left-center" v-html="list[selIndex].content">
  226. <!-- {{list[selIndex].content}}-->
  227. </div>
  228. <div v-if="list[selIndex].content_href.length">
  229. <el-image style="width: 100%;" v-for="(url,urlIndex) in JSON.parse(list[selIndex].content_href)" :key="urlIndex" :src="url" fit="cover"></el-image>
  230. </div>
  231. </template>
  232. <template v-if="list[selIndex].note_type == 2">
  233. <div class="left-title">
  234. {{list[selIndex].title}}
  235. </div>
  236. <div class="left-cover">
  237. <el-image style="width: 100%;" v-for="(url,urlIndex) in JSON.parse(list[selIndex].cover_img)" :key="urlIndex" :src="url" fit="cover"></el-image>
  238. </div>
  239. <div class="priview-center" style="background: #000;" v-if="list[selIndex].content_href" flex>
  240. <video style="width: 100%;" :src="list[selIndex].content_href" controls="controls"></video>
  241. </div>
  242. </template>
  243. </div>
  244. <div class="preview-model">
  245. <el-form :model="addForm" ref="addForm" :rules="addRule" label-width="100px">
  246. <el-form-item label="发布时间">
  247. {{list[selIndex].created_at|dateTimeFormat('Y-m-d H:i:s')}}
  248. </el-form-item>
  249. <el-form-item label="发布会员">
  250. {{list[selIndex].user.nickname}}
  251. </el-form-item>
  252. <el-form-item label="关联类型">
  253. {{list[selIndex].cate_name}}
  254. </el-form-item>
  255. <el-form-item label="关联商品">
  256. <div v-if="list[selIndex].goods">
  257. <div class="preview-goods" flex>
  258. <el-image style="width: 60px; height: 60px" :src="list[selIndex].goods.cover_pic" fit="contain"></el-image>
  259. <div class="preview-goods-right" flex="">
  260. <div>{{list[selIndex].goods.goods_name}}</div>
  261. <div>{{list[selIndex].goods.price}}</div>
  262. </div>
  263. </div>
  264. </div>
  265. <div v-else>
  266. </div>
  267. </el-form-item>
  268. <el-form-item label="审核状态" prop="check_status">
  269. <el-radio-group v-model="addForm.check_status">
  270. <el-radio :label="1">通过</el-radio>
  271. <el-radio :label="2">驳回</el-radio>
  272. </el-radio-group>
  273. </el-form-item>
  274. <el-form-item
  275. v-if="addForm.check_status == 2" label="驳回原因"
  276. :rules="addForm.check_status == 2?addRule.remark:[{ required: false}]"
  277. prop="remark">
  278. <el-input type="textarea" placeholder="请输入驳回原因" v-model="addForm.remark" :autosize="{ minRows: 2, maxRows: 8}" maxlength="30" show-word-limit>{{addForm.remark}}</el-input>
  279. </el-form-item>
  280. </el-form>
  281. </div>
  282. </div>
  283. <span slot="footer" class="dialog-footer">
  284. <el-button @click="dialogAddgsVisible = false">取 消</el-button>
  285. <el-button type="primary" @click="saveAddForm('addForm')" v-loading="btnLoading">确 定</el-button>
  286. </span>
  287. </el-dialog>
  288. <!-- 弹框添加中心结束-->
  289. <!-- 自定义 -->
  290. <el-dialog title="素材图片预览" :visible.sync="app_share.dialog" width="30%">
  291. <div flex="dir:left main:center" class="app-share">
  292. <com-image mode="aspectFill" style=" width: 100%; height: 500px;text-align: center;"
  293. :src="app_share.img" width="100%" height="100%">
  294. </com-image>
  295. </div>
  296. <div slot="footer" class="dialog-footer">
  297. <el-button @click="app_share.dialog = false" type="primary">关闭</el-button>
  298. </div>
  299. </el-dialog>
  300. </el-card>
  301. </div>
  302. <script>
  303. const app = new Vue({
  304. el: '#app',
  305. data() {
  306. return {
  307. listLoading: false,
  308. page: 1,
  309. pagination:null,
  310. //本地存时间,请求时不发送
  311. time: [],
  312. search: {
  313. user_id: '',
  314. mobile: '',
  315. user_name: '',
  316. date_start: null,
  317. date_end: null,
  318. title:null,
  319. },
  320. list: [],
  321. //弹框配置
  322. addForm: {
  323. id: '',//
  324. describe: '',//素材文案
  325. download_type: '',//上传类型:1-图文;2-短视频
  326. img_url: [],//素材图片
  327. video: {
  328. video_url: '',
  329. thumb_url: '',
  330. },//素材视频链接
  331. check_status: '',//审核状态:0:未审核 1:审核通过 2:审核不通过
  332. remark: '',//驳回原因
  333. },
  334. addRule: {
  335. check_status: [
  336. {required: true, message: '请填选择状态', trigger: 'change'},
  337. ],
  338. remark: [
  339. {required: true, message: '请填驳回原因', trigger: 'change'},
  340. {
  341. validator: (rule, value, callback) => {
  342. if(value.length>30||value.length<0){
  343. callback('最大长度在1-30个字内');
  344. }
  345. callback();
  346. },
  347. trigger: 'blur'
  348. },
  349. ],
  350. },
  351. title: "",
  352. check_status:'yes',
  353. status: 0,
  354. dialogAddgsVisible: false,
  355. dataList: [],
  356. // 对话框显示与否
  357. dialogVisible: false,
  358. btnLoading: false,
  359. app_share: {
  360. dialog: false,
  361. img: '',
  362. },
  363. selIndex: -1, //审核选中的下标
  364. };
  365. },
  366. methods: {
  367. searchs() {
  368. this.page = 1;
  369. this.getList();
  370. },
  371. pageChange(currentPage) {
  372. let self = this;
  373. self.page = currentPage;
  374. self.getList();
  375. },
  376. change_tab(tab,event){
  377. if (tab.name == 'yes') {
  378. this.status = 0;
  379. } else {
  380. this.status = 2;
  381. }
  382. this.getList();
  383. },
  384. getList() {
  385. let self = this;
  386. self.listLoading = true;
  387. // 检查是否选择了搜索时间
  388. if (!self.time) {
  389. self.search.date_start = '';
  390. self.search.date_end = '';
  391. } else {
  392. self.search.date_start = self.time[0];
  393. self.search.date_end = self.time[1];
  394. }
  395. request({
  396. method: 'post',
  397. params: {
  398. r: 'operating-note/notes/index',
  399. },
  400. data: {
  401. page: self.page,
  402. user_id: self.search.user_id,
  403. mobile: self.search.mobile,
  404. user_name: self.search.user_name,
  405. check_status:this.status,
  406. date_start: self.search.date_start,
  407. date_end: self.search.date_end,
  408. title: self.search.title,
  409. },
  410. }).then(e => {
  411. self.listLoading = false;
  412. self.list = e.data.data.list;
  413. this.pagination = e.data.data.pagination;
  414. this.pagination.pageSize = e.data.data.page_size;
  415. this.pagination.total_count = e.data.data.count;
  416. }).catch(e => {
  417. console.log(e);
  418. });
  419. },
  420. appShare(url) {
  421. this.app_share.dialog = true;
  422. this.app_share.img = url;
  423. },
  424. /**
  425. *点击按钮,弹出框
  426. * @param
  427. */
  428. addgsForm(row, index) {
  429. console.log(row,'*****');
  430. this.addForm.id = row.id?row.id:'';
  431. if(row.check_status == 0) {
  432. this.addForm.check_status = 1;
  433. }
  434. this.addForm.check_remark = row.check_remark;
  435. // this.addForm.type = row.source.type;
  436. //上传类型:1-图文;2-短视频
  437. // if (row.source.type == 1) {
  438. // if(row.source.source){
  439. // this.addForm.img_url = row.source.source;
  440. // }else{
  441. // this.addForm.img_url = [];
  442. // }
  443. // } else {
  444. // this.addForm.video_url = row.source.source;
  445. // this.addForm.thumb_url = row.source.cover;
  446. // }
  447. this.title = "审核"
  448. this.selIndex = index;
  449. this.dialogAddgsVisible = true;
  450. console.info(this.dialogAddgsVisible );
  451. },
  452. /**
  453. *更新新数据
  454. * @param
  455. */
  456. saveAddForm(formName) {
  457. this.$refs[formName].validate((valid) => {
  458. let self = this;
  459. if (valid) {
  460. self.btnLoading = true;
  461. request({
  462. params: {
  463. r: 'operating-note/notes/check',
  464. },
  465. method: 'post',
  466. data: {
  467. id: self.addForm.id,
  468. check_status: self.addForm.check_status,
  469. type:1,
  470. check_remark: self.addForm.remark,
  471. }
  472. }).then(e => {
  473. this.btnLoading = false;
  474. if (e.data.code == 0) {
  475. this.dialogAddgsVisible = false;
  476. self.$message.success(e.data.msg);
  477. self.getList();
  478. this.addForm.remark = '';
  479. this.addForm.check_status = '';
  480. } else {
  481. self.$message.error(e.data.msg);
  482. }
  483. }).catch(e => {
  484. this.btnLoading = false;
  485. console.log(e);
  486. });
  487. } else {
  488. console.log('error submit!!');
  489. return false;
  490. }
  491. });
  492. },
  493. /**
  494. *关闭或取消模态框,清空值
  495. * @param
  496. */
  497. closeDialogAddgsVisible() {
  498. this.addForm.remark = '';
  499. this.addForm.check_status = '';
  500. this.addForm.goods = {
  501. id: '',
  502. name: '',
  503. price: '',
  504. cover_pic: '',
  505. };
  506. this.dialogAddgsVisible = false;
  507. },
  508. },
  509. mounted: function () {
  510. this.getList();
  511. }
  512. });
  513. </script>