activityreview.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. @extends('layouts.base')
  2. @section('title', '活动管理')
  3. @section('content')
  4. <style xmlns:v-bind="http://www.w3.org/1999/xhtml">
  5. .rightlist #app .rightlist-head{padding:15px 0;line-height:50px;}
  6. .rightlist #app{margin-left:30px;}
  7. .rightlist-head-con{float:left;padding-right:20px;font-size:16px;color:#888;}
  8. .el-form-item__label{padding-right:30px;}
  9. .mouse-active{cursor:pointer;border:1px dotted #409EFF;border-radius: 4px;}
  10. /* 滑块选择小白点 */
  11. .el-switch.is-checked .el-switch__core::after {left: 100%;margin-left: -17px;}
  12. .el-switch__core::after {content: "";position: absolute;top: 1px;left: 1px;border-radius: 100%;transition: all .3s;width: 16px;height: 16px;background-color: #fff;}
  13. </style>
  14. <link rel="stylesheet" href="//at.alicdn.com/t/font_913727_zrmdutznqpd.css">
  15. <div id="app-share-activity">
  16. <template>
  17. <el-container>
  18. <el-header height="auto">
  19. <div class="">
  20. <h4 class="card-title">活动审核</h4>
  21. <div style="padding-top: 24px">
  22. <el-form v-loading="loading" ref="form" :model="form" :inline="true">
  23. <el-form-item label="活动ID">
  24. <el-input v-model="searchParams.id" placeholder="活动ID"></el-input>
  25. </el-form-item>
  26. <el-form-item label="活动名称">
  27. <el-input v-model="searchParams.name" placeholder="请输入活动名称"></el-input>
  28. </el-form-item>
  29. <el-form-item label="创建时间">
  30. <template>
  31. <div class="block">
  32. <span class="demonstration"></span>
  33. <el-date-picker
  34. v-model="searchParams.localcreate_time"
  35. type="datetimerange"
  36. range-separator="至"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. align="right">
  40. </el-date-picker>
  41. </div>
  42. </template>
  43. </el-form-item>
  44. <el-button type="primary" icon="el-icon-search" @click="searchData()">搜索</el-button>
  45. </el-form>
  46. </div>
  47. </div>
  48. </el-header>
  49. {{--表格start--}}
  50. <el-main>
  51. <template>
  52. <el-table :data="list">
  53. <el-table-column align="center" align="center" prop="id" label="ID" width="auto"></el-table-column>
  54. <el-table-column align="center" prop="start_time" label="创建时间" width="auto"></el-table-column>
  55. <el-table-column align="center" prop="store_id" label="门店ID" width="auto"></el-table-column>
  56. <el-table-column
  57. align="center"
  58. prop="end_time"
  59. label="结束时间">
  60. </el-table-column>
  61. <el-table-column align="center" prop="name" label="活动名称" width="auto"></el-table-column>
  62. <el-table-column label="审核">
  63. <template slot-scope="scope">
  64. {{-- <el-tooltip :content="scope.row.reviewstatus?'启用':'禁用'" placement="top">--}}
  65. <el-switch v-model="scope.row.reviewstatus" :active-value="1" :inactive-value="0" @change="activitystatusChange(scope.$index,scope.row,scope.row.id)"></el-switch>
  66. {{-- </el-tooltip>--}}
  67. </template>
  68. </el-table-column>
  69. <el-table-column
  70. align="center"
  71. prop="browse_count"
  72. label="浏览人数">
  73. </el-table-column>
  74. <el-table-column align="center" label="操作">
  75. <template slot-scope="scope">
  76. <a v-bind:href="'{{ yzWebUrl('plugin.share-store-activity.admin.activity.showdetail', array('id' => '')) }}'+[[scope.row.id]]" title="查看">
  77. <i class="el-icon-edit" style="font-size:28px;color:#606266"></i>
  78. </a>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. </template>
  83. </el-main>
  84. {{--表格end--}}
  85. <el-footer>
  86. <el-pagination
  87. layout="prev, pager, next"
  88. @current-change="currentChange"
  89. :current-page.sync="current_page"
  90. :total="page_total"
  91. :page-size="page_size"
  92. background v-loading="loading">
  93. </el-pagination>
  94. </el-footer>
  95. </el-container>
  96. </template>
  97. </div>
  98. <script>
  99. var app = new Vue({
  100. el: '#app-share-activity',
  101. delimiters: ['[[', ']]'],
  102. data() {
  103. let pageList = {!! $pageList ?: '{}'!!};
  104. console.log("数据:"+ JSON.stringify(pageList.data) );
  105. return {
  106. form : {},
  107. loading : false,
  108. searchParams: {
  109. 'id' : '',
  110. 'name' : '',
  111. 'create_time' : [],
  112. 'localcreate_time':'',
  113. 'aa':''
  114. },
  115. real_search_form: {
  116. 'id' : '',
  117. 'name' : '',
  118. 'create_time' : '',
  119. },
  120. list : pageList.data,
  121. current_page : pageList.current_page,
  122. page_total : pageList.total,
  123. page_size : pageList.per_page,
  124. }
  125. },
  126. methods: {
  127. activitystatusChange(index,row,id) {
  128. // console.log(row.reviewstatus);return false;
  129. this.loading = true;
  130. this.$http.post('{!! yzWebFullUrl('plugin.share-store-activity.admin.activity.store-change-status') !!}',{id:id,status:row.reviewstatus}).then(function (response) {
  131. if (response.data.result){
  132. if(row.reviewstatus){
  133. this.$message({message: '开启成功',type: 'success'});
  134. }
  135. else {
  136. this.$message({message: '关闭成功',type: 'success'});
  137. }
  138. } else {
  139. this.$message({message: response.data.msg,type: 'error'});
  140. if (this.list[index].status==1){
  141. this.list[index].status = 0;
  142. }
  143. else{
  144. this.list[index].status = 1;
  145. }
  146. }
  147. this.loading = false;
  148. },function (response) {
  149. this.$message({message: response.data.msg,type: 'error'});
  150. if (this.list[index].status==1){
  151. this.list[index].status = 0;
  152. } else{
  153. this.list[index].status = 1;
  154. }
  155. this.loading = false;
  156. });
  157. },
  158. del(id) {
  159. this.$confirm('是否删除', '提示', {
  160. confirmButtonText: '确定',
  161. cancelButtonText: '取消',
  162. type: 'warning'
  163. }).then(() => {
  164. this.$http.post('{!! yzWebFullUrl('plugin.share-store-activity.admin.activity.del') !!}',{id:id}).then(function (response) {
  165. if (response.data.result) {
  166. this.$message({
  167. type: 'success',
  168. message: '删除成功!'
  169. });
  170. window.open("{!! yzWebUrl('plugin.share-store-activity.admin.activity.index') !!}", '_self');
  171. }
  172. });
  173. }).catch(() => {
  174. this.$message({
  175. type: 'info',
  176. message: '已取消删除'
  177. });
  178. });
  179. },
  180. searchData() {
  181. let thattime=this.searchParams;
  182. let stime=Math.floor(new Date(this.searchParams.localcreate_time[0]).getTime() /1000).toString();
  183. let etime=Math.floor(new Date(this.searchParams.localcreate_time[1]).getTime() /1000).toString();
  184. this.loading = true;
  185. if(this.searchParams.localcreate_time){
  186. this.searchParams.create_time[0]=stime
  187. this.searchParams.create_time[1]=etime
  188. }
  189. console.log("转换1:"+this.searchParams.create_time[0])
  190. console.log("转换2:"+this.searchParams.create_time[1])
  191. this.$http.post('{!! yzWebFullUrl('plugin.share-store-activity.admin.activity.search') !!}',{search:this.searchParams}
  192. ).then(function (response) {
  193. if (response.data.result){
  194. let datas = response.data.data;
  195. this.page_total = datas.total;
  196. this.list = datas.data;
  197. this.page_size = datas.per_page;
  198. this.current_page = datas.current_page;
  199. this.real_search_form = this.searchParams;
  200. }
  201. else {
  202. this.$message({message: response.data.msg,type: 'error'});
  203. }
  204. this.loading = false;
  205. },function (response) {
  206. this.loading = false;
  207. this.$message({message: response.data.msg,type: 'error'});
  208. }
  209. );
  210. },
  211. addActivity(){
  212. window.open("{!! yzWebUrl('plugin.share-store-activity.admin.activity.add') !!}", '_self');
  213. },
  214. copy(row,index) {
  215. that = this;
  216. let Url = that.$refs['copy'+index];
  217. Url.select(); // 选择对象
  218. document.execCommand("Copy",false);
  219. that.$message({message:"复制成功!",type:"success"});
  220. },
  221. copyMini(row,index) {
  222. let that = this;
  223. let Url = that.$refs['copyMini'+index];
  224. Url.select(); // 选择对象
  225. document.execCommand("Copy",false);
  226. that.$message({message:"复制成功!",type:"success"});
  227. },
  228. currentChange(val) {
  229. this.loading = true;
  230. this.$http.post('{!! yzWebFullUrl('plugin.share-store-activity.admin.activity.search') !!}',{page:val,search:this.real_search_form}).then(function (response) {
  231. if (response.data.result){
  232. let datas = response.data.data;
  233. this.page_total = datas.total;
  234. this.list = datas.data;
  235. this.page_size = datas.per_page;
  236. this.current_page = datas.current_page;
  237. }
  238. else {
  239. this.$message({message: response.data.msg,type: 'error'});
  240. }
  241. this.loading = false;
  242. },function (response) {
  243. this.loading = false;
  244. this.$message({message: response.data.msg,type: 'error'});
  245. }
  246. );
  247. }
  248. },
  249. });
  250. </script>
  251. @endsection