94e73b57d2d3812b99c242f4a263ea4b.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <?php /*a:5:{s:76:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\store\store_product_reply\index.php";i:1595820902;s:61:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\container.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_head.php";i:1595820902;s:57:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\style.php";i:1595820902;s:64:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <?php if(empty($is_layui) || (($is_layui instanceof \think\Collection || $is_layui instanceof \think\Paginator ) && $is_layui->isEmpty())): ?>
  8. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  9. <?php endif; ?>
  10. <link href="/static/plug/layui/css/layui.css" rel="stylesheet">
  11. <link href="/system/css/layui-admin.css" rel="stylesheet">
  12. <link href="/system/frame/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
  13. <link href="/system/frame/css/animate.min.css" rel="stylesheet">
  14. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  15. <script src="/system/frame/js/jquery.min.js"></script>
  16. <script src="/system/frame/js/bootstrap.min.js"></script>
  17. <script src="/static/plug/layui/layui.all.js"></script>
  18. <script>
  19. $eb = parent._mpApi;
  20. window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
  21. window.module="<?php echo app('http')->getName();?>";
  22. </script>
  23. <title></title>
  24. <script src="/static/plug/sweetalert2/sweetalert2.all.min.js"></script>
  25. <!--<script type="text/javascript" src="/static/plug/basket.js"></script>-->
  26. <script type="text/javascript" src="/static/plug/requirejs/require.js"></script>
  27. <?php /* <script type="text/javascript" src="/static/plug/requirejs/require-basket-load.js"></script> */ ?>
  28. <script>
  29. var hostname = location.hostname;
  30. if(location.port) hostname += ':' + location.port;
  31. requirejs.config({
  32. map: {
  33. '*': {
  34. 'css': '/static/plug/requirejs/require-css.js'
  35. }
  36. },
  37. shim:{
  38. 'iview':{
  39. deps:['css!iviewcss']
  40. },
  41. 'layer':{
  42. deps:['css!layercss']
  43. }
  44. },
  45. baseUrl:'//'+hostname+'/',
  46. paths: {
  47. 'static':'static',
  48. 'system':'system',
  49. 'vue':'static/plug/vue/dist/vue.min',
  50. 'axios':'static/plug/axios.min',
  51. 'iview':'static/plug/iview/dist/iview.min',
  52. 'iviewcss':'static/plug/iview/dist/styles/iview',
  53. 'lodash':'static/plug/lodash',
  54. 'layer':'static/plug/layer/layer',
  55. 'layercss':'static/plug/layer/theme/default/layer',
  56. 'jquery':'static/plug/jquery/jquery.min',
  57. 'moment':'static/plug/moment',
  58. 'sweetalert':'static/plug/sweetalert2/sweetalert2.all.min',
  59. 'formCreate':'/static/plug/form-create/form-create.min',
  60. },
  61. basket: {
  62. excludes:['system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  63. // excludes:['system/util/mpFormBuilder','system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  64. }
  65. });
  66. </script>
  67. <script type="text/javascript" src="/system/util/mpFrame.js"></script>
  68. </head>
  69. <body class="gray-bg">
  70. <div class="wrapper wrapper-content">
  71. <div class="layui-fluid">
  72. <div class="layui-row layui-col-space15" id="app">
  73. <div class="layui-col-md12">
  74. <div class="layui-card">
  75. <div class="layui-card-header">搜索条件</div>
  76. <div class="layui-card-body">
  77. <form class="layui-form layui-form-pane" action="">
  78. <div class="layui-form-item">
  79. <div class="layui-inline">
  80. <label class="layui-form-label">用户昵称</label>
  81. <div class="layui-input-block">
  82. <input type="text" name="nickname" class="layui-input">
  83. </div>
  84. </div>
  85. <div class="layui-inline">
  86. <label class="layui-form-label">商品名称</label>
  87. <div class="layui-input-block">
  88. <input type="text" name="product_name" class="layui-input">
  89. </div>
  90. </div>
  91. <div class="layui-inline">
  92. <label class="layui-form-label">订单id</label>
  93. <div class="layui-input-block">
  94. <input type="text" name="order_id" class="layui-input">
  95. </div>
  96. </div>
  97. <div class="layui-inline">
  98. <label class="layui-form-label">筛选类型</label>
  99. <div class="layui-input-block">
  100. <select name="is_reply">
  101. <option value="">全部</option>
  102. <option value="2">已回复</option>
  103. <option value="0">未回复</option>
  104. </select>
  105. </div>
  106. </div>
  107. <div class="layui-inline">
  108. <label class="layui-form-label">评分筛选</label>
  109. <div class="layui-input-block">
  110. <select name="score_type">
  111. <option value="">全部</option>
  112. <option value="1">好评</option>
  113. <option value="2">差评</option>
  114. </select>
  115. </div>
  116. </div>
  117. <div class="layui-inline">
  118. <div class="layui-input-inline">
  119. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search"
  120. lay-filter="search">
  121. <i class="layui-icon layui-icon-search"></i>搜索
  122. </button>
  123. </div>
  124. </div>
  125. </div>
  126. </form>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="layui-col-md12">
  131. <div class="layui-card">
  132. <div class="layui-card-header">评价列表</div>
  133. <div class="layui-card-body">
  134. <div class="layui-btn-container">
  135. <button type="button" class="layui-btn layui-btn-sm"
  136. onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('create'); ?>')">添加虚拟评论
  137. </button>
  138. </div>
  139. <div class="layui-form">
  140. <table class="layui-table">
  141. <thead>
  142. <tr>
  143. <th width="18%">产品信息</th>
  144. <th width="8%">订单号</th>
  145. <th width="8%">买家</th>
  146. <th width="8%">评分</th>
  147. <th width="16%">评论内容</th>
  148. <th width="17%">回复内容</th>
  149. <th width="10%">评论时间</th>
  150. <th width="14%">操作</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <tr v-for="(item,index) in messageList">
  155. <td>
  156. <div class="layui-col-md3 layui-col-sm3 layui-col-xs3">
  157. <img style="width: 100%;" :src="item.image" @click="lockImage(item.image)" alt="">
  158. </div>
  159. <div class="layui-col-md9 layui-col-sm9 layui-col-xs9">{{item.store_name}}</div>
  160. </td>
  161. <td>{{item.order_id}}</td>
  162. <td>{{item.nickname}}</td>
  163. <td>{{item.product_score}}</td>
  164. <td>
  165. <div class="layui-col-md12 layui-col-sm12 layui-col-xs12" style="margin: 5px 0;">
  166. {{item.comment}}
  167. </div>
  168. <div class="layui-col-md12 layui-col-sm12 layui-col-xs12">
  169. <img @click="lockImage(pic)" style="width: 30%;" v-for="pic in item.pics" :src="pic"
  170. alt="">
  171. </div>
  172. </td>
  173. <td>{{item.merchant_reply_content}}</td>
  174. <td>{{item._add_time}}</td>
  175. <td>
  176. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm"
  177. @click="edit(item,index)">回复
  178. </button>
  179. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm"
  180. @click="delReply(item,index)">删除
  181. </button>
  182. </td>
  183. </tr>
  184. </tbody>
  185. </table>
  186. <div ref="pages" style="text-align: right;" v-if="count > where.limit"></div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. <script src="/system/js/layuiList.js"></script>
  194. <script type="text/javascript">
  195. var product_id = <?=$product_id?>;
  196. require(['vue'], function (Vue) {
  197. new Vue({
  198. el: "#app",
  199. data: {
  200. where: {
  201. page: 1,
  202. title: '',
  203. is_reply: '',
  204. limit: 10,
  205. product_name: '',
  206. producr_id: product_id,
  207. message_page: 1,
  208. order_id: '',
  209. nickname: '',
  210. score_type: '',
  211. },
  212. product: {
  213. loading: false,
  214. loadend: false,
  215. loadTitle: '加载更多',
  216. },
  217. product_name: '',
  218. messageList: [],
  219. message: {
  220. loading: false,
  221. loadend: false,
  222. loadTitle: '加载更多',
  223. },
  224. count: 0,
  225. },
  226. watch: {
  227. 'where.producr_id': function (n) {
  228. this.message.loadend = false;
  229. this.where.message_page = 1;
  230. this.$set(this, 'messageList', []);
  231. this.getMessageList();
  232. },
  233. 'where.message_page': function (n) {
  234. this.message.loadend = false;
  235. this.getMessageList(true);
  236. }
  237. },
  238. methods: {
  239. see: function (nickname, uid) {
  240. $eb.createModalFrame(nickname + '-会员详情', layList.Url({c: 'user.user', a: 'see', p: {uid: uid}}));
  241. },
  242. Reset: function () {
  243. if (!this.where.product_name) return;
  244. this.where.page = 1;
  245. this.product.loadend = false;
  246. this.product_name = '';
  247. this.where.product_name = '';
  248. this.$set(this, 'productImaesList', []);
  249. this.getProductImaesList();
  250. },
  251. seachs: function () {
  252. this.where.page = 1;
  253. this.product.loadend = false;
  254. if (!this.where.product_name && !this.product_name) return layList.msg('请输入产品名称再进行查找!');
  255. if (this.where.product_name == this.product_name) return;
  256. this.product_name = this.where.product_name;
  257. this.$set(this, 'productImaesList', []);
  258. this.getProductImaesList();
  259. },
  260. delReply: function (item, index) {
  261. var url = layList.U({a: 'delete', p: {id: item.id}}), that = this;
  262. $eb.$swal('delete', function () {
  263. $eb.axios.get(url).then(function (res) {
  264. if (res.status == 200 && res.data.code == 200) {
  265. $eb.$swal('success', res.data.msg);
  266. that.messageList.splice(index, 1);
  267. that.$set(that, 'messageList', that.messageList);
  268. } else
  269. return Promise.reject(res.data.msg || '删除失败')
  270. }).catch(function (err) {
  271. $eb.$swal('error', err);
  272. });
  273. })
  274. },
  275. edit: function (item, index) {
  276. var url = layList.U({a: 'set_reply'}), rid = item.id;
  277. $eb.$alert('textarea', {
  278. 'title': '请输入回复内容',
  279. 'value': item.merchant_reply_content
  280. }, function (result) {
  281. $eb.axios.post(url, {content: result, id: rid}).then(function (res) {
  282. if (res.status == 200 && res.data.code == 200) {
  283. item.merchant_reply_time = 1;
  284. item.merchant_reply_content = result;
  285. $eb.swal(res.data.msg);
  286. } else
  287. $eb.swal(res.data.msg);
  288. });
  289. })
  290. },
  291. loadList: function () {
  292. this.getProductImaesList();
  293. },
  294. lockImage: function (href) {
  295. return layList.layer.open({
  296. type: 1,
  297. title: false,
  298. closeBtn: 0,
  299. shadeClose: true,
  300. content: '<img src="' + href + '" style="display: block;width: 100%;" />'
  301. });
  302. },
  303. getMessageList: function (isFa) {
  304. var that = this;
  305. if (that.message.loading) return;
  306. if (that.message.loadend) return;
  307. var index = layList.layer.load(1, {shade: [0.1, '#fff']});
  308. layList.baseGet(layList.U({a: 'get_product_reply_list', q: that.where}), function (res) {
  309. var list = res.data.list;
  310. var loadend = list.length < that.where.limit;
  311. that.message.loading = false;
  312. that.message.loadend = loadend;
  313. that.count = res.data.count;
  314. that.$set(that, 'messageList', list);
  315. layList.layer.close(index);
  316. isFa || that.initPage();
  317. }, function (res) {
  318. that.message.loading = false;
  319. layList.layer.close(index);
  320. });
  321. },
  322. slitherMonitor: function () {
  323. var clientHeight = document.documentElement.clientHeight;
  324. if (this.$refs.producr.offsetHeight >= clientHeight) this.$refs.producr.style.overflowX = 'scroll';
  325. else this.$refs.producr.style.overflow = 'hidden';
  326. },
  327. initPage: function () {
  328. var that = this;
  329. that.$nextTick(function () {
  330. layList.laypage.render({
  331. elem: that.$refs.pages
  332. , count: that.count
  333. , limit: that.where.limit
  334. , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
  335. , jump: function (obj) {
  336. that.where.message_page = obj.curr
  337. }
  338. });
  339. })
  340. }
  341. },
  342. mounted: function () {
  343. layList.form.render();
  344. this.getMessageList();
  345. //查询
  346. var that = this;
  347. layList.search('search', function (where) {
  348. if ((where.product_name && that.where.product_name == where.product_name) || (where.is_reply && that.where.is_reply == where.is_reply)) return false;
  349. that.where.product_name = where.product_name;
  350. that.where.is_reply = where.is_reply;
  351. that.where.nickname = where.nickname;
  352. that.where.message_page = 1;
  353. that.where.order_id = where.order_id;
  354. that.where.score_type = where.score_type;
  355. that.message.loadend = false;
  356. that.getMessageList();
  357. });
  358. }
  359. })
  360. })
  361. </script>
  362. </div>
  363. </body>
  364. </html>