check.php 20 KB

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