circle.blade.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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. /* 导航 */
  7. .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
  8. .el-radio-button__inner{border:0;}
  9. .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
  10. </style>
  11. <div class="all">
  12. <div id="app" v-cloak>
  13. <div class="vue-head">
  14. <el-radio-group v-model="choose_index" @change="changeList">
  15. <el-radio-button label="1">圈子管理</el-radio-button>
  16. <el-radio-button label="2">发布审核
  17. <span style="display: inline-block;background: #ff485d;color: #fff;border-radius: 8px 8px 8px 1px;position: absolute;top: -10px;height: 15px;line-height: 15px;padding: 0 5px;font-size: 12px;font-weight: 500;">{{$data['circle_count']}}</span>
  18. </el-radio-button>
  19. </el-radio-group>
  20. </div>
  21. <div class="vue-head">
  22. <div class="vue-main-title" style="margin-bottom:20px">
  23. <div class="vue-main-title-left"></div>
  24. <div class="vue-main-title-content">[[choose_index==1?'圈子管理':'发布审核']]</div>
  25. <div class="vue-main-title-button">
  26. </div>
  27. </div>
  28. <div class="vue-search">
  29. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  30. <el-form-item label="">
  31. <el-input v-model="search_form.circle_name" placeholder="圈子名称"></el-input>
  32. </el-form-item>
  33. <el-form-item label="">
  34. <el-select v-model="search_form.category_id" clearable placeholder="所属分类">
  35. <el-option v-for="(item,index) in category_list" :key="index" :label="item.name" :value="item.id"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="">
  39. <el-input v-model="search_form.member_info" placeholder="会员ID/昵称/名称/手机号"></el-input>
  40. </el-form-item>
  41. <el-form-item label="" v-if="choose_index==1">
  42. <el-date-picker
  43. v-model="times"
  44. type="datetimerange"
  45. value-format="timestamp"
  46. range-separator="至"
  47. start-placeholder="开始日期"
  48. end-placeholder="结束日期"
  49. style="margin-left:5px;"
  50. align="right">
  51. </el-date-picker>
  52. </el-form-item>
  53. <el-form-item label="">
  54. <el-button type="primary" @click="search(1)">搜索</el-button>
  55. </el-form-item>
  56. </el-form>
  57. </div>
  58. </div>
  59. <div class="vue-main" v-if="choose_index==1">
  60. <div>
  61. <div class="vue-main-title" style="margin-bottom:20px">
  62. <div class="vue-main-title-left"></div>
  63. <div class="vue-main-title-content" style="flex:0 0 120px">圈子列表</div>
  64. <div class="vue-main-title-button">
  65. </div>
  66. </div>
  67. <el-table :data="list" style="width: 100%">
  68. <el-table-column label="ID" align="center" prop="id"></el-table-column>
  69. <el-table-column prop="down_time" label="圈子名称" min-width="180" align="left" class="edit-cell">
  70. <template slot-scope="scope">
  71. <div style="display:flex;align-items: center;">
  72. <img :src="scope.row.circle_img" style="width:50px;min-width:50px;height:50px;margin-right:10px">
  73. <span>[[scope.row.name]]</span>
  74. </div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="分类" align="center" prop="category_name"></el-table-column>
  78. <el-table-column label="圈主" align="center" prop="display_order">
  79. <template slot-scope="scope">
  80. <div>
  81. <div v-if="scope.row.avatar">
  82. <img :src="scope.row.avatar" alt="" style="width:40px;height:40px;border-radius:50%">
  83. </div>
  84. <div @click="gotoMember(scope.row.member_id)" style="line-height:32px;color:#29BA9C;cursor: pointer;" class="vue-ellipsis">[[scope.row.nickname]]</div>
  85. </div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="发布数量" align="center">
  89. <template slot-scope="scope">
  90. <div>
  91. <div class="vue-ellipsis">[[scope.row.invitation]]</div>
  92. <!-- <div>
  93. <el-link title="查看详情" :underline="false" @click="gotoDetail(scope.row)" style="text-align: center;width:50px">
  94. <i class="iconfont icon-all_watchroot"></i>
  95. </el-link>
  96. </div> -->
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="成员数量" align="center">
  101. <template slot-scope="scope">
  102. <div>
  103. <div class="vue-ellipsis">[[scope.row.member_count]]</div>
  104. <div>
  105. <el-link title="查看详情" :underline="false" @click="gotoMemberDetail(scope.row)" style="text-align: center;width:50px">
  106. <i class="iconfont icon-all_watchroot"></i>
  107. </el-link>
  108. </div>
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="状态" align="center" prop="id" >
  113. <template slot-scope="scope">
  114. <div>
  115. <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" @change="changeStatus(scope.row.id,'status')"></el-switch>
  116. </div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="推荐" align="center" prop="is_recommend" >
  120. <template slot-scope="scope">
  121. <div>
  122. <el-switch v-model="scope.row.is_recommend" :active-value="1" :inactive-value="0" @change="changeStatus(scope.row.id,'is_recommend')"></el-switch>
  123. </div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column prop="refund_time" label="操作" align="center" width="180">
  127. <template slot-scope="scope">
  128. <el-link title="编辑圈子" :underline="false" @click="gotoDetail(scope.row)" style="width:50px;">
  129. <i class="iconfont icon-ht_operation_edit"></i>
  130. </el-link>
  131. <el-link title="删除圈子" :underline="false" @click="del(scope.row.id)" style="width:50px;">
  132. <i class="iconfont icon-ht_operation_delete"></i>
  133. </el-link>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. </div>
  138. </div>
  139. <div class="vue-main" v-if="choose_index==2">
  140. <div>
  141. <div class="vue-main-title" style="margin-bottom:20px">
  142. <div class="vue-main-title-left"></div>
  143. <div class="vue-main-title-content" style="flex:0 0 120px">发布审核</div>
  144. <div class="vue-main-title-button">
  145. </div>
  146. </div>
  147. <el-table :data="list" style="width: 100%">
  148. <el-table-column label="时间" align="center" prop="created_at"></el-table-column>
  149. <el-table-column prop="down_time" label="圈子名称" min-width="180" align="left" class="edit-cell">
  150. <template slot-scope="scope">
  151. <div style="display:flex">
  152. <img :src="scope.row.circle_img" style="min-width:50px;width:50px;height:50px;margin-right:10px">
  153. <span>[[scope.row.name]]</span>
  154. </div>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="分类" align="center" prop="category_name"></el-table-column>
  158. <el-table-column label="圈主" align="center" prop="category_name">
  159. <template slot-scope="scope">
  160. <div>
  161. <div v-if="scope.row.avatar">
  162. <img :src="scope.row.avatar" alt="" style="width:40px;height:40px;border-radius:50%">
  163. </div>
  164. <div @click="gotoMember(scope.row.member_id)" style="line-height:32px;color:#29BA9C;cursor: pointer;" class="vue-ellipsis">[[scope.row.nickname]]</div>
  165. </div>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="查看详情" align="center">
  169. <template slot-scope="scope">
  170. <div>
  171. <div>
  172. <el-link title="查看详情" :underline="false" @click="gotoDetail(scope.row)" style="text-align: center;width:50px">
  173. <i class="iconfont icon-all_watchroot"></i>
  174. </el-link>
  175. </div>
  176. </div>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="状态" align="center" prop="id" >
  180. <template slot-scope="scope">
  181. <div>
  182. <span v-if="scope.row.is_review==1" style="color:#67C23A;font-weight:600">审核通过</span>
  183. <span v-if="scope.row.is_review==0" style="color:#E6A23C;font-weight:600">待审核</span>
  184. <span v-if="scope.row.is_review==2" style="color:#F56C6C;font-weight:600">审核驳回</span>
  185. </div>
  186. </template>
  187. </el-table-column>
  188. <el-table-column prop="refund_time" label="操作" align="center" width="250">
  189. <template slot-scope="scope">
  190. <div v-if="scope.row.is_review==0">
  191. <el-link title="通过审核" :underline="false" @click="pass(scope.row.id)" style="text-align: center;width:50px">
  192. <i class="iconfont icon-jk_record"></i>
  193. </el-link>
  194. <el-link title="驳回审核" :underline="false" @click="reject(scope.row.id)" style="text-align: center;width:50px">
  195. <i class="iconfont icon-ht_operation_reject"></i>
  196. </el-link>
  197. </div>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. </div>
  202. </div>
  203. <!-- 分页 -->
  204. <div class="vue-page" v-if="total>0">
  205. <el-row>
  206. <el-col align="right">
  207. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  208. :page-size="per_page" :current-page="current_page" background
  209. ></el-pagination>
  210. </el-col>
  211. </el-row>
  212. </div>
  213. </div>
  214. </div>
  215. <script>
  216. var app = new Vue({
  217. el: "#app",
  218. delimiters: ['[[', ']]'],
  219. name: 'test',
  220. data() {
  221. return {
  222. choose_index:'1',
  223. list:[],
  224. category_list:[],
  225. search_form:{
  226. },
  227. times:[],
  228. rules: {},
  229. current_page:1,
  230. total:1,
  231. per_page:1,
  232. }
  233. },
  234. created() {
  235. },
  236. mounted() {
  237. this.getData(1);
  238. },
  239. methods: {
  240. getData(page) {
  241. let json = {
  242. page:page
  243. }
  244. for(let i in this.search_form) {
  245. if(this.search_form[i]) {
  246. json[i] = this.search_form[i]
  247. }
  248. }
  249. if(this.times&&this.times!=null&&this.times.length) {
  250. json.created_start = this.times[0] / 1000
  251. json.created_end = this.times[1] / 1000
  252. }
  253. let url = ''
  254. if(this.choose_index=='1') {
  255. url = '{!! yzWebFullUrl('plugin.circle.admin.circle.get-list') !!}'
  256. }
  257. else {
  258. url = '{!! yzWebFullUrl('plugin.circle.admin.circle.get-review-list') !!}'
  259. }
  260. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  261. this.$http.post(url,json).then(function(response) {
  262. if (response.data.result) {
  263. this.category_list = response.data.data.cat;
  264. this.list = response.data.data.circle.data;
  265. this.current_page=response.data.data.circle.current_page;
  266. this.total=response.data.data.circle.total;
  267. this.per_page=response.data.data.circle.per_page;
  268. loading.close();
  269. } else {
  270. this.$message({
  271. message: response.data.msg,
  272. type: 'error'
  273. });
  274. }
  275. loading.close();
  276. }, function(response) {
  277. this.$message({
  278. message: response.data.msg,
  279. type: 'error'
  280. });
  281. loading.close();
  282. });
  283. },
  284. gotoMemberDetail(item) {
  285. let link = `{!! yzWebFullUrl('plugin.circle.admin.circle.circle-member-list') !!}`+`&circle_id=`+item.id;
  286. window.location.href = link;
  287. },
  288. gotoDetail(item) {
  289. let link = `{!! yzWebFullUrl('plugin.circle.admin.circle.edit') !!}`+`&circle_id=`+item.id+`&type=`+this.choose_index;
  290. window.location.href = link;
  291. },
  292. search(val) {
  293. this.getData(val);
  294. },
  295. del(id) {
  296. this.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  297. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  298. this.$http.post('{!! yzWebFullUrl('plugin.circle.admin.circle.delete-circle') !!}',{circle_id:id}).then(function (response) {
  299. if (response.data.result) {
  300. this.$message({type: 'success',message: '删除成功!'});
  301. }
  302. else{
  303. this.$message({type: 'error',message: response.data.msg});
  304. }
  305. loading.close();
  306. this.search(this.current_page)
  307. },function (response) {
  308. this.$message({type: 'error',message: response.data.msg});
  309. loading.close();
  310. }
  311. );
  312. }).catch(() => {
  313. this.$message({type: 'info',message: '已取消删除'});
  314. });
  315. },
  316. // 快速修改
  317. changeStatus(id,type) {
  318. let that = this;
  319. let json = {circle_id: id, circle_type: type};
  320. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  321. that.$http.post("{!! yzWebFullUrl('plugin.circle.admin.circle.recommend') !!}", json).then(response => {
  322. if (response.data.result == 1) {
  323. that.$message.success('操作成功!');
  324. } else {
  325. that.$message.error(response.data.msg);
  326. }
  327. that.search(this.current_page);
  328. loading.close();
  329. }), function (res) {
  330. console.log(res);
  331. loading.close();
  332. };
  333. },
  334. search(val) {
  335. this.getData(val);
  336. },
  337. gotoMember(id) {
  338. window.location.href = `{!! yzWebFullUrl('member.member.detail') !!}`+`&id=`+id;
  339. },
  340. changeList() {
  341. this.search_form = {};
  342. this.getData(1)
  343. },
  344. pass(id) {
  345. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  346. this.$http.post('{!! yzWebFullUrl('plugin.circle.admin.circle.review-circle') !!}',{circle_id:id,review:1}).then(function (response) {
  347. if (response.data.result){
  348. this.$message.success("操作成功");
  349. this.search(this.current_page);
  350. }
  351. else {
  352. this.$message.error( response.data.msg );
  353. }
  354. loading.close();
  355. },function (response) {
  356. this.$message.error(response.data.msg);
  357. loading.close();
  358. }
  359. );
  360. },
  361. reject(id) {
  362. this.$confirm('确定驳回吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  363. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  364. this.$http.post('{!! yzWebFullUrl('plugin.circle.admin.circle.review-circle') !!}',{circle_id:id,review:2}).then(function (response) {
  365. if (response.data.result){
  366. this.$message.success("操作成功");
  367. this.search(this.current_page);
  368. }
  369. else {
  370. this.$message.error( response.data.msg );
  371. }
  372. loading.close();
  373. },function (response) {
  374. this.$message.error(response.data.msg);
  375. loading.close();
  376. }
  377. );
  378. }).catch(() => {
  379. this.$message({type: 'info',message: '已取消驳回'});
  380. });
  381. },
  382. },
  383. })
  384. </script>
  385. @endsection