audit.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. @extends('layouts.base')
  2. @section('title', '审核列表')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}" />
  5. <style>
  6. .edit-i{display:none;}
  7. .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
  8. .el-tabs__item,.is-top{font-size:16px}
  9. .el-tabs__active-bar { height: 3px;}
  10. .description .el-form-item__label{line-height:24px}
  11. </style>
  12. <div class="all">
  13. <div id="app" v-cloak>
  14. <div class="vue-nav" style="margin-bottom:15px">
  15. <el-tabs v-model="activeName" @tab-click="handleClick">
  16. <el-tab-pane label="基础设置" name="1"></el-tab-pane>
  17. <el-tab-pane label="评价列表" name="2"></el-tab-pane>
  18. <el-tab-pane label="审核列表" name="3"></el-tab-pane>
  19. </el-tabs>
  20. </div>
  21. <div class="vue-head">
  22. <div class="vue-main-title" style="margin-bottom:20px">
  23. <div class="vue-main-title-left"></div>
  24. <div class="vue-main-title-content">评论审核</div>
  25. </div>
  26. <div class="vue-search">
  27. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  28. <el-form-item label="">
  29. <el-input v-model="search_form.keyword" placeholder="商品标题"></el-input>
  30. </el-form-item>
  31. <el-form-item label="">
  32. <el-select v-model="search_form.searchtime" clearable placeholder="是否搜索时间">
  33. <el-option label="不搜索时间" value="0"></el-option>
  34. <el-option label="搜索时间" value="1"></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="">
  38. <el-date-picker
  39. v-model="times"
  40. type="datetimerange"
  41. value-format="timestamp"
  42. range-separator="至"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期"
  45. style="margin-left:5px;"
  46. align="right">
  47. </el-date-picker>
  48. </el-form-item>
  49. <el-form-item label="">
  50. <el-button type="primary" @click="search(1)">搜索</el-button>
  51. </el-form-item>
  52. </el-form>
  53. </div>
  54. </div>
  55. <div class="vue-main">
  56. <div class="vue-main-form">
  57. <el-table :data="list" style="width: 100%">
  58. <el-table-column label="商品信息">
  59. <template slot-scope="scope">
  60. <div v-if="scope.row.goods" style="display:flex;align-items: center">
  61. <img v-if="scope.row.goods.thumb" :src="scope.row.goods.thumb" onerror="this.src='{{static_url("resource/images/nopic.jpg")}}'; this.title='图片未找到.'" style="width:50px;height:50px"></img>
  62. <div style="margin-left:10px">[[scope.row.goods.title]]</div>
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="评价者">
  67. <template slot-scope="scope">
  68. <div style="display:flex;align-items: center">
  69. <img v-if="scope.row.head_img_url" :src="scope.row.head_img_url" onerror="this.src='{{static_url("resource/images/nopic.jpg")}}'; this.title='图片未找到.'" style="width:50px;height:50px"></img>
  70. <div style="margin-left:10px">[[scope.row.nick_name]]</div>
  71. </div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="评分等级" align="center">
  75. <template slot-scope="scope">
  76. <div>
  77. <el-rate v-model="scope.row.level" disabled show-score></el-rate>
  78. </div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="时间" align="center" prop="created_at"></el-table-column>
  82. <el-table-column prop="refund_time" label="操作" align="center" width="320">
  83. <template slot-scope="scope">
  84. <el-link v-if="scope.row.audit_status==2" title="查看详情" :underline="false" :href="'{{ yzWebUrl('goods.comment.reply-view', array('page_type' => 'audit','id' => '')) }}'+[[scope.row.id]]" style="text-align: center;width:50px">
  85. <i class="iconfont icon-all_watchroot"></i>
  86. </el-link>
  87. <el-link v-if="scope.row.audit_status==2" title="通过审核" :underline="false" @click="pass(scope.row.id)" style="text-align: center;width:50px">
  88. <i class="iconfont icon-jk_record"></i>
  89. </el-link>
  90. {{-- <el-link v-if="scope.row.status==0" title="驳回审核" :underline="false" @click="refundReject(scope.row.id,-1)" style="text-align: center;width:50px">--}}
  91. {{-- <i class="iconfont icon-ht_operation_reject"></i>--}}
  92. {{-- </el-link>--}}
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. </div>
  97. </div>
  98. <!-- 分页 -->
  99. <div class="vue-page" v-if="total>0">
  100. <el-row>
  101. <el-col align="right">
  102. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  103. :page-size="per_page" :current-page="current_page" background
  104. ></el-pagination>
  105. </el-col>
  106. </el-row>
  107. </div>
  108. </div>
  109. </div>
  110. <script>
  111. var app = new Vue({
  112. el: "#app",
  113. delimiters: ['[[', ']]'],
  114. name: 'test',
  115. data() {
  116. return {
  117. list:[],
  118. change_sort:'',
  119. times:[],
  120. options:[
  121. {id:0,name:'全部评价类型'},
  122. {id:1,name:'真实评价'},
  123. {id:2,name:'模拟评价'},
  124. ],
  125. search_form:{
  126. },
  127. rules: {},
  128. current_page:1,
  129. total:1,
  130. per_page:1,
  131. activeName:'3',
  132. }
  133. },
  134. created() {
  135. },
  136. mounted() {
  137. this.getData(1);
  138. },
  139. methods: {
  140. handleClick(val) {
  141. console.log(val.name)
  142. if(val.name == 1) {
  143. window.location.href = `{!! yzWebFullUrl('goods.comment.index') !!}`;
  144. }
  145. else if(val.name == 2) {
  146. window.location.href = `{!! yzWebFullUrl('goods.comment.list') !!}`;
  147. }
  148. else if(val.name == 3) {
  149. window.location.href = `{!! yzWebFullUrl('goods.comment.audit') !!}`;
  150. }
  151. },
  152. getData(page) {
  153. console.log(this.times);
  154. let json = {
  155. keyword:this.search_form.keyword,
  156. fade:this.search_form.fade,
  157. searchtime:this.search_form.searchtime,
  158. };
  159. if(this.times && this.times.length>0) {
  160. json.starttime = this.times[0]/1000;
  161. json.endtime = this.times[1]/1000
  162. }
  163. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  164. this.$http.post('{!! yzWebFullUrl('goods.comment.comment-data') !!}',{page:page,search:json,type:'audit'}).then(function(response) {
  165. if (response.data.result) {
  166. this.list = response.data.data.list.data;
  167. this.list.forEach((item,index) => {
  168. if(item.goods) {
  169. item.goods.title = this.escapeHTML(item.goods.title);
  170. }
  171. });
  172. this.current_page=response.data.data.list.current_page;
  173. this.total=response.data.data.list.total;
  174. this.per_page=response.data.data.list.per_page;
  175. loading.close();
  176. } else {
  177. this.$message({
  178. message: response.data.msg,
  179. type: 'error'
  180. });
  181. }
  182. loading.close();
  183. }, function(response) {
  184. this.$message({
  185. message: response.data.msg,
  186. type: 'error'
  187. });
  188. loading.close();
  189. });
  190. },
  191. search(val) {
  192. this.getData(val);
  193. },
  194. // 字符转义
  195. escapeHTML(a) {
  196. a = "" + a;
  197. return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");;
  198. },
  199. pass(id) {
  200. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  201. this.$http.post('{!! yzWebFullUrl('goods.comment.changeAuditStatus') !!}',{comment_id:id}).then(function (response) {
  202. if (response.data.result){
  203. this.$message.success("操作成功");
  204. this.search(this.current_page);
  205. }
  206. else {
  207. this.$message.error( response.data.msg );
  208. }
  209. loading.close();
  210. },function (response) {
  211. this.$message.error(response.data.msg);
  212. loading.close();
  213. }
  214. );
  215. },
  216. },
  217. })
  218. </script>
  219. @endsection