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. 无
  267. </div>
  268. </el-form-item>
  269. <el-form-item label="审核状态" prop="check_status">
  270. <el-radio-group v-model="addForm.check_status">
  271. <el-radio :label="1">通过</el-radio>
  272. <el-radio :label="2">驳回</el-radio>
  273. </el-radio-group>
  274. </el-form-item>
  275. <el-form-item
  276. v-if="addForm.check_status == 2" label="驳回原因"
  277. :rules="addForm.check_status == 2?addRule.remark:[{ required: false}]"
  278. prop="remark">
  279. <el-input type="textarea" placeholder="请输入驳回原因" v-model="addForm.remark" :autosize="{ minRows: 2, maxRows: 8}" maxlength="30" show-word-limit>{{addForm.remark}}</el-input>
  280. </el-form-item>
  281. </el-form>
  282. </div>
  283. </div>
  284. <span slot="footer" class="dialog-footer">
  285. <el-button @click="dialogAddgsVisible = false">取 消</el-button>
  286. <el-button type="primary" @click="saveAddForm('addForm')" v-loading="btnLoading">确 定</el-button>
  287. </span>
  288. </el-dialog>
  289. <!-- 弹框添加中心结束-->
  290. <!-- 自定义 -->
  291. <el-dialog title="素材图片预览" :visible.sync="app_share.dialog" width="30%">
  292. <div flex="dir:left main:center" class="app-share">
  293. <com-image mode="aspectFill" style=" width: 100%; height: 500px;text-align: center;"
  294. :src="app_share.img" width="100%" height="100%">
  295. </com-image>
  296. </div>
  297. <div slot="footer" class="dialog-footer">
  298. <el-button @click="app_share.dialog = false" type="primary">关闭</el-button>
  299. </div>
  300. </el-dialog>
  301. </el-card>
  302. </div>
  303. <script>
  304. const app = new Vue({
  305. el: '#app',
  306. data() {
  307. return {
  308. listLoading: false,
  309. page: 1,
  310. pagination:null,
  311. //本地存时间,请求时不发送
  312. time: [],
  313. search: {
  314. user_id: '',
  315. mobile: '',
  316. user_name: '',
  317. date_start: null,
  318. date_end: null,
  319. title:null,
  320. },
  321. list: [],
  322. //弹框配置
  323. addForm: {
  324. id: '',//
  325. describe: '',//素材文案
  326. download_type: '',//上传类型:1-图文;2-短视频
  327. img_url: [],//素材图片
  328. video: {
  329. video_url: '',
  330. thumb_url: '',
  331. },//素材视频链接
  332. check_status: '',//审核状态:0:未审核 1:审核通过 2:审核不通过
  333. remark: '',//驳回原因
  334. },
  335. addRule: {
  336. check_status: [
  337. {required: true, message: '请填选择状态', trigger: 'change'},
  338. ],
  339. remark: [
  340. {required: true, message: '请填驳回原因', trigger: 'change'},
  341. {
  342. validator: (rule, value, callback) => {
  343. if(value.length>30||value.length<0){
  344. callback('最大长度在1-30个字内');
  345. }
  346. callback();
  347. },
  348. trigger: 'blur'
  349. },
  350. ],
  351. },
  352. title: "",
  353. check_status:'yes',
  354. status: 0,
  355. dialogAddgsVisible: false,
  356. dataList: [],
  357. // 对话框显示与否
  358. dialogVisible: false,
  359. btnLoading: false,
  360. app_share: {
  361. dialog: false,
  362. img: '',
  363. },
  364. selIndex: -1, //审核选中的下标
  365. };
  366. },
  367. methods: {
  368. searchs() {
  369. this.page = 1;
  370. this.getList();
  371. },
  372. pageChange(currentPage) {
  373. let self = this;
  374. self.page = currentPage;
  375. self.getList();
  376. },
  377. change_tab(tab,event){
  378. if (tab.name == 'yes') {
  379. this.status = 0;
  380. } else {
  381. this.status = 2;
  382. }
  383. this.getList();
  384. },
  385. getList() {
  386. let self = this;
  387. self.listLoading = true;
  388. // 检查是否选择了搜索时间
  389. if (!self.time) {
  390. self.search.date_start = '';
  391. self.search.date_end = '';
  392. } else {
  393. self.search.date_start = self.time[0];
  394. self.search.date_end = self.time[1];
  395. }
  396. request({
  397. method: 'post',
  398. params: {
  399. r: 'operating-note/notes/index',
  400. },
  401. data: {
  402. page: self.page,
  403. user_id: self.search.user_id,
  404. mobile: self.search.mobile,
  405. user_name: self.search.user_name,
  406. check_status:this.status,
  407. date_start: self.search.date_start,
  408. date_end: self.search.date_end,
  409. title: self.search.title,
  410. },
  411. }).then(e => {
  412. self.listLoading = false;
  413. self.list = e.data.data.list;
  414. this.pagination = e.data.data.pagination;
  415. this.pagination.pageSize = e.data.data.page_size;
  416. this.pagination.total_count = e.data.data.count;
  417. }).catch(e => {
  418. console.log(e);
  419. });
  420. },
  421. appShare(url) {
  422. this.app_share.dialog = true;
  423. this.app_share.img = url;
  424. },
  425. /**
  426. *点击按钮,弹出框
  427. * @param
  428. */
  429. addgsForm(row, index) {
  430. console.log(row,'*****');
  431. this.addForm.id = row.id?row.id:'';
  432. if(row.check_status == 0) {
  433. this.addForm.check_status = 1;
  434. }
  435. this.addForm.check_remark = row.check_remark;
  436. // this.addForm.type = row.source.type;
  437. //上传类型:1-图文;2-短视频
  438. // if (row.source.type == 1) {
  439. // if(row.source.source){
  440. // this.addForm.img_url = row.source.source;
  441. // }else{
  442. // this.addForm.img_url = [];
  443. // }
  444. // } else {
  445. // this.addForm.video_url = row.source.source;
  446. // this.addForm.thumb_url = row.source.cover;
  447. // }
  448. this.title = "审核"
  449. this.selIndex = index;
  450. this.dialogAddgsVisible = true;
  451. console.info(this.dialogAddgsVisible );
  452. },
  453. /**
  454. *更新新数据
  455. * @param
  456. */
  457. saveAddForm(formName) {
  458. this.$refs[formName].validate((valid) => {
  459. let self = this;
  460. if (valid) {
  461. self.btnLoading = true;
  462. request({
  463. params: {
  464. r: 'operating-note/notes/check',
  465. },
  466. method: 'post',
  467. data: {
  468. id: self.addForm.id,
  469. check_status: self.addForm.check_status,
  470. type:1,
  471. check_remark: self.addForm.remark,
  472. }
  473. }).then(e => {
  474. this.btnLoading = false;
  475. if (e.data.code == 0) {
  476. this.dialogAddgsVisible = false;
  477. self.$message.success(e.data.msg);
  478. self.getList();
  479. this.addForm.remark = '';
  480. this.addForm.check_status = '';
  481. } else {
  482. self.$message.error(e.data.msg);
  483. }
  484. }).catch(e => {
  485. this.btnLoading = false;
  486. console.log(e);
  487. });
  488. } else {
  489. console.log('error submit!!');
  490. return false;
  491. }
  492. });
  493. },
  494. /**
  495. *关闭或取消模态框,清空值
  496. * @param
  497. */
  498. closeDialogAddgsVisible() {
  499. this.addForm.remark = '';
  500. this.addForm.check_status = '';
  501. this.addForm.goods = {
  502. id: '',
  503. name: '',
  504. price: '',
  505. cover_pic: '',
  506. };
  507. this.dialogAddgsVisible = false;
  508. },
  509. },
  510. mounted: function () {
  511. this.getList();
  512. }
  513. });
  514. </script>