check.php 20 KB

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