index.blade.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. <el-form ref="form" :model="form" label-width="15%">
  22. <div class="vue-head">
  23. <div class="vue-main-title">
  24. <div class="vue-main-title-left"></div>
  25. <div class="vue-main-title-content">基础设置</div>
  26. </div>
  27. <div class="vue-main-form">
  28. <el-form-item label="评论审核" prop="is_comment_audit">
  29. <el-switch v-model="form.is_comment_audit" :active-value="1" :inactive-value="0"></el-switch>
  30. <div class="tip">开启后会员评论需要后台审核后才能在前端显示</div>
  31. </el-form-item>
  32. <el-form-item label="默认好评" prop="is_default_good_reputation">
  33. <el-switch v-model="form.is_default_good_reputation" :active-value="1" :inactive-value="0"></el-switch>
  34. <div class="tip">开启后订单确认收货15天后自动增加默认好评</div>
  35. </el-form-item>
  36. <el-form-item label="商品详情评论显示" prop="is_order_detail_comment_show">
  37. <el-switch v-model="form.is_order_detail_comment_show" :active-value="1" :inactive-value="0"></el-switch>
  38. <div class="tip">关闭后前端商品详情页不显示评论</div>
  39. </el-form-item>
  40. <el-form-item label="订单显示评论入口" prop="is_order_comment_entrance">
  41. <el-switch v-model="form.is_order_comment_entrance" :active-value="1" :inactive-value="0"></el-switch>
  42. <div class="tip">开启后已完成订单的列表页和订单详情页显示评论入口</div>
  43. </el-form-item>
  44. <el-form-item label="追评" prop="is_additional_comment">
  45. <el-switch v-model="form.is_additional_comment" :active-value="1" :inactive-value="0"></el-switch>
  46. <div class="tip">开启后评价过的订单/默认好评订单可进行追评</div>
  47. </el-form-item>
  48. <el-form-item label="评分维度" prop="is_score_latitude">
  49. <el-switch v-model="form.is_score_latitude" :active-value="1" :inactive-value="0"></el-switch>
  50. <div class="tip">开启后评价页面可对描述/包装,物流服务/配送,服务态度/质量进行评分</div>
  51. </el-form-item>
  52. <el-form-item label="评论置顶排序" prop="top_sort">
  53. <el-radio v-model="form.top_sort" label="asc">正序</el-radio>
  54. <el-radio v-model="form.top_sort" label="desc">倒序</el-radio>
  55. </el-form-item>
  56. </div>
  57. </div>
  58. </el-form>
  59. <div class="vue-page">
  60. <div class="vue-center">
  61. <el-button type="primary" @click="submitForm('form')">提交</el-button>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
  67. @include('public.admin.tinymceee')
  68. <script>
  69. var app = new Vue({
  70. el:"#app",
  71. delimiters: ['[[', ']]'],
  72. name: 'test',
  73. data() {
  74. return{
  75. activeName:'1',
  76. form:{
  77. is_comment_audit:'0',
  78. is_order_detail_comment_show:'1',
  79. is_default_good_reputation:'0',
  80. is_order_comment_entrance:'0',
  81. is_additional_comment:'0',
  82. is_score_latitude:'0',
  83. top_sort:'asc',
  84. },
  85. loading: false,
  86. }
  87. },
  88. created() {
  89. },
  90. mounted() {
  91. this.getData();
  92. },
  93. methods: {
  94. handleClick(val) {
  95. console.log(val.name)
  96. if(val.name == 1) {
  97. window.location.href = `{!! yzWebFullUrl('goods.comment.index') !!}`;
  98. }
  99. else if(val.name == 2) {
  100. window.location.href = `{!! yzWebFullUrl('goods.comment.list') !!}`;
  101. }
  102. else if(val.name == 3) {
  103. window.location.href = `{!! yzWebFullUrl('goods.comment.audit') !!}`;
  104. }
  105. },
  106. getData() {
  107. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  108. this.$http.post('{!! yzWebFullUrl('goods.comment.saveSet') !!}').then(function (response) {
  109. if (response.data.result){
  110. let that = response.data.data.data;
  111. if (that) {
  112. this.form.is_comment_audit = that.is_comment_audit ? that.is_comment_audit : '0';
  113. this.form.is_default_good_reputation = that.is_default_good_reputation ? that.is_default_good_reputation : '0';
  114. this.form.is_order_comment_entrance = that.is_order_comment_entrance ? that.is_order_comment_entrance : '0';
  115. this.form.is_additional_comment = that.is_additional_comment ? that.is_additional_comment : '0';
  116. this.form.is_score_latitude = that.is_score_latitude ? that.is_score_latitude : '0';
  117. this.form.top_sort = that.top_sort ? that.top_sort : 'asc';
  118. this.form.is_order_detail_comment_show=that.is_order_detail_comment_show?that.is_order_detail_comment_show:'1'
  119. }
  120. }
  121. else {
  122. this.$message({message: response.data.msg,type: 'error'});
  123. }
  124. loading.close();
  125. },function (response) {
  126. this.$message({message: response.data.msg,type: 'error'});
  127. loading.close();
  128. }
  129. );
  130. },
  131. submitForm(formName) {
  132. let json = {
  133. is_comment_audit:this.form.is_comment_audit,
  134. is_default_good_reputation:this.form.is_default_good_reputation,
  135. is_order_detail_comment_show:this.form.is_order_detail_comment_show,
  136. is_order_comment_entrance:this.form.is_order_comment_entrance,
  137. is_additional_comment:this.form.is_additional_comment,
  138. is_score_latitude:this.form.is_score_latitude,
  139. top_sort:this.form.top_sort,
  140. };
  141. this.$refs[formName].validate((valid) => {
  142. if (valid) {
  143. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  144. this.$http.post('{!! yzWebFullUrl('goods.comment.saveSet') !!}',{form:json}).then(response => {
  145. if (response.data.result) {
  146. this.$message({type: 'success',message: '操作成功!'});
  147. } else {
  148. this.$message({message: response.data.msg,type: 'error'});
  149. }
  150. loading.close();
  151. },response => {
  152. loading.close();
  153. });
  154. }
  155. else {
  156. console.log('error submit!!');
  157. return false;
  158. }
  159. });
  160. },
  161. },
  162. })
  163. </script>
  164. @endsection