activity-list.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. @extends('layouts.base')
  2. @section('title', "活动管理")
  3. @section('content')
  4. <link rel="stylesheet" href="{{resource_get('plugins/deposit-ladder/views/backend/index.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. </style>
  11. <div class="all">
  12. <div id="app" v-cloak>
  13. <div class="vue-crumbs">
  14. 定金阶梯团 > 活动管理
  15. </div>
  16. <div class="vue-head">
  17. <div class="vue-main-title" style="margin-bottom:20px">
  18. <div class="vue-main-title-left"></div>
  19. <div class="vue-main-title-content">活动管理</div>
  20. <div class="vue-main-title-button">
  21. </div>
  22. </div>
  23. <div class="vue-search">
  24. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  25. <el-form-item label="">
  26. <el-input v-model="search_form.activity_name" placeholder="活动名称"></el-input>
  27. </el-form-item>
  28. <el-form-item label="">
  29. <el-select v-model="search_form.status" clearable placeholder="活动状态">
  30. <el-option label="未开始" value="-1"></el-option>
  31. <el-option label="进行中" value="0"></el-option>
  32. <el-option label="已失效" value="1"></el-option>
  33. <el-option label="自动下单失败" value="2"></el-option>
  34. <el-option label="已结束" value="3"></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="">
  38. <el-select v-model="search_form.audit_status" clearable placeholder="审核状态">
  39. <el-option label="待审核" value="0"></el-option>
  40. <el-option label="审核通过" value="1"></el-option>
  41. <el-option label="已驳回" value="2"></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="">
  45. <el-button type="primary" @click="search(1)">搜索</el-button>
  46. </el-form-item>
  47. </el-form>
  48. </div>
  49. </div>
  50. <div class="vue-main">
  51. <div class="vue-main-form">
  52. <div class="vue-main-title" style="margin-bottom:20px">
  53. <div class="vue-main-title-left"></div>
  54. <div class="vue-main-title-content" style="flex:0 0 120px">活动列表</div>
  55. <div class="vue-main-title-button">
  56. <el-button type="primary" plain icon="el-icon-plus" size="small" @click="addModal">创建活动</el-button>
  57. </div>
  58. </div>
  59. <el-table :data="list" style="width: 100%">
  60. <el-table-column label="活动名称" align="center" prop="activity_name" width="200"> </el-table-column>
  61. <el-table-column label="状态" align="center" prop="status_name" width="110">
  62. <template slot-scope="scope">
  63. <div >[[scope.row.status_name]]</div>
  64. <div style="color: red">[[scope.row.status==2?scope.row.fail_text:'']]</div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="活动时间" align="center" prop="created_at" >
  68. <template slot-scope="scope">
  69. <div>
  70. <div>
  71. [[scope.row.activity_start_str]]
  72. 至<br/>
  73. [[scope.row.activity_end_str]]
  74. </div>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="订单数" align="center" prop="" width="150">
  79. <template slot-scope="scope">
  80. <div>
  81. <div>[[scope.row.goods?scope.row.goods.real_sales:0]]</div>
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="定金金额(元)" align="center" prop="deposit"> </el-table-column>
  86. <el-table-column label="活动审核" align="center" prop="">
  87. <template slot-scope="scope">
  88. <p v-if="scope.row.has_one_polymorphism.status == 0" style="color: #e5a239;"> 待审核</p>
  89. <p v-if="scope.row.has_one_polymorphism.status == 1" style="color: #68c239;"> 审核通过</p>
  90. <p v-if="scope.row.has_one_polymorphism.status == 2" style="color: #f56b6b;"> 已驳回</p>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop="refund_time" label="操作" align="center" >
  94. <template slot-scope="scope">
  95. <el-button size="mini" type="success" v-if="scope.row.status==0" @click="openShare(scope.row.id,5)" round>
  96. 推广
  97. </el-button>
  98. <el-button size="mini" type="success" @click="openOrder(scope.row.id)" round>
  99. 定金订单
  100. </el-button>
  101. <el-button size="mini" v-if="scope.row.status==0||scope.row.status==2"
  102. type="primary" @click="gotoDetail(scope.row)" round>
  103. 编辑
  104. </el-button>
  105. <el-button size="mini" @click="manually(scope.row.id)" v-if="scope.row.status==2" type="danger" round>手动下单</el-button>
  106. <el-button size="mini" @click="invalid(scope.row.id)"
  107. v-if="scope.row.status==0||scope.row.status==2" type="danger" round>失效
  108. </el-button>
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. </div>
  113. </div>
  114. <el-dialog title="推广" :visible.sync="share_show" width="800">
  115. <div style="display:flex">
  116. <div class="left" style="flex:2;text-align:left">
  117. <el-button type="text" @click="changeShare(1)" :style="{color:(share_index==1?'':'#333')}" style="font-size:18px">推广链接和二维码</el-button><br />
  118. <el-button type="text" @click="changeShare(2)" :style="{color:(share_index==2?'':'#333')}" style="font-size:18px" v-if="show_share_data.mini">微信小程序</el-button>
  119. </div>
  120. <div class="center" style="width:355px;height:550px;margin:0 20px" >
  121. <img :src="show_share_data.poster" alt="" style="width:100%;">
  122. </div>
  123. <div class="right" style="flex:3">
  124. <div>分享链接</div>
  125. <el-input v-model="show_share_data.url" style="width:70%" ref="url"></el-input>
  126. <el-button @click="copyLink('url')">复制</el-button>
  127. <div class="tip" style="margin:20px 0">可在微信好友、微信群、微博、QQ、知乎、短信群发等渠道推广,或者用户页面装修等!</div>
  128. <div>
  129. <el-button type="text" @click="download(show_share_data.poster,'poster')">下载海报</el-button>
  130. <el-button type="text" @click="download(show_share_data.qr_code,'qr_code')">下载二维码</el-button>
  131. </div>
  132. </div>
  133. </div>
  134. <span slot="footer" class="dialog-footer">
  135. <!-- <el-button @click="share_show = false">取 消</el-button> -->
  136. <!-- <el-button type="primary" @click="img_text_url = false">确 定</el-button> -->
  137. </span>
  138. </el-dialog>
  139. <!-- 分页 -->
  140. <div class="vue-page" >
  141. <el-row>
  142. <el-col align="right">
  143. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  144. :page-size="per_page" :current-page="current_page" background
  145. ></el-pagination>
  146. </el-col>
  147. </el-row>
  148. </div>
  149. </div>
  150. </div>
  151. <script>
  152. let is_platform = (`{!! $is_platform !!}`) ? (`{!! $is_platform !!}`) : 0
  153. var app = new Vue({
  154. el: "#app",
  155. delimiters: ['[[', ']]'],
  156. name: 'test',
  157. data() {
  158. return {
  159. activeName:'2',
  160. is_platform: is_platform,
  161. street:0,
  162. list:[],
  163. change_sort:'',
  164. times:[],
  165. search_form:{
  166. activity_name:"",
  167. status:"",
  168. polymorphism: "",
  169. audit_status: ""
  170. },
  171. show_share_data : {
  172. url:"",
  173. qr_code:"",
  174. poster:"",
  175. mini:false,
  176. },
  177. share_show:false,
  178. share_index:1,
  179. share_activity:0,
  180. rules: {},
  181. current_page:1,
  182. total:1,
  183. per_page:1,
  184. }
  185. },
  186. created() {
  187. },
  188. mounted() {
  189. this.getData(1);
  190. },
  191. methods: {
  192. getData(page) {
  193. let json = {
  194. page: page,
  195. search: {
  196. status:this.search_form.status,
  197. activity_name:this.search_form.activity_name,
  198. polymorphism: this.search_form.polymorphism,
  199. audit_status: this.search_form.audit_status
  200. },
  201. };
  202. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  203. this.$http.post('{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.activity.show') !!}',json).then(function(response) {
  204. if (response.data.result) {
  205. // console.log(response.data.data)
  206. this.list = response.data.data.data;
  207. this.current_page=response.data.data.current_page;
  208. this.total=response.data.data.total;
  209. this.per_page=response.data.data.per_page;
  210. loading.close();
  211. } else {
  212. this.$message({
  213. message: response.data.msg,
  214. type: 'error'
  215. });
  216. }
  217. loading.close();
  218. }, function(response) {
  219. this.$message({
  220. message: response.data.msg,
  221. type: 'error'
  222. });
  223. loading.close();
  224. });
  225. },
  226. gotoDetail(item) {
  227. let link = `{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.activity.edit') !!}`+`&id=`+item.id;
  228. window.location.href = link;
  229. },
  230. addModal() {
  231. let link = `{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.activity.add') !!}`;
  232. window.location.href = link;
  233. },
  234. openShare(id,type) {
  235. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  236. let json = {
  237. id:id,
  238. type:type
  239. };
  240. if (type == 2) {
  241. this.share_index = 2;
  242. json.ingress = 'weChatApplet';
  243. } else {
  244. this.share_index = 1;
  245. }
  246. this.$http.post('{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.activity.extension') !!}',json).then(function (response) {
  247. if (response.data.result){
  248. this.share_activity = id;
  249. this.show_share_data = response.data.data;
  250. this.share_show = true;
  251. }
  252. else {
  253. this.$message.error( response.data.msg);
  254. }
  255. loading.close();
  256. },function (response) {
  257. this.$message.error(response.data.msg);
  258. this.share_show = false;
  259. loading.close();
  260. }
  261. );
  262. },
  263. changeShare(index) {
  264. this.share_index = index;
  265. let type = 5;
  266. if (index == 2) {
  267. type = 2;
  268. }
  269. this.openShare(this.share_activity,type)
  270. },
  271. openOrder(id){
  272. window.location = '{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.order-list.index') !!}&activity_id='+id;
  273. },
  274. search(val) {
  275. this.getData(val);
  276. },
  277. copyLink(type) {
  278. this.$refs[type].select();
  279. document.execCommand("Copy")
  280. this.$message.success("复制成功!");
  281. },
  282. download(href, name) {
  283. let eleLink = document.createElement("a");
  284. eleLink.download = name;
  285. eleLink.href = href;
  286. eleLink.click();
  287. eleLink.remove();
  288. },
  289. invalid(id){
  290. let json = {
  291. id:id,
  292. }
  293. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  294. this.$http.post('{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.activity.invalid') !!}',json).then(function (response) {
  295. if (response.data.result){
  296. this.$message.success("操作成功");
  297. this.search(this.current_page);
  298. }
  299. else {
  300. this.$message.error( response.data.msg );
  301. }
  302. loading.close();
  303. },function (response) {
  304. this.$message.error(response.data.msg);
  305. loading.close();
  306. }
  307. );
  308. },
  309. manually(id){
  310. let json = {
  311. id:id,
  312. }
  313. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  314. this.$http.post('{!! yzWebFullUrl('plugin.deposit-ladder.backend.store.activity.manually') !!}',json).then(function (response) {
  315. if (response.data.result){
  316. this.$message.success("操作成功");
  317. this.search(this.current_page);
  318. }
  319. else {
  320. this.$message.error( response.data.msg );
  321. }
  322. loading.close();
  323. },function (response) {
  324. this.$message.error(response.data.msg);
  325. loading.close();
  326. }
  327. );
  328. },
  329. },
  330. })
  331. </script>
  332. @endsection