slide-show.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. .edit-i{display:none;}
  11. .el-table_1_column_3:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
  12. </style>
  13. <div class="all">
  14. <div id="app" v-cloak>
  15. <div class="vue-nav" style="margin-bottom:15px">
  16. <el-tabs v-model="activeName" @tab-click="handleClick">
  17. <el-tab-pane label="优惠券设置" name="1"></el-tab-pane>
  18. <el-tab-pane label="优惠券列表" name="2"></el-tab-pane>
  19. <el-tab-pane label="领取发放记录" name="3"></el-tab-pane>
  20. <el-tab-pane label="分享领取记录" name="4"></el-tab-pane>
  21. <el-tab-pane label="使用记录" name="5"></el-tab-pane>
  22. <el-tab-pane label="领券中心幻灯片" name="6"></el-tab-pane>
  23. <el-tab-pane label="会员优惠券" name="7"></el-tab-pane>
  24. </el-tabs>
  25. </div>
  26. <div class="vue-main">
  27. <div class="vue-main-form">
  28. <div class="vue-main-title" style="margin-bottom:20px">
  29. <div class="vue-main-title-left"></div>
  30. <div class="vue-main-title-content">幻灯片列表</div>
  31. <div class="vue-main-title-button">
  32. <el-button type="primary" plain icon="el-icon-plus" size="small" @click="addModal">添加幻灯片</el-button>
  33. </div>
  34. </div>
  35. <el-table :data="list" style="width: 100%">
  36. <el-table-column label="ID" align="center" prop="id" width="80"></el-table-column>
  37. <el-table-column label="显示顺序" align="center" prop="sort">
  38. <template slot-scope="scope">
  39. <el-popover class="item" placement="top" effect="light">
  40. <div style="text-align:center;">
  41. <el-input v-model="change_sort" size="small"
  42. style="width:100px;"></el-input>
  43. <el-button size="small"
  44. @click="confirmChangeSort(scope.row.id)">确定
  45. </el-button>
  46. </div>
  47. <a slot="reference">
  48. <i class="el-icon-edit edit-i" title="点击编辑排序"
  49. @click="editTitle(scope.$index)"></i>
  50. </a>
  51. </el-popover>
  52. [[scope.row.sort]]
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="标题" align="center" prop="title"></el-table-column>
  56. <el-table-column label="链接" align="center" prop="slide_link"></el-table-column>
  57. <el-table-column label="状态" align="center" prop="">
  58. <template slot-scope="scope">
  59. <div>
  60. <div>[[scope.row.status_name]]</div>
  61. </div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="refund_time" label="操作" align="center" width="320">
  65. <template slot-scope="scope">
  66. <el-link title="编辑幻灯片" :underline="false" :href="'{{ yzWebUrl('coupon.slide-show.edit', array('id' => '')) }}'+[[scope.row.id]]" style="width:50px;">
  67. <i class="iconfont icon-ht_operation_edit"></i>
  68. </el-link>
  69. <el-link title="删除幻灯片" :underline="false" @click="del(scope.row.id,scope.$index)" style="width:50px;">
  70. <i class="iconfont icon-ht_operation_delete"></i>
  71. </el-link>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. </div>
  77. <!-- 分页 -->
  78. <div class="vue-page" v-if="total>0">
  79. <el-row>
  80. <el-col align="right">
  81. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  82. :page-size="per_page" :current-page="current_page" background
  83. ></el-pagination>
  84. </el-col>
  85. </el-row>
  86. </div>
  87. </div>
  88. </div>
  89. <script>
  90. var app = new Vue({
  91. el: "#app",
  92. delimiters: ['[[', ']]'],
  93. name: 'test',
  94. data() {
  95. return {
  96. activeName:'6',
  97. list:[],
  98. times:[],
  99. change_sort: "",//修改排序弹框赋值
  100. search_form:{
  101. },
  102. rules: {},
  103. current_page:1,
  104. total:0,
  105. per_page:1,
  106. }
  107. },
  108. created() {
  109. },
  110. mounted() {
  111. this.getData(1);
  112. },
  113. methods: {
  114. getData(page) {
  115. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  116. this.$http.post('{!! yzWebFullUrl('coupon.slide-show.search') !!}',{page:page}).then(function(response) {
  117. if (response.data.result) {
  118. this.list = response.data.data.data;
  119. this.current_page=response.data.data.current_page;
  120. this.total=response.data.data.total;
  121. this.per_page=response.data.data.per_page;
  122. loading.close();
  123. } else {
  124. this.$message({
  125. message: response.data.msg,
  126. type: 'error'
  127. });
  128. }
  129. loading.close();
  130. }, function(response) {
  131. this.$message({
  132. message: response.data.msg,
  133. type: 'error'
  134. });
  135. loading.close();
  136. });
  137. },
  138. // 编辑排序
  139. editTitle(index, type) {
  140. let that = this;
  141. that.change_sort = "";
  142. that.change_sort = that.list[index].sort;
  143. },
  144. // 确认修改排序
  145. confirmChangeSort(id) {
  146. let that = this;
  147. if (!(/^\d+$/.test(that.change_sort))) {
  148. that.$message.error('请输入正确数字');
  149. return false;
  150. }
  151. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  152. let json = {id: id, sort: that.change_sort};
  153. that.$http.post("{!! yzWebFullUrl('coupon.slide-show.edit-sort') !!}", json).then(response => {
  154. console.log(response);
  155. if (response.data.result == 1) {
  156. that.$message.success('操作成功!');
  157. // that.$refs.search_form.click();
  158. if (document.all) {
  159. document.getElementById('app').click();
  160. } else {// 其它浏览器
  161. var e = document.createEvent('MouseEvents')
  162. e.initEvent('click', true, true)
  163. document.getElementById('app').dispatchEvent(e)
  164. }
  165. that.search(1);
  166. } else {
  167. that.$message.error(response.data.msg);
  168. }
  169. loading.close();
  170. }), function (res) {
  171. console.log(res);
  172. loading.close();
  173. };
  174. },
  175. search(val) {
  176. this.getData(val);
  177. },
  178. addModal() {
  179. let link = `{!! yzWebFullUrl('coupon.slide-show.add') !!}`;
  180. console.log(link);
  181. window.location.href = link;
  182. },
  183. del(id,index) {
  184. this.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  185. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  186. this.$http.post('{!! yzWebFullUrl('coupon.slide-show.del') !!}',{id:id}).then(function (response) {
  187. if (response.data.result) {
  188. this.$message({type: 'success',message: '删除成功!'});
  189. }
  190. else{
  191. this.$message({type: 'error',message: response.data.msg});
  192. }
  193. loading.close();
  194. this.search(this.current_page)
  195. },function (response) {
  196. this.$message({type: 'error',message: response.data.msg});
  197. loading.close();
  198. }
  199. );
  200. }).catch(() => {
  201. this.$message({type: 'info',message: '已取消删除'});
  202. });
  203. },
  204. handleClick(val) {
  205. console.log(val.name)
  206. if(val.name == 1) {
  207. window.location.href = `{!! yzWebFullUrl('coupon.base-set.see') !!}`;
  208. }
  209. else if(val.name == 2) {
  210. window.location.href = `{!! yzWebFullUrl('coupon.coupon.index') !!}`;
  211. }
  212. else if(val.name == 3) {
  213. window.location.href = `{!! yzWebFullUrl('coupon.coupon.log-view') !!}`;
  214. }
  215. else if(val.name == 4) {
  216. window.location.href = `{!! yzWebFullUrl('coupon.share-coupon.log') !!}`;
  217. }
  218. else if(val.name == 5) {
  219. window.location.href = `{!! yzWebFullUrl('coupon.coupon-use.index') !!}`;
  220. }
  221. else if(val.name == 6) {
  222. window.location.href = `{!! yzWebFullUrl('coupon.slide-show') !!}`;
  223. }
  224. else if(val.name == 7) {
  225. window.location.href = `{!! yzWebFullUrl('coupon.member-coupon.index') !!}`;
  226. }
  227. },
  228. },
  229. })
  230. </script>
  231. @endsection